Dear all,

using the following code I have find a problem with the port algorithm. If I 
use the nls function without lower bound for my parameter it compute the 
parameter's value but I want the parameter positive. Running the following code 
I had this error. Thanks at all.


optim <- nls(Prezzo ~ 
S*pnorm((log(15/14)+(0.015+theta^2/2)*0.17)/(theta*sqrt(0.17))) - 
14*exp(-0.015*0-17)*pnorm((log(15/14)+(0.015+theta^2/2)*0.17)/(theta*sqrt(0.17))
 - theta * sqrt(0.17)),
+  start=c(theta=0.1),
+  data=data,
+  algorithm="port",
+  lower=0.01,
+  trace=TRUE,
+  control= nls.control(maxiter = 100, tol = 1e-05, minFactor = 1/1024, 
printEval = FALSE, warnOnly = FALSE))


Error in nls_port_fit(m, start, lower, upper, control, trace, give.v = TRUE) :
  INTEGER() can only be applied to a 'integer', not a 'NULL'


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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