[R] Why I am getting error when writing a function for "optim"?

S Ellison S.Ellison at LGCGroup.com
Fri Feb 13 17:59:48 CET 2015


You don't appear to be supplying a valid parameter set to optim. 

The first argument in optim (par) must be a vector of parameters to optimise; you're passing a vector of NAs. Thise are not finite.

Also, temp is defined as a value and optim will not be able to optimise that. You need to define temp as a function.

S



*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list