Simplest way to generate AR(2) process on MATLAB As part of a project I need to use autocorrelation method of estimating model paramters of an autoregressive process on MATLAB. 

Can anyone tell me the simplest way to generate an AR(2) process on MATLAB so that I can estimate its model parameters $\hat{a}_{p}(k)$ and $\hat{b}_{0}$?

The difference equation for the process is given below:

$$x(n) = -0.9x(n-1) + w(n)$$
The simplest way to approximate an AR-2 process in Matlab / Octave is the following:

N = 1024;                    % number of process samples.
a = [1, -0.9, 0.2];          % denominator coefficients, p = 2.
b = [1.0];                   % numerator coefficient.
x = filter(b,a, randn(1,N)); % generate N sample of AR-2 x[n].


Note: an AR process requires a true-white noise sequence $v[n]$ at the input of the filter but here we input a single instance of a crude approximation of it. Hence the process is not truly an AR-2 but an approximation...