[R] Issues when trying to fit a nonlinear regression model

Paul Bernal p@u|bern@|07 @end|ng |rom gm@||@com
Mon Aug 21 06:10:21 CEST 2023


Thank you so much for your valuable feedback Berwin.

Have a great day.
Cheers,
Paul

El El dom, 20 de ago. de 2023 a la(s) 10:21 p. m., Berwin A Turlach <
berwin.turlach using gmail.com> escribió:

> G'day Paul,
>
> On Sun, 20 Aug 2023 12:15:08 -0500
> Paul Bernal <paulbernal07 using gmail.com> wrote:
>
> > Any idea on how to proceed in this situation? What could I do?
>
> You are fitting a simple asymptotic model for which nls() can find good
> starting values if you use the self starting models (SSxyz()).  Well,
> Doug (et al.) choose to parameterise the asymptotic model differently,
> but you can easily change to your parameterisation if you want:
>
> ```
> fm1 <- nls(y ~ SSasymp(x, Asym, R0, lrc), data=mod14data2_random)
> theta1 <- coef(fm1)["Asym"]
> theta2 <- coef(fm1)["Asym"] - coef(fm1)["R0"]
> theta3 <- exp(coef(fm1)["lrc"])
>
> fm2 <- nls(y ~ theta1 - theta2 * exp(-theta3*x),
>            start=list(theta1=theta1, theta2=theta2, theta3=theta3),
>            data=mod14data2_random)
> summary(fm2)
> ```
>
> Cheers,
>
>         Berwin
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list