Passing additional paramaters to nlsList(nlme) fit function

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Passing additional paramaters to nlsList(nlme) fit function

Dieter Menne
Hello, nls-users,

is it possible to pass additional parameters to the model function that are
known and groupwise constant with nlsList? I could not find something like a
"keep this fixed" option in the documentation and the code (my fault...?)

The current workaround is to break the problem down into groups and use
globals to pass the constant parameters, but it is ugly code and won't work
when an over-all nlme is needed.

Dieter Menne

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Passing additional paramaters to nlsList(nlme) fit function

Spencer Graves
          The "nlsList" function does NOT have the common ellipsis ("..." )
argument to support that.

          An alternative is use "vector" to create an object of mode "list" of
the desired length, then in a loop call "nls" (which does support "...")
and store the results in a list.  However, this won't produce an object
of class "nlsList", which means that the methods writted for "nlsList"
will not be available to you.

          If it were my problem, I might make a local copy of the "nlsList"
function and try to modify it to work, at least for my problem.  In this
case, "nlsList" is merely a call to "UseMethods".  To get beyond that, I
requested 'methods("nlsList")' with the following result:

          nlsList.formula    nlsList.selfStart*

          If you supply your own starting values, you don't need
"nlsList.selfStart".  If you do need it, you can get it via
'getAnywhere("nlsList.selfStart")';  the asterisk ("*") says that this
function is "non-visible", which means that just typing its name won't
get it.  Then I might use "debug" to figure out what it's doing and what
I want to change.

          hope this helps.
          spencer graves

Dieter Menne wrote:

> Hello, nls-users,
>
> is it possible to pass additional parameters to the model function that are
> known and groupwise constant with nlsList? I could not find something like a
> "keep this fixed" option in the documentation and the code (my fault...?)
>
> The current workaround is to break the problem down into groups and use
> globals to pass the constant parameters, but it is ugly code and won't work
> when an over-all nlme is needed.
>
> Dieter Menne
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Passing additional paramaters to nlsList(nlme) fit function

Dieter Menne
Original question...

> > is it possible to pass additional parameters to the model function that are
> > known and groupwise constant with nlsList? I could not find something like a
> > "keep this fixed" option in the documentation and the code (my fault...?)

Spencer Graves <spencer.graves <at> pdf.com> writes:

>
>  The "nlsList" function does NOT have the common ellipsis ("..." )
> argument to support that.
...
>  If it were my problem, I might make a local copy of the "nlsList"
> function and try to modify it to work, at least for my problem.  In this
> case, "nlsList" is merely a call to "UseMethods".  To get beyond that, I
> requested 'methods("nlsList")' with the following result:
>
>  nlsList.formula    nlsList.selfStart*

Thanks, Spencer. When I studied the quinModel example (page 380,
Pinheiro/Bates) I noted that it is possible to pass non-varying parameters to
nlme by not including them in the fixed=... parameter. As quite a few examples
in PB used nlsList for the first approximation (and, as far I understand, nlme
does it internally anyway) I had missed this feature of nlme, even if the PB-
book heavily use-stained.

Dieter

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html