This file is indexed.

/usr/share/dynare/matlab/subset.m is in dynare-common 4.4.1-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
function jndx = subset()

% Copyright (C) 2006-2011 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/>.

global options_ estim_params_ M_

ExcludedParamNames = options_.ExcludedParams;
VarObs = options_.varobs;
VarExo = M_.exo_names;
info   = options_.ParamSubSet;

nvx = estim_params_.nvx;
nvn = estim_params_.nvn;
ncx = estim_params_.ncx;
ncn = estim_params_.ncn;
np  = estim_params_.np;
nx  = nvx+nvn+ncx+ncn+np;

if strcmpi(info,'All')
    indx = (1:nx)';
elseif strcmpi(info,'DeepParameters')
    indx = (nvx+nvn+ncx+ncn+1:nx)';
elseif strcmpi(info,'StructuralShocks')
    indx = [(1:nvx),nvx+nvn+1:nvx+nvn+ncx]';
elseif strcmpi(info,'StructuralShocksWithoutCorrelations')
    indx = (1:nvx)';
elseif strcmpi(info,'MeasurementErrors')
    indx = [(nvx+1:nvx+nvn),(nvx+nvn+ncx+1:nvx+nvn+ncx+ncn)]';
elseif strcmpi(info,'MeasurementErrorsWithoutCorrelations')
    indx = (nvx+1:nvx+nvn)';
elseif strcmpi(info,'AllWithoutMeasurementErrors')
    indx = [(1:nvx),nvx+nvn+1:nvx+nvn+ncx,nvx+nvn+ncx+ncn+1:nx]';
elseif strcmpi(info,'None')
    indx = [];
end

if isempty(ExcludedParamNames)
    jndx = indx;
else
    tt = [];
    for i = 1:length(ExcludedParamNames)
        tmp = strmatch(ExcludedParamNames{i},M_.exo_names);
        if ~isempty(tmp) && ( strcmpi(info,'All') || strcmpi(info,'StructuralShocks') || ...
                             strcmpi(info,'StructuralShocksWithoutCorrelations') || ...
                             strcmpi(info,'AllWithoutMeasurementErrors') )
            % The parameter the user wants to exclude is related to the size of the structural innovations.
            if ncx
                disp(['I cannot exclude some of the structural variances if the'])
                disp(['structural innovations are correlated...'])
                error
            end
            tt = [tt;tmp];
        elseif isempty(tmp) && nvn 
            tmp = strmatch(ExcludedParamNames{i},options_.varobs);
            if ~isempty(tmp) && ( strcmpi(info,'All') || strcmpi(info,'MeasurementErrors') || ...
                                 strcmpi(info,'MeasurementErrorsWithoutCorrelations') )
                % The parameter the user wants to exclude is related to the size of the measurement errors variances.
                tmp = nvx+tmp;
                if ncn
                    disp(['I cannot exclude some the measurement error variances if the'])
                    disp(['measurement errors are correlated...'])
                    error
                end
                tt = [tt;tmp];
            end
        else% Excluded parameters are deep parameters...
            tmp = strmatch(ExcludedParamNames{i},M_.param_names(estim_params_.param_vals(:,1),:),'exact');
            if ~isempty(tmp)
                tt = [tt;nvx+nvn+ncx+ncn+tmp];
            else
                disp('The parameter you want to exclude is unknown!')
                error
            end
        end
    end
    jndx = [];
    for i=1:length(indx)
        if ~any(indx(i)==tt)
            jndx = [ jndx ; indx(i) ];
        end
    end
end