


@info:
! @deftypefn {Function File} {@var{ts} =} log(@var{ts})
! @anchor{log}
! Apply the logarithm function to a Dynare time series object.
!
! @strong{Inputs}
! @table @var
! @item ts
! Dynare time series object, instantiated by @ref{dynSeries}
! @end table
!
! @strong{Outputs}
! @table @var
! @item ts
! Dynare time series object with transformed data field.
! @end table
!
! @strong{This function is called by:}
! None.
!
! @strong{This function calls:}
! None.
!
! @end deftypefn
@eod:

0001 function ts = log(ts) 0002 0003 %@info: 0004 %! @deftypefn {Function File} {@var{ts} =} log(@var{ts}) 0005 %! @anchor{log} 0006 %! Apply the logarithm function to a Dynare time series object. 0007 %! 0008 %! @strong{Inputs} 0009 %! @table @var 0010 %! @item ts 0011 %! Dynare time series object, instantiated by @ref{dynSeries} 0012 %! @end table 0013 %! 0014 %! @strong{Outputs} 0015 %! @table @var 0016 %! @item ts 0017 %! Dynare time series object with transformed data field. 0018 %! @end table 0019 %! 0020 %! @strong{This function is called by:} 0021 %! None. 0022 %! 0023 %! @strong{This function calls:} 0024 %! None. 0025 %! 0026 %! @end deftypefn 0027 %@eod: 0028 0029 % Copyright (C) 2011 Dynare Team 0030 % 0031 % This file is part of Dynare. 0032 % 0033 % Dynare is free software: you can redistribute it and/or modify 0034 % it under the terms of the GNU General Public License as published by 0035 % the Free Software Foundation, either version 3 of the License, or 0036 % (at your option) any later version. 0037 % 0038 % Dynare is distributed in the hope that it will be useful, 0039 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0040 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0041 % GNU General Public License for more details. 0042 % 0043 % You should have received a copy of the GNU General Public License 0044 % along with Dynare. If not, see <http://www.gnu.org/licenses/>. 0045 0046 % AUTHOR(S) stephane DOT adjemian AT univ DASH lemans DOT fr 0047 0048 if ~isa(ts,'dynSeries') 0049 error('dynSeries::log: Input argument has to be a Dynare time series object!') 0050 end 0051 0052 if any(ts.data<eps) 0053 error('dynSeries::log: Input argument has to be strictly positive!') 0054 end 0055 0056 ts.data = log(ts.data);