Skip to content
Snippets Groups Projects
Select Git revision
  • c0b132abbd8da10e0f9a8d0afd4549c08604c953
  • master default
  • isfile
  • nlf-fixes
  • newton-quadratic-equation-solver
  • nlf-fixes-r
  • nls-fixes
  • sep-fixes
  • sep
  • use-dprior
  • ep-sparse
  • rebase-1
  • parfor
  • reset-seed-in-unit-tests
  • remove-persistent-variables
  • nonlinear-filter-fixes
  • pac-mce-with-composite-target
  • 6.x
  • dprior
  • covariance-quadratic-approximation
  • benchmark-ec
  • 5.5
  • 5.4
  • 5.3
  • 5.2
  • 5.1
  • 5.0
  • 5.0-rc1
  • 4.7-beta3
  • 4.7-beta2
  • 4.7-beta1
  • 4.6.4
  • 4.6.3
  • 4.6.2
  • 4.6.1
  • 4.6.0
  • 4.6.0-rc2
  • 4.6.0-rc1
  • 4.6-beta1
  • 4.5.7
  • 4.5.6
41 results

dynare_simul.m

Blame
  • Forked from Dynare / dynare
    Source project has a limited visibility.
    demean.m 1.56 KiB
    function c = demean(x)
    % Removes the mean of each column of a matrix.
     
    %@info:
    %! @deftypefn {Function File} {@var{c} =} demean (@var{x})
    %! @anchor{demean}
    %! This function removes the mean of each column of a matrix.
    %!
    %! @strong{Inputs}
    %! @table @var
    %! @item x
    %! Matlab matrix (T-by-N).
    %! @end table
    %!
    %! @strong{Outputs}
    %! @table @var
    %! @item c
    %! Matlab matrix (T-by-N). The demeaned x matrix.
    %! @end table
    %! 
    %! @strong{This function is called by:} 
    %! @ref{compute_cova}, @ref{compute_acov}, @ref{compute_std}.
    %! 
    %! @strong{This function calls:} 
    %! @ref{ndim},
    %!    
    %! @end deftypefn
    %@eod:
    
    % Copyright (C) 2011-2012 Dynare Team
    %    
    % This file is part of Dynare.
    %
    % Dynare is free software: you can redistribute it and/or modify
    % it under the terms of the GNU General Public License as published by
    % the Free Software Foundation, either version 3 of the License, or
    % (at your option) any later version.
    %
    % Dynare is distributed in the hope that it will be useful,
    % but WITHOUT ANY WARRANTY; without even the implied warranty of
    % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    % GNU General Public License for more details.
    %
    % You should have received a copy of the GNU General Public License
    % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
    
    % Original author: stephane DOT adjemian AT univ DASH lemans DOT fr
       
    if ndim(x)==1
        c = x-mean(x);
    elseif ndim(x)==2
        c = bsxfun(@minus,x,mean(x));
    else
        error('descriptive_statistics::demean:: This function is not implemented for arrays with dimension greater than two!')
    end