% test second order solution
all second order matrices include the 1/2 of the expansion;
%  P4=constant all variables ;
%  F4= constant of all states;
%  PHI2= coeff. matrix of states on x-product of states
%  PHI1= autorecursive coefficient first order endogenous states (same as last lower block of PHI)
%  Pi1= mapping from endogenous states to all variables (same as last columns of Pi)
%  Pi2= mapping from x-products of states (vech) to all variables (P3) in papaer
%  bigpsi= x-product of lagged states and contemporaneous shocks


%%%%%%%% Need to fix the timing of the state variables so to have that
%%%%%%%% states are all predetermined (see Alan's trick)
% canonical form
V=vech(Y_t*Y_t');
V(:,jj)=(PHIh*V(:,jj-1)+bigpsi*xi_t+Mh*bSig_t);
S(:,jj)=(PHI*S(:,jj-1)+PHI2*V(:,jj-1)+M*eps_at1+F4x*bSig);
C(:,jj)=(Pi*S(:,jj)+Pi2*V(:,jj))+(1-noconstant)*P4*bSig;

C(:,jj)=Pi*()

A*Y(+1)+B*Y+Ax0*V+Ax1*kron(PHI,PHI)*V+Ax2*kron(PHI,I)*V

% STATE SPACE FORM 



Y=