Re: [R] nls model definition help

2013-10-24 Thread S Ellison
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of wayne.w.jo...@shell.com > Sent: 22 October 2013 18:52 > To: R-help@r-project.org > Subject: [R] nls model definition help > > Hi fellow R users, > > I'm trying to fit a model u

Re: [R] nls model definition help

2013-10-23 Thread Prof J C Nash (U30A)
Because you have y on both sides, and at different times, I think you are going to have to bite the bullet and write down a residual function. Suggestion: write it as res[t+1] = (th1*x1 + R1*x2) * exp(a1*x3) + (1-th1*x1 + R1*x2)*y(t) - y[t+1] (cleaning up the indices -- they are surely needed fo