Displaying 2 results from an estimated 2 matches for "epower".
Did you mean:
power
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)
2011 Oct 05
4
SPlus to R
...-d)*nc))/nc
+ ncl<-length(pc)
+ ne.old<-ne
+ ne.old1<-ne.old
+ ### sweeping forward
+ for(i in 1:ncl){
+ cmin<-cc[1]
+ cmax<-cc[2]
+ ### fixed cci<-cmax bug
+ cci <-1
+ lhood<-dbinom((i:ncl)-1,nc,pc[i])
+ ne[i:ncl]<-(1+(cci-1)*(lhood/lhood[1])) * ne.old1[i:ncl]
+ Ep0 <-Epower(nc, d, ne, pc, alpha)
+ while(abs(Ep0[i]-power)>tol1){
+ if(Ep0[i]<power) cmin<-cci
+ else cmax<-cci
+ cci<-(cmax+cmin)/2
+ ne[i:ncl]<-(1+(cci-1)*(lhood/lhood[1])) * ne.old1[i:ncl]
+ Ep0<-Epower(nc, d, ne, pc, alpha)
+ }
+ ne.old1<-ne
+ }
+ ne1<-ne
+ ### sweeping backwar...