Re: [R] Multi-dimensional non-linear fitting - advice on best method?

From: peter dalgaard <pdalgd_at_gmail.com>
Date: Mon, 25 Apr 2011 00:57:46 +0200

On Apr 24, 2011, at 02:38 , Julian Gilbey wrote:

> Hello!
>
> I have a set of data of the form (x, y1, y2) where x is the
> independent variable and (y1, y2) is the response pair. The model is
> some messy non-linear function:
>
> (y1, y2) = f(x; param1, param2, ..., paramk) + (y1error, y2error)
>
> where the parameters param1, ..., paramk are to be estimated, and I'll
> assume the errors to be normal for sake of simplicity.
>
> If there were only one response per input, I would use the nls()
> function, but what can I do in this case?

I believe the gnls function in the nlme package is your friend. It's a bit involved but the basic idea is to stack the two response variables and use a weights argument with a varIdent structure with variance depending on whether it is a y1 or a y2 observation. You can also specify a within-pair correlation.

>
> Many thanks,
>
> Julian
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> 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.

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes_at_cbs.dk  Priv: PDalgd_at_gmail.com

______________________________________________
R-help_at_r-project.org mailing list
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.
Received on Sun 24 Apr 2011 - 23:01:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 26 Apr 2011 - 21:40:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive