# MLE
x <- gen.rsp(gen.irt(100, 20))
y <- estimate.theta.mle(x$rsp, x$items$a, x$items$b, x$items$c)
cor(x$thetas, y)
plot(x$thetas, y, xlim=c(-4, 4), ylim=c(-4, 4), col=rgb(.8,.2,.2,.5), pch=16)
abline(a=0, b=1)
# MAP
x <- gen.rsp(gen.irt(100, 20))
y <- estimate.theta.map(x$rsp, x$items$a, x$items$b, x$items$c)
cor(x$thetas, y)
plot(x$thetas, y, xlim=c(-3, 3), ylim=c(-3, 3), col=rgb(.8,.2,.2,.5), pch=16)
abline(a=0, b=1)
# EAP
x <- gen.rsp(gen.irt(100, 20))
y <- estimate.theta.eap(x$rsp, x$items$a, x$items$b, x$items$c)
cor(x$thetas, y)
plot(x$thetas, y, xlim=c(-3, 3), ylim=c(-3, 3), col=rgb(.8,.2,.2,.5), pch=16)
abline(a=0, b=1)
Run the code above in your browser using DataLab