Home > vbmeg > functions > estimation > bayes > dynamics > mex-programs > init_AtQA.m

init_AtQA

PURPOSE ^

SYNOPSIS ^

function [AtQA] = init_AtQA(Nvact, Ndelta, NL_indx ,Val)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [AtQA] = init_AtQA(Nvact, Ndelta, NL_indx ,Val)
0002 
0003 if nargin < 4, Val=1; end
0004 
0005 % Initialization
0006 AtQA = cell(Ndelta,1);
0007 for nl = 1:Ndelta
0008     AtQA{nl} = spalloc(Nvact, Nvact, Nvact);
0009 end
0010 
0011 for nl = 1:Ndelta
0012     for nv = 1:Nvact
0013         if ~isempty(NL_indx{nv,nl})
0014             AtQA{nl}(NL_indx{nv,nl},NL_indx{nv,nl}) = Val; 
0015         end
0016     end
0017 end
0018 
0019 return
0020 %------------------------- END -----------------------------
0021 
0022 Nmem = zeros(Ndelta,1);
0023 for nl = 1:Ndelta
0024     indx_all = [];
0025     for nv = 1:Nvact
0026       indx_all = [indx_all; nl_indx{nv,nl}];
0027     end
0028     indx_all = unique(indx_all);
0029     Nmem(nl) = length(indx_all);
0030 end
0031 
0032 AtQA = cell(Ndelta,1);
0033 for nl = 1:Ndelta
0034   AtQA{nl} = spalloc(Nvact, Nvact, Nmem(nl));
0035 end

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005