Re: Linear regression w/ confidence intervals
- From: Peter Perkins <Peter.PerkinsRemoveThis@xxxxxxxxxxxxx>
- Date: Fri, 05 Aug 2005 11:27:17 -0400
Tobin Fricke wrote:
1. The 'regress' function, which does linear least squares best-fit regression, outputs confidence intervals for the best-fit parameters that it comes up with. How are these confidence intervals computed, and how should they be interpreted?
Hi Tobin -
The parameter confidence intervals computed by REGRESS are completely standard, based on mse*inv(X'*X), though of course not computed that way. Any book on linear regression will describe these.
2. I have some data Y and regressors X; I also know the variance of each of the data points Y (since the vector Y was obtained by averaging many vectors). I would like to do *weighted* linear least squares regression taking into account the variance (error) of each point. How is this best accomplished? I see that the nonlinear fitting routines accept a 'weight' option--how do I translate variances into weights?
It's not exactly clear to me what you're saying you know about the variances of each measurement.
The LSCOV function handles weighted regression, and will return standard errors, but not confidence intervals. You can fool REGRESS into computing a weighted regression by using yw = y.*sqrt(w) and Xw = X.*repmat(sqrt(w),1,size(X,2)), where w is your vector of weights.
Ordinarily, you'd want to use the number of raw observations that went into each element of your response vector as your weights -- those are proportional to the reciprocal of the variances. But the statement, "I also know the variance of each of the data points (since the vector Y was obtained by averaging many vectors)" might mean several things. I'm assuming you have a different number of raw measurements that went into each observation that you have, and the number is different for each observation.
Hope this helps.
- Peter Perkins The MathWorks, Inc. .
- References:
- Linear regression w/ confidence intervals
- From: Tobin Fricke
- Linear regression w/ confidence intervals
- Prev by Date: Re: testing for bad condition
- Next by Date: Re: testing for bad condition
- Previous by thread: Linear regression w/ confidence intervals
- Next by thread: How to mark a gray-scale image with color contour?
- Index(es):
Relevant Pages
|