Skip to contents

Nonparametric ideal-point estimation from binary roll-call votes that minimises the number of classification errors (Poole 2000).

Usage

morie_spatial_voting_optimal_classification(
  votes,
  n_dims = 1L,
  max_iter = 500L,
  n_restarts = 10L,
  seed = 42L
)

Arguments

votes

Legislator-by-vote matrix; 1=yea, 0=nay, NA=missing.

n_dims

Number of latent dimensions.

max_iter

Maximum iterations per restart.

n_restarts

Random restarts (best PRE retained).

seed

RNG seed.

Value

A list with ideal_points, cutting_normals, PRE, APRE, total_errors, null_errors, n_dims.

References

Poole, K. T. (2000). "Non-Parametric Unfolding of Binary Choice Data." Political Analysis, 8(3), 211-237.

Examples

set.seed(1)
v <- matrix(stats::rbinom(20 * 30, 1, 0.5), 20, 30)
morie_spatial_voting_optimal_classification(v)
#> $ideal_points
#>       [,1]
#>  [1,]   -1
#>  [2,]    1
#>  [3,]    1
#>  [4,]   -1
#>  [5,]   -1
#>  [6,]    1
#>  [7,]    1
#>  [8,]    1
#>  [9,]   -1
#> [10,]    1
#> [11,]    1
#> [12,]   -1
#> [13,]    1
#> [14,]    1
#> [15,]    1
#> [16,]   -1
#> [17,]   -1
#> [18,]   -1
#> [19,]   -1
#> [20,]    1
#> 
#> $cutting_normals
#>       [,1]
#>  [1,]    1
#>  [2,]   -1
#>  [3,]   -1
#>  [4,]   -1
#>  [5,]    1
#>  [6,]   -1
#>  [7,]   -1
#>  [8,]    1
#>  [9,]   -1
#> [10,]    1
#> [11,]    1
#> [12,]   -1
#> [13,]    1
#> [14,]   -1
#> [15,]    1
#> [16,]    1
#> [17,]    1
#> [18,]   -1
#> [19,]   -1
#> [20,]    1
#> [21,]    1
#> [22,]    1
#> [23,]   -1
#> [24,]    1
#> [25,]   -1
#> [26,]    1
#> [27,]    1
#> [28,]    1
#> [29,]   -1
#> [30,]    1
#> 
#> $PRE
#> [1] 0.1463415
#> 
#> $APRE
#> [1] 0.1463415
#> 
#> $total_errors
#> [1] 210
#> 
#> $null_errors
#> [1] 246
#> 
#> $n_dims
#> [1] 1
#>