function [sigma_sq,SSR]=compute_ar1_err_variance(zz)
% Copyright (c) 2013-2018, Francesco Corsello, All Rights Reserved.
z=zz(:);
t=size(z,1);
y=z(2:end,1);
x=[ones(t-1,1) z(1:end-1,1)];
beta=(x'*x)\(x'*y);
err=y-x*beta;
SSR=err'*err;
sigma_sq=SSR/(t-3);

end