Skip to contents

Run benchmarks across multiple configurations to compare performance.

Usage

ratiod_benchmark_compare(configs, n_iter = 500, n_warmup = 250, n_threads = 1)

Arguments

configs

A list of configuration lists, each with N, p, n_groups

n_iter

Iterations per benchmark

n_warmup

Warmup iterations

n_threads

Number of threads

Value

A data frame with benchmark results

Examples

# \donttest{
# Compare benchmarks (slow, not run on CRAN)
configs <- list(
  list(N = 50, p = 2, n_groups = 0),
  list(N = 100, p = 2, n_groups = 0)
)
comparison <- ratiod_benchmark_compare(configs, n_iter = 200, n_warmup = 100)
#> Inference: Exact (Tier 1)
#>   Backend: hmc
#>   Reason: default (full MCMC)
#> Fitting ratio model...
#>   Family: negbin_negbin
#>   Observations: 50
#>   Iterations: 200 (warmup: 100)
#> Running NUTS sampler...
#>   Parameters: 6
#>   Iterations: 200 (warmup: 100)
#>   Chains: 1 (cores: 1)
#> Inference: Exact (Tier 1)
#>   Backend: hmc
#>   Reason: default (full MCMC)
#> Fitting ratio model...
#>   Family: negbin_negbin
#>   Observations: 100
#>   Iterations: 200 (warmup: 100)
#> Running NUTS sampler...
#>   Parameters: 6
#>   Iterations: 200 (warmup: 100)
#>   Chains: 1 (cores: 1)
print(comparison)
#>     N p n_groups n_params elapsed_sec samples_per_sec iter_per_sec n_divergent
#> 1  50 2        0        6  0.01600027        6249.894     12499.79           0
#> 2 100 2        0        6  0.01913905        5224.919     10449.84           0
# }