Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 4.3
  • 4.4
  • 4.5
  • 4.6
  • 5.x
  • 6.x
  • asm
  • aux_func
  • benchmark-ec
  • clang+openmp
  • covariance-quadratic-approximation
  • dates-and-dseries-improvements
  • declare_vars_in_model_block
  • dmm
  • dprior
  • dragonfly
  • dynamic-striated
  • dynare_minreal
  • eigen
  • ep-sparse
  • error_msg_undeclared_model_vars
  • estim_params
  • exceptions
  • exo_steady_state
  • filter_initial_state
  • gpm-optimal-policy
  • julia
  • kalman_mex
  • master
  • mex-GetPowerDeriv
  • mr#2134
  • new-samplers
  • newton-quadratic-equation-solver
  • nlf-fixes
  • nlf-fixes-r
  • nls-fixes
  • nonlinear-filter-fixes
  • occbin
  • pac-mce-with-composite-target
  • parfor
  • penalty
  • rebase-1
  • remove-persistent-variables
  • remove-priordens
  • reset-seed-in-unit-tests
  • rmExtraExo
  • sep
  • sep-fixes
  • separateM_
  • silicon
  • silicon-new-samplers
  • slice
  • sphinx-doc-experimental
  • static_aux_vars
  • time-varying-information-set
  • use-dprior
  • various_fixes
  • 3.062
  • 3.063
  • 4.0.0
  • 4.0.1
  • 4.0.2
  • 4.0.3
  • 4.0.4
  • 4.1-alpha1
  • 4.1-alpha2
  • 4.1.0
  • 4.1.1
  • 4.1.2
  • 4.1.3
  • 4.2.0
  • 4.2.1
  • 4.2.2
  • 4.2.3
  • 4.2.4
  • 4.2.5
  • 4.3.0
  • 4.3.1
  • 4.3.2
  • 4.3.3
  • 4.4-beta1
  • 4.4.0
  • 4.4.1
  • 4.4.2
  • 4.4.3
  • 4.5.0
  • 4.5.1
  • 4.5.2
  • 4.5.3
  • 4.5.4
  • 4.5.5
  • 4.5.6
  • 4.5.7
  • 4.6-beta1
  • 4.6.0
  • 4.6.0-rc1
  • 4.6.0-rc2
  • 4.6.1
  • 4.6.2
  • 4.6.3
  • 4.6.4
  • 4.7-beta1
  • 4.7-beta2
  • 4.7-beta3
  • 5.0
  • 5.0-rc1
  • 5.1
  • 5.2
  • 5.3
  • 5.4
  • 5.5
111 results

Target

Select target project
  • giovanma/dynare
  • giorgiomas/dynare
  • Vermandel/dynare
  • Dynare/dynare
  • normann/dynare
  • MichelJuillard/dynare
  • wmutschl/dynare
  • FerhatMihoubi/dynare
  • sebastien/dynare
  • lnsongxf/dynare
  • rattoma/dynare
  • CIMERS/dynare
  • FredericKarame/dynare
  • SumuduK/dynare
  • MinjeJeon/dynare
  • camilomrch/dynare
  • DoraK/dynare
  • avtishin/dynare
  • selma/dynare
  • claudio_olguin/dynare
  • jeffjiang07/dynare
  • EthanSystem/dynare
  • stepan-a/dynare
  • wjgatt/dynare
  • JohannesPfeifer/dynare
  • gboehl/dynare
  • ebenetce/dynare
  • chskcau/dynare-doc-fixes
28 results
Select Git revision
  • 4.3
  • 4.4
  • 4.5
  • 4.6
  • 5.x
  • 6.x
  • asm
  • aux_func
  • clang+openmp
  • dates-and-dseries-improvements
  • declare_vars_in_model_block
  • dmm
  • dragonfly
  • dynare_minreal
  • eigen
  • error_msg_undeclared_model_vars
  • estim_params
  • exo_steady_state
  • gpm-optimal-policy
  • julia
  • madysson
  • master
  • mex-GetPowerDeriv
  • penalty
  • separateM_
  • slice
  • sphinx-doc-experimental
  • static_aux_vars
  • time-varying-information-set
  • various_fixes
  • 3.062
  • 3.063
  • 4.0.0
  • 4.0.1
  • 4.0.2
  • 4.0.3
  • 4.0.4
  • 4.1-alpha1
  • 4.1-alpha2
  • 4.1.0
  • 4.1.1
  • 4.1.2
  • 4.1.3
  • 4.2.0
  • 4.2.1
  • 4.2.2
  • 4.2.3
  • 4.2.4
  • 4.2.5
  • 4.3.0
  • 4.3.1
  • 4.3.2
  • 4.3.3
  • 4.4-beta1
  • 4.4.0
  • 4.4.1
  • 4.4.2
  • 4.4.3
  • 4.5.0
  • 4.5.1
  • 4.5.2
  • 4.5.3
  • 4.5.4
  • 4.5.5
  • 4.5.6
  • 4.5.7
  • 4.6-beta1
  • 4.6.0
  • 4.6.0-rc1
  • 4.6.0-rc2
  • 4.6.1
  • 4.6.2
  • 4.6.3
  • 4.6.4
  • 4.7-beta1
  • 4.7-beta2
  • 4.7-beta3
  • 5.0
  • 5.0-rc1
  • 5.1
  • 5.2
  • 5.3
  • 5.4
  • 5.5
  • 6-beta1
  • 6-beta2
  • 6.0
  • 6.1
  • 6.2
  • 6.3
  • 6.4
91 results
Show changes
Showing
with 306 additions and 79 deletions
......@@ -36,7 +36,7 @@ function [dLIK,dlik,a,Pstar] = kalman_filter_d(Y, start, last, a, Pinf, Pstar, k
% Durbin/Koopman (2012): "Time Series Analysis by State Space Methods", Oxford University Press,
% Second Edition, Ch. 5 and 7.2
% Copyright (C) 2004-2017 Dynare Team
% Copyright (C) 2004-2018 Dynare Team
%
% This file is part of Dynare.
%
......@@ -65,7 +65,7 @@ dLIK = Inf; % Default value of the log likelihood.
oldK = Inf;
s = 0;
while rank(Pinf,diffuse_kalman_tol) && (t<=last)
while rank(Z*Pinf*Z',diffuse_kalman_tol) && (t<=last)
s = t-start+1;
v = Y(:,t)-Z*a; %get prediction error v^(0) in (5.13) DK (2012)
Finf = Z*Pinf*Z'; % (5.7) in DK (2012)
......
......@@ -87,7 +87,7 @@ function [dLIK, dlikk, a, Pstar, llik] = univariate_kalman_filter_d(data_index,
% Series Analysis by State Space Methods", Oxford University Press,
% Second Edition, Ch. 5, 6.4 + 7.2.5
% Copyright (C) 2004-2017 Dynare Team
% Copyright (C) 2004-2018 Dynare Team
%
% This file is part of Dynare.
%
......@@ -154,7 +154,7 @@ while newRank && (t<=last)
end
end
if newRank
oldRank = rank(Pinf,diffuse_kalman_tol);
oldRank = rank(Z*Pinf*Z',diffuse_kalman_tol);
else
oldRank = 0;
end
......@@ -162,7 +162,7 @@ while newRank && (t<=last)
Pstar = T*Pstar*T'+QQ;
Pinf = T*Pinf*T';
if newRank
newRank = rank(Pinf,diffuse_kalman_tol);
newRank = rank(Z*Pinf*Z',diffuse_kalman_tol);
end
if oldRank ~= newRank
disp('univariate_diffuse_kalman_filter:: T does influence the rank of Pinf!')
......
......@@ -44,7 +44,6 @@ if ramsey_policy
otherwise
error('Wrong operator in get_complementarity_conditions')
end
eq_index(i) = 1;
end
end
end
......@@ -52,6 +51,10 @@ end
etags = M.equations_tags;
for i=1:size(etags,1)
if strcmp(etags{i,2},'mcp')
eq_nbr = etags{i,1};
if ramsey_policy
eq_nbr = eq_nbr + M.ramsey_eq_nbr;
end
str = etags{i,3};
kop = strfind(etags{i,3},'<');
if ~isempty(kop)
......@@ -61,8 +64,8 @@ for i=1:size(etags,1)
'not recognized'],etags{i,3},strtrim(str(1:kop-1))))
end
ub(k) = str2num(str(kop+1:end));
eq_index(etags{i,1}) = k;
eq_index(k) = etags{i,1};
eq_index(eq_nbr) = k;
eq_index(k) = eq_nbr;
else
kop = strfind(etags{i,3},'>');
if ~isempty(kop)
......@@ -72,8 +75,8 @@ for i=1:size(etags,1)
'not recognized'],etags{i,3},strtrim(str(1:kop-1))))
end
lb(k) = str2num(str(kop+1:end));
eq_index(etags{i,1}) = k;
eq_index(k) = etags{i,1};
eq_index(eq_nbr) = k;
eq_index(k) = eq_nbr;
else
error(sprintf(['Complementarity condition %s can''t be ' ...
'parsed'],etags{i,3}))
......
......@@ -82,7 +82,7 @@ return
%@test:1
% Write a data file
fid = fopen('example.m','w');
fid = fopen('example1.m','w');
fwriten(fid, 'a = randn(100,1);');
fwriten(fid, 'b = randn(100,1);');
fwriten(fid, 'c = transpose(randn(100,1));');
......@@ -98,8 +98,8 @@ fclose(fid);
listofvariablestobeloaded = {'b', 'a'};
% Test if we can load the data.
try
data = load_m_file_data_legacy('example.m', listofvariablestobeloaded);
delete example.m
data = load_m_file_data_legacy('example1.m', listofvariablestobeloaded);
delete('example1.m');
t(1) = 1;
catch
t(1) = 0;
......@@ -109,7 +109,7 @@ T = all(t);
%@test:2
% Write a data file
fid = fopen('example.m','w');
fid = fopen('example2.m','w');
fwriten(fid, 'a = randn(100,1);');
fwriten(fid, 'b = randn(100,1);');
fwriten(fid, 'c = transpose(randn(100,1));');
......@@ -125,8 +125,8 @@ fclose(fid);
listofvariablestobeloaded = {'e', 'a'};
% Test if we can load the data.
try
data = load_m_file_data_legacy('example.m', listofvariablestobeloaded);
delete example.m
data = load_m_file_data_legacy('example2.m', listofvariablestobeloaded);
delete('example2.m');
t(1) = 0;
catch
t(1) = 1;
......@@ -136,7 +136,7 @@ T = all(t);
%@test:3
% Write a data file
fid = fopen('example.m','w');
fid = fopen('example3.m','w');
fwriten(fid, 'a = randn(100,1);');
fwriten(fid, 'b = randn(100,1);');
fwriten(fid, 'c = transpose(randn(100,1));');
......@@ -152,8 +152,8 @@ fclose(fid);
listofvariablestobeloaded = {'c', 'a'};
% Test if we can load the data.
try
data = load_m_file_data_legacy('example.m', listofvariablestobeloaded);
delete example.m
data = load_m_file_data_legacy('example3.m', listofvariablestobeloaded);
delete('example3.m');
t(1) = 1;
catch
t(1) = 0;
......
......@@ -41,7 +41,7 @@ function optimal_bandwidth = mh_optimal_bandwidth(data,number_of_draws,bandwidth
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
%% Kernel specifications.
% Kernel specifications.
if strcmpi(kernel_function,'gaussian')
% Kernel definition
k = @(x)inv(sqrt(2*pi))*exp(-0.5*x.^2);
......@@ -89,15 +89,17 @@ else
end
%% Get the Skold and Roberts' correction.
% Get the Skold and Roberts' correction.
if bandwidth==0 || bandwidth==-1
correction = correction_for_repeated_draws(data,number_of_draws);
else
correction = 0;
end
%% Compute the standard deviation of the draws.
% Compute the standard deviation of the draws.
sigma = std(data);
%% Optimal bandwidth parameter.
% Optimal bandwidth parameter.
if bandwidth == 0 % Rule of thumb bandwidth parameter (Silverman [1986].
h = 2*sigma*(sqrt(pi)*mu02/(12*(mu21^2)*number_of_draws))^(1/5);
h = h*correction^(1/5);
......@@ -132,10 +134,10 @@ elseif bandwidth == -2 % Bump killing... I compute local bandwith parameters
error(['I can''t compute the optimal bandwidth with this kernel...' ...
'Try the gaussian, triweight or cosinus kernels.']);
end
T = zeros(n,1);
for i=1:n
T = zeros(number_of_draws, 1);
for i=1:number_of_draws
j = i;
while j<= n && (data(j,1)-data(i,1))<2*eps
while j<=number_of_draws && (data(j,1)-data(i,1))<2*eps
j = j+1;
end
T(i) = (j-i);
......@@ -143,13 +145,13 @@ elseif bandwidth == -2 % Bump killing... I compute local bandwith parameters
end
correction = correction/number_of_draws;
Itilda4 = 8*7*6*5/(((2*sigma)^9)*sqrt(pi));
g3 = abs(2*correction*k6(0)/(mu21*Itilda4*correction))^(1/9);
g3 = abs(2*correction*k6(0)/(mu21*Itilda4*number_of_draws))^(1/9);
Ihat3 = 0;
for i=1:number_of_draws
Ihat3 = Ihat3 + sum(k6((data(i,1)-data)/g3));
end
Ihat3 = -Ihat3/((n^2)*g3^7);
g2 = abs(2*correction*k4(0)/(mu21*Ihat3*n))^(1/7);
g2 = abs(2*correction*k4(0)/(mu21*Ihat3*number_of_draws))^(1/7);
Ihat2 = 0;
for i=1:number_of_draws
Ihat2 = Ihat2 + sum(k4((data(i)-data)/g2));
......
function r = iscolumn(V)
% Copyright (C) 2018 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/>.
sz = size(V);
r = (length(sz) == 2) && (sz(2) == 1);
function v = supported_octave_version()
% Copyright (C) 2017 Dynare Team
function r = ismatrix(V)
% Copyright (C) 2018 Dynare Team
%
% This file is part of Dynare.
%
......@@ -17,4 +16,4 @@ function v = supported_octave_version()
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
v = '4.2.1';
\ No newline at end of file
r = (ndims(V) == 2);
function r = isrow(V)
% Copyright (C) 2018 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/>.
sz = size(V);
r = (length(sz) == 2) && (sz(1) == 1);
......@@ -27,7 +27,7 @@ function a = isfile(b)
%! @end deftypefn
%@eod:
% Copyright (C) 2012 Dynare Team
% Copyright (C) 2012-2017 Dynare Team
%
% This file is part of Dynare.
%
......@@ -44,18 +44,45 @@ function a = isfile(b)
% 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
stringarrayflag = false;
cellofstringflag = false;
n = 1;
a = false;
[base,ext] = strtok(b,'.');
if ~isoctave() && ~matlab_ver_less_than('9.1') && isstring(b) && length(b)>1 && isvector(b)
n = length(b);
stringarrayflag = true;
a = false(size(b));
end
if iscell(b) && length(b)>1 && isvector(b)
if all(cellfun(@ischar, b))
n = length(b);
cellofstringflag = true;
a = false(size(b));
else
error('Wrong input argument type!')
end
end
for i=1:n
if stringarrayflag
d = b(i);
elseif cellofstringflag
d = b{i};
elseif ischar(b) && size(b, 1)==1
d = b;
else
error('Wrong input argument type!')
end
[base, ext] = strtok(d, '.');
if isempty(ext)
% File has no extension.
[status, c] = fileattrib(b);
[status, c] = fileattrib(d);
if status
a = ~c.directory;
else
a = 0;
a(i) = ~c.directory;
end
else
a = isequal(exist(b,'file'),2);
a(i) = isequal(exist(d, 'file'), 2);
end
end
\ No newline at end of file
......@@ -135,10 +135,14 @@ end
%@eof:2
%@test:3
%$ if ~isoctave()
%$ t = zeros(3,1);
%$ t(1) = dassert(corr(5), NaN);
%$ t(2) = dassert(corr([1 2 3],5),NaN(3,1));
%$ t(3) = dassert(corr(5,[1 2 3]),NaN(1,3));
%$ else
%$ t = 1;
%$ end
%$ T = all(t);
%@eof:3
......
......@@ -236,6 +236,12 @@ y = ipermute(y,order);
%@test:1
%$ if isoctave()
%$ t = true;
%$ T = t;
%$ LOG = NaN;
%$ return
%$ end
%$ X = randn(10000000, 1);
%$
%$ try
......
function l = ischarint(x)
% Returns true if and only if char x represents an integer.
% Copyright © 2018 DynareTeam
%
% 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/>.
s = warning;
warning off;
l = isint(str2double(x));
warning(s);
\ No newline at end of file
function l = ischarnum(x)
% Returns true if and only if char x represents a real number.
% Copyright © 2018 DynareTeam
%
% 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/>.
l = false;
s = warning;
warning off;
number = str2double(x);
warning(s);
if ~isempty(number)
if isreal(number)
l = true;
end
end
\ No newline at end of file
function tok = strsplit(str, delimiters)
% Splits a string into multiple terms.
%
% INPUTS
% - str [char] String to be splitted.
% - delimiters [char, cell(char)] Delimiters.
%
% OUTPUTS
% - tok [cell(char)] Terms.
% Copyright © 2018 DynareTeam
%
% 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/>.
remove_empty = true;
remove_numbers = false;
% Check first input arguments
assert(ischar(str) && ndims(str)==2 && size(str,1)<=1, 'The first arugment has to be a row char array!');
% Set default value for second input arguments
if nargin<2
delimiters = {' '};
end
% If second input argument is a char transform it into a sigleton cell of char
if nargin>1
if ischar(delimiters)
assert(ndims(delimiters)==2 && size(delimiters,1)==1, 'The second input argument has to be be a char string!');
delimiters = {delimiters};
end
end
% Check that `delimiters` is a one dimensional cell
assert(ndim(delimiters)<=1, 'The second input argument has to be a one dimensional cell array!')
% Check that `delimiters` is a cell of row char arrays
assert(all(cellfun(@ischar, delimiters)) && all(cellfun(@rows, delimiters)==1), 'The second input argument has to be a cell of row char arrays!')
% If space is one of the delimiters obtain the index in `delimiters`
idspace = strmatch(' ', delimiters);
% Get the number of delimiters
n = length(delimiters);
% Remove unnecessary spaces
delimiters(setdiff(1:n, idspace)) = strtrim(delimiters(setdiff(1:n, idspace)));
% Join all the delimiters (strjoin is not available with matlab version less than R2013a)
if n>1
delimiter = '';
for i=1:n
if isspace(delimiters{i})
delimiter = horzcat(delimiter, '\s');
else
delimiter = horzcat(delimiter, delimiters{i});
end
delimiter = horzcat(delimiter,'|');
end
delimiter = horzcat(delimiter, '\W');
else
delimiter = delimiters{1};
end
% Get tokens
tok = regexp(str, delimiter, 'split');
if remove_empty
% Remove empty tokens
tok = tok(find(~cellfun(@isempty, tok)));
end
if remove_numbers
% Remove numbers
tok = tok(find(~cellfun(@ischarnum, tok)));
end
\ No newline at end of file
......@@ -49,7 +49,7 @@ function [alphahat,epsilonhat,etahat,atilde,P,aK,PK,decomp,V] = missing_DiffuseK
% Durbin/Koopman (2012): "Time Series Analysis by State Space Methods", Oxford University Press,
% Second Edition, Ch. 5
% Copyright (C) 2004-2017 Dynare Team
% Copyright (C) 2004-2018 Dynare Team
%
% This file is part of Dynare.
%
......@@ -134,9 +134,9 @@ while rank(Pinf(:,:,t+1),diffuse_kalman_tol) && t<smpl
return
else %rank of F_{\infty,t} is 0
Finf_singular(1,t) = 1;
Fstar(:,:,t) = ZZ*Pstar(:,:,t)*ZZ' + H(di,di); % (5.7) in DK (2012)
if rcond(Fstar(:,:,t)) < kalman_tol %F_{*} is singular
if ~all(abs(Fstar(:,:,t))<kalman_tol)
Fstar(di,di,t) = ZZ*Pstar(:,:,t)*ZZ' + H(di,di); % (5.7) in DK (2012)
if rcond(Fstar(di,di,t)) < kalman_tol %F_{*} is singular
if ~all(all(abs(Fstar(di,di,t))<kalman_tol))
% The univariate diffuse kalman filter should be used.
alphahat = Inf;
return
......@@ -146,12 +146,12 @@ while rank(Pinf(:,:,t+1),diffuse_kalman_tol) && t<smpl
Pinf(:,:,t+1) = T*Pinf(:,:,t)*transpose(T);
end
else
iFstar(:,:,t) = inv(Fstar(:,:,t));
Kstar(:,:,t) = Pstar(:,:,t)*ZZ'*iFstar(:,:,t); %(5.15) of DK (2012) with Kstar=T^{-1}*K^(0)
iFstar(di,di,t) = inv(Fstar(di,di,t));
Kstar(:,di,t) = Pstar(:,:,t)*ZZ'*iFstar(di,di,t); %(5.15) of DK (2012) with Kstar=T^{-1}*K^(0)
Pinf(:,:,t+1) = T*Pinf(:,:,t)*transpose(T); % DK (2012), 5.16
Lstar(:,:,t) = T - T*Kstar(:,di,t)*ZZ; %L^(0) in DK (2012), eq. 5.12
Pstar(:,:,t+1) = T*Pstar(:,:,t)*Lstar(:,:,t)'+QQ; % (5.17) DK (2012)
a(:,t+1) = T*(a(:,t)+Kstar(:,:,t)*v(:,t)); % (5.13) DK (2012)
a(:,t+1) = T*(a(:,t)+Kstar(:,di,t)*v(di,t)); % (5.13) DK (2012)
end
end
else
......
......@@ -111,8 +111,23 @@ for plt = 1:nbplt
end
end
xx = x;
if x(kk)~=0 || ~isinf(BoundsInfo.lb(kk)) || ~isinf(BoundsInfo.lb(kk))
l1 = max(BoundsInfo.lb(kk),(1-sign(x(kk))*ll)*x(kk)); m1 = 0; %lower bound
l2 = min(BoundsInfo.ub(kk),(1+sign(x(kk))*ll)*x(kk)); %upper bound
else
%size info for 0 parameter is missing, use prior standard
%deviation
upper_bound=BoundsInfo.lb(kk);
if isinf(upper_bound)
upper_bound=-1e-6*DynareOptions.huge_number;
end
lower_bound=BoundsInfo.ub(kk);
if isinf(lower_bound)
lower_bound=-1e-6*DynareOptions.huge_number;
end
l1 = max(lower_bound,-BayesInfo.p2(kk)); m1 = 0; %lower bound
l2 = min(upper_bound,BayesInfo.p2(kk)); %upper bound
end
binding_lower_bound=0;
binding_upper_bound=0;
if isequal(x(kk),BoundsInfo.lb(kk))
......
Subproject commit 6b77c21cd8d57935ff5aea121e2e3818264ce43f
Subproject commit 738413a1670b35da0d7e07675eaa0648b8c1df24
Subproject commit bc59736f5b50454cea925c99b98a757a0494f3e8
Subproject commit dfa40f0b7506cfdee02c69c33eeb26180a22e76f
% Solve model, generate model IRFs
[zdatalinear, zdatapiecewise, zdatass, oobase_, Mbase_ ] = ...
solve_one_constraint(modnam,modnamstar,...
constraint, constraint_relax,...
shockssequence,irfshock,nperiods,maxiter);
% unpack the IRFs
for i=1:Mbase_.endo_nbr
eval([deblank(Mbase_.endo_names(i,:)),'_uncdifference=zdatalinear(:,i);']);
eval([deblank(Mbase_.endo_names(i,:)),'_difference=zdatapiecewise(:,i);']);
eval([deblank(Mbase_.endo_names(i,:)),'_ss=zdatass(i);']);
end
nparams = size(Mbase_.param_names,1);
for i = 1:nparams
eval([Mbase_.param_names(i,:),'= Mbase_.params(i);']);
end