Saturday, May 18, 2013

optim() usage in R.


optim(par, fn, gr = NULL, ...,
      method = c("Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN", "Brent"),
      lower = -Inf, upper = Inf,
      control = list(), hessian = FALSE) 
 
'par' is the default parameter for 'fn'.
Additional parameters for 'fn' can be passed on by specifying them after 'fn', such as
optim( par=c(0.05, 0.1), fn=llh, lifespan=current_lifespan)

Reference:
http://www.biostat.umn.edu/~ph7440/pubh7440/OptimLinearModel.R

No comments:

Post a Comment