log_lklh {REffectivePred} | R Documentation |
The likelihood function
Description
The negative log likelihood function of the model.
Usage
log_lklh(
param,
params_limits,
restrictions = NULL,
restriction.starts = NULL,
ranges = NULL,
rt_func = 1,
silence.errors = FALSE,
fit.t.pred,
lt,
cases,
scenario = NULL,
H.E,
H.W,
adj.period,
population,
rho,
serial_mean,
serial_var,
window_size
)
Arguments
param |
Includes the following sets of parameters in a vector, in this order:
|
params_limits |
Boundaries/limits of the ini_params. |
restrictions |
A numeric integer vector giving the severity of restrictions. Zero means no restriction, and higher numbers means greater severity/disruption. The ordered unique values should be consecutive integers starting from zero. Each number (other than 0) adds a new parameter to the fit. restrictions = NULL causes the function to use mobility data instead of the psi values (currently unsupported). |
restriction.starts |
A vector of same length as restrictions, of times when restrictions came into effect. Note: the first index time should be 1. |
ranges |
An vector of time ranges for the different waves. The wave ranges should be contiguous, with at least one unit of time between consecutive waves. |
rt_func |
The parametric form of function c(). Options are listed under function c_helper. |
silence.errors |
Ignores (skips) NA or NaN values when summing up likelihood contributions over time. |
fit.t.pred |
Time of prediction. |
lt |
Length of cases. |
cases |
A vector containing cases for each time-point. |
scenario |
A character string describing options to deal with restrictions. Currently unsupported. |
H.E |
Mobility metrics for category Retail & Entertainment. Currently unsupported. |
H.W |
Mobility metrics for category Workplaces. Currently unsupported. |
adj.period |
Delays in society adjusting. |
population |
total population size. |
rho |
Under-reporting fraction. |
serial_mean |
Mean of the serial interval on the log scale. |
serial_var |
Variance of the serial interval on the log scale. |
window_size |
The maximum value for the serial interval. |
Details
The predicted curve is computed based on parameters supplied, by first calling the prediction
function pred.curve
. The probability model used to compute the likelihood assumes that observed
infection at time t
are \sim N(mean = I_t, sd = \sqrt{u*I_t})
, where I_t
are predicted infections, and sums the
log-likelihood contributions for each time t
during waves, and up to fit.t.pred
.
Value
The negative log likelihood value of the data.