epinowcast
Loading...
Searching...
No Matches
apply_missing_reference_effects.stan
Go to the documentation of this file.
1
28vector apply_missing_reference_effects(int start, int end, vector obs,
29 array[] int sl, array[] int csl,
30 vector miss_ref_lprop) {
31 array[3] int n = filt_obs_indexes(start, end, csl, sl);
32 vector[n[3]] alloc_obs;
33 // Declare once outside loop to avoid repeated allocation
34 array[3] int l;
35 for (i in start:end) {
36 l = filt_obs_indexes(i, i, csl, sl);
37 alloc_obs[l[1]:l[2]] =
38 segment(obs, l[1], l[3]) + miss_ref_lprop[i];
39 }
40 return(alloc_obs);
41}
vector apply_missing_reference_effects(int start, int end, vector obs, array[] int sl, array[] int csl, vector miss_ref_lprop)
array[] int filt_obs_indexes(int start, int end, array[] int csl, array[] int sl)