A step of the RcppExports implementation. Called by morie_spatial_voting_dw_nominate.
See the file header for the source the module follows.
Examples
set.seed(27)
votes <- matrix(rbinom(30, 1, 0.5), 6, 5) # legislators x roll calls
X <- matrix(rnorm(6, sd = 0.5), 6, 1) # starting ideal points (1 dimension)
nv <- matrix(1, 5, 1); mid <- matrix(0, 5, 1) # roll-call normal vectors and midpoints
r <- morie_spatial_nominate_iterate_cpp(votes, X, w = 1, nv = nv, mid = mid,
beta = 15, max_iter = 5L)
str(r, max.level = 1)
#> List of 8
#> $ ideal_points : num [1:6, 1] -0.746 -0.546 -0.946 -0.346 -0.146 ...
#> $ normal_vectors: num [1:5, 1] -1 1 -1 1 -1
#> $ midpoints : num [1:5, 1] -0.544 -0.369 -0.319 -0.453 -0.544
#> $ dim_weights : num [1, 1] 1
#> $ cutpoints : num [1:5, 1] 0.544 -0.369 0.319 -0.453 0.544
#> $ log_lik : num -26.7
#> $ gmp : num 0.8
#> $ n_dims : int 1
