Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
be388664
Verified
Commit
be388664
authored
3 years ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
Fix handling of heteroskedastic_shocks block with several declared periods
Closes:
#1791
parent
de860897
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#5497
passed
3 years ago
Stage: build
Stage: test
Stage: pkg
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/dynare_estimation_init.m
+17
-18
17 additions, 18 deletions
matlab/dynare_estimation_init.m
preprocessor
+1
-1
1 addition, 1 deletion
preprocessor
with
18 additions
and
19 deletions
matlab/dynare_estimation_init.m
+
17
−
18
View file @
be388664
...
...
@@ -32,7 +32,7 @@ function [dataset_, dataset_info, xparam1, hh, M_, options_, oo_, estim_params_,
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-202
0
Dynare Team
% Copyright (C) 2003-202
1
Dynare Team
%
% This file is part of Dynare.
%
...
...
@@ -665,24 +665,23 @@ if options_.heteroskedastic_filter
error
([
'estimation option conflict: analytic_derivation isn
''
t available '
...
'for heteroskedastic_filter'
])
end
M_
.
heteroskedastic_shocks
.
Qvalue
=
NaN
(
M_
.
exo_nbr
,
options_
.
nobs
);
M_
.
heteroskedastic_shocks
.
Qscale
=
NaN
(
M_
.
exo_nbr
,
options_
.
nobs
);
xname
=
fieldnames
(
M_
.
heteroskedastic_shocks
.
Qhet
);
for
k
=
1
:
length
(
xname
)
inx
=
strcmp
(
xname
{
k
},
M_
.
exo_names
);
isqscale
=
false
;
if
isfield
(
M_
.
heteroskedastic_shocks
.
Qhet
.
(
xname
{
k
}),
'scale'
)
M_
.
heteroskedastic_shocks
.
Qscale
(
inx
,
M_
.
heteroskedastic_shocks
.
Qhet
.
(
xname
{
k
})
.
time_scale
)
=
M_
.
heteroskedastic_shocks
.
Qhet
.
(
xname
{
k
})
.
scale
.^
2
;
isqscale
=
true
;
end
if
isfield
(
M_
.
heteroskedastic_shocks
.
Qhet
.
(
xname
{
k
}),
'value'
)
if
isqscale
&&
~
isempty
(
intersect
(
M_
.
heteroskedastic_shocks
.
Qhet
.
(
xname
{
k
})
.
time_value
,
M_
.
heteroskedastic_shocks
.
Qhet
.
(
xname
{
k
})
.
time_scale
))
fprintf
(
'\ndynare_estimation_init: With the option "heteroskedastic_shocks" you cannot define\n'
)
fprintf
(
'dynare_estimation_init: the scale and the value for the same shock \n'
)
fprintf
(
'dynare_estimation_init: in the same period!\n'
)
error
(
'Scale and value defined for the same shock in the same period with "heteroskedastic_shocks".'
)
end
M_
.
heteroskedastic_shocks
.
Qvalue
(
inx
,
M_
.
heteroskedastic_shocks
.
Qhet
.
(
xname
{
k
})
.
time_value
)
=
M_
.
heteroskedastic_shocks
.
Qhet
.
(
xname
{
k
})
.
value
.^
2
;
end
for
k
=
1
:
length
(
M_
.
heteroskedastic_shocks
.
Qvalue_orig
)
v
=
M_
.
heteroskedastic_shocks
.
Qvalue_orig
(
k
);
M_
.
heteroskedastic_shocks
.
Qvalue
(
v
.
exo_id
,
v
.
periods
)
=
v
.
value
^
2
;
end
for
k
=
1
:
length
(
M_
.
heteroskedastic_shocks
.
Qscale_orig
)
v
=
M_
.
heteroskedastic_shocks
.
Qscale_orig
(
k
);
M_
.
heteroskedastic_shocks
.
Qscale
(
v
.
exo_id
,
v
.
periods
)
=
v
.
scale
^
2
;
end
if
any
(
any
(
~
isnan
(
M_
.
heteroskedastic_shocks
.
Qvalue
)
&
~
isnan
(
M_
.
heteroskedastic_shocks
.
Qscale
)))
fprintf
(
'\ndynare_estimation_init: With the option "heteroskedastic_shocks" you cannot define\n'
)
fprintf
(
'dynare_estimation_init: the scale and the value for the same shock \n'
)
fprintf
(
'dynare_estimation_init: in the same period!\n'
)
error
(
'Scale and value defined for the same shock in the same period with "heteroskedastic_shocks".'
)
end
end
This diff is collapsed.
Click to expand it.
preprocessor
@
824433aa
Compare
a5d653a5
...
824433aa
Subproject commit
a5d653a5f1046d75c1c3dcd1581e7c9d99f54bb6
Subproject commit
824433aa3f1bd9b5e4f7c395231111242b3c308a
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment