Vicente Martà Centelles
2016-Aug-03 08:57 UTC
[R] It is possible to use "input parameters" with "standard error" in fitting function nls
Dear all, I would like to introduce an input parameter with an associated standard error to perform a fitting using the nls function (or any similar function): parameter1 = 9.00 +/- 0.20 (parameter 1 has a value of 9.00 and standard error of 0.20) fittingResults <- nls(y ~ function(xdata, ydata, parameter1, fittingparameter),start=list(parameter1=9.00, fittingparameter=5.00)) summary(fittingResults) Does anyone know how to introduce the associated standard error of the parameter to the fitting function? Many thanks for your help, Best regards Vicente -- _______________________________________ *Dr. Vicente Mart? Centelles* *Postdoctoral Researcher (VALi+d Generalitat Valenciana, Spain)* *Universitat Jaume I*Departamento de Qu?mica Inorg?nica y Org?nica Avda Sos Baynat s/n E-12071-Castell?n (Spain) Tel.: +34 964728235 Fax: +34 964728214 e-mail: martiv at qio.uji.es *web page*: www.vmarti.es [[alternative HTML version deleted]]
Bert Gunter
2016-Aug-03 16:41 UTC
[R] It is possible to use "input parameters" with "standard error" in fitting function nls
Vicente: You have not received a reply. I think it is because your post appears to reveal a profound lack of understanding about how empirical modeling works: the uncertainty in parameter estimates derives from the uncertainty in the data (via the modeling process, of course). You cannot set them independently as "input." I urge that you consult a local statistical expert, take a statistics course or two, and/or do some studying before proceeding further. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Aug 3, 2016 at 1:57 AM, Vicente Mart? Centelles <martiv at qio.uji.es> wrote:> Dear all, > > I would like to introduce an input parameter with an associated standard > error to perform a fitting using the nls function (or any similar function): > > parameter1 = 9.00 +/- 0.20 (parameter 1 has a value of 9.00 and standard > error of 0.20) > > fittingResults <- nls(y ~ function(xdata, ydata, parameter1, > fittingparameter),start=list(parameter1=9.00, fittingparameter=5.00)) > summary(fittingResults) > > Does anyone know how to introduce the associated standard error of the > parameter to the fitting function? > > Many thanks for your help, > > Best regards > > Vicente > > > -- > _______________________________________ > *Dr. Vicente Mart? Centelles* > *Postdoctoral Researcher (VALi+d Generalitat Valenciana, Spain)* > > > *Universitat Jaume I*Departamento de Qu?mica Inorg?nica y Org?nica > Avda Sos Baynat s/n > E-12071-Castell?n (Spain) > Tel.: +34 964728235 > Fax: +34 964728214 > e-mail: martiv at qio.uji.es > > *web page*: www.vmarti.es > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Bert Gunter
2016-Aug-03 22:21 UTC
[R] It is possible to use "input parameters" with "standard error" in fitting function nls
Unless there is good reason to do otherwise, you should cc the list to allow others to provide perhaps better responses or to correct my possible errors. I have done so here. If your "parameter" is fixed in the modeling it cannot contribute to the uncertainty of estimation of the remaining model parameters. It would presumably contribute to the uncertainty in the fitted model, however. One approach to deal with the situation might be to combine the data from your prior modeling and your current data and estimate *all* parameters. Another might be to put appropriate priors on all your model parameters -- including an informative prior on the one you wanted to hold fixed, but won't -- and fit a full Bayesian model. Or maybe hold hold it fixed and do some sort of propagation of errors analysis. Or... The point is that the approach you take depends on the details of what you have and what your purpose is. You need to consult with a local statistician for this. And, in any case, statistical questions are generally OT here, and this appears to be a fairly complicated one. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Aug 3, 2016 at 2:06 PM, Vicente Mart? Centelles <martiv at qio.uji.es> wrote:> Hello Bert, > > Thanks for your message. > > The parameter that I want to input with the standard error is a value form > another experiment and therefore it has an associated error, this parameter > will not change during the fitting, it has to be fixed. > > Best regards > > Vicente > > 2016-08-03 17:41 GMT+01:00 Bert Gunter <bgunter.4567 at gmail.com>: >> >> Vicente: >> >> You have not received a reply. I think it is because your post appears >> to reveal a profound lack of understanding about how empirical >> modeling works: the uncertainty in parameter estimates derives from >> the uncertainty in the data (via the modeling process, of course). You >> cannot set them independently as "input." >> >> I urge that you consult a local statistical expert, take a statistics >> course or two, and/or do some studying before proceeding further. >> >> >> Cheers, >> Bert >> >> >> >> Bert Gunter >> >> "The trouble with having an open mind is that people keep coming along >> and sticking things into it." >> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) >> >> >> On Wed, Aug 3, 2016 at 1:57 AM, Vicente Mart? Centelles >> <martiv at qio.uji.es> wrote: >> > Dear all, >> > >> > I would like to introduce an input parameter with an associated standard >> > error to perform a fitting using the nls function (or any similar >> > function): >> > >> > parameter1 = 9.00 +/- 0.20 (parameter 1 has a value of 9.00 and >> > standard >> > error of 0.20) >> > >> > fittingResults <- nls(y ~ function(xdata, ydata, parameter1, >> > fittingparameter),start=list(parameter1=9.00, fittingparameter=5.00)) >> > summary(fittingResults) >> > >> > Does anyone know how to introduce the associated standard error of the >> > parameter to the fitting function? >> > >> > Many thanks for your help, >> > >> > Best regards >> > >> > Vicente >> > >> > >> > -- >> > _______________________________________ >> > *Dr. Vicente Mart? Centelles* >> > *Postdoctoral Researcher (VALi+d Generalitat Valenciana, Spain)* >> > >> > >> > *Universitat Jaume I*Departamento de Qu?mica Inorg?nica y Org?nica >> > Avda Sos Baynat s/n >> > E-12071-Castell?n (Spain) >> > Tel.: +34 964728235 >> > Fax: +34 964728214 >> > e-mail: martiv at qio.uji.es >> > >> > *web page*: www.vmarti.es >> > >> > [[alternative HTML version deleted]] >> > >> > ______________________________________________ >> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> > https://stat.ethz.ch/mailman/listinfo/r-help >> > PLEASE do read the posting guide >> > http://www.R-project.org/posting-guide.html >> > and provide commented, minimal, self-contained, reproducible code. > > > > > -- > _______________________________________ > Dr. Vicente Mart? Centelles > Postdoctoral Researcher (VALi+d Generalitat Valenciana, Spain) > > Universitat Jaume I > Departamento de Qu?mica Inorg?nica y Org?nica > Avda Sos Baynat s/n > E-12071-Castell?n (Spain) > Tel.: +34 964728235 > Fax: +34 964728214 > e-mail: martiv at qio.uji.es > > web page: www.vmarti.es
Vicente Martà Centelles
2016-Aug-10 14:00 UTC
[R] It is possible to use "input parameters" with "standard error" in fitting function nls
Dear all, I found the solution to my question on internet: https://www.r-bloggers.com/introducing-propagate/ The ?propagate? package on CRAN can do this It has one single purpose: propagation of uncertainties (?error propagation?). predictNLS: The propagate function is used to calculate the propagated error to the fitted values of a nonlinear model of type nls or nlsLM. Please refer to my post here: http://rmazing.wordpress.com/2013/08/26/predictnls-part-2-taylor-approximation-confidence-intervals-for-nls-models/ . Best regards Vicente 2016-08-03 9:57 GMT+01:00 Vicente Mart? Centelles <martiv at qio.uji.es>:> > Dear all, > > I would like to introduce an input parameter with an associated standard > error to perform a fitting using the nls function (or any similar function): > > parameter1 = 9.00 +/- 0.20 (parameter 1 has a value of 9.00 and standard > error of 0.20) > > fittingResults <- nls(y ~ function(xdata, ydata, parameter1, > fittingparameter),start=list(parameter1=9.00, fittingparameter=5.00)) > summary(fittingResults) > > Does anyone know how to introduce the associated standard error of the > parameter to the fitting function? > > Many thanks for your help, > > Best regards > > Vicente > > > -- > _______________________________________ > *Dr. Vicente Mart? Centelles* > *Postdoctoral Researcher (VALi+d Generalitat Valenciana, Spain)* > > > *Universitat Jaume I*Departamento de Qu?mica Inorg?nica y Org?nica > Avda Sos Baynat s/n > E-12071-Castell?n (Spain) > Tel.: +34 964728235 > Fax: +34 964728214 > e-mail: martiv at qio.uji.es > > *web page*: www.vmarti.es >-- _______________________________________ *Dr. Vicente Mart? Centelles* *Postdoctoral Researcher (VALi+d Generalitat Valenciana, Spain)* *Universitat Jaume I*Departamento de Qu?mica Inorg?nica y Org?nica Avda Sos Baynat s/n E-12071-Castell?n (Spain) Tel.: +34 964728235 Fax: +34 964728214 e-mail: martiv at qio.uji.es *web page*: www.vmarti.es [[alternative HTML version deleted]]