function [phi] = sparse_fit(X) T = length(X); X_bar = mean(X); fact = sum((X-X_bar).^2); for i=[1,2,10,11] rho(i) = sum( (X(i+1:T) - X_bar).* (X(1:T-i) - X_bar) ) / fact; end phi = [1 , rho(11); rho(1), rho(10)]\ [rho(1);rho(2)]; endfunction