Can take a distribution list, a probability distribution vector, a probability distribution matrix or empirical delay data as input. If delay is already a delay distribution vector or matrix, it is returned as is.

.get_delay_distribution(
  delay,
  n_report_time_steps = NULL,
  ref_date = NULL,
  time_step = "day",
  ...
)

Arguments

delay

list, vector, matrix or dataframe. Delay distribution to transform or validate into a vector of discretized probability distribution.

n_report_time_steps

integer. Length of the incidence time series in the accompanying analysis. This argument is needed to determine the dimensions of the output matrix.

ref_date

Date. Optional. Date of the first data entry in incidence_data

time_step

string. Time between two consecutive incidence datapoints. "day", "2 days", "week", "year"... (see seq.Date for details)

...

Arguments passed on to build_delay_distribution

max_quantile

numeric value between 0 and 1. Upper quantile reached by the last element in the discretized distribution vector.

offset_by_one

boolean. Set to TRUE if distribution represents the fit of data that was offset by one (fitted_data = original_data + 1) to accommodate zeroes in original_data.

Value

vector or matrix of discretized probability distribution.

Details

If delay is a single distribution list, this function builds and return the vector of discretized probability distribution. If delay is a list of distribution lists, this function builds and return the matrix of discretized probability distribution, with dimensions corresponding to the number of delays in the list. If delay is a vector, the function checks that delay is a valid discretized probability distribution and returns it. Similarly, if delay is a matrix, the function checks that it is in the correct format and returns it. In a matrix, each column index corresponds to a time step associated with a date of event, each row index corresponds to a time step associated with a date of event observation. Each entry m_ij corresponds to the probability that an event occurring at time step j is observed at time step i. Matrices must be lower-triangular. Sums over columns must not exceed 1.

See build_delay_distribution for details on the distribution list format; see get_matrix_from_empirical_delay_distr for details on the empirical delay data format.