Hi everyone,
I'm trying to perform a bi exponential Fit with the package NLS. the
plinear algorithm seems to be a good choice
see:
p<-3000
q<-1000
a<--0.03
b<--0.02
t<-seq(0:144);t
y<-p*exp(a*t) + q*exp(b*t)+rnorm(t,sd=0.3*(p*
exp(a*t) + q*exp(b*t)))
fittA <- nls(y~cbind(exp(a*t), exp(b*t)),
algorithm="plinear",start=list(a=-.1, b=-0.2), data=list(y=y, t=t),
trace=FALSE);fittA
# a b .lin1 .lin2
# -0.003074 -2.777 4512 -2399
fittB <- nls(y~cbind(exp(a*t), exp(b*t)),
algorithm="plinear",start=list(a=-.1, b=-0.3), data=list(y=y, t=t),
trace=FALSE);fittB
# a b .lin1 .lin2
# -0.02248 -0.04684 2414.86017 2052.96601
but
1 - the initial condition is very sensitive, is there any way to find a
good start for the parameters?
2 - I would like to havre .lin1 >0 ans .lin2 >0 , is there a way to do that?
thx a lot
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.