# Estimating an GARCH(1,1) model? Long hand method

I am really trying to invest some time to estimate a GARCH(1,1) method, I know there is many statistical packages that will do this for me (Eviews, MATLAB, R), but I am trying to do this by hand, so that I can really understand the model.

Following the theory from Verbeek. 'A guide to modern econometrics',

I first estimate an AR(1) model,

$$Y_t= \alpha +\theta Y_{t-1} +\varepsilon_t$$

And then I save the residuals, $$\varepsilon_t$$,

I then want to model a GARCH(1,1) with these residuals.

$$\sigma_t^2=\omega+\alpha \varepsilon_{t-1}^2 +\beta\sigma_{t-1}^2$$

This is where I am struggling, I understand a few things, I understand how I can get the lagged $$\varepsilon_{t-1}^2$$, I already have it from the first equation, however my major question is how do I get a value for $$\sigma_{t-1}^2$$ this is what I am trying to estimate, so I am really struggling about how I derive this part. I suppose I need a series for $$\sigma_{t-1}^2$$, which in matrix terms is a long as the $$\varepsilon_{t-1}^2$$.

I am thinking I may need to use a for loop to get this $$\sigma_{t-1}^2$$, but any suggestions on how I might go about this would be helpful.

Second, when I do realise how to do the above step, I need to estimate the thing my maximum likelihood estimation. I think I read around this and try my best to solve it.

I would really like help on step one if anyone has got the time or direction to a good reference?