Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc;
- clear all;
- var_eps = 1;
- epsilon = sqrt(var_eps)*randn(5000,1); % Gaussian signal exciting the AR model
- Y(1) = 0.0;
- Y(2) = 0.0;
- for n= 3:5000
- Y(n)= 0.1950*Y(n-1) -0.9500*Y(n-2)+ epsilon(n); %AR(2) model
- end
- y_tminus1 = Y(1:end-1).';
- mult = y_tminus1*y_tminus1'; %This creates a square matrix
- autocorr = xcorr2(mult); %To perform autocorrelation of 1 sampled lag time series with itself(1 sampled lag)
- inverse_autocorr = inv(autocorr); **%PROBLEM**
- %Warning: Matrix is singular to working precision.
- trace_inv=trace(inverse_autocorr);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement