networkIRT {emIRT} | R Documentation |
Network IRT estimation via EM
Description
networkIRT
estimates an IRT model with network in cells. Estimation
is conducted using the EM algorithm described in the reference paper below. The algorithm
generalizes a model by Slapin and Proksch (2009) that is commonly applied to manifesto
data.
Usage
networkIRT(.y, .starts = NULL, .priors = NULL, .control = NULL,
.anchor_subject = NULL, .anchor_item = NULL)
Arguments
.y |
matrix, with 1 indicating a valid link and 0 otherwise. Followers (usually voters) are on rows, elites are on columns. No NA values are permitted. |
.starts |
a list containing several matrices of starting values for the parameters. The list should contain the following matrices:
|
.priors |
list, containing several matrices of starting values for the parameters. The list should contain the following matrices (1x1) matrices:
|
.control |
list, specifying some control functions for estimation. Options include the following:
|
.anchor_subject |
integer, specifying subject to use as identification anchor. |
.anchor_item |
integer, specifying item to use as identification anchor. |
Value
An object of class networkIRT
.
means |
list, containing several matrices of point estimates for the parameters corresponding to the inputs for the priors. The list should contain the following matrices.
|
vars |
list, containing several matrices of variance estimates for parameters corresponding to the inputs for the priors. Note that these variances are those recovered via variational approximation, and in most cases they are known to be far too small and generally unusable. Better estimates of variances can be obtained manually via the parametric bootstrap. The list should contain the following matrices:
|
runtime |
A list of fit results, with elements listed as follows: |
iters
integer, number of iterations run.
conv
integer, convergence flag. Will return 1 if threshold reached, and 0 if maximum number of iterations reached.
threads
integer, number of threads used to estimated model.
tolerance
numeric, tolerance threshold for convergence. Identical to thresh argument in input to .control list.
N |
Number of followers in estimation, should correspond to number of rows in data matrix .y |
J |
Number of politicians in estimation, should correspond to number of columns in data matrix .y |
call |
Function call used to generate output. |
Author(s)
Kosuke Imai imai@Harvard.edu
James Lo jameslo@princeton.edu
Jonathan Olmsted jpolmsted@gmail.com
References
Kosuke Imai, James Lo, and Jonathan Olmsted (2016). “Fast Estimation of Ideal Points with Massive Data.” American Political Science Review, Vol. 110, No. 4 (December), pp. 631-656.
See Also
'ustweet'
Examples
## Not run:
data(ustweet)
## A ridiculously short run to pass CRAN
## For a real test, set maxit to a more reasonable number to reach convergence
lout <- networkIRT(.y = ustweet$data,
.starts = ustweet$starts,
.priors = ustweet$priors,
.control = {list(verbose = TRUE,
maxit = 3,
convtype = 2,
thresh = 1e-6,
threads = 1
)
},
.anchor_item = 43
)
## End(Not run)