Displaying 2 results from an estimated 2 matches for "epow".
Did you mean:
epo
2010 Nov 03
3
optim works on command-line but not inside a function
...University MSc student.
------
PS: the other functions I am using are:
#IRT.p is the function that represents the probability
#of a positive outcome of an item with difficulty b,
#discriminativity a, in combination with a student with
#competence theta.
IRT.p <- function(theta, a, b){
epow <- exp(-a*(theta-b))
result <- 1/(1+epow)
result
}
# = IRT.p^-1 ; for usage in the loglikelihood
IRT.oneOverP <- function(theta, a, b){
epow <- exp(-a*(theta-b))
result <- (1+epow)
result
}
# = (1-IRT.p)^-1 ; for usage in the loglikelihood
IRT.oneOverPneg &l...
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 backw...