From ce7af53855880ebe1e1611def715d031fe61fd85 Mon Sep 17 00:00:00 2001
From: michel <michel@ac1d8469-bf42-47a9-8791-bf33cf982152>
Date: Sat, 23 Jan 2010 16:55:28 +0000
Subject: [PATCH] v4.2: changed vech functions names to avoid conflict with
 other toolboxes       vech.m      -> dyn_vech.m       unvech.m    ->
 dyn_unvech.m       diag_vech.m -> dyn_diag_vech.m

git-svn-id: https://www.dynare.org/svn/dynare/trunk@3375 ac1d8469-bf42-47a9-8791-bf33cf982152
---
 matlab/conditional_variance_decomposition.m         |  5 +++--
 matlab/display_conditional_variance_decomposition.m |  4 ++--
 matlab/{diag_vech.m => dyn_diag_vech.m}             |  4 ++--
 matlab/{unvech.m => dyn_unvech.m}                   |  5 +++--
 matlab/{vech.m => dyn_vech.m}                       |  5 +++--
 matlab/dynare_identification.m                      | 10 +++++-----
 matlab/getH.m                                       |  8 ++++----
 matlab/getJJ.m                                      | 12 ++++++------
 8 files changed, 28 insertions(+), 25 deletions(-)
 rename matlab/{diag_vech.m => dyn_diag_vech.m} (93%)
 rename matlab/{unvech.m => dyn_unvech.m} (93%)
 rename matlab/{vech.m => dyn_vech.m} (93%)

diff --git a/matlab/conditional_variance_decomposition.m b/matlab/conditional_variance_decomposition.m
index c04c61e0c..bf8eef091 100644
--- a/matlab/conditional_variance_decomposition.m
+++ b/matlab/conditional_variance_decomposition.m
@@ -15,7 +15,7 @@ function PackedConditionalVarianceDecomposition = conditional_variance_decomposi
 %
 % [1] In this version, absence of measurement errors is assumed...
 
-% Copyright (C) 2009 Dynare Team
+% Copyright (C) 2010 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -31,6 +31,7 @@ function PackedConditionalVarianceDecomposition = conditional_variance_decomposi
 %
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
+
 number_of_state_innovations = ...
     StateSpaceModel.number_of_state_innovations;
 transition_matrix = StateSpaceModel.transition_matrix;
@@ -68,6 +69,6 @@ NumberOfVariables = length(SubsetOfVariables);
 PackedConditionalVarianceDecomposition = zeros(NumberOfVariables*(NumberOfVariables+1)/2,length(Steps),StateSpaceModel.number_of_state_innovations); 
 for i=1:number_of_state_innovations
     for h = 1:length(Steps)
-        PackedConditionalVarianceDecomposition(:,h,i) = vech(ConditionalVariance(:,:,h,i));
+        PackedConditionalVarianceDecomposition(:,h,i) = dyn_vech(ConditionalVariance(:,:,h,i));
     end
 end
\ No newline at end of file
diff --git a/matlab/display_conditional_variance_decomposition.m b/matlab/display_conditional_variance_decomposition.m
index 5fd17383c..99af1e8df 100644
--- a/matlab/display_conditional_variance_decomposition.m
+++ b/matlab/display_conditional_variance_decomposition.m
@@ -16,7 +16,7 @@ function oo_ = display_conditional_variance_decomposition(Steps, SubsetOfVariabl
 % [1] The covariance matrix of the state innovations needs to be diagonal.
 % [2] In this version, absence of measurement errors is assumed...
 
-% Copyright (C) 2009 Dynare Team
+% Copyright (C) 2010 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -58,7 +58,7 @@ for i=1:length(Steps)
     disp(['Period ' int2str(Steps(i)) ':'])
     
     for j=1:exo_nbr
-        vardec_i(:,j) = diag_vech(conditional_decomposition_array(:, ...
+        vardec_i(:,j) = dyn_diag_vech(conditional_decomposition_array(:, ...
                                                           i,j));
     end
     vardec_i = 100*vardec_i./repmat(sum(vardec_i,2),1,exo_nbr);
diff --git a/matlab/diag_vech.m b/matlab/dyn_diag_vech.m
similarity index 93%
rename from matlab/diag_vech.m
rename to matlab/dyn_diag_vech.m
index 6b444b10e..5d5d94664 100644
--- a/matlab/diag_vech.m
+++ b/matlab/dyn_diag_vech.m
@@ -1,4 +1,4 @@
-function d = diag_vech(Vector)
+function d = dyn_diag_vech(Vector)
 % This function returns the diagonal elements of a symmetric matrix
 % stored in vech form
 % 
@@ -8,7 +8,7 @@ function d = diag_vech(Vector)
 % OUTPUTS 
 %   d                  [double]   a n*1 vector, where n solves n*(n+1)/2=m.
 
-% Copyright (C) 2009 Dynare Team
+% Copyright (C) 2010 Dynare Team
 %
 % This file is part of Dynare.
 %
diff --git a/matlab/unvech.m b/matlab/dyn_unvech.m
similarity index 93%
rename from matlab/unvech.m
rename to matlab/dyn_unvech.m
index b5a2bdc1e..f70670a98 100644
--- a/matlab/unvech.m
+++ b/matlab/dyn_unvech.m
@@ -1,4 +1,4 @@
-function Matrix = unvech(Vector)
+function Matrix = dyn_unvech(Vector)
 % This function implements the unvech operator.
 % 
 % INPUTS 
@@ -7,7 +7,7 @@ function Matrix = unvech(Vector)
 % OUTPUTS 
 %   Matrix             [double]   a n*n symetric matrix, where n solves n*(n+1)/2=m.
 
-% Copyright (C) 2009 Dynare Team
+% Copyright (C) 2010 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -23,6 +23,7 @@ function Matrix = unvech(Vector)
 %
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
+
 m = length(Vector);
 n = (sqrt(1+8*m)-1)/2;
 b = 0;
diff --git a/matlab/vech.m b/matlab/dyn_vech.m
similarity index 93%
rename from matlab/vech.m
rename to matlab/dyn_vech.m
index b48376718..6e54c4050 100644
--- a/matlab/vech.m
+++ b/matlab/dyn_vech.m
@@ -1,4 +1,4 @@
-function Vector = vech(Matrix)
+function Vector = dyn_vech(Matrix)
 % This function implements the vech operator.
 % 
 % INPUTS 
@@ -7,7 +7,7 @@ function Vector = vech(Matrix)
 % OUTPUTS 
 %   Vector             [double]   a n*(n+1)/2 vector.
 
-% Copyright (C) 2009 Dynare Team
+% Copyright (C) 2010 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -23,6 +23,7 @@ function Vector = vech(Matrix)
 %
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
+
 n = length(Matrix);
 b = 0;
 Vector = NaN(n*(n+1)/2,1);
diff --git a/matlab/dynare_identification.m b/matlab/dynare_identification.m
index ca68d2b26..be5956d1e 100644
--- a/matlab/dynare_identification.m
+++ b/matlab/dynare_identification.m
@@ -2,7 +2,7 @@ function [pdraws, TAU, GAM, LRE, gp, H, JJ] = dynare_identification(options_iden
 
 % main 
 %
-% Copyright (C) 2008 Dynare Team
+% Copyright (C) 2010 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -100,8 +100,8 @@ if iload <=0,
             %        bayestopt_.restrict_var_list, ...
             %        bayestopt_.restrict_columns, ...
             %        bayestopt_.restrict_aux, M_.exo_nbr);
-            %     tau=[vec(Aa); vech(Bb*M_.Sigma_e*Bb')];
-            tau=[oo_.dr.ys(oo_.dr.order_var); vec(A); vech(B*M_.Sigma_e*B')];
+            %     tau=[vec(Aa); dyn_vech(Bb*M_.Sigma_e*Bb')];
+            tau=[oo_.dr.ys(oo_.dr.order_var); vec(A); dyn_vech(B*M_.Sigma_e*B')];
             yy0=oo_.dr.ys(I);    
             [residual, g1 ] = feval([M_.fname,'_dynamic'],yy0, oo_.exo_steady_state', M_.params,1);    
 
@@ -121,7 +121,7 @@ if iload <=0,
                         gam{j+1}=gam{j+1}.*sy;
                     end
                 end
-                dum = vech(gam{1});
+                dum = dyn_vech(gam{1});
                 for j=1:nlags,
                     dum = [dum; vec(gam{j+1})];
                 end
@@ -277,7 +277,7 @@ end
 %   GAM0=GAM;
 % end
 % if useautocorr,
-%   idiag = find(vech(eye(size(options_.varobs,1))));
+%   idiag = find(dyn_vech(eye(size(options_.varobs,1))));
 %   GAM(idiag,:) = GAM(idiag,:)./(sGAM(idiag)'*ones(1,SampleSize));
 % %   siJmean(idiag,:) = siJmean(idiag,:)./(sGAM(idiag)'*ones(1,nparam));
 % %   siJmean = siJmean./(max(siJmean')'*ones(size(params)));
diff --git a/matlab/getH.m b/matlab/getH.m
index c7d9caef1..30bd790dc 100644
--- a/matlab/getH.m
+++ b/matlab/getH.m
@@ -2,7 +2,7 @@ function [H, dA, dOm, Hss, gp, info] = getH(A, B, M_,oo_,kronflag,indx,indexo)
 
 % computes derivative of reduced form linear model w.r.t. deep params
 %
-% Copyright (C) 2008 Dynare Team
+% Copyright (C) 2010 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -279,7 +279,7 @@ else % generalized sylvester equation
             dSig(indexo(j),indexo(j)) = 2*sqrt(M_.Sigma_e(indexo(j),indexo(j)));
             y = B*dSig*B';
             y = y(nauxe+1:end,nauxe+1:end);
-            H(:,j) = [zeros((m-nauxe)^2,1); vech(y)];
+            H(:,j) = [zeros((m-nauxe)^2,1); dyn_vech(y)];
             if nargout>1,
                 dOm(:,:,j) = y;
             end
@@ -296,7 +296,7 @@ else % generalized sylvester equation
             dA(:,:,j+length(indexo)) = x;
             dOm(:,:,j+length(indexo)) = y;
         end
-        H(:,j+length(indexo)) = [x(:); vech(y)];
+        H(:,j+length(indexo)) = [x(:); dyn_vech(y)];
     end
     %     for j=1:param_nbr,
     %         disp(['Derivatives w.r.t. ',M_.param_names(indx(j),:),', ',int2str(j),'/',int2str(param_nbr)])
@@ -308,7 +308,7 @@ else % generalized sylvester equation
     %         y = y*B'+B*y';
     %         x = x(nauxe+1:end,nauxe+1:end);
     %         y = y(nauxe+1:end,nauxe+1:end);
-    %         H(:,j) = [x(:); vech(y)];
+    %         H(:,j) = [x(:); dyn_vech(y)];
     %     end
     H = [[zeros(M_.endo_nbr,length(indexo)) Hss]; H];
 
diff --git a/matlab/getJJ.m b/matlab/getJJ.m
index d93316066..1f684a615 100644
--- a/matlab/getJJ.m
+++ b/matlab/getJJ.m
@@ -1,6 +1,6 @@
 function [JJ, H, gam, gp] = getJJ(A, B, M_,oo_,options_,kronflag,indx,indexo,mf,nlags,useautocorr)
 
-% Copyright (C) 2009 Dynare Team
+% Copyright (C) 2010 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -68,9 +68,9 @@ else
       dum1=dum;
       dum1 = (dum1.*sy-dsy.*GAM)./(sy.*sy);
       dum1 = dum1-diag(diag(dum1))+diag(diag(dum));
-      dumm = vech(dum1(mf,mf));
+      dumm = dyn_vech(dum1(mf,mf));
     else
-      dumm = vech(dum(mf,mf));
+      dumm = dyn_vech(dum(mf,mf));
     end
     for i=1:nlags,
       dum1 = A^i*dum;
@@ -93,9 +93,9 @@ else
       dum1=dum;
       dum1 = (dum1.*sy-dsy.*GAM)./(sy.*sy);
       dum1 = dum1-diag(diag(dum1))+diag(diag(dum));
-      dumm = vech(dum1(mf,mf));
+      dumm = dyn_vech(dum1(mf,mf));
     else
-      dumm = vech(dum(mf,mf));
+      dumm = dyn_vech(dum(mf,mf));
     end
     for i=1:nlags,
       dum1 = A^i*dum;
@@ -126,7 +126,7 @@ else
         GAM{j+1}=GAM{j+1}.*sy;
       end
     end
-    gam = vech(GAM{1});
+    gam = dyn_vech(GAM{1});
     for j=1:nlags,
       gam = [gam; vec(GAM{j+1})];
     end
-- 
GitLab