function [iamat,amat]=getamatonly(res,hlast,c0in,p00_ain,N)
c0=chofac(N,c0in);
p00_a=chofac(N,p00_ain);
amatx=[];
T=rows(res);
for j=2:N
%v2=-a1*v1+sqrt(exp(h2))*e2
ytemp=res(:,j);  %v2
xtemp=res(:,1:j-1)*(-1); %-v1
ytemp=ytemp./repmat(sqrt(hlast(j)),T,cols(ytemp));
xtemp=xtemp./repmat(sqrt(hlast(j)),T,cols(xtemp));
%prior means and variances
alpha21_0=c0(j,1:j-1)';
v00_a=diag(1./p00_a(j,1:j-1)); %inverse prior variance

alpha21_2=getreg1(ytemp,xtemp,alpha21_0,v00_a,1); %draw from Normal
amatx=[amatx alpha21_2'];
end
amat=amatx;
iamat=invpd(chofac(N,amatx'));%chofac converts to a lower triangular 