Displaying 1 result from an estimated 1 matches for "oneoverpneg".
2010 Nov 03
3
optim works on command-line but not inside a function
..., 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 <- function(theta, a, b){
epow <- exp(a*(theta-b))
result <- (1+epow)
result
}
#simulation-based sample generation of thetas and outcomes
#based on a given a and b. (See IRT.p) The sample-size is n
IRT.generateSample <- function(a, b, n){
x<-rnorm(n, mean=b, sd=b/...