Markus Schmotz
2010-Mar-29 09:45 UTC
[R] Error of a fit parameter, of the data set has errors itself?
Hi out there, imagine you have a dataset (x,y) with errors f, so that each y_i is y_i +- f_i. This is the normal case for almost all measurements, since one quantity y can only be measured with a certain accuracy f.> x<-c(1,2,3) > y<-c(1.1,0.8,1.3) > f<-c(0.2,0.2,0.2) > plot(x,y) #whereas every y has the uncertainty of fIf I now perform a nls-fit (and force the data through (0,0) to have only one fitting parameter)> n<-nls(y~a*x,start=list(a=1)) > summary(n)I end up with an estimate of "a" of 1.4 +- 0.06 as standard error of the fit. In this case the error gives only the accuracy of the fit itself, but does not include the measurement errors in y: f (e.g. error bars). How is it possible to take them into account as well? I know that there is the chi-squared test, where the goodness of the fit is calculated, but this does not include the errors itself. There should be an easy solution, since this is a common problem in science, but I haven't found a solution for R yet. Any suggestions or solutions? Thanks in advance! -- Markus
Possibly Parallel Threads
- How can I calculate the error of a fit parameter, when the data set has an error itself?
- Variance-covariance matrix for beta hat and b hat from lme
- linear functional relationships with heteroscedastic & non-Gaussian errors - any packages around?
- naive "collinear" weighted linear regression
- Spline integration & Gaussian quadrature (was: gauss.quad.prob)