Skip to contents

Utilities for benchmarking ratio model fitting performance across different dataset sizes and configurations.

Fits a model on simulated data and reports timing and performance metrics.

Usage

ratiod_benchmark(
  N = 500,
  p = 3,
  n_groups = 0,
  family = ratiod_negbin_negbin(),
  n_iter = 1000,
  n_warmup = 500,
  n_chains = 1,
  n_threads = 1,
  verbose = FALSE
)

Arguments

N

Number of observations

p

Number of predictors

n_groups

Number of random effect groups (0 for none)

family

Model family (default: ratiod_negbin_negbin())

n_iter

Total iterations

n_warmup

Warmup iterations

n_chains

Number of chains

n_threads

Number of threads per chain

verbose

Print progress (default: FALSE)

Value

A list with timing and diagnostic information

Examples

# \donttest{
# Quick benchmark (slow, not run on CRAN)
bench <- ratiod_benchmark(N = 100, p = 3, n_iter = 200, n_warmup = 100)
#> 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: 8
#>   Iterations: 200 (warmup: 100)
#>   Chains: 1 (cores: 1)
print(bench)
#> tulpaRatio Benchmark Results
#> =======================
#> 
#> Configuration:
#>   Observations:   100
#>   Predictors:     3
#>   RE groups:      0
#>   Parameters:     8
#>   Iterations:     200 (100 warmup)
#>   Chains:         1
#>   Threads:        1
#> 
#> Timing:
#>   Total time:     0.0 seconds
#>   Samples/sec:    4752.2
#>   Iter/sec:       9504.4
#> 
#> Diagnostics:
#>   Divergent:      0 (0.00%)
# }