Skip to contents

Imai, Lo & Olmsted (2016) EM for the binary probit IRT model \(y^*_{ij} = \alpha_j + \beta_j^\top x_i + e_{ij}\), yea when \(y^*_{ij} > 0\), with priors \(x_i \sim N(\mu_x, s^2_x I)\) and \((\alpha_j, \beta_j) \sim N(\mu_b, s^2_b I)\). The E-step replaces \(y^*\) by its truncated-normal mean (untruncated when missing); the M-step is the pair of ridge regressions of emIRT::binIRT with asEM = TRUE. The fixed point is the posterior mode.

Usage

morie_spatial_voting_em_irt(
  votes,
  n_dims = 1L,
  max_iter = 500L,
  tol = 1e-06,
  x_prior = c(0, 1),
  beta_prior = c(0, 25),
  start = NULL,
  conv = c("cor", "abs")
)

Arguments

votes

Legislator-by-vote matrix of 1 (yea), 0 (nay), NA (missing).

n_dims

Latent dimensions.

max_iter

Maximum EM iterations.

tol

Convergence threshold.

x_prior

Prior mean and variance of the ideal points.

beta_prior

Prior mean and variance of the intercepts and slopes.

start

Optional list of starting alpha, beta and x; default alpha = beta = 0 and x from 50 steps of orthogonal iteration on the cross-product of the column-centred +1/-1 votes.

conv

"cor" (1 minus the smallest old/new correlation per column) or "abs" (largest absolute change).

Value

List with ideal_points, discrimination, difficulty (the intercepts), log_lik, iterations, converged.

References

Imai, K., Lo, J., and Olmsted, J. (2016). "Fast Estimation of Ideal Points with Massive Data." APSR, 110(4), 631-656.

Examples

set.seed(1)
v <- matrix(stats::rbinom(20 * 30, 1, 0.5), 20, 30)
morie_spatial_voting_em_irt(v, max_iter = 20L)
#> $ideal_points
#>              [,1]
#>  [1,] -1.08361820
#>  [2,]  0.69808049
#>  [3,]  0.30901322
#>  [4,] -0.52823436
#>  [5,] -0.70916025
#>  [6,] -0.33970020
#>  [7,]  0.38881767
#>  [8,] -0.05908574
#>  [9,] -0.12113206
#> [10,]  0.14124058
#> [11,]  0.38171672
#> [12,] -0.18390221
#> [13,]  0.35700789
#> [14,]  0.70097543
#> [15,]  0.28241636
#> [16,]  0.17248989
#> [17,] -0.03617674
#> [18,] -0.14926298
#> [19,] -0.32370906
#> [20,]  0.10610257
#> 
#> $discrimination
#>              [,1]
#>  [1,]  0.12016908
#>  [2,] -0.67102811
#>  [3,] -1.92205959
#>  [4,] -1.51959990
#>  [5,]  1.19190082
#>  [6,] -1.58551373
#>  [7,] -0.07257292
#>  [8,] -0.35678675
#>  [9,] -0.23271382
#> [10,]  0.40170327
#> [11,]  1.20663364
#> [12,] -0.49152646
#> [13,]  2.08486432
#> [14,] -2.28986526
#> [15,]  1.99215348
#> [16,] -0.40815417
#> [17,] -0.92222353
#> [18,] -0.70875776
#> [19,] -0.61336379
#> [20,]  1.52837284
#> [21,] -0.55194932
#> [22,]  1.90151399
#> [23,] -0.16951141
#> [24,]  0.30908205
#> [25,] -3.47127906
#> [26,]  0.22658128
#> [27,]  0.07936686
#> [28,]  2.00895101
#> [29,] -2.10792807
#> [30,]  1.63043998
#> 
#> $difficulty
#>  [1]  0.12513631 -0.26351318  0.23014879 -0.14515630 -0.13842860 -0.13140428
#>  [7]  0.25267311 -0.12523847  0.25355362  0.25487440  0.12035632 -0.25888019
#> [13] -0.54774919 -0.69539453 -0.74412986 -0.38819557  0.14879637 -0.25954112
#> [19] -0.26631747 -0.16086197  0.39790218 -0.05265075 -0.25377142 -0.38893115
#> [25] -0.09678065  0.52551590 -0.12533157  0.12744394  0.19854940  0.14774753
#> 
#> $log_lik
#> [1] -354.3582
#> 
#> $iterations
#> [1] 20
#> 
#> $converged
#> [1] FALSE
#>