Skip to contents

Slapin & Proksch (2008) one-dimensional Poisson IRT for estimating document positions from word-count data.

Usage

morie_spatial_voting_wordfish(dtm, max_iter = 100L, tol = 1e-06)

Arguments

dtm

Document-by-term integer count matrix.

max_iter

Maximum EM iterations.

tol

Convergence tolerance.

Value

List with positions, word_weights, word_fixed, doc_fixed, log_lik, iterations.

References

Slapin, J. B. and Proksch, S.-O. (2008). "A Scaling Model for Estimating Time-Series Party Positions from Texts." AJPS, 52(3).

Examples

set.seed(1)
dtm <- matrix(stats::rpois(20 * 30, 5), 20, 30)
morie_spatial_voting_wordfish(dtm, max_iter = 20L)
#> $positions
#>  [1]  1.15570659  0.25111445  0.01650556 -1.49106129  0.13088144 -1.07365520
#>  [7]  1.05617759 -0.83530154 -0.99936159  0.25353260 -0.31732379 -1.84826884
#> [13] -0.20769336  1.06437931  1.98755859  0.68871590  0.01462927 -0.99868738
#> [19]  1.10180015  0.05035155
#> 
#> $word_weights
#>  [1] -0.07785646  0.08860747 -0.19629421  0.09898878  0.29413583 -0.20524017
#>  [7]  0.34458941  0.06535203 -0.11601394 -0.02845996  0.15361966  0.02581396
#> [13] -0.05843864 -0.04506290  0.04459250  0.02281734 -0.12888382  0.32763256
#> [19] -0.24324392 -0.03989910  0.03327635 -0.02279927 -0.23604077 -0.21824477
#> [25] -0.17612846 -0.09972048 -0.02083150  0.25111826  0.04534479  0.08035011
#> 
#> $word_fixed
#>  [1] -3.315182 -3.461244 -3.466097 -3.317472 -3.510344 -3.417202 -3.441309
#>  [8] -3.558520 -3.301055 -3.359336 -3.361845 -3.512037 -3.408761 -3.616834
#> [15] -3.629662 -3.427678 -3.233952 -3.416332 -3.504955 -3.427939 -3.210977
#> [22] -3.397747 -3.523497 -3.479582 -3.505254 -3.326454 -3.417543 -3.391218
#> [29] -3.398318 -3.381565
#> 
#> $doc_fixed
#>  [1] 5.056246 4.941642 5.087596 5.087596 5.049856 5.056246 4.875197 5.023881
#>  [9] 5.003946 5.153292 5.117994 4.882802 4.997212 5.010635 4.976734 4.934474
#> [17] 4.997212 4.934474 5.111988 5.170484
#> 
#> $log_lik
#> [1] 1934.188
#> 
#> $iterations
#> [1] 20
#>