I am currently trying to model and plot a sigmoidal curve with a low amount of points.
>myExperiment
V1 N mean
0.1 9 0.9
1 9 0.8
10 9 0.1
5 9 0.2
I am using the nlsLM
function from the minpack.lm
package.
> nlsLM(mean2 ~ -a/(1 + exp(-b * (v1-o))))
Nonlinear regression model
model: mean2 ~ -a/(1 + exp(-b * (v1 - o)))
data: parent.frame()
a b o
-1.452 -0.451 1.292
residual sum-of-squares: 0.007017
Number of iterations to convergence: 27
Achieved convergence tolerance: 1.49e-08
Warning message:
In nlsLM(mean2 ~ -a/(1 + exp(-b * (v1 - o)))) :
No starting values specified for some parameters.
Initializing ‘a’, ‘b’, ‘o’ to '1.'.
Consider specifying 'start' or using a selfStart model
Using those starting values I receive this error.
> nls(mean~-a/(1 + exp(-b * (v1-o))), start=list(a=-1.452, b=-0.451, o=1.292))
Error in nls(mean ~ -a/(1 + exp(-b * (v1 - o))), start = list(a = -1.452, :
step factor 0.000488281 reduced below 'minFactor' of 0.000976562
I am not well studied in stats to know if this is a syntax R error or a stats failure. What am I doing poorly?
-Thanks