[Pkg-octave-commit] [SCM] Debian packaging for dynare branch, master, updated. debian/4.2.5-2-18-g2a35554

Sébastien Villemot sebastien.villemot at ens.fr
Mon Jun 18 19:21:59 UTC 2012


The following commit has been merged in the master branch:
commit 0e5968e111df6a73b5a4a0ea2f8136ea3278e28f
Author: Sébastien Villemot <sebastien.villemot at ens.fr>
Date:   Mon Jun 18 15:30:38 2012 +0200

    shock-decomposition.patch: new patch picked upstream

diff --git a/debian/patches/series b/debian/patches/series
index 67c8b41..9d797d8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 extra-addpatch.patch
 fhs-compliance.patch
+shock-decomposition.patch
diff --git a/debian/patches/shock-decomposition.patch b/debian/patches/shock-decomposition.patch
new file mode 100644
index 0000000..d381758
--- /dev/null
+++ b/debian/patches/shock-decomposition.patch
@@ -0,0 +1,95 @@
+Description: Fix shock_decomposition command
+Origin: upstream, commit: 68e7a310eda20f8f7611521ac45608a6941b31cc
+
+diff --git a/matlab/evaluate_smoother.m b/matlab/evaluate_smoother.m
+index 02f2755..d923027 100644
+--- a/matlab/evaluate_smoother.m
++++ b/matlab/evaluate_smoother.m
+@@ -43,8 +43,7 @@ function oo = evaluate_smoother(parameters)
+ 
+ global options_ M_ bayestopt_ oo_
+ 
+-persistent load_data
+-persistent gend  data  data_index  number_of_observations  no_more_missing_observations
++persistent dataset_
+ 
+ if nargin==0
+     parameters = 'posterior_mode';
+@@ -79,43 +78,22 @@ if ischar(parameters)
+     end
+ end
+ 
+-if isempty(load_data)
+-    % Get the data.
+-    n_varobs = size(options_.varobs,1);
+-    rawdata = read_variables(options_.datafile,options_.varobs,[],options_.xls_sheet,options_.xls_range);
+-    options_ = set_default_option(options_,'nobs',size(rawdata,1)-options_.first_obs+1);
+-    gend = options_.nobs;
+-    rawdata = rawdata(options_.first_obs:options_.first_obs+gend-1,:);
+-    % Transform the data.
+-    if options_.loglinear
+-        if ~options_.logdata
+-            rawdata = log(rawdata);
+-        end
+-    end
+-    % Test if the data set is real.
+-    if ~isreal(rawdata)
+-        error('There are complex values in the data! Probably  a wrong transformation')
++if isempty(dataset_)
++    % Load and transform data.
++    transformation = [];
++    if options_.loglinear && ~options_.logdata
++        transformation = @log;
+     end
+-    % Detrend the data.
+-    options_.missing_data = any(any(isnan(rawdata)));
+-    if options_.prefilter == 1
+-        if options_.missing_data
+-            bayestopt_.mean_varobs = zeros(n_varobs,1);
+-            for variable=1:n_varobs
+-                rdx = find(~isnan(rawdata(:,variable)));
+-                m = mean(rawdata(rdx,variable));
+-                rawdata(rdx,variable) = rawdata(rdx,variable)-m;
+-                bayestopt_.mean_varobs(variable) = m;
+-            end
+-        else
+-            bayestopt_.mean_varobs = mean(rawdata,1)';
+-            rawdata = rawdata-repmat(bayestopt_.mean_varobs',gend,1);
+-        end
++    xls.sheet = options_.xls_sheet;
++    xls.range = options_.xls_range;
++
++    if ~isfield(options_,'nobs')
++        options_.nobs = [];
+     end
+-    data = transpose(rawdata);
+-    % Handle the missing observations.
+-    [data_index,number_of_observations,no_more_missing_observations] = describe_missing_data(data,gend,n_varobs);
+-    missing_value = ~(number_of_observations == gend*n_varobs);
++
++    dataset_ = initialize_dataset(options_.datafile,options_.varobs,options_.first_obs,options_.nobs,transformation,options_.prefilter,xls);
++    options_.nobs = dataset_.info.ntobs;
++
+     % Determine if a constant is needed.
+     if options_.steadystate_flag% if the *_steadystate.m file is provided.
+         [ys,tchek] = feval([M_.fname '_steadystate'],...
+@@ -143,15 +121,15 @@ if isempty(load_data)
+     else
+         options_.noconstant = 0;
+     end
+-    load_data = 1;
+ end
+ 
+ pshape_original   = bayestopt_.pshape;
+ bayestopt_.pshape = Inf(size(bayestopt_.pshape));
+-clear('priordens')%
++clear('priordens')
++
++[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp] = ...
++    DsgeSmoother(parameters,dataset_.info.ntobs,dataset_.data,dataset_.missing.aindex,dataset_.missing.state);
+ 
+-[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp] ...
+-    = DsgeSmoother(parameters,gend,data,data_index,missing_value);
+ oo.Smoother.SteadyState = ys;
+ oo.Smoother.TrendCoeffs = trend_coeff;
+ if options_.filter_covariance

-- 
Debian packaging for dynare



More information about the Pkg-octave-commit mailing list