![]() |
EpiNow2 Stan Functions
|
Functions for convolving time series. More...

Functions | |
| array[] int | calc_conv_indices_xlen (int s, int xlen, int ylen) |
| array[] int | calc_conv_indices_len (int s, int xlen, int ylen) |
| vector | convolve_with_rev_pmf (vector x, vector y, int len) |
| vector | convolve_to_report (vector infections, vector delay_rev_pmf, int seeding_time) |
Functions for convolving time series.
Functions from convolve.stan for implementing convolutions between infections and delay distributions.
| array[] int calc_conv_indices_len | ( | int | s, |
| int | xlen, | ||
| int | ylen ) |
Calculate convolution indices for the case where s > xlen
| s | Current position in the output vector |
| xlen | Length of the x vector |
| ylen | Length of the y vector |
Definition at line 39 of file convolve.stan.
Referenced by convolve_with_rev_pmf().

| array[] int calc_conv_indices_xlen | ( | int | s, |
| int | xlen, | ||
| int | ylen ) |
convolution_functions Functions
This file contains functions for performing discrete convolutions, which are used throughout the model to combine time series with delay distributions. Calculate convolution indices for the case where s <= xlen
| s | Current position in the output vector |
| xlen | Length of the x vector |
| ylen | Length of the y vector |
Definition at line 20 of file convolve.stan.
Referenced by convolve_with_rev_pmf().

| vector convolve_to_report | ( | vector | infections, |
| vector | delay_rev_pmf, | ||
| int | seeding_time ) |
Convolve infections to reported cases.
This function convolves a vector of infections with a reversed delay distribution to produce a vector of reported cases.
| infections | A vector of infection counts. |
| delay_rev_pmf | A vector representing the reversed probability mass function of the delay distribution. |
| seeding_time | The number of initial time steps to exclude from the output. |
seeding_time + 1. Definition at line 105 of file convolve.stan.
References convolve_with_rev_pmf().

| vector convolve_with_rev_pmf | ( | vector | x, |
| vector | y, | ||
| int | len ) |
Convolve a vector with a reversed probability mass function.
This function performs a discrete convolution of two vectors, where the second vector is assumed to be an already reversed probability mass function.
| x | The input vector to be convolved. |
| y | The already reversed probability mass function vector. |
| len | The desired length of the output vector. |
len containing the convolution result. | If | len is not of equal length to the sum of the lengths of x and y. |
Definition at line 62 of file convolve.stan.
References calc_conv_indices_len(), and calc_conv_indices_xlen().
Referenced by convolve_to_report(), and get_delay_rev_pmf().

