Skip to contents

\(P(y_{ij} = 1) = \Phi(\beta_j^\top x_i - \alpha_j)\) with priors \(x_i \sim N(0, I)\) and \((\alpha_j, \beta_j) \sim N(0, v I)\). Each sweep draws the latent utilities from their truncated normals (Albert and Chib 1993), then every \((\alpha_j, \beta_j)\) and every \(x_i\) from its Gaussian full conditional, as in MCMCpack::MCMCirt1d and pscl::ideal. All draws are inverse-CDF transforms of Philox uniforms (sweep t uses stream t), so the R and Python arms give the same chain.

Usage

morie_spatial_voting_cjr_irt(
  votes,
  n_dims = 1L,
  n_samples = 1000L,
  burn_in = 200L,
  beta_prior_var = 25,
  start = NULL,
  seed = 0,
  keep_chains = TRUE
)

Arguments

votes

Roll-call matrix of 1, 0 and NA (missing).

n_dims

Ideal-point dimensions.

n_samples

Retained sweeps.

burn_in

Discarded sweeps.

beta_prior_var

Prior variance \(v\) of the bill parameters.

start

Optional starting ideal points; default the morie_spatial_voting_em_irt posterior mode.

seed

Philox key.

keep_chains

Return the draws as well as the summaries.

Value

List: ideal_point_mean, ideal_point_sd, alpha_mean, beta_mean, n_samples and, when kept, ideal_point_chain, alpha_chain, beta_chain.

References

Clinton J, Jackman S & Rivers D (2004). The statistical analysis of roll call data. American Political Science Review, 98(2), 355-370.

Albert J H & Chib S (1993). Bayesian analysis of binary and polychotomous response data. Journal of the American Statistical Association, 88(422), 669-679.

Examples

votes <- rbind(c(1, 1, 0, 0), c(1, 1, 1, 0), c(0, 1, 1, 1), c(0, 0, 1, 1), c(1, 0, 0, 0))
fit <- morie_spatial_voting_cjr_irt(votes, n_samples = 50L, burn_in = 10L)
round(fit$ideal_point_mean, 3)
#>        [,1]
#> [1,] -1.209
#> [2,] -0.508
#> [3,]  0.358
#> [4,]  0.859
#> [5,] -0.904