Etsushi Kato
2001-Sep-12 06:42 UTC
[R] nonlinear fitting when both x and y having measurement error?
Dear r-help, I want to conduct nonlinear fitting to a data frame having x and y variables. Because both x and y have measurement error, I want to include error term of x variable in the model. I'm not sure but I think ordinary nls model only consider error term of y variable. How can I do this kind of nonlinear fitting in R. Is there any examples in nls package? Thanks in advance, -- Etsushi Kato ekato at ees.hokudai.ac.jp -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Prof Brian Ripley
2001-Sep-12 07:03 UTC
[R] nonlinear fitting when both x and y having measurement error?
On Wed, 12 Sep 2001, Etsushi Kato wrote:> Dear r-help, > > I want to conduct nonlinear fitting to a data frame having x and y > variables. Because both x and y have measurement error, I want to > include error term of x variable in the model. I'm not sure but I > think ordinary nls model only consider error term of y variable. > > How can I do this kind of nonlinear fitting in R. Is there any > examples in nls package?That is not a least-squares problem. Even in the simple linear case (one x one y) it's a hard problem, one that cannot be solved without more information (for example on the ratio of the error variances, or knowing one of them). As far as I know there is no software available in R for that case (although it's not hard to write). I think you need to write down a suitable likelihood and optimize it numerically (with optim). This topic is not well covered in regression texts, although it is in that by Sprent, for example. There is a specialist text by W. A. Fuller (1987) Measurement Error Models. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
pauljohn@ukans.edu
2001-Sep-15 13:55 UTC
[R] nonlinear fitting when both x and y having measurement error?
I've seen the answers that point in the measurement model direction, but I wonder if there is not a more direct approach. In my copy of Pindyck and Rubinfeld's Econometric Models and Economic Forecasts, it outlines an instrumental variable approach in which the x with error is replaced by an instrument, a predicted value from an auxiliary model in which x is regressed on other exogenous/predetermined variables. They prove the parameter estimates are consistent, which (I believe) is about the best we can hope for. One advantage of that strategy is that one need not assume a specific distribution for the error terms involved, only something general like E(e)=0 and constant variance. The ML approach will require the choice of a precise distribution. Not so? They don't show that approach works when the relationship between x and y is nonlinear. Come to think of it, I don't recall a treatment of IV applications for nonlinear equations. This is a great question and I'm interested to hear more about how the project works out in the end. pj Etsushi Kato wrote:> > Dear r-help, > > I want to conduct nonlinear fitting to a data frame having x and y > variables. Because both x and y have measurement error, I want to > include error term of x variable in the model. I'm not sure but I > think ordinary nls model only consider error term of y variable.-- Paul E. Johnson email: pauljohn at ukans.edu Dept. of Political Science http://lark.cc.ukans.edu/~pauljohn University of Kansas Office: (785) 864-9086 Lawrence, Kansas 66045 FAX: (785) 864-5700 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._