r - how do I use nls to estimate parameters? -
i want estimate e50 e0 emax emax model equation y=e0 + ((dose * emax)/(dose + ed50)) want use default algorithm how can estimate e0 emax , e50?
i found example code :
args(nls) function (formula, data = parent.frame(), start, control = nls.control(), algorithm = c("default", "plinear", "port"), trace = false, subset, weights, na.action, model = false, lower = -inf, upper = inf, ...) null
thanks
your example data doesn't seem named, i'll pretend didn't see it. make vector called dose
contains dose information , vector called y
contains y variable. should same length. i'll use rnorm()
example. call nls reasonable start values. i'll pick out of blue.
> dose <- rnorm(400) > y <- rnorm(400) > nls(formula=y~e0+((dose*emax)/(dose+ed50)),start=c(e0=1,emax=10,ed50=2)) nonlinear regression model model: y ~ e0 + ((dose * emax)/(dose + ed50)) data: parent.frame() e0 emax ed50 0.036105 0.005475 1.991276 residual sum-of-squares: 373.8 number of iterations convergence: 21 achieved convergence tolerance: 9.759e-06
Comments
Post a Comment