Hello!
I have an experimental dataset of values (y, x1, x2, w), where y is the measured quantity, x1 and x2 are the two independet variables and w is the error of each measurement. The function I've chosen to describe my data is f(x1, x2) = (b0 + b1*x1 + b2*x12) + (b3 + b4*x1 + b5*x12)*x2 + (b6 + b7*x1)*x22
These are my tasks:
Estimate values of bi Estimate their standard errors Calculate predicted values of f(x1, x2) on a mesh grid and estimate their confidence intervals Calculate predicted values of ∂f(x1, x2)/∂x1 and definite integral ∫[(∂f(x1, x2)/∂x1)/x1] dx1 and their confidence intervals on a mesh grid.I have several questions:
Can all of my tasks be solved by weighted least squares? I've solved task 1-3 using WLS in matrix form by linearization of the chosen function, but I have no idea how to solve step №4. I've performed Monte Carlo simulations to estimate bi and their s.e. I've generated perturbated values y'i from normal distribution with mean yi and standard deviation wi. I did this operation N=5000 times. For each perturbated dataset I estimated b'i, and from 5000 values of b'i I calculated mean values and their standard deviation. In the end, bi estimated from Monte-Carlo simulation coincide with those found by WLS. Am I correct, that to obtain standard error of b'i their standard deviationsmust be devided by № of Degrees of freedom? How to estimate confidence bands for predicted values of f(x1, x2) using Monte-Carlo approach? I've generated a bunch of perturbated bi values from normal distribution using their BLUE as mean and standard deviations. Then I calculated lots of predicted values of f(x1,x2), found their means and standard deviations. Values of f(x1, x2) found by WLS and MC coincide, but s.d. found from MC are 5-45 order higher than those from WLS. What is the scaling factor that I'm missing here? It seems that some of parameters b are not independent of each other, since there are only 2 independent variables. Should I take this into account in when I generate bi values? If yes, how can this be done? Should I use Chi-squared test to decide whether generated values of bi are suitable for further calculations, or should they be rejected?In fact, I do not only want to solve tasks I've mentioned earlier, but I want to compare the two methods for regression analysis. I would appreciate any help and suggestions!