Skip to contents

Runs predictions using multiple models and compares results.

Usage

compare_models(
  data,
  models = NULL,
  summary_fun = mean,
  return_all = FALSE,
  progress = TRUE,
  ...
)

Arguments

data

Data frame with measurements

models

Character vector of model names to compare

summary_fun

Function to summarize across models (default is mean)

return_all

Logical whether to return all model results

progress

Logical whether to show progress

...

Additional arguments passed to predict_d2h_precip

Value

Data frame with ensemble predictions or list of all results

Examples

if (FALSE) { # \dontrun{
local({
  old <- options(leafwax.suppress_preview_warning = TRUE)
  on.exit(options(old))

  data(example_data)
  prior <- d2h_prior_normal(mean = -70, sd = 30)

  # Compare multiple models
  comparison <- compare_models(
    example_data,
    models = c("baseline", "baseline_sp"),
    prior = prior,
    progress = FALSE
  )

  # Get all individual model results
  all_results <- compare_models(
    example_data,
    models = c("baseline", "baseline_sp"),
    prior = prior,
    return_all = TRUE,
    progress = FALSE
  )
})
} # }