View source: R/choice_probabilities.R
| choiceprob_logit | R Documentation |
These helper functions compute logit choice probabilities for unordered and
ordered outcomes. Panel inputs reuse the observation-level logit formulae,
which remain valid because the logit error term is independent across
occasions. Latent class models are supported via weighted averages of
class-specific probabilities. When Omega is supplied, the coefficients are
assumed to follow a multivariate normal distribution and the resulting
probabilities are evaluated by averaging over simulation draws.
choiceprob_logit(
X,
y = NULL,
Tp = NULL,
beta,
Omega = NULL,
gamma = NULL,
weights = NULL,
input_checks = TRUE,
ordered = !is.null(gamma),
ranked = !ordered && !is.null(y) && length(y) > 0 && length(y[[1]]) > 1,
panel = !is.null(Tp) && any(Tp > 1),
lc = !is.null(weights),
draws = NULL,
n_draws = 200
)
X |
[ In the ordered case ( |
y |
[ In the ranked case ( In the non-panel case ( |
Tp |
[ Can be |
beta |
[ In the latent class case ( |
Omega |
[ Can be In the latent class case ( |
gamma |
[ The event |
weights |
[ |
input_checks |
[ |
ordered, ranked, panel, lc |
[ |
draws |
[ |
n_draws |
[ |
A numeric vector with the choice probabilities for the observed choices when
y is supplied. If y is NULL, a matrix with one row per observation and
one column per alternative is returned.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.