Skip to contents

Imai, Lo & Olmsted (2016) closed-form EM updates for binary IRT, suitable for very large vote matrices where MCMC is infeasible.

Usage

morie_spatial_voting_em_irt(votes, n_dims = 1L, max_iter = 100L, tol = 1e-06)

Arguments

votes

Legislator-by-vote binary matrix.

n_dims

Latent dimensions.

max_iter

Maximum EM iterations.

tol

Convergence tolerance on ideal-point change.

Value

List with ideal_points, discrimination, difficulty, log_lik, iterations.

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,] -8.34843696
#>  [2,]  0.89150733
#>  [3,]  0.23702748
#>  [4,] -0.54488880
#>  [5,] -1.20010725
#>  [6,] -0.54669661
#>  [7,]  0.28410337
#>  [8,]  0.30078257
#>  [9,]  0.21391605
#> [10,]  0.37457606
#> [11,]  0.55588768
#> [12,]  0.19032600
#> [13,]  0.28623296
#> [14,]  0.69530786
#> [15,]  0.27717053
#> [16,]  0.35395746
#> [17,]  0.31234062
#> [18,]  0.07256368
#> [19,] -0.58549053
#> [20,]  0.42958553
#> 
#> $discrimination
#>               [,1]
#>  [1,]   0.34497126
#>  [2,]  -0.39451879
#>  [3,]  -3.31074098
#>  [4,]  -0.83435742
#>  [5,]   0.39738562
#>  [6,]  -0.70551291
#>  [7,]  -0.31206919
#>  [8,]  -0.28178311
#>  [9,]   0.29869727
#> [10,]   0.43434212
#> [11,]   0.52383035
#> [12,]   0.11954703
#> [13,]   9.40203052
#> [14,]  -1.58508737
#> [15,]   2.89291878
#> [16,]  -0.49322931
#> [17,]  -1.70486305
#> [18,]  -1.18173433
#> [19,]   0.12253056
#> [20,]   1.71257545
#> [21,]  -1.64475473
#> [22,]  15.67667574
#> [23,]   0.25005495
#> [24,]   0.45940739
#> [25,] -55.52661588
#> [26,]  -0.07841362
#> [27,]  -0.20113823
#> [28,]   2.25803301
#> [29,]  -3.04664881
#> [30,]   1.42174462
#> 
#> $difficulty
#>  [1]  0.258390381 -0.476621432  0.803607566 -0.210840472 -0.167652991
#>  [6] -0.226762002  0.373809669 -0.257468139  0.474194884  0.475491818
#> [11]  0.246991781 -0.378799943 -3.345481893 -0.923464118 -1.515259410
#> [16] -0.707748305  0.397285752 -0.403907549 -0.378362904 -0.399277670
#> [21]  0.867764639 -3.958063214 -0.371114504 -0.611975376 13.822338574
#> [26]  0.829603352 -0.249948977 -0.005085419  0.730607188  0.131292696
#> 
#> $log_lik
#> [1] -344.189
#> 
#> $iterations
#> [1] 20
#>