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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Stéphane Adjemian
dynare
Commits
f717712e
Commit
f717712e
authored
4 years ago
by
Johannes Pfeifer
Browse files
Options
Downloads
Patches
Plain Diff
Fix trace plots with measurement errors and their correlations
Problem was introduced when transitioning to cell arrays
parent
acdca03e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
matlab/name2index.m
+2
-2
2 additions, 2 deletions
matlab/name2index.m
matlab/set_prior.m
+1
-3
1 addition, 3 deletions
matlab/set_prior.m
tests/measurement_errors/ls2003a.mod
+5
-2
5 additions, 2 deletions
tests/measurement_errors/ls2003a.mod
with
8 additions
and
7 deletions
matlab/name2index.m
+
2
−
2
View file @
f717712e
...
...
@@ -87,7 +87,7 @@ end
if
strcmpi
(
type
,
'MeasurementError'
)
if
nargin
<
6
% Covariance matrix diagonal term
i
=
nvx
+
strmatch
(
name1
,
M_
.
endo_names
{
estim_params_
.
var_endo
(:,
1
)
}
,
'exact'
);
i
=
nvx
+
strmatch
(
name1
,
M_
.
endo_names
(
estim_params_
.
var_endo
(:,
1
)
)
,
'exact'
);
if
isempty
(
i
)
disp
([
'The standard deviation of the measurement error on '
name1
' is not an estimated parameter!'
])
return
...
...
@@ -95,7 +95,7 @@ if strcmpi(type,'MeasurementError')
else
% Covariance matrix off-diagonal term
offset
=
nvx
+
nvn
+
ncx
;
try
list_of_measurement_errors
=
{
M_
.
endo_names
{
estim_params_
.
corrn
(:,
1
)
}
,
M_
.
endo_names
{
estim_params_
.
corrn
(:,
2
)
}
}
;
list_of_measurement_errors
=
[
M_
.
endo_names
(
estim_params_
.
corrn
(:,
1
)
,
1
)
,
M_
.
endo_names
(
estim_params_
.
corrn
(:,
2
)
,
1
)]
;
k1
=
strmatch
(
name1
,
list_of_measurement_errors
(:,
1
),
'exact'
);
k2
=
strmatch
(
name2
,
list_of_measurement_errors
(:,
2
),
'exact'
);
i
=
offset
+
intersect
(
k1
,
k2
);
...
...
This diff is collapsed.
Click to expand it.
matlab/set_prior.m
+
1
−
3
View file @
f717712e
...
...
@@ -133,9 +133,7 @@ if ncn
bayestopt_
.
p4
=
[
bayestopt_
.
p4
;
estim_params_
.
corrn
(:,
10
)];
%take generalized distribution into account
bayestopt_
.
jscale
=
[
bayestopt_
.
jscale
;
estim_params_
.
corrn
(:,
11
)];
baseid
=
length
(
bayestopt_
.
name
);
bayestopt_
.
name
=
[
bayestopt_
.
name
;
cell
(
ncn
,
1
)];
[
bayestopt_
.
name
;
cellstr
([
repmat
(
'corr '
,
ncn
,
1
)
...
M_
.
endo_names
{
estim_params_
.
corrn
(:,
1
)}
...
repmat
(
', '
,
ncn
,
1
)
,
M_
.
endo_names
{
estim_params_
.
corrn
(:,
2
)}])];
bayestopt_
.
name
=
[
bayestopt_
.
name
;
cell
(
ncn
,
1
)];;
for
i
=
1
:
ncn
k1
=
estim_params_
.
corrn
(
i
,
1
);
k2
=
estim_params_
.
corrn
(
i
,
2
);
...
...
This diff is collapsed.
Click to expand it.
tests/measurement_errors/ls2003a.mod
+
5
−
2
View file @
f717712e
...
...
@@ -61,7 +61,10 @@ stderr e_ys,inv_gamma_pdf,1.2533,0.6551;
stderr e_pies,inv_gamma_pdf,1.88,0.9827;
stderr dq,inv_gamma_pdf,0.001,0.0001;
stderr de,inv_gamma_pdf,0.001,0.0001;
stderr pie_obs,inv_gamma_pdf,0.001,0.0001;
corr dq,de, normal_pdf,0,1;
corr pie_obs,de, normal_pdf,0,1;
end;
estimation(datafile=data_ca1,first_obs=8,nobs=79,mh_nblocks=1
0
,prefilter=1,mh_jscale=0.5,mh_replic=0,mode_check);
estimation(datafile=data_ca1,first_obs=8,nobs=79,mh_nblocks=1,prefilter=1,mh_jscale=0.5,mh_replic=
300
0,mode_check);
generate_trace_plots(1);
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