est_theta {lazy.irt} R Documentation

## Estimation of Theta

### Description

Estimation of Theta

### Usage

```est_theta(Uc = NULL, U = NULL, param = NULL, method = "EAP",
theta = NULL, thd = NULL, thdist = "NORMAL", thmin = -4, thmax = 4,
npoints = 21, thmean = 0, thstd = 1, print = 0, plot = 0)
```

### Arguments

 `Uc` The compressed item response data. `U` The uncompressed item response data. `param` The parameter data frame. `method` = "EAP", "MAP" or "ML" `theta` Discrete theta values. `thd` pdf of theta normalized to sum to unity. When NULL, N(0,1) will be used. When thd == 1, locally uniform prior will be used. `thdist` = "NORMAL" or "UNIFORM" `thmin` Minimum value of discrete thata value. `thmax` Maximum value of discrete thata value. `npoints` # of discrete points for theta. `thmean` The prior mean of normal theta distribution. `thstd` The prior standard deviation of normal theta distribution. `print` = 2 to print the result. `plot` = 1 to show the histogram of theta.

### Details

The core part of EAP is as follows:

``` ULP=U%*%t(logP)
eULP=exp(ULP)*matrix(1,nrow(ULP))%*%t(thd)
rseULP=rowSums(eULP)
H=eULP/rseULP
thetahat=H%*%theta
```

where `logP` is the log of irf matrix (ntheta x sum(ncat)),
`U` is the un-compressed item response matrix( N x sum(ncat)),
and `thd` is the normalized prior theta pdf vector (ntheta).
Therefore, `H` is N x ntheta matrix of normalized posterior pdf
First two lines calculate the unnormalized joint pdf of U and theta.
The next line line normalizes the posterior distribution of theta given `U` stored in `H` matrix.
The last line calculates the posterior mean.

When `thd` is a scalar, the locally uniform theta distribution is used.

method = "ML" or method ="MAP" uses native optimze function and may be very slow.

### Value

A list of
thetahat Estimated theta valuesr
theta Theta values for EAP
thd Theta disrtibution for EAP
method
thdist
thmin
thmax
npoints
thmean
thstd

### Examples

```
# compressed item response at equally spaced 21 theta points in [-3,3]
set.seed(1701)
resg <- gendataIRT( 1, paramS3, npoints=21, compress=1 )
Uc <- resg\$U
theta <- resg\$theta
thetaEAP <- est_theta( Uc, param=paramS3, print=1 )\$thetahat
thetaMAP <- est_theta( Uc, param=paramS3, print=1, method="MAP" )\$thetahat
thetaML <- est_theta( Uc, param=paramS3, print=1, method="ML" )\$thetahat
cor( cbind(theta,thetaEAP,thetaMAP,thetaML) )
plot(theta, thetaEAP)

# uncompressed item response at equally spaced 101 theta points in [-3,3]
set.seed(1701)
resg <- gendataIRT( 1, paramS3, npoints=101, compress=0 )
U <- resg\$U
theta <- resg\$theta
res <- est_theta( U=U, param=paramS3, print=1 )
plot(theta,res\$thetahat)

# 100 normally distriuted theta
set.seed(1701)
resg <- gendataIRT( 1, paramS3, npoints=100, compress=1, thdist="rnorm" )
Uc <- resg\$U
theta <- resg\$theta
res <- est_theta( Uc=Uc, param=paramS3, print=1 )
plot(theta,res\$thetahat)

```

[Package lazy.irt version 0.1.3 Index]