convolution_matrix | R Documentation |
This function allows the construction of convolution matrices which can be be combined with a vector of primary events to produce a vector of secondary events for example in the form of a renewal equation or to simulate reporting delays. Time-varying delays are supported as well as distribution padding (to allow for use in renewal equation like approaches).
convolution_matrix(dist, t, include_partial = FALSE)
dist |
A vector of list of vectors describing the distribution to be convolved as a probability mass function. |
t |
Integer value indicating the number of time steps to convolve over. |
include_partial |
Logical, defaults to FALSE. If TRUE, the convolution include partially complete secondary events. |
A matrix with each column indicating a primary event and each row indicating a secondary event.
Helper functions for model modules
add_max_observed_delay()
,
add_pmfs()
,
enw_reference_by_report()
,
enw_reps_with_complete_refs()
,
extract_obs_metadata()
,
extract_sparse_matrix()
,
latest_obs_as_matrix()
,
simulate_double_censored_pmf()
# Simple convolution matrix with a static distribution
convolution_matrix(c(1, 2, 3), 10)
# Include partially reported convolutions
convolution_matrix(c(1, 2, 3), 10, include_partial = TRUE)
# Use a list of distributions
convolution_matrix(rep(list(c(1, 2, 3)), 10), 10)
# Use a time-varying list of distributions
convolution_matrix(c(rep(list(c(1, 2, 3)), 10), list(c(4, 5, 6))), 11)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.