The time series model is expressed as
y(t) = 0.5 + 0.3y(t-1) + n(t)
where
n(t) = 0.1*randn(500,1) for t=1,2,...,500
Slides contain the Correlation and covariance matrix. The formula for correlation is: E[y(t)*y(t)^T]
which can be invoked by using xcorr
. I would like to know how one can calculate the individual Correlation matrix for its lagged version E[y(t-1)*y(t-1)^T]
without using the inbuilt commands so that I can finally implement the following expression
trace([E[y(t-1)*y(t-1)']]^-1)
UPDATE
For example, Let
y = randn(10,1);
for t = 1:10
disp(y(t));
end
Expectation_y = sum(y(1:end))/10
Likewise, how do I perform expectation for lagged variables and then implement the formula =
trace([E[y(t-1)*y(t-1)']]^-1)