Now we add the basline water efficiency uptake to each of the two models
## Add baseline WE uptake
This has to be done after the expansion to months as it is a monthly uptake model. how this works:
* Add baseline WE uptake rates of dual flush WC & low flow shower head uptake and adjust l/day/hh for WCs and showers accordingly
### Backwards estimation of water efficiency uptake
The first step is to allocate households to dual-flush/no dual-flush status and low-flow/no low-flow shower heads for all years. The logic applied is as follows:
* dual-flush/no dual-flush WC:
* linearly interpolate rate for a given year and month using the 2% yearly adoption rate
* apply these rates randomly to households. We acknowledge that those with meters may be more likely to also have low-flush WCs but we do not model this association at this time.
* low-flow/normal flow shower head:
* as for WC but stratified by top & bottom 50% shower litres/day within household size
> somehow this process needs to take account of the 'existing' uptake levels in 2011 in model v2 (based on SPRG survey data)
```{r Backcast WE uptake rates}
# start with a collapsed year/month spine
hhFinalDataComboExpandedDT <- hhFinalDataComboExpandedDT[, obsDate := ymd(paste0(currYear, "-", currMon, "-15"))] # make it the middle
Next we use the water use reduction values given at the start of the section to update the l/day/hh for those who have the dual flush WCs or low flow showers.
We only run the TUB processes for each input model separately as they use an external consumption threshold which will be different across models.
We only run the TUB processes for each input model separately as they use an external consumption threshold which will be different across models.
The others are run on the pooled model households as all processes are the same and we want as large a pool of 'uncovnerted; households as possible for the random selection processes.
The others are run on the pooled model households as all processes are the same and we want as large a pool of 'unconverted; households as possible for the random selection processes.
> Need to find ways to speed up these loops
> Need to find ways to speed up these loops
...
@@ -319,7 +319,7 @@ Add the additional dual flush WCs.
...
@@ -319,7 +319,7 @@ Add the additional dual flush WCs.
# sample households with single flush at appropriate rate
# sample households with single flush at appropriate rate
# save the resulting data.table and add more rows for each drought phase (setting dualFlushWCdr as we go) then merge back onto original file to add dualFlushWCdr
# save the resulting data.table and add more rows for each drought phase (setting dualFlushWCdr as we go) then merge back onto original file to add dualFlushWCdr
weMulti <- 1 # set to 1 here so that in normal years it has no effect - it is a multiplier used to increase the % who adopt in a non-nomral drough phase (See below)
weMulti <- 1 # set to 1 here so that in normal years it has no effect - it is a multiplier used to increase the % who adopt in a non-normal drought phase (See below)
droughtPhase <- "1. Normal"
droughtPhase <- "1. Normal"
monthYearDT <- hhFinalDataComboExpandedCEHDT[currYear == y & currMon == m]
monthYearDT <- hhFinalDataComboExpandedCEHDT[currYear == y & currMon == m]