Skip to contents

Extract acceptance ratio from Metropolis-Hastings algorithm used by compute_mallows() or by the move step in update_mallows() and compute_mallows_sequentially(). Currently the function only returns the values, but it will be refined in the future. If burnin is not set in the call to compute_mallows(), the acceptance ratio for all iterations will be reported. Otherwise the post burnin acceptance ratio is reported. For the SMC method the acceptance ratios apply to all iterations, since no burnin is needed in here.

Usage

get_acceptance_ratios(model_fit, ...)

# S3 method for BayesMallows
get_acceptance_ratios(model_fit, ...)

# S3 method for SMCMallows
get_acceptance_ratios(model_fit, ...)

Arguments

model_fit

A model fit.

...

Other arguments passed on to other methods. Currently not used.

Examples

set.seed(1)
mod <- compute_mallows(
  data = setup_rank_data(potato_visual),
  compute_options = set_compute_options(burnin = 200)
)

get_acceptance_ratios(mod)
#> $alpha_acceptance
#> $alpha_acceptance[[1]]
#> [1] 0.7038889
#> 
#> 
#> $rho_acceptance
#> $rho_acceptance[[1]]
#> [1] 0.4716667
#> 
#> 
#> $aug_acceptance
#> $aug_acceptance[[1]]
#> [1] NaN
#> 
#>