# Ordinary Least Squares¶

There are many econometric options in Matlab such as the Econometrics Toolbox, the Statistics Toolbox or manually entering the equations in by hand. In this section we will simulate an AR(1) process and then estimate its parameters using ordinary least squares. We compute our estimates by using both the statistics toolbox and manual entry.

## Simulate an AR(1) Process¶

• We simulate an AR(1) process exactly as described in the previous section

$$y_{t} = c + \phi y_{t-1} + \epsilon_{t}$$. The true parameters are:

$\begin{split}c & = 5 \\ \phi &= 0.7 \\ \sigma &= 2\end{split}$