Likelihood and log-likelihood evaluation for a Mallows mixture model
Compute either the likelihood or the log-likelihood value of the Mallows mixture model parameters for a dataset of complete rankings.
lik_db_mix(rho, alpha, weights, metric, rankings, obs_freq = NULL, log = FALSE)
rho |
A matrix of size |
alpha |
A vector of |
weights |
A vector of |
metric |
Character string specifying the distance measure to use.
Available options are |
rankings |
A matrix with observed rankings in each row. |
obs_freq |
A vector of observation frequencies (weights) to apply to
each row in |
log |
A logical; if TRUE, the log-likelihood value is returned. Default
is |
The likelihood or the log-likelihood value corresponding to one or
more observed complete rankings under the Mallows mixture rank model with
distance specified by the metric
argument.
# Simulate a sample from a Mallows model with the Kendall distance n_items <- 5 mydata <- sample_mallows( n_samples = 100, rho0 = 1:n_items, alpha0 = 10, metric="kendall") # Compute the likelihood and log-likelihood values under the true model... lik_db_mix( rho = rbind(1:n_items,1:n_items), alpha = c(10, 10), weights = c(0.5,0.5), metric = "kendall", rankings = mydata ) lik_db_mix( rho = rbind(1:n_items, 1:n_items), alpha = c(10, 10), weights = c(0.5, 0.5), metric = "kendall", rankings = mydata, log = TRUE ) # or equivalently, by using the frequency distribution freq_distr <- rank_freq_distr(mydata) lik_db_mix( rho = rbind(1:n_items,1:n_items), alpha = c(10, 10), weights = c(0.5, 0.5), metric = "kendall", rankings = freq_distr[, 1:n_items], obs_freq = freq_distr[,n_items+1] ) lik_db_mix( rho = rbind(1:n_items, 1:n_items), alpha = c(10, 10), weights=c(0.5, 0.5), metric = "kendall", rankings = freq_distr[, 1:n_items], obs_freq = freq_distr[, n_items+1], log=TRUE )
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.