Home > matlab > row_header_width.m

row_header_width

PURPOSE ^

This function computes the width of the row headers for

SYNOPSIS ^

function w=row_header_width(M_,estim_params_,bayestopt_)

DESCRIPTION ^

 This function computes the width of the row headers for
 the estimation results
 
 INPUTS 
   estim_params_    [structure] 
   M_               [structure]
   bayestopt_       [structure]
  
 OUTPUTS 
   w                integer

 SPECIAL REQUIREMENTS
   None.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function w=row_header_width(M_,estim_params_,bayestopt_)
0002 % This function computes the width of the row headers for
0003 % the estimation results
0004 %
0005 % INPUTS
0006 %   estim_params_    [structure]
0007 %   M_               [structure]
0008 %   bayestopt_       [structure]
0009 %
0010 % OUTPUTS
0011 %   w                integer
0012 %
0013 % SPECIAL REQUIREMENTS
0014 %   None.
0015 
0016 % Copyright (C) 2006-2009 Dynare Team
0017 %
0018 % This file is part of Dynare.
0019 %
0020 % Dynare is free software: you can redistribute it and/or modify
0021 % it under the terms of the GNU General Public License as published by
0022 % the Free Software Foundation, either version 3 of the License, or
0023 % (at your option) any later version.
0024 %
0025 % Dynare is distributed in the hope that it will be useful,
0026 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0027 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0028 % GNU General Public License for more details.
0029 %
0030 % You should have received a copy of the GNU General Public License
0031 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0032 
0033 np = estim_params_.np;
0034 nvx = estim_params_.nvx;
0035 nvn = estim_params_.nvn;
0036 ncx = estim_params_.ncx;
0037 ncn = estim_params_.ncn;
0038 
0039 w = 0;
0040 if np
0041     for i=1:np
0042         w = max(w,length(bayestopt_.name{i}));
0043     end
0044 end
0045 if nvx
0046     for i=1:nvx
0047         k = estim_params_.var_exo(i,1); 
0048         w = max(w,length(deblank(M_.exo_names(k,:))));
0049     end
0050 end
0051 if nvn
0052     for i=1:nvn
0053         k = estim_params_.var_endo(i,1); 
0054         w = max(w,length(deblank(M_.endo_names(k,:))));
0055     end
0056 end
0057 if ncx
0058     for i=1:ncx
0059         k1 = estim_params_.corrx(i,1);
0060         k2 = estim_params_.corrx(i,2);
0061         w = max(w,length(deblank(M_.exo_names(k1,:)))...
0062                 +length(deblank(M_.exo_names(k2,:))))
0063 
0064     end
0065 end
0066 if ncn
0067     for i=1:nvn
0068         k1 = estim_params_.corrn(i,1);
0069         k2 = estim_params_.corrn(i,2);
0070         w = max(w,length(deblank(M_.endo_names(k1,:)))...
0071                 +length(deblank(M_.endo_names(k2,:))));
0072 
0073     end
0074 end
0075

Generated on Tue 22-May-2012 02:40:23 by m2html © 2005