我正在学习有关创建信息功能的教程,我现在完成了教程,我希望再采取一个步骤并且已经陷入僵局。我正在关注的教程如下。
irt.4PM.Info <- function(theta,item.par,D=1.7) {
# This function calculates the Fisher information for
# Four Parameter Model, given item parameters and ability.
#
# item.par should be a matrix with four columns:
# Each row represents an item,
# first column represents a parameters (item discrimination)
# second column represents b parameters (item difficulty)
# third column represents c parameters(pseudo-guessing parameter)
# fourth column represents d parameters (upper asymptote)
# theta can be a single number or a vector.
return(t(sapply(theta,
FUN = function (x) (
(D * item.par[,1])^2 * (item.par[,4] - item.par[,3])^2)/
((item.par[,3] + item.par[,4] *
exp(D*item.par[,1] * (x - item.par[,2]))) *
(1 - item.par[,3] + (1-item.par[,4]) *
exp(D*item.par[,1] * (x-item.par[,2]))) *
(1 + exp(-D * item.par[,1] * (x - item.par[,2])))^2) )))
}
theta.2 <- c(-1,-.5,0,1,2)
itpars <- data.frame(a = c(1, 1,.75),
b = c(0,-.5, 1),
c = c(0, 0, .2),
d = c(1, 1,.98));
itpars
## a b c d
## 1 1.00 0.0 0.0 1.00
## 2 1.00 -0.5 0.0 1.00
## 3 0.75 1.0 0.2 0.98
theta.3 <- seq(-4,4,by=0.01)
item.1.pars <- data.frame(a=1.2,b=-0.6,c=.1,d=1)
plot(theta.3,irt.4PM.Info(theta.3,item.1.pars),type="l",
main="Information Functon",
xlab="Theta", ylab="Information")
我要做的是绘制我现在所具有的功能的反转。也就是说,该函数看起来像一个钟形曲线,我希望得到这个函数的倒数(颠倒的钟形曲线)
我想要的曲线是标准误差,它是信息的倒数SE = 1 / I ^ .5(I =信息)