Learn R Programming

emIRT (version 0.0.5)

dynIRT: Dynamic IRT estimation via Variational Inference

Description

ordIRT estimates an dynamic IRT model with two response categories per item, over several sessions. Ideal points over time follow a random walk prior, and the model originates from the work of Martin and Quinn (2002). Estimation is conducted using the variational EM algorithm described in the reference paper below. The algorithm will produce point estimates that are comparable to those of MCMCdynamicIRT1d, but will do so much more rapidly and also scale better with larger data sets.

Usage

dynIRT(.data, .starts = NULL, .priors = NULL, .control = NULL)

Arguments

.data
matrix of numeric values containing the data to be scaled. Respondents are assumed to be on rows, and items assumed to be on columns, so the matrix is assumed to be of dimension (N x J). For each item, only 3 ordered category responses are acc

Value

  • An object of class dynIRT.
  • meanslist, containing several matrices of point estimates for the parameters corresponding to the inputs for the priors. The list should contain the following matrices.
    • x
    { A (N x T) matrix of point estimates for the respondent ideal points $x_{it}$, with rows indicating respondent and columns indicating session of the estimated ideal point. Estimates will equal exactly 0 for legislator/period combinations in which the legislator did not serve.} alpha{ A (J x 1) matrix of point estimates for the item difficulty parameter $\alpha_j$.} beta{ A (J x 1) matrix of point estimates for the item discrimination parameter $\beta_j$.}

item

  • .starts
  • beta
  • x
  • .priors
  • x.sigma0
  • beta.mu
  • beta.sigma
  • omega2
  • .control
  • verbose
  • thresh
  • maxit
  • checkfreq
  • vars
  • alpha
  • beta
  • runtime
  • conv
  • threads
  • tolerance
  • N
  • J
  • T
  • call

itemize

  • iters

eqn

$\beta_j$

References

Original model and the example is based off of Andrew Martin and Kevin Quinn, ``Dynamic Ideal Point Estimation via Markov Chain Monte Carlo for the U.S. Supreme Court, 1953-1999.'' Political Analysis 10(2) 134-153. Also see http://mqscores.berkeley.edu. Variational model is described in Kosuke Imai, James Lo, and Jonathan Olmsted ``Fast Estimation of Ideal Points with Massive Data.'' Working Paper. Available at http://imai.princeton.edu/research/fastideal.html.

See Also

'mq_data'.

Examples

Run this code
### Replication of Martin-Quinn Judicial Ideology Scores
### Based on July 23, 2014 (2014 Release 01) release of the Supreme Court Database
### Start values and priors based on replication code provided by Kevin Quinn

data(mq_data)

## Estimate dynamic variational model using dynIRT()
lout <- dynIRT(.data = mq_data$data.mq,
                    .starts = mq_data$cur.mq,
                    .priors = mq_data$priors.mq,
                    .control = {list(
                    threads = 1,
                    verbose = TRUE,
                    thresh = 1e-6,
		    maxit=500
                    )})

## Extract estimate from variational model
## Delete point estimates of 0, which are justices missing from that session
vi.out <- c(t(lout$means$x))
vi.out[vi.out==0] <- NA
vi.out <- na.omit(vi.out)

## Compare correlation against MCMC-estimated result
## Correlates at r=0.93 overall, and 0.96 when excluding Douglas
cor(vi.out, mq_data$mq_mcmc)	
cor(vi.out[mq_data$justiceName != "Douglas"],
 mq_data$mq_mcmc[mq_data$justiceName != "Douglas"])

Run the code above in your browser using DataLab