search for: myfxn

Displaying 1 result from an estimated 1 matches for "myfxn".

Did you mean: myfun
2009 Sep 08
1
optim() argument scoping: passing parameter values into user's subfunction
...within its evaluation. This function allows for the parameters to enter as arguments to various probability distribution functions. However, I am violating some scoping convention, as somewhere within the hierarchy of calls a variable is not visible. I will give a genericized example here. > myFxn <- function(parms, Y, phi, <other args>) {<body of function>} ### I want to optimize this over its first argument > optim(par=<numeric(>2)>, fn=myFxn, ### end of named args, next are all in "..." Y=<data>, <other args>,...