You can fit an intervention model in R. This is simply a regression with ARIMA errors. The regression variables measure the effect of interest and the ARIMA errors take care of the serial correlations.
If you assume that the retrofit results in a level shift in demand costs, then the following code will fit the model. Assume that the data is stored in x
which is a ts
object with frequency 24
library(forecast)
z <- numeric(length(x))
z[(365*24+1):length(x)] <- 1
fit <- auto.arima(x, xreg=z)
The coefficient of z
will give you the estimated effect of average demand savings per hour.
If you want a different effect for different times of the day, then try the following.
z <- seasonaldummy(x)
z <- cbind(z,1-rowSums(z))
z[1:(365*24)] <- 0
fit <- auto.arima(x, xreg=z)
Then there will be 24 regression variables representing the 24 hours of the day. The seasonaldummy()
function generates 23 dummy variables as you normally don't need the extra one. So the second line creates the missing indicator variable for the 24th hour.
In reality, your data probably have a more complicated seasonal pattern than simply a daily pattern. I imagine there is a day of week effect as well, and probably holiday effects. These can be added in as additional regressors in the above models to control for them.