| utility_updates | R Documentation |
Low-level Gibbs sampler kernels for error covariance matrices, latent utilities, and ordered-response thresholds.
d_to_gamma(d)
log_likelihood_ordered(d, y, sys, Tvec)
update_Sigma(n_Sigma_0, V_Sigma_0, N, S)
update_U(U, y, sys, Sigma_inv, available = NULL)
update_U_ranked(U, sys, Sigma_inv)
update_d(d, y, sys, mu_d_0, Sigma_d_0, Tvec, step_scale)
d |
[ |
y |
[ |
sys |
[ |
Tvec |
[ |
n_Sigma_0 |
[ |
V_Sigma_0 |
[ |
N |
[ |
S |
[ |
U |
[ |
Sigma_inv |
[ |
available |
[ |
mu_d_0 |
[ |
Sigma_d_0 |
[ |
step_scale |
[ |
The functions return one sampler update or transformation:
update_Sigma(): a J - 1 by J - 1 covariance matrix.
update_U() and update_U_ranked(): J - 1 by 1 numeric latent
utility matrices.
d_to_gamma(): a numeric column matrix containing ordered thresholds
and their infinite bounds.
log_likelihood_ordered(): one numeric log-likelihood value.
update_d(): a numeric vector of updated log-increments.
Robert1995RprobitB
### two deciders who choose twice on an ordered scale of four levels
set.seed(1)
d <- c(0, log(2))
y <- matrix(c(1, 2, 3, 2), nrow = 2)
sys <- matrix(0, nrow = 2, ncol = 2)
Tvec <- c(2, 2)
### the thresholds, their likelihood, and their random-walk update
d_to_gamma(d)
log_likelihood_ordered(d, y, sys, Tvec)
update_d(
d, y, sys, mu_d_0 = c(0, 0), Sigma_d_0 = diag(2), Tvec = Tvec,
step_scale = c(0.1, 0.1)
)
### the latent utilities of an unordered and of a ranked choice
update_U(
c(0, 0), y = 1, sys = c(0, 0), Sigma_inv = diag(2),
available = c(TRUE, TRUE, TRUE)
)
update_U_ranked(c(0, 0), sys = c(0, 0), Sigma_inv = diag(2))
### the error covariance
update_Sigma(n_Sigma_0 = 4, V_Sigma_0 = diag(2), N = 10, S = diag(2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.