Markus Schmotz
2010-Mar-16 12:53 UTC
[R] How can I calculate the error of a fit parameter, when the data set has an error 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, that one quantity y can only be measured with a certain accuracy. > 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 f If 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 (error bars). How is it possible to take them into account? I know that there is the chi-squared test, where the goodness of the fit is calculated, but again this does not include the errors itself. There should be an easy solution, since this is a common problem in science, which I haven't found yet. Any suggestions or solutions? Thanks in advance! -- Markus
Maybe Matching Threads
- Error of a fit parameter, of the data set has errors itself?
- Variance-covariance matrix for beta hat and b hat from lme
- Spline integration & Gaussian quadrature (was: gauss.quad.prob)
- How to solve a non-linear system of equations using R
- Constraints in projection pursuit regression