ocbe-uio / BayesMallows

R-package for Bayesian preference learning with the Mallows rank model.
https://ocbe-uio.github.io/BayesMallows/
GNU General Public License v3.0
21 stars 9 forks source link

Better error message #385

Closed osorensen closed 6 months ago

osorensen commented 6 months ago

This error message is bad. Should instead tell the user to call setup_rank_data.

library(BayesMallows)
n_items <- ncol(sushi_rankings)
mod0 <- sample_prior(
  n = 1e4, n_items = n_items, priors = set_priors(gamma = 9, lambda = 2))

mod <- update_mallows(
  model = mod0, 
  new_data = sushi_rankings[1, ]
)
#> Error in value[[3L]](cond): Exact partition function not known. Please provide an estimate in argument pfun_estimate.

mod <- update_mallows(
  model = mod0, 
  new_data = setup_rank_data(rankings = sushi_rankings[1, ])
    )

Created on 2024-02-22 with reprex v2.1.0