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
Dóra Kocsis
dynare
Commits
b356c5e5
Commit
b356c5e5
authored
Nov 20, 2010
by
Ferhat Mihoubi
Committed by
Sébastien Villemot
Nov 25, 2010
Browse files
add_auxiliary_variables_to_steadystate is compatible with bytecode option
+ minor corrections in steady_.m
parent
48eb2a83
Changes
11
Hide whitespace changes
Inline
Side-by-side
matlab/add_auxiliary_variables_to_steadystate.m
View file @
b356c5e5
function
ys1
=
add_auxiliary_variables_to_steadystate
(
ys
,
aux_vars
,
fname
,
...
exo_steady_state
,
exo_det_steady_state
,
params
)
exo_steady_state
,
exo_det_steady_state
,
params
,
byte_code
)
% Add auxiliary variables to the steady state vector
% Copyright (C) 2009 Dynare Team
...
...
@@ -18,7 +18,6 @@ function ys1 = add_auxiliary_variables_to_steadystate(ys,aux_vars,fname, ...
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
n
=
length
(
aux_vars
);
ys1
=
[
ys
;
zeros
(
n
,
1
)];
k
=
size
(
ys
,
1
)
+
1
;
...
...
@@ -33,9 +32,15 @@ for i=1:n
end
for
i
=
1
:
aux_lead_nbr
+
1
;
res
=
feval
([
fname
'_static'
],
ys1
,
...
[
exo_steady_state
;
...
exo_det_steady_state
],
params
);
if
byte_code
[
info
,
res
]
=
bytecode
(
'static'
,
'evaluate'
,
ys1
,
...
[
exo_steady_state
;
...
exo_det_steady_state
],
params
);
else
res
=
feval
([
fname
'_static'
],
ys1
,
...
[
exo_steady_state
;
...
exo_det_steady_state
],
params
);
end
;
for
j
=
1
:
n
if
aux_vars
(
j
)
.
type
==
0
el
=
aux_vars
(
j
)
.
endo_index
;
...
...
matlab/dr1.m
View file @
b356c5e5
...
...
@@ -111,7 +111,8 @@ if options_.ramsey_policy
M_
.
fname
,
...
oo_
.
exo_steady_state
,
...
oo_
.
exo_det_steady_state
,
...
M_
.
params
);
M_
.
params
,
...
options_
.
bytecode
);
else
error
([
M_
.
fname
'_steadystate.m doesn
''
t match the model'
]);
end
...
...
@@ -167,9 +168,9 @@ else
end
;
if
options_
.
order
==
1
if
(
options_
.
bytecode
)
jacobia_
=
[];
[
chck
,
junk
,
jacobia_
]
=
bytecode
(
'dynamic'
,
'evaluate'
,
z
,[
oo_
.
exo_simul
...
oo_
.
exo_det_simul
],
M_
.
params
,
1
,
jacobia_
)
;
[
chck
,
junk
,
loc_dr
]
=
bytecode
(
'dynamic'
,
'evaluate'
,
z
,[
oo_
.
exo_simul
...
oo_
.
exo_
det_
simul
],
M_
.
params
,
1
);
jacobia_
=
[
loc_dr
.
g1
loc_dr
.
g1_x
]
;
else
[
junk
,
jacobia_
]
=
feval
([
M_
.
fname
'_dynamic'
],
z
,[
oo_
.
exo_simul
...
oo_
.
exo_det_simul
],
M_
.
params
,
it_
);
...
...
matlab/dyn_ramsey_static_.m
View file @
b356c5e5
...
...
@@ -67,7 +67,8 @@ if options_.steadystate_flag
M
.
fname
,
...
oo
.
exo_steady_state
,
...
oo
.
exo_det_steady_state
,
...
M_
.
params
);
M_
.
params
,
...
options_
.
bytecode
);
else
error
([
M
.
fname
'_steadystate.m doesn
''
t match the model'
]);
end
...
...
matlab/dynare_estimation_1.m
View file @
b356c5e5
...
...
@@ -313,7 +313,8 @@ if options_.steadystate_flag% if the *_steadystate.m file is provided.
M_
.
fname
,
...
zeros
(
M_
.
exo_nbr
,
1
),
...
oo_
.
exo_det_steady_state
,
...
M_
.
params
);
M_
.
params
,
...
options_
.
bytecode
);
else
error
([
M_
.
fname
'_steadystate.m doesn
''
t match the model'
]);
end
...
...
matlab/evaluate_likelihood.m
View file @
b356c5e5
...
...
@@ -115,7 +115,8 @@ if isempty(load_data)
M_
.
fname
,
...
zeros
(
M_
.
exo_nbr
,
1
),
...
oo_
.
exo_det_steady_state
,
...
M_
.
params
);
M_
.
params
,
...
options_
.
bytecode
);
else
error
([
M_
.
fname
'_steadystate.m doesn
''
t match the model'
]);
end
...
...
matlab/initial_estimation_checks.m
View file @
b356c5e5
...
...
@@ -73,7 +73,8 @@ if options_.steadystate_flag
M_
.
fname
,
...
oo_
.
exo_steady_state
,
...
oo_
.
exo_det_steady_state
,
...
M_
.
params
);
M_
.
params
,
...
options_
.
bytecode
);
else
error
([
M_
.
fname
'_steadystate.m doesn
''
t match the model'
]);
end
...
...
@@ -84,10 +85,17 @@ if options_.steadystate_flag
check1
=
0
;
if
isfield
(
options_
,
'unit_root_vars'
)
&
options_
.
diffuse_filter
==
0
if
isempty
(
options_
.
unit_root_vars
)
check1
=
max
(
abs
(
feval
([
M_
.
fname
'_static'
],
...
oo_
.
steady_state
,
...
[
oo_
.
exo_steady_state
;
...
oo_
.
exo_det_steady_state
],
M_
.
params
)))
>
options_
.
dynatol
;
if
~
options_
.
bytecode
check1
=
max
(
abs
(
feval
([
M_
.
fname
'_static'
],
...
oo_
.
steady_state
,
...
[
oo_
.
exo_steady_state
;
...
oo_
.
exo_det_steady_state
],
M_
.
params
)))
>
options_
.
dynatol
;
else
[
info
,
res
]
=
bytecode
(
'static'
,
'evaluate'
,
oo_
.
steady_state
,
...
[
oo_
.
exo_steady_state
;
...
oo_
.
exo_det_steady_state
],
M_
.
params
);
check1
=
max
(
abs
(
res
))
>
options_
.
dynatol
;
end
if
check1
error
([
'The seadystate values returned by '
M_
.
fname
...
'_steadystate.m don
''
t solve the static model!'
])
...
...
matlab/model_diagnostics.m
View file @
b356c5e5
...
...
@@ -84,7 +84,8 @@ if options_.steadystate_flag
ys
=
add_auxiliary_variables_to_steadystate
(
ys
,
M_
.
aux_vars
,
...
M_
.
fname
,
...
oo_
.
exo_steady_state
,
...
oo_
.
exo_det_steady_state
);
oo_
.
exo_det_steady_state
,
...
options_
.
bytecode
);
else
error
([
M_
.
fname
'_steadystate.m doesn
''
t match the model'
]);
end
...
...
matlab/osr1.m
View file @
b356c5e5
...
...
@@ -51,7 +51,8 @@ if exist([M_.fname '_steadystate'])
ys
=
add_auxiliary_variables_to_steadystate
(
ys
,
M_
.
aux_vars
,
...
M_
.
fname
,
...
oo_
.
exo_steady_state
,
...
oo_
.
exo_det_steady_state
,
M_
.
params
);
oo_
.
exo_det_steady_state
,
M_
.
params
,
...
options_
.
bytecode
);
else
error
([
M_
.
fname
'_steadystate.m doesn
''
t match the model'
]);
end
...
...
matlab/resid.m
View file @
b356c5e5
...
...
@@ -45,7 +45,8 @@ if options_.steadystate_flag
M_
.
fname
,
...
oo_
.
exo_steady_state
,
...
oo_
.
exo_det_steady_state
,
...
M_
.
params
);
M_
.
params
,
...
options_
.
bytecode
);
else
error
([
M_
.
fname
'_steadystate.m doesn
''
t match the model'
]);
end
...
...
matlab/resol.m
View file @
b356c5e5
...
...
@@ -80,7 +80,8 @@ if options_.steadystate_flag
M_
.
fname
,
...
oo_
.
exo_steady_state
,
...
oo_
.
exo_det_steady_state
,
...
M_
.
params
);
M_
.
params
,
...
options_
.
bytecode
);
else
error
([
M_
.
fname
'_steadystate.m doesn
''
t match the model'
]);
end
...
...
matlab/steady_.m
View file @
b356c5e5
...
...
@@ -57,7 +57,8 @@ if options_.steadystate_flag
M_
.
fname
,
...
oo_
.
exo_steady_state
,
...
oo_
.
exo_det_steady_state
,
...
M_
.
params
);
M_
.
params
,
...
options_
.
bytecode
);
else
error
([
M_
.
fname
'_steadystate.m doesn
''
t match the model'
]);
end
...
...
@@ -84,11 +85,12 @@ if options_.steadystate_flag
if
~
isempty
(
idx
)
check1
=
1
;
end
elseif
options_
.
block
&&
options_
.
bytecode
elseif
options_
.
bytecode
[
check1
,
residuals
]
=
bytecode
(
'evaluate'
,
'static'
,
oo_
.
steady_state
,
...
[
oo_
.
exo_steady_state
;
...
oo_
.
exo_det_steady_state
],
M_
.
params
,
1
);
mexErrCheck
(
'bytecode'
,
check1
);
check1
=
max
(
abs
(
residuals
))
>
options_
.
dynatol
;
else
check1
=
0
;
check1
=
max
(
abs
(
feval
([
M_
.
fname
'_static'
],
...
...
...
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