Re: [R] optim works on command-line but not inside a function

2010-11-03 Thread Berend Hasselman
Damokun wrote: > > Dear all, > > I am trying to optimize a logistic function using optim, inside the > following functions: > #Estimating a and b from thetas and outcomes by ML > > IRT.estimate.abFromThetaX <- function(t, X, inits, lw=c(-Inf,-Inf), > up=rep(Inf,2)){ > optRes <- optim(inits

Re: [R] optim works on command-line but not inside a function

2010-11-03 Thread Jonathan P Daily
As the error message says, the values of your function must be finite in order to run the algorithm. Some part of your loop is passing arguments (inits maybe... you only tried (0,0) in the CLI example) that cause IRT.llZetaLambdaCorrNan to be infinite. -- Jon