I have two questions related to transfer functions. The first is a general question regarding how to compute values of $Y_t$ from a rational transfer polynomial function of the form popularized by Box and Jenkins. The second is related to the arimax() function in the TSA package in R. It is my understanding that the rational transfer function can be expressed as (ignoring any noise terms):
$Y_t = \frac{\omega(B)^sB^d}{\delta(B)^r}X_t$
Lets first make it easy and assume r = 1, s = 0 and d = 0. Then the equation should simplify to:
$Y_t = \frac{\omega_0}{(1-\delta_1B^1)}X_t$ (equation 1)
My first intuition would be to multiply both sides by ${(1-\delta_1 B^1)}$ then re-arrange to solve for $Y_t$:
$Y_t = \omega_oX_t+\delta_1 Y_{t-1}$ (equation 2)
However, I've seen here and here (pg. 286) that you can express the transfer function as so:
$Y_t = \frac{\omega_0}{(1-\delta_1B^1)}X_t = \omega_o(1+\delta_1 B^1)X_t$
This would yield a different equation for $Y_t$:
$Y_t = \omega_oX_t+\delta_1\omega_o X_{t-1}$ (equation 3)
So is equation 2 the correct way to calculate $Y_t$ or is it equation 3? If $d \neq 0$, say r = 0, s = 1 and d = 1, could you re-write the equation 1 as:
$Y_t = \frac{\omega_0}{(1-\delta_1B^1)}X_{t-1}$
and then solve for $Y_t$ by one of the equations above?
Finally, for a related R question. Assuming one of the two ways above is correct for solving for $Y_t$, I would like to check the fitted values that are calculated using the arimax() function in the TSA package. I will use the Box and Jenkins sales and lead data, and use their transfer function. The arimax() function is taken from this post and gives correct coefficients:
>library(astsa)
>library(TSA)
>d.lead <- diff(BJsales.lead) #first difference
>d.sale <- diff(BJsales) #first difference
>center.d.lead <- d.lead - mean(d.lead) # mean centered, first difference
>center.d.sale <- d.sale - mean(d.sale) # mean centered, first difference
>mod <- arimax(center.d.sale,
order=c(0,0,1),
include.mean=TRUE,
fixed=c(NA,NA,NA,0,0,0,NA),
xtransf=center.d.lead,
transfer=list(c(1,3)),
method="ML")
>mod
Coefficients:
ma1 intercept T1-AR1 T1-MA0 T1-MA1 T1-MA2 T1-MA3
-0.4500 -0.0055 0.7253 0 0 0 4.7008
s.e. 0.0772 0.0107 0.0048 0 0 0 0.0613
>fitted(mod)[1:5]
[1] NA NA NA 0.1264714 1.3631528
Now, I would like to calculate by hand the fitted values of mod. Assuming equation 1 above is correct $Y_t$ (center.d.sale) equals (again ignoring noise):
$Y_t = \omega_3X_{t-3}+\delta_1 Y_{t-1}$
If $\omega_3 = 4.7008$ and $\delta_1 = 0.7253$ then the first calculated value ($Y_4$) should be:
>4.7008*center.d.lead[1] + 0.7253*center.d.sale[3]
-0.4922764
This is clearly not the same as the fitted value:
>fitted(mod)[4]
0.1264714
Even including the intercept, the values aren't the same. Do you know how arimax() calculates the fitted values, or if my equation is wrong, the proper way to calculate the fitted values from the transfer function coefficients?