aggregate.multi_epiparameter {epiparameter} | R Documentation |
Aggregate multiple <epiparameter>
objects into a single <epiparameter>
object.
Description
Combine a list of <epiparameter>
objects into a single <epiparameter>
with a mixture distribution [see distributional::dist_mixture()
].
The aggregated <epiparameter>
returned from aggregate()
can then be used
with the density()
, cdf()
, quantile()
and generate()
methods for the
combined distributions.
Usage
## S3 method for class 'multi_epiparameter'
aggregate(x, weighting = c("equal", "sample_size", "custom"), ..., weights)
Arguments
x |
A |
weighting |
A |
... |
dots Not used, will warn if extra arguments are passed to function. |
weights |
A |
Details
The aggregate()
method requires that all <epiparameter>
objects are
parameterised with <distribution>
objects (from the distributional
package). This means that unparameterised (see is_parameterised()
) or
discretised (see discretise()
) distributions cannot be aggregated and the
function will error.
Value
An <epiparameter>
object
Examples
ebola_si <- epiparameter_db(epi_name = "serial interval", disease = "ebola")
aggregate(ebola_si)