I have four different time series of hourly measurements:
- The heat consumption inside a house
- The temperature outside the house
- The solar radiation
- The wind speed
I want to be able to predict the heat consumption inside the house. There is a clear seasonal trend, both on a yearly basis, and on a daily basis. Since there is a clear correlation between the different series, I want to fit them using an ARIMAX-model. This can be done in R, using the function arimax from the package TSA.
I tried to read the documentation on this function, and to read up on transfer functions, but so far, my code:
regParams = ts.union(ts(dayy))
transferParams = ts.union(ts(temp))
model10 = arimax(heat,order=c(2,1,1),seasonal=list(order=c(0,1,1),period=24),xreg=regParams,xtransf=transferParams,transfer=list(c(1,1))
pred10 = predict(model10, newxreg=regParams)
gives me:

where the black line is the actual measured data, and the green line is my fitted model in comparison. Not only is it not a good model, but clearly something is wrong.
I will admit that my knowledge of ARIMAX-models and transfer functions is limited. In the function arimax(), (as far as I have understood), xtransf is the exogenous time series which I want to use (using transfer functions) to predict my main time series. But what is the difference between xreg and xtransf really?
More generally, what have I done wrong? I would like to be able to get a better fit than the one achieved from lm(heat ~ tempradiwind*time).
Edits: Based on some of the comments, I removed transfer, and added xreg instead:
regParams = ts.union(ts(dayy), ts(temp), ts(time))
model10 = arimax(heat,order=c(2,1,1),seasonal=list(order=c(0,1,1),period=24),xreg=regParams)
where dayy is the "number day of the year", and time is the hour of the day. Temp is again the temperature outside. This gives me the following result:

which is better, but not nearly what I expected to see.
predict()is used for forecasting, whilefitted()returns the model fit over the historical period. If you want more specific help, you should post a reproducible example with some code. – Zach Nov 18 '11 at 13:18heatto linearly increase with hour of day, and then jump back down when the hour returns to 1. If you use dummy variables, each hour of the day will get it's own effect. Run through my example code, and pay careful attention to how I construct my xreg object. – Zach Nov 18 '11 at 13:24statsandforecastpackages is that they do not fit prober transfer functions. The documentation of thestats::arimafunction state the following: If an xreg term is included, a linear regression (with a constant term if include.mean is true and there is no differencing) is fitted with an ARMA model for the error term. So, if you actually need to fit transfer functions it seems like theTSA::arimaxfunction is the way to go inR. – Christoffer May 03 '18 at 13:37