search for: abfromthetax

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

2010 Nov 03
3
optim works on command-line but not inside a function
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, method="L-BFGS-B", fn=IRT.llZetaLambdaCorrNan, gr=IRT.gradZL, lower=lw, upper=up, t=t, X=X) c(optRes$par[2], -(optRes$par[1]/optRes$par[2]) ) } #Estimating a and b from thetas an...