Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dynare
dynare
Commits
f0b9f453
Commit
f0b9f453
authored
Aug 29, 2017
by
Johannes Pfeifer
Committed by
Stéphane Adjemian
Oct 04, 2017
Browse files
Make empirical moments independent of simul_replic by outputting first instead of later replication
Closes
#1487
parent
0f84dadb
Changes
2
Hide whitespace changes
Inline
Side-by-side
matlab/simult.m
View file @
f0b9f453
function
[
y_
,
DynareResults
]
=
simult
(
y0
,
dr
,
DynareModel
,
DynareOptions
,
DynareResults
)
function
[
y_
out
,
DynareResults
]
=
simult
(
y0
,
dr
,
DynareModel
,
DynareOptions
,
DynareResults
)
%
Simulate
a
DSGE
model
(
perturbation
approach
).
%
@info
:
...
...
@@ -25,7 +25,7 @@ function [y_,DynareResults] =simult(y0, dr,DynareModel,DynareOptions,DynareResul
%!
@strong
{
Outputs
}
%!
@sp
1
%!
@table
@
@var
%!
@item
y_
%!
@item
y_
out
%!
Matrix
of
doubles
,
simulated
time
series
for
all
the
endogenous
variables
(
one
per
row
).
%!
@item
DynareResults
%!
Matlab
'
s
structure
gathering
the
results
(
see
@ref
{
oo_
}).
...
...
@@ -88,6 +88,9 @@ for i=1:replic
if
replic
>
1
fwrite
(
fh
,
y_
,
'
float64
'
);
end
if
i
==
1
y_out
=
y_
;
end
end
if
replic
>
1
...
...
tests/example2.mod
View file @
f0b9f453
...
...
@@ -41,3 +41,11 @@ var u = 0.009^2;
end;
stoch_simul(periods=2000, drop=200);
%% test that simul_replic does not affect simulated moments
moments_temp=oo_.var;
set_dynare_seed('default');
stoch_simul(periods=2000, drop=200,simul_replic=2);
if ~isequal(moments_temp,oo_.var)
error('Simul_replic affects simulated moments')
end
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment