Re: [R] Non linear modeling

2005-03-20 Thread Spencer Graves
Another question: What do you know or assume about the distribution of e? If (y-x) is always positive, the survival package, especially the survreg function, might help you. For this, I found especially helpful the discussion of this in Venables and Ripley (2002) Modern Applied

[R] Non linear modeling

2005-03-18 Thread Angelo Secchi
Hi, is there a way in R to fit a non linear model like y=x+exp(a*x)*eps where a is the parameter and eps is the error term? Thanks Angelo __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

RE: [R] Non linear modeling

2005-03-18 Thread Liaw, Andy
AFAIK most model fitting techniques will only deal with additive errors, not multiplicative ones. You might want to try fitting: log(y-x) = a*x + e which is linear. Andy From: Angelo Secchi Hi, is there a way in R to fit a non linear model like y=x+exp(a*x)*eps where a is the

Re: [R] Non linear modeling

2005-03-18 Thread ronggui
then is the nls function can deal the problem as Guillaume STORCHI mentioned in the last post? [X-nls(y~x+exp(a*x)*eps, data=,start=list(a=,eps=))] or just can solve the problem as:log(y-x) = a*x + e? On Fri, 18 Mar 2005 08:56:38 -0500 Liaw, Andy [EMAIL PROTECTED] wrote: AFAIK most model

RE: [R] Non linear modeling

2005-03-18 Thread Liaw, Andy
That's treating eps as a parameter in the model. If I read your question right, that's not what you want. Andy From: ronggui [mailto:[EMAIL PROTECTED] then is the nls function can deal the problem as Guillaume STORCHI mentioned in the last post? [X-nls(y~x+exp(a*x)*eps,

Re: [R] Non linear modeling

2005-03-18 Thread Angelo Secchi
You are right. eps in my model is not a parameter but the error term. Also the linearization doesn't solve the problem, since sometimes you cannot take logs. Any other ideas? Thanks On Fri, 18 Mar 2005 11:21:12 -0500 Liaw, Andy [EMAIL PROTECTED] wrote: That's treating eps as a parameter in

Re: [R] Non linear modeling

2005-03-18 Thread Spencer Graves
What do you want to minimize? Can you write a function to compute eps given x, y, and a? Given that, you can then write another function to compute the objective function you want to minimize. If a is a scalar, compute the objective function for a range of values of a and plot. If you

Re: [R] Non linear modeling

2005-03-18 Thread Christian Ritz
Hi Angelo, have a look at the following example which uses 'gls' in the nlme package. library(nlme) x - runif(100, 0, 1) y - x + exp(4*x)*rnorm(100, 0, 2) gls(y~x, correlation = varExp(form=~x)) For details see ?gls and ?varExp. Christian __