function [out,out1,exo]=get_prior_exo(dataMatrix,L,H,eq)
N=cols(dataMatrix);
out=cell(H,1);
out1=out;
Y=dataMatrix;
exo=cell(N,1);
for j=1:N
    id=1:N;
    id(j)=[];
    exo{j}=Y(:,id);
end
X=[];
for j=1:L
    X=[X lagmatrix(Y,j)];
end
X=[X ones(rows(Y),1) exo{eq}];
Y=Y(L+1:end,eq);
X=X(L+1:end,:);
B=X\Y;
E=Y-X*B;
S=(E'*E)/(rows(Y)-cols(X));
V0=kron(S,invpd(X'*X));
SD=(diag(V0));
out{1}=B;
out1{1}=SD;


for h=1:H
 Y=dataMatrix;
X=[];
for j=1+h-1:L+h-1
    X=[X lagmatrix(Y,j)];
end
exo1=exo{eq};

X=[X ones(rows(Y),1) exo1(1:end,:) ];
Y=Y(L+h:end,eq);
X=X(L+h:end,:);
B=X\Y;
E=Y-X*B;
S=(E'*E)/(rows(Y)-cols(X));
V0=kron(S,invpd(X'*X));
SD=(diag(V0));
out{h+1}=B;
out1{h+1}=SD;

end