IRfactormle: MLE for discrete factor models for item response

Description Usage Arguments Value References See Also Examples

Description

MLE for discrete factor copula models for item response; f90 in function name means the log-likelihood and derivatives are computed in fortran90 code, ir1nllk and ir2nllk are also based on f90.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
ml1irfact(nq,start,ydata,pcond,LB=0,UB=50,ihess=F,prlevel=0,mxiter=50)
f90ml1irfact(nq,start,ydata,copname,LB=0,UB=40,ihess=F,prlevel=0,
   mxiter=50,nu1=3)
ml2irfact(nq,start,ydata,pcond1,pcond2,LB=0,UB=40,ihess=F,prlevel=0,mxiter=50)
f90ml2irfact(nq,start,ydata,copname,LB=0,UB=40,ihess=F,prlevel=0,
   mxiter=50,nu1=5,nu2=5)
f90ml2irfactb(nq,start,ifixed,ydata,copname,LB=0,UB=40,ihess=F,prlevel=0,
   mxiter=50,nu1=5,nu2=5)
ir1nllk(param,dstruct,iprfn=F)
ir2nllk(param,dstruct,iprfn=F)
f90irfisherinfo1(param,ucutp,nq=15,copname,nu1=3,nn=1000)
f90irfisherinfo2(param,ucutp,copname,nq=15,ifixed,nu1=3,nu2=3,nn=1000)

Arguments

param

parameter for ir1nllk and ir2nllk, these functions are input to pdhessmin or pdhessminb

nq

number of quadrature points

start

starting point of param for nlm optimization

ifixed

logical vector of same length as param, ifixed[i]=TRUE iff param[i] is fixed at the given value

ydata

nxd integer-valued matrix with values in 0,1,...,ncat-1, ncat is number of ordinal categories.

pcond

function for bivariate copula conditional cdf, linking to latent variable

pcond1

function for copula conditional cdf for factor 1

pcond2

function for copula conditional cdf for factor 2

copname

"gumbel" or "gaussian" or "t" or "gumbelt" (Gumbel for factor 1 and t for factor 2) or "tgumbel" (t for factor 1 and Gumbel for factor 2)

dstruct

structure that includes $quad for the Gauss-Legendre nodes and weights, $copname for the model, $data for ydata, $cutp for the ordinal cutpoints

LB

lower bound of components of param, usually of length(param), could also be a scalar for a common lower bound

UB

upper bound of components of param, usually of length(param), could also be a scalar for a common upper bound

ihess

option for hessian in nlm()

prlevel

print.level in nlm()

mxiter

maximum number of iterations iterlim in nlm()

ucutp

(ncat-1)xd matrix of cutpoints in (0,1)

nu1

df parameter for factor 1 if copname="t" or "gumbelt" or "tgumbel"

nu2

df parameter for factor 2 if copname="t" or "gumbelt" or "tgumbel"

iprfn

flag for printing of function value and derivatives

nn

nominal sample size for inverse of Fisher information

Value

$fnval, $grad, $hess for ir1nllk and ir2nllk; MLE etc for ml1irfact and ml2irfact.

$finfo with Fisher information matrix, $SE with sqrt(diagonal of inverse Fisher information matrix divided by nn) for f90irfisherinfo1 and f90irfisherinfo2.

References

Nikoloulopoulos A K and Joe H (2014). Factor copula models for item response data, Psychometrika.

See Also

IRfactorsim factorcopmle

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
data(ltmconv)
d=ncol(sci)
#1-factor (3 methods)
nq=21
## Not run: 
library(abind)  # need abind() for ir1factpmf and ir2factpmf
#                 called by ml1irfact and ml2irfact respectively
ml1a=ml1irfact(nq,start=rep(2,d),sci,pcond=pcondgum,LB=1,UB=20,ihess=TRUE,
  prlevel=1,mxiter=50)
ml1b=f90ml1irfact(nq,start=rep(2,d),sci,copname="gumbel",LB=1,UB=20,ihess=TRUE,
  prlevel=1,mxiter=50)
ucutp=unifcuts(sci)
gl=gausslegendre(nq)
dstrgum=list(copname="gumbel",dat=sci,quad=gl,cutp=ucutp)  
ml1c=pdhessmin(param=rep(2,d),ir1nllk,dstruct=dstrgum,LB=rep(1,d),UB=rep(20,d),
  iprint=TRUE,eps=1.e-5);
#2-factor (2 methods)
param=c(1.5,1.1,1.6,2.5,1.05,1.2,1.5,rep(.4,d))
dfdefault=2
ml2a=ml2irfact(nq,start=param,sci,pcond1=pcondgum,pcond2=pcondt,
  LB=c(rep(1,d),rep(-1,d)),UB=c(rep(20,d),rep(1,d)),prlevel=1,mxiter=50)
dstrgumt=list(copname="gumbelt",dat=sci,quad=gl,cutp=ucutp,nu2=2) 
ml2b = pdhessmin(param,ir2nllk,dstruct=dstrgumt,
  LB=c(rep(1,d),rep(-1,d)),UB=c(rep(20,d),rep(1,d)),iprint=TRUE,eps=1.e-5); 
## End(Not run)
# Fisher information (check for near non-identifiability)
theta=c(0.5,0.6,0.5,0.6,0.4)
delta=c(0.3,0.4,0.3,0.4,0.2)
ifixed=rep(FALSE,2*d)
nq=21
K=4
d=5
ucut=seq(1:(K-1))/K
ucuts=matrix(rep(ucut,d),ncol=d)
nn=1000
ifixed=rep(FALSE,2*d)
cat("\nt5/t5\n")
finft=f90irfisherinfo2(c(theta,delta),ucutp=ucuts,copname="t",nq=nq,ifixed,
   nu1=5,nu2=5,nn=nn)
print(finft$SE)
cat("\nt20/t20\n")
finft=f90irfisherinfo2(c(theta,delta),ucutp=ucuts,copname="t",nq=nq,ifixed,
   nu1=20,nu2=20,nn=nn)
print(finft$SE)  # larger as cliser to Gaussian non-identifiable case

YafeiXu/CopulaModel documentation built on May 9, 2019, 11:07 p.m.