[R] nls, restrict parameter values

About this list Date view Thread view Subject view Author view Attachment view

From: Angel - (angel_lul@hotmail.com)
Date: Fri 09 May 2003 - 01:38:55 EST


Message-id: <Law11-F179ir3wSimD300007d65@hotmail.com>

Hi,
I posted a question (bellow) a few weeks ago and had a reply (thanks
Christian) that partly solves the problem, but I still would like to be able
to restrict some of the independent variables in a nls model to be always
>0, (is there a way to do it)??
Thanks,
Angel

>From: "Christian Ritz" <ritz@dina.kvl.dk>
>To: "Angel -" <angel_lul@hotmail.com>
>CC: <r-help@stat.math.ethz.ch>
>Subject: Re: [R] nls: Missing value or an Infinity produced when evaluating
>the model
>Date: Wed, 23 Apr 2003 15:22:37 +0200
>
>Hi Angel,
>
>I tried reparametrise your model, setting:
>
>BirthMass^0.25=u
>MaxMass^0.25=v
>
>and giving the following formula in R:
>
>GrowthModel<-nls(BodyMass~(((1-(1-u/v)*exp(-a*Time/(4*v)))^4)*v^4),data=grow
>th,start=c(u=4,v=5,a=1.5),trace=TRUE)
>
>And this works for me, but the u estimate is negative (not significantly
>different from 0, though).
>
>Christian
>
>----- Original Message -----
>From: "Angel -" <angel_lul@hotmail.com>
>To: <r-help@stat.math.ethz.ch>
>Sent: Wednesday, April 23, 2003 2:29 PM
>Subject: [R] nls: Missing value or an Infinity produced when evaluating the
>model
>
>
> > Hi,
> > I am trying to fit a sigmoid curve to some data with nls but I am
>getting
> > into some trouble.
> > Seems that the optimization method is getting down to some parameter
> > estimates that make the equation unsolvable. This is an example:
> >
> >> growth<-data.frame(Time=c(5,7,9,11,13,15,17,19,21,23,25,27),BodyMass=c
> >(45,85,125,210,300,485,570,700,830,940,1030,1120))

> >>
>GrowthModel<-nls(BodyMass~(((1-(1-((BirthMass/MaxMass)^0.25))*exp(-a*Time/
> >(4*MaxMass^0.25)))^4)*MaxMass),data=growth,start=c
> >(BirthMass=3,MaxMass=2500,a=1.5),trace=TRUE)

> >56043.86 : 3.0 2500.0 1.5 >Error in numericDeriv(form[[3]],
>names(ind), env) : > Missing value or an Infinity produced when
>evaluating the model
> >
> >Is there anyway I can restrict the parameter values used so it doesn't
>get to this no return point.
> >Any other alternatives are also very welcome!
> >Thanks in advance,
> >Angel

_________________________________________________________________
Use MSN Messenger to send music and pics to your friends
http://www.msn.co.uk/messenger

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:46 EST