x = 1:1000
z = gompertz(x, mu=0.01, l=200, z0=1, zmax=5) + rnorm(length(x),sd=0.1)
f = fitCellGrowth(x, z, model = "gompertz")
floc = fitCellGrowth(x, z, model = "locfit", locfit.h=500)
plot(x,z, main="simulated data\nGompertz model")
lines(x, predict(f,x), lwd=2, col="red")
lines(x, predict(floc,x), lwd=2, col="blue")
legend( "right", legend=c("gompertz fit", "locfit"), lwd=1, col=c("red","blue") )
Run the code above in your browser using DataLab