% This program solves the model and runs the simulation using the VARMA
% representation
clear;
% modified 24.8. CK
% modified 24.10.08 CK



global model_num; 
global model_name;
%--------------------------------------------------------------------------
% SIMULATION SETUP: 
initialdrop=200;    % number of observations to drop  
horizon= 180;        % length of simulation before droppping `dropinitial' observations  
n=1000;                % no. of simulations
model_num=5;        % specifies the model: 
                    % 1 KP benchmark model  
                    % 2 KP w indivisible labor 
                    % 3 KP w Frisch E. 0.63
                    % 4 CKM benchmark model
                    % 5 CKM w indivisble labor
                    % 6 CKM w Frisch E. 0.63
                    % 7 CKM w sigma_l/2
                    % 8 CKM w sigma_l/3

 save_d=1;          % 1 - save 0 - dont save
                    
%--------------------------------------------------------------------------
getmodelname; 

j=1;
series_mat=[];


name=['c:\christian\ownresearch\BCAandVARMA\programs_revision\coeff_' model_name '.dat'];


coeff=load(name); 
const=coeff(:,1);
AR1=coeff(:,2:3); MA1=coeff(:,4:5); DD=coeff(:,6:7);


while j<n+1;

    series=simulationVARMA(const,AR1,MA1,DD,horizon,initialdrop);
    
    series_mat=[series_mat;series];

    j=j+1;
end


disp(model_name);

if save_d==1;
    
    name=['c:\christian\ownresearch\BCAandVARMA\programs_revision\VARMAseries_' model_name num2str(horizon) '.dat'];
    save(name,'series_mat','-ascii');

end



















