# Nonlinear regression with correlated errors

it's my first post here and I'm a newbie in statistics, so please forgive me if I'm doing something wrong or explaining myself badly.

Anyway, I have a problem similar to this: How to perform nonlinear regression with correlated errors?, i.e. a nonlinear least squares problem.

My points are the mean of 50 sets of data and are fitted well by "half" a parabola (something like $x^2 - 1/2$, with $x \in [-1,0]$), but the errors are very correlated or anti-correlated at all distances.

More precisely, close points are correlated, while far-away points are anti-correlated. I'm not sure about this, but it looks like for some reason the integral of the curve might be fixed (given the same set, if points are above the mean in the first half, they are below in the other and vice-versa).

The problem is, I have no idea how to handle errors in this situation.

I hope I have been clear and would appreciate any suggestion on the subject. Thank you very much in advance.

• I wonder whether when you say "50 sets of data" you might mean a set of data with 50 data points? – Michael Hardy Aug 15 '12 at 18:35
• Sorry for the confusion, @Michael. Every single measure I take consists of the values of a certain quantity f at different values of x. Let's say, for example, f(1)=y_1, f(2)=y_2, ..., f(n)=y_n. Each set of y_1, ..., y_n has the shape of a parabola (clearly, approximately always the same). I have 50 measures of this kind, so in theory I can calculate the mean and standard deviation on each y_i and then naively find a fit for these mean values. If the data were independent I would also know how to estimate the errors of the fitting parameters, but the problem is that they are all correlated. – Lel Aug 15 '12 at 20:23

This actually a linear regression problem because the model is linear in the coefficients c$_i$ even though it is quadratic in the variable x. The assumption in linear regression is that the residuals are uncorrelated (and normally distributed if least squares is to be considered optimal). Uncorrelated is important because it makes sense to minimize the sum of squared residuals if they are uncorrelated. In your case at points close in the x space there is high positive correlation and when they are far apart high negative correlation. In some instances the correlation structure can be modeled and a curve fit can be made based on that structure. But here you seem to have a very extreme case that is hard to characterize and is peculiar. I do not think there is a good way to handle this.