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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
b38d6f81
Verified
Commit
b38d6f81
authored
Jan 17, 2021
by
Johannes Pfeifer
Committed by
Stéphane Adjemian
Jan 22, 2021
Browse files
Options
Downloads
Patches
Plain Diff
compute_moments_varendo: use pruned state space at higher order
parent
314948ce
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/dsge_simulated_theoretical_correlation.m
+15
-1
15 additions, 1 deletion
matlab/dsge_simulated_theoretical_correlation.m
matlab/dsge_simulated_theoretical_covariance.m
+12
-1
12 additions, 1 deletion
matlab/dsge_simulated_theoretical_covariance.m
with
27 additions
and
2 deletions
matlab/dsge_simulated_theoretical_correlation.m
+
15
−
1
View file @
b38d6f81
...
@@ -71,6 +71,13 @@ if ~posterior
...
@@ -71,6 +71,13 @@ if ~posterior
end
end
nvar
=
length
(
ivar
);
nvar
=
length
(
ivar
);
if
options_
.
pruning
obs_var
=
NaN
(
nvar
,
1
);
for
i
=
1
:
nvar
obs_var
(
i
,
1
)
=
find
(
strcmp
(
M_
.
endo_names
(
ivar
(
i
),:),
M_
.
endo_names
(
oo_
.
dr
.
order_var
)));
end
end
% Set the size of the auto-correlation function to nar.
% Set the size of the auto-correlation function to nar.
oldnar
=
options_
.
ar
;
oldnar
=
options_
.
ar
;
options_
.
ar
=
nar
;
options_
.
ar
=
nar
;
...
@@ -109,7 +116,14 @@ for file = 1:NumberOfDrawsFiles
...
@@ -109,7 +116,14 @@ for file = 1:NumberOfDrawsFiles
M_
=
set_parameters_locally
(
M_
,
temp
.
pdraws
{
linee
,
1
});
M_
=
set_parameters_locally
(
M_
,
temp
.
pdraws
{
linee
,
1
});
[
dr
,
info
,
M_
,
options_
,
oo_
]
=
resol
(
0
,
M_
,
options_
,
oo_
);
[
dr
,
info
,
M_
,
options_
,
oo_
]
=
resol
(
0
,
M_
,
options_
,
oo_
);
end
end
if
~
options_
.
pruning
tmp
=
th_autocovariances
(
dr
,
ivar
,
M_
,
options_
,
nodecomposition
);
tmp
=
th_autocovariances
(
dr
,
ivar
,
M_
,
options_
,
nodecomposition
);
else
pruned_state_space
=
pruned_state_space_system
(
M_
,
options_
,
dr
,
obs_var
,
options_
.
ar
,
1
,
0
);
for
i
=
1
:
nar
tmp
{
i
+
1
}
=
pruned_state_space
.
Corr_yi
(:,:,
i
);
end
end
for
i
=
1
:
nar
for
i
=
1
:
nar
Correlation_array
(
linea
,:,:,
i
)
=
tmp
{
i
+
1
};
Correlation_array
(
linea
,:,:,
i
)
=
tmp
{
i
+
1
};
end
end
...
...
This diff is collapsed.
Click to expand it.
matlab/dsge_simulated_theoretical_covariance.m
+
12
−
1
View file @
b38d6f81
...
@@ -70,6 +70,12 @@ if ~posterior
...
@@ -70,6 +70,12 @@ if ~posterior
end
end
nvar
=
length
(
ivar
);
nvar
=
length
(
ivar
);
if
options_
.
pruning
obs_var
=
NaN
(
nvar
,
1
);
for
i
=
1
:
nvar
obs_var
(
i
,
1
)
=
find
(
strcmp
(
M_
.
endo_names
(
ivar
(
i
),:),
M_
.
endo_names
(
oo_
.
dr
.
order_var
)));
end
end
% Set the size of the auto-correlation function to zero.
% Set the size of the auto-correlation function to zero.
nar
=
options_
.
ar
;
nar
=
options_
.
ar
;
options_
.
ar
=
0
;
options_
.
ar
=
0
;
...
@@ -108,7 +114,12 @@ for file = 1:NumberOfDrawsFiles
...
@@ -108,7 +114,12 @@ for file = 1:NumberOfDrawsFiles
M_
=
set_parameters_locally
(
M_
,
temp
.
pdraws
{
linee
,
1
});
M_
=
set_parameters_locally
(
M_
,
temp
.
pdraws
{
linee
,
1
});
[
dr
,
info
,
M_
,
options_
,
oo_
]
=
resol
(
0
,
M_
,
options_
,
oo_
);
[
dr
,
info
,
M_
,
options_
,
oo_
]
=
resol
(
0
,
M_
,
options_
,
oo_
);
end
end
if
~
options_
.
pruning
tmp
=
th_autocovariances
(
dr
,
ivar
,
M_
,
options_
,
nodecomposition
);
tmp
=
th_autocovariances
(
dr
,
ivar
,
M_
,
options_
,
nodecomposition
);
else
pruned_state_space
=
pruned_state_space_system
(
M_
,
options_
,
dr
,
obs_var
,
options_
.
ar
,
1
,
0
);
tmp
{
1
}
=
pruned_state_space
.
Var_y
;
end
for
i
=
1
:
nvar
for
i
=
1
:
nvar
for
j
=
i
:
nvar
for
j
=
i
:
nvar
Covariance_matrix
(
linea
,
symmetric_matrix_index
(
i
,
j
,
nvar
))
=
tmp
{
1
}(
i
,
j
);
Covariance_matrix
(
linea
,
symmetric_matrix_index
(
i
,
j
,
nvar
))
=
tmp
{
1
}(
i
,
j
);
...
...
This diff is collapsed.
Click to expand it.
Johannes Pfeifer
@JohannesPfeifer
mentioned in issue
#1757 (closed)
·
Jan 23, 2021
mentioned in issue
#1757 (closed)
mentioned in issue #1757
Toggle commit list
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