Generate Counterfactual versions of a ts_inter object
counterfactual_ts.Rd
mbtransfer makes predictions starting from ts_inter objects, so in order to simulate counterfactuals we need to provide alternative versions of those objects as input. This function truncates an existing ts object at start_ix and creates new intervention series according to the values of w0 and w1 (starting from the truncation point).
Arguments
- ts
The starting ts_inter object from which to build the ' counterfactuals. By default, this is the last timepoint in the current series.
- w0
The first version of the intervention series to consider.
- w1
The second version of the intervention series to consider.
- start_ix
The truncation position for the original ts. Defaults to no truncation, which appends new interventions to the end of the existing series.