get_parameters: Get parameters from distributions or fitted models

View source: R/dist_spec.R

get_parametersR Documentation

Get parameters from distributions or fitted models

Description

Generic function to extract parameters. For dist_spec objects, extracts the distribution parameters (e.g., shape and rate for Gamma). For fitted model objects, extracts estimated parameters and delays as dist_spec objects that can be used as priors.

Usage

get_parameters(x, ...)

## S3 method for class 'dist_spec'
get_parameters(x, id = NULL, ...)

## S3 method for class 'epinowfit'
get_parameters(x, ...)

## S3 method for class 'estimate_dist'
get_parameters(x, ...)

Arguments

x

A dist_spec object or fitted model object

...

Additional arguments passed to methods

id

Numeric index of the distribution to extract (for multi- component dist_spec objects). If NULL (default), extracts from the first component.

Value

For dist_spec: a list of distribution parameters. For fitted models: a named list of dist_spec objects.

Examples

# For dist_spec objects
dist <- Gamma(shape = 3, rate = 2)
get_parameters(dist)

## Not run: 
# For fitted models - extract estimated distributions
dists <- get_parameters(fit)
names(dists)

## End(Not run)

EpiNow2 documentation built on June 17, 2026, 1:07 a.m.