MATLAB: How to calculate autocorrelation of series in different columns of a 68×5 matrix

autocorrelation

I have a 68×5 matrix.It has gdp data of five countries for 68 quarters. The series is first lagged. I want to calculate autocorrelation of gdp series for each country. How can i do that? Also, How do i calculate correlation of gdp between country i and j? Thanks in adance.

Best Answer

Assuming that M is your matrix:
% Autocorrelation of i_th country
autocorr(M(:,i))
% Crosscorrelation between i_th and j_th country
crosscorr(M(:,i), M(:,j))