Description Usage Arguments Value Examples
log likelihood function for 2pl
1 | log_lik_2pl(y, X, psi, z, theta, nitems)
|
y |
vectorised test |
X |
design matrix indexing each observation to corresponding item |
psi |
vector of item parameters |
z |
design matrix indexing each observation to corresponding individual |
theta |
vector of latent traits (i.e. random effects associated to individual level) |
nitems |
integer especifying the number of items. It is used to separate parameters as psi[1:nitems] and psi[(nitems+1):(2*nitems)] |
a double atomic vector
1 2 3 4 5 6 7 8 9 | data("test_data")
temp<-uirt_DM(test_data,"id")
nitems<-ncol(temp$X)
nind<-ncol(temp$Z)
alpha<-runif(nitems,0.6,1.5) ##simulation of discrimination parameters
beta<-runif(nitems,-2.4,2.4) ##simulation of dificulty parameters
theta<-rnorm(nind) ##simulation of random effects
psi<-c(-alpha*beta,log(alpha)) ###vector of parameters based on alpha and beta
res<-log_lik_2pl(temp$Y,temp$X,psi,temp$Z,theta,nitems) ###2pl log likelihood evaluated at given values
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.