# GARCH(1,1) Implementation question

Could someone shed some light into the implementation of the GARCH(1,1) model contained in page6 of the following document? http://www-stat.wharton.upenn.edu/~steele/Courses/956/RResources/GarchAndR/WurtzEtAlGarch.pdf. In particular, I am looking at the creating the likelihood function in R.

To begin with, the GARCH(1,1) model is define to be

$\sigma _t ^2 = \omega + \alpha z^2 _{t-1} + \beta \sigma ^2_{t-1}$.

By repeated substitution, the model can be written as

$\sigma _t ^2 = \omega + \alpha z^2 _{t-1} + \beta(\omega + \alpha z^2 _{t-2}) + \ldots \beta ^{t-2}(\omega + \alpha z^2 _1) + \beta ^{t-1}\sigma_1 ^2$.

Now, based from my understanding of the use of the function filter in R, the line of code h = filter(e, beta, "r", init = Mean), seems to suggest that

$\sigma ^2_t \equiv \omega + \alpha z^2 _{t-1} + \beta(\omega + \alpha z^2 _{t-2}) + \ldots \beta ^{t-2}(\omega + \alpha z^2 _1) + \beta ^{t-1}(\omega + \alpha \mathbb{E}[z^2]) + \underbrace{\mathbb{E}[z^2]}_{=:\text{init}}$,

which is somewhat inconsistent with the previous equation. I am not aware of any theory which suggest this relationship or at least I am not sure why the code initialises the historical variance of the data outside the recursive equation. I hope somebody can help me address this issue for me if I have misunderstood it.