%compute factor loadings</span>
  H(:,i) = ns_basis(ttm,i,1/2.5)';
<span class="keyword">end</span>
H=[H zeros(length(H),K-get(ns,<span class="string">'dim'</span>))];

N=get(ns,<span class="string">'simT'</span>)*get(ns,<span class="string">'simN'</span>);  <span class="comment">%number of quarters simulated</span>
M=get(ns,<span class="string">'numSims'</span>);    <span class="comment">%number of simulations</span>

<span class="comment">% Initialize matrices</span>
F=zeros(N,size(ttm,2),M);
Zb=zeros(N,s