Skip to contents

Posterior summaries for a Bayesian IRT chain

Usage

morie_spatial_voting_bayesian_irt_posterior(chain, standardize = TRUE)

Arguments

chain

Array of shape (n_samples, n_leg, n_dims).

standardize

Whether to per-sample standardise.

Value

List with posterior_mean, posterior_sd, ci_lower, ci_upper, n_samples, standardized.

References

Jackman S (2009). Bayesian Analysis for the Social Sciences. Wiley.

Examples

set.seed(1)
ch <- array(rnorm(100 * 5 * 2), c(100, 5, 2))
morie_spatial_voting_bayesian_irt_posterior(ch)
#> $posterior_mean
#>             [,1]         [,2]
#> [1,]  0.06747061 -0.008652293
#> [2,] -0.06792212 -0.144214340
#> [3,]  0.01295946  0.064296854
#> [4,]  0.07157441  0.079645425
#> [5,] -0.08408237  0.008924354
#> 
#> $posterior_sd
#>           [,1]      [,2]
#> [1,] 0.8371227 0.8684629
#> [2,] 0.8735941 0.9292335
#> [3,] 0.9014309 0.9285926
#> [4,] 0.8864563 0.8757094
#> [5,] 0.9779248 0.8728132
#> 
#> $ci_lower
#>           [,1]      [,2]
#> [1,] -1.523770 -1.605500
#> [2,] -1.557427 -1.620396
#> [3,] -1.635257 -1.527519
#> [4,] -1.425360 -1.556741
#> [5,] -1.526407 -1.598210
#> 
#> $ci_upper
#>          [,1]     [,2]
#> [1,] 1.423874 1.623438
#> [2,] 1.654565 1.530238
#> [3,] 1.592998 1.648031
#> [4,] 1.517149 1.629250
#> [5,] 1.642080 1.504817
#> 
#> $n_samples
#> [1] 100
#> 
#> $standardized
#> [1] TRUE
#>