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

Ravi Varadhan rvaradhan at jhmi.edu
Mon Apr 25 01:02:48 CEST 2011


Julian,

You have not specified your problem fully.  What is the nature of f?  Is f a scalar function or is it a vector function (2-dim)?

Here are some examples showing different possibilities:

(1) y1 = f + e1 = a + b*exp(-c*x) + e1; y2 = f + e2 = a + b*exp(-c*x) + e2; (e1, e2) ~ bivariate normal

(2) y1 = f + e1 = a + b*exp(-c*x) + e1; y2 = f + e2 = a + b*exp(-c*x) + e2; (e1, e2) ~ independently normal

(3) y1 = f1 + e1 = a1 + b1*exp(-c1*x) + e1; y2 = f2 + e2 = a2 + b2*exp(-c2*x) + e2; (e1, e2) ~ bivariate normal

(4) y1 = f1 + e1 = a1 + b1*exp(-c1*x) + e1; y2 = f2 + e2 = a2 + b2*exp(-c2*x) + e2; (e1, e2) ~ independently normal

For scenario (2), you form a single `y' vector by concatenating all the y1 and y2 and then do a single application of nls.  For (4), you do 2 separate nls runs, one for y1 and another for y2.  

For (1) and (3) you can do a likelihood maximization.

You have more scenarios where f1 and f2 can have different functional forms.  Which scenario is the one that you are considering?

Ravi.
________________________________________
From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of David Winsemius [dwinsemius at comcast.net]
Sent: Sunday, April 24, 2011 6:25 PM
To: Julian Gilbey
Cc: r-help at r-project.org
Subject: Re: [R] Multi-dimensional non-linear fitting - advice on best  method?

On Apr 23, 2011, at 8:38 PM, 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 wonder it would be sensible or at least informative to consider
solving for the "inverse case". i.e. solve for:

x = f(y1, y2)

--
David Winsemius, MD
West Hartford, CT

______________________________________________
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.



More information about the R-help mailing list