epinowcast
|
Go to the source code of this file.
Functions | |
real | delay_snap_lpmf (array[] int dummy, int start, int end, array[] int obs, array[] int sl, array[] int csl, array[] int nsl, array[] int cnsl, array[] int obs_lookup, array[] vector imp_obs, array[] int sg, array[] int st, array[,] int rdlurd, vector srdlh, matrix refp_lh, array[] int dpmfs, int ref_p, int rep_h, int ref_as_p, array[] real phi, int model_obs, vector refnp_lh, int ref_np, array[] int sdmax, array[] int csdmax) |
real | delay_group_lpmf (array[] int groups, int start, int end, array[] int obs, array[] int sl, array[] int csl, array[] int nsl, array[] int cnsl, array[] int obs_lookup, array[] vector imp_obs, int t, array[] int sg, array[,] int ts, array[] int st, array[,] int rdlurd, vector srdlh, matrix refp_lh, array[] int dpmfs, int ref_p, int rep_h, int ref_as_p, array[] real phi, int model_obs, int model_miss, int miss_obs, array[] int missing_reference, array[,] int obs_by_report, vector miss_ref_lprop, array[] int sdmax, array[] int csdmax, array[] int miss_st, array[] int miss_cst, vector refnp_lh, int ref_np) |
real delay_group_lpmf | ( | array[]int | groups, |
int | start, | ||
int | end, | ||
array[]int | obs, | ||
array[]int | sl, | ||
array[]int | csl, | ||
array[]int | nsl, | ||
array[]int | cnsl, | ||
array[]int | obs_lookup, | ||
array[]vector | imp_obs, | ||
int | t, | ||
array[]int | sg, | ||
array int | ts[,], | ||
array[]int | st, | ||
array int | rdlurd[,], | ||
vector | srdlh, | ||
matrix | refp_lh, | ||
array[]int | dpmfs, | ||
int | ref_p, | ||
int | rep_h, | ||
int | ref_as_p, | ||
array[]real | phi, | ||
int | model_obs, | ||
int | model_miss, | ||
int | miss_obs, | ||
array[]int | missing_reference, | ||
array int | obs_by_report[,], | ||
vector | miss_ref_lprop, | ||
array[]int | sdmax, | ||
array[]int | csdmax, | ||
array[]int | miss_st, | ||
array[]int | miss_cst, | ||
vector | refnp_lh, | ||
int | ref_np | ||
) |
Log probability mass function for delayed group data
Computes the log probability mass for a range of time indexes in delayed group data. It manages data filtering, allocation for expected log observations, and handles missing data if applicable.
start | Start index for the range of interest. |
end | End index for the range of interest. |
obs | Array of observed data, stored as a flat vector. |
sl | Array of start index for each observation period. |
csl | Array of cumulative start indexes. |
nsl | Array of next start indexes, indicating the start of the next period. |
cnsl | Array of cumulative next start indexes. |
obs_lookup | Array of indexes linking observed data to modeled expectations. |
imp_obs | Array of imputed observed data, organized by group and time. |
sg | Array indicating group index for each observation. |
st | Array indicating time index for each observation. |
rdlurd | Array indicating reporting dates lookup reference data. |
srdlh | Vector of standardized reporting date log hazards. |
refp_lh | Matrix of reference date logit hazards. |
dpmfs | Array of indices for accessing reference date effects in refp_lh . |
ref_p | Binary flag for reference date effects presence. |
rep_h | Binary flag for reporting hazard effects presence. |
ref_as_p | Binary flag indicating if reference date input should be treated as probability. |
phi | Array of dispersion parameters for negative binomial distribution. |
model_obs | Binary flag indicating if a negative binomial model is used. |
refnp_lh | Vector of non-parametric reference log hazards. |
ref_np | Binary flag for non-parametric reference effects presence. |
sdmax | Array of maximum start dates for each period. |
csdmax | Array of cumulative start dates. |
groups | Array of group identifiers. |
t | Integer representing the current time index. |
groups | Array of group identifiers. |
ts | Array of snapshot indices by time and group. |
model_miss | Binary flag indicating if missing observations should be modeled (0 = no, 1 = yes). |
miss_obs | Number of observations with missing reference dates. |
missing_reference | Array of observations reported without a reference date (by reporting time). |
obs_by_report | Array of observation indices by reference date for entries in missing_reference. |
miss_ref_lprop | Vector of log probabilities for missing reference dates. |
miss_st | Array of start indices for observations by group in missing_reference. |
miss_cst | Array of cumulative start indices for observations by group in missing_reference. |
expected_obs_from_snaps
.obs_lpmf
.apply_missing_reference_effects
and log_expected_by_report
if model_miss
is 1.Dependencies:
filt_obs_indexes
expected_obs_from_snaps
obs_lpmf
allocate_observed_obs
apply_missing_reference_effects
log_expected_by_report
.This function is similar to delay_snap_lpmf
but is specifically designed for group data and includes additional steps for missing data.
Definition at line 122 of file delay_lpmf.stan.
real delay_snap_lpmf | ( | array[]int | dummy, |
int | start, | ||
int | end, | ||
array[]int | obs, | ||
array[]int | sl, | ||
array[]int | csl, | ||
array[]int | nsl, | ||
array[]int | cnsl, | ||
array[]int | obs_lookup, | ||
array[]vector | imp_obs, | ||
array[]int | sg, | ||
array[]int | st, | ||
array int | rdlurd[,], | ||
vector | srdlh, | ||
matrix | refp_lh, | ||
array[]int | dpmfs, | ||
int | ref_p, | ||
int | rep_h, | ||
int | ref_as_p, | ||
array[]real | phi, | ||
int | model_obs, | ||
vector | refnp_lh, | ||
int | ref_np, | ||
array[]int | sdmax, | ||
array[]int | csdmax | ||
) |
Log probability mass function for delayed snapshot data
Computes the log probability mass for a range of time indexes in delayed snapshot data. It applies filters to identify relevant observations and calculates the expected log observations based on various inputs.
start | Start index for the range of interest. |
end | End index for the range of interest. |
obs | Array of observed data, stored as a flat vector. |
sl | Array of start index for each observation period. |
csl | Array of cumulative start indexes. |
nsl | Array of next start indexes, indicating the start of the next period. |
cnsl | Array of cumulative next start indexes. |
obs_lookup | Array of indexes linking observed data to modeled expectations. |
imp_obs | Array of imputed observed data, organized by group and time. |
sg | Array indicating group index for each observation. |
st | Array indicating time index for each observation. |
rdlurd | Array indicating reporting dates lookup reference data. |
srdlh | Vector of standardized reporting date log hazards. |
refp_lh | Matrix of reference date logit hazards. |
dpmfs | Array of indices for accessing reference date effects in refp_lh . |
ref_p | Binary flag for reference date effects presence. |
rep_h | Binary flag for reporting hazard effects presence. |
ref_as_p | Binary flag indicating if reference date input should be treated as probability. |
phi | Array of dispersion parameters for negative binomial distribution. |
model_obs | Binary flag indicating if a negative binomial model is used. |
refnp_lh | Vector of non-parametric reference log hazards. |
ref_np | Binary flag for non-parametric reference effects presence. |
sdmax | Array of maximum start dates for each period. |
csdmax | Array of cumulative start dates. |
dummy | Dummy array parameter, not used in the calculation. |
expected_obs_from_snaps
.obs_lpmf
.Dependencies:
filt_obs_indexes
expected_obs_from_snaps
obs_lpmf
This function is similar to delay_group_lpmf
but operates on snapshot data rather than group data.
Definition at line 28 of file delay_lpmf.stan.