32 vector scaled_reports, vector conv_reports, array[]
int obs,
33 int cumulative,
int historic,
int primary_hist_additive,
34 int current,
int primary_current_additive,
int predict
36 int t = num_elements(scaled_reports);
37 vector[t] secondary_reports = rep_vector(0.0, t);
42 if (cumulative && i > 1) {
44 secondary_reports[i] = secondary_reports[i - 1];
46 secondary_reports[i] = obs[i - 1];
51 if (primary_hist_additive) {
52 secondary_reports[i] += conv_reports[i];
54 secondary_reports[i] = fmax(0, secondary_reports[i] - conv_reports[i]);
59 if (primary_current_additive) {
60 secondary_reports[i] += scaled_reports[i];
62 secondary_reports[i] -= scaled_reports[i];
65 secondary_reports[i] = 1e-6 + secondary_reports[i];
67 return(secondary_reports);
vector calculate_secondary(vector scaled_reports, vector conv_reports, array[] int obs, int cumulative, int historic, int primary_hist_additive, int current, int primary_current_additive, int predict)
Calculate secondary reports from primary reports.