29 array[]
int sl, array[]
int csl,
30 array[]
int nsl, array[]
int cnsl, array[]
int obs_lookup,
31 array[] vector imp_obs, array[]
int sg,
32 array[]
int st, array[,]
int rdlurd,
33 vector srdlh, matrix refp_lh, array[]
int dpmfs,
34 int ref_p,
int rep_h,
int ref_as_p, array[] real phi,
35 int model_obs, vector refnp_lh,
int ref_np,
36 array[]
int sdmax, array[]
int csdmax) {
44 array[nc[3]]
int filt_obs = segment(obs, nc[1], nc[3]);
45 array[nc[3]]
int filt_obs_lookup = segment(obs_lookup, nc[1], nc[3]);
46 array[nc[3]]
int filt_obs_lookup_local;
48 filt_obs_lookup_local[i] = filt_obs_lookup[i] - n[1] + 1;
52 vector[n[3]] log_exp_obs;
56 start, end, imp_obs, rdlurd, srdlh, refp_lh, dpmfs, ref_p, rep_h, ref_as_p, sl, csl, sg, st, n[3], refnp_lh, ref_np, sdmax, csdmax
60 profile(
"model_likelihood_neg_binomial") {
62 filt_obs | log_exp_obs[filt_obs_lookup_local], phi, model_obs
123 array[]
int sl, array[]
int csl, array[]
int nsl,
124 array[]
int cnsl, array[]
int obs_lookup,
125 array[] vector imp_obs,
int t, array[]
int sg,
126 array[,]
int ts, array[]
int st,
127 array[,]
int rdlurd, vector srdlh, matrix refp_lh,
128 array[]
int dpmfs,
int ref_p,
int rep_h,
int ref_as_p,
129 array[] real phi,
int model_obs,
int model_miss,
130 int miss_obs, array[]
int missing_reference,
131 array[,]
int obs_by_report, vector miss_ref_lprop,
132 array[]
int sdmax, array[]
int csdmax,
133 array[]
int miss_st, array[]
int miss_cst,
134 vector refnp_lh,
int ref_np) {
137 int i_start = ts[1, start];
138 int i_end = ts[t, end];
145 vector[n[3]] log_exp_obs;
146 vector[model_miss ? miss_obs : 0] log_exp_obs_miss;
154 vector[f[3]] log_exp_all;
158 i_start, i_end, imp_obs, rdlurd, srdlh, refp_lh, dpmfs, ref_p, rep_h, ref_as_p, sdmax, csdmax, sg, st, f[3], refnp_lh, ref_np, sdmax, csdmax
163 i_start, i_end, log_exp_all, sl, csl, sdmax, csdmax
166 i_start, i_end, log_exp_obs, sl, csl, log1m_exp(miss_ref_lprop)
172 i_start, i_end, log_exp_all, sdmax, csdmax, miss_ref_lprop
175 log_exp_all, obs_by_report[l[1]:l[2]]
180 i_start, i_end, imp_obs, rdlurd, srdlh, refp_lh, dpmfs, ref_p, rep_h, ref_as_p, sl, csl, sg, st, n[3], refnp_lh, ref_np, sdmax, csdmax
184 profile(
"model_likelihood_neg_binomial") {
187 array[nc[3]]
int filt_obs = segment(obs, nc[1], nc[3]);
188 array[nc[3]]
int filt_obs_lookup = segment(obs_lookup, nc[1], nc[3]);
189 array[nc[3]]
int filt_obs_lookup_local;
191 filt_obs_lookup_local[i] = filt_obs_lookup[i] - n[1] + 1;
195 filt_obs | log_exp_obs[filt_obs_lookup_local], phi, model_obs
198 if (model_miss && miss_obs) {
200 array[l[3]]
int filt_miss_ref = segment(missing_reference, l[1], l[3]);
201 tar +=
obs_lpmf(filt_miss_ref | log_exp_obs_miss, phi, model_obs);
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_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)
vector expected_obs_from_snaps(int start, int end, array[] vector imp_obs, array[,] int rdlurd, vector srdlh, matrix refp_lh, array[] int dpmfs, int ref_p, int rep_h, int ref_as_p, array[] int sl, array[] int csl, array[] int sg, array[] int st, int n, vector refnp_lh, int ref_np, array[] int sdmax, array[] int csdmax)