[R] error using boxcox.nls during non linear estimation
Francisco Mora Ardila
fmora at oikos.unam.mx
Tue Aug 14 05:48:22 CEST 2012
Hi all
I´ve got a problem using boxcox.nls function in nlrwr packagge. I´m fitting several non
linear models to these data:
> x
[1] 2 1 1 5 4 6 13 11 13 101 101 101
> y
[1] 1.281055090 1.563609934 0.001570796 2.291579783 0.841891853
[6] 6.553951324 14.243274230 14.519899320 15.066473610 21.728809880
[11] 18.553054450 23.722637370
I used nls function with self starters, for example SSgompertz:
model<-nls(y~SSgompertz(x,a,b))
The model runs OK, with the following summary:
Formula: y ~ SSgompertz(x, a, b, c)
Parameters:
Estimate Std. Error t value Pr(>|t|)
a 21.2426 0.9689 21.924 4.03e-09 ***
b 5.3330 1.4722 3.622 0.00555 **
c 0.8045 0.0274 29.364 3.01e-10 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.686 on 9 degrees of freedom
Number of iterations to convergence: 5
Achieved convergence tolerance: 1.508e-06
But then, trying to use boxcox.nls(model) gives the following error:
> boxcox.nls(model)
Error in eval(object$data)[, as.character(formula(object)[[2]])[2]] :
object type 'environment' is not a subset
(this last part traduced from spanish)
I´ve tryed other functions, even without self starters but it does not work. Then it
seems to be there something in the data, but I don´t know what.
Any suggestions?
Francisco
----------------------
Francisco Mora Ardila
Estudiante de Doctorado
Centro de Investigaciones en Ecosistemas
Universidad Nacional Autónoma de México
More information about the R-help
mailing list