Hi,
First: i have looked through previous posts but could get one related to my
problem!
I am trying to fit a negative gompertz curve in my data seems alright but
the curve doesn't bend at the left (max asymptote)...see  graph attached.

Here is my code;

EProb=read.table("ProbF.txt",header=TRUE)
attach(EProb)
EProb

plot(mHWLrelMSL,Prob, ylab="Exceedance probability, P (%)",xlab="mHWL (m rel
Sea level)", xlim=c(-1.0,1.5), cex=1, pch=1, col="blue")

#####################  ## Modified Negative Gompertz ....: Y = a*
exp(b*(1-exp(c*X)))

gm <- nls(Prob~ a*exp(b*(1-exp(c*mHWLrelMSL))), start=list(a=117.6234567153,
b=-60.3, c=-0.2))
summary(gm)

xfit= seq(min(mHWLrelMSL),max(mHWLrelMSL), by=0.01)

param= coef(summary(gm))[,1]
A=param [1]
B=param [2]
C=param [3]

yfit = A*exp(B*(1-exp(C*xfit)))         
lines(spline(xfit,yfit),col="red",lwd=3)

####parent text file

Prob.txt <http://r.789695.n4.nabble.com/file/n4670394/Prob.txt>  

###output graph

<http://r.789695.n4.nabble.com/file/n4670394/regression2606.png> 

Thanks in advance.

Amon
akim...@vub.ac.be




--
View this message in context: 
http://r.789695.n4.nabble.com/Fitting-a-negative-Gompertz-model-to-data-tp4670394.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@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.

Reply via email to