Home > . > calib_obj2.m

calib_obj2

PURPOSE ^

targets and iy order: 1) variances 2) correlations

SYNOPSIS ^

function objective=calib_obj2(M_.Sigma_e,A,ghu1,ghx,ghu,targets,var_weights,iy,nar)

DESCRIPTION ^

 targets and iy order: 1) variances 2) correlations 
 3) constraints on M_.Sigma_e itself 4) autocorrelations

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % targets and iy order: 1) variances 2) correlations
0002 % 3) constraints on M_.Sigma_e itself 4) autocorrelations
0003 function objective=calib_obj2(M_.Sigma_e,A,ghu1,ghx,ghu,targets,var_weights,iy,nar)
0004   global vx fold
0005   
0006   objective = cell (nar+3);
0007   oo_.gamma_y = cell(nar+1,1);
0008   M_.Sigma_e=diag(M_.Sigma_e);
0009   nx = size(ghx,2);
0010   b=ghu1*M_.Sigma_e*ghu1';
0011   vx = lyapunov_symm(A,b);
0012   oo_.gamma_y{1} = ghx*vx*ghx'+ ghu*M_.Sigma_e*ghu';
0013   if ~isempty(targets{1})
0014     objective{1} = sqrt(oo_.gamma_y{1}(iy{1}));
0015   end
0016 
0017   sy = sqrt(diag(oo_.gamma_y{1}));
0018   sy = sy *sy';
0019   if ~isempty(targets{2})
0020     objective{2} = oo_.gamma_y{1}(iy{2})./(sy(iy{2})+1e-10);
0021   end
0022   
0023   if ~isempty(targets{3})
0024     objective{3} = M_.Sigma_e(iy{3});
0025   end
0026   
0027   % autocorrelations
0028   if nar > 0
0029     vxy = (A*vx*ghx'+ghu1*M_.Sigma_e*ghu');
0030     
0031     oo_.gamma_y{2} = ghx*vxy./(sy+1e-10);
0032     if ~isempty(targets{4})
0033       objective{4} = oo_.gamma_y{2}(iy{4});
0034     end
0035     
0036     for i=2:nar
0037       vxy = A*vxy;
0038       oo_.gamma_y{i+1} = ghx*vxy./(sy+1e-10);
0039       if ~isempty(targets{i+3})
0040     objecitve{i+3} = oo_.gamma_y{i+1}(iy{i+3});
0041       end
0042     end
0043   end
0044 
0045   % 11/04/02 MJ generalized for correlations, autocorrelations and
0046   %             constraints on M_.Sigma_e

Generated on Fri 16-Jun-2006 09:09:06 by m2html © 2003