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
e2dd3cb8
Commit
e2dd3cb8
authored
Oct 13, 2011
by
Michel Juillard
Browse files
fixing more problems with steady state refactoring
parent
19a5ccb6
Changes
8
Hide whitespace changes
Inline
Side-by-side
matlab/dr1.m
View file @
e2dd3cb8
...
...
@@ -88,25 +88,27 @@ z = repmat(dr.ys,1,klen);
if
~
options_
.
bytecode
z
=
z
(
iyr0
)
;
end
;
exo_ss
=
[
oo_
.
exo_steady_state
' oo_.exo_det_steady_state'
];
x_length
=
M_
.
maximum_lag
+
M_
.
maximum_lead
+
1
;
exo_simul
=
[
repmat
(
oo_
.
exo_steady_state
',x_length,1) repmat(oo_.exo_det_steady_state'
,
x_length
,
1
)];
it_
=
M_
.
maximum_lag
+
1
;
if
options_
.
order
==
1
if
(
options_
.
bytecode
)
[
chck
,
junk
,
loc_dr
]
=
bytecode
(
'dynamic'
,
'evaluate'
,
z
,
exo_s
s
,
...
[
chck
,
junk
,
loc_dr
]
=
bytecode
(
'dynamic'
,
'evaluate'
,
z
,
exo_s
imul
,
...
M_
.
params
,
dr
.
ys
,
1
);
jacobia_
=
[
loc_dr
.
g1
loc_dr
.
g1_x
loc_dr
.
g1_xd
];
else
[
junk
,
jacobia_
]
=
feval
([
M_
.
fname
'_dynamic'
],
z
,
exo_s
s
,
...
M_
.
params
,
dr
.
ys
,
1
);
[
junk
,
jacobia_
]
=
feval
([
M_
.
fname
'_dynamic'
],
z
,
exo_s
imul
,
...
M_
.
params
,
dr
.
ys
,
it_
);
end
;
elseif
options_
.
order
==
2
if
(
options_
.
bytecode
)
[
chck
,
junk
,
loc_dr
]
=
bytecode
(
'dynamic'
,
'evaluate'
,
z
,
exo_s
s
,
...
[
chck
,
junk
,
loc_dr
]
=
bytecode
(
'dynamic'
,
'evaluate'
,
z
,
exo_s
imul
,
...
M_
.
params
,
dr
.
ys
,
1
);
jacobia_
=
[
loc_dr
.
g1
loc_dr
.
g1_x
];
else
[
junk
,
jacobia_
,
hessian1
]
=
feval
([
M_
.
fname
'_dynamic'
],
z
,
...
exo_s
s
,
...
M_
.
params
,
dr
.
ys
,
1
);
exo_s
imul
,
...
M_
.
params
,
dr
.
ys
,
3
);
end
;
if
options_
.
use_dll
% In USE_DLL mode, the hessian is in the 3-column sparse representation
...
...
matlab/evaluate_steady_state.m
View file @
e2dd3cb8
...
...
@@ -46,7 +46,6 @@ function [ys,params,info] = evaluate_steady_state(ys_init,M,options,oo,steadysta
params
=
M
.
params
;
exo_ss
=
[
oo
.
exo_steady_state
;
oo
.
exo_det_steady_state
];
updated_params_flag
=
0
;
fh_static
=
str2func
([
M
.
fname
'_static'
]);
if
length
(
M
.
aux_vars
)
>
0
h_set_auxiliary_variables
=
str2func
([
M
.
fname
'_set_auxiliary_variables'
]);
...
...
@@ -95,13 +94,14 @@ function [ys,params,info] = evaluate_steady_state(ys_init,M,options,oo,steadysta
elseif
(
options
.
bytecode
==
0
&&
options
.
block
==
0
)
if
options
.
linear
==
0
% non linear model
[
ys
,
check
]
=
dynare_solve
(
fh
_static
,
...
[
ys
,
check
]
=
dynare_solve
(
[
M
.
fname
'
_static
'
]
,
...
ys_init
,
...
options
.
jacobian_flag
,
...
exo_ss
,
params
);
else
% linear model
[
fvec
,
jacob
]
=
feval
(
fh_static
,
ys_init
,
exo_ss
,
...
fh_static
=
str2func
([
M
.
fname
'_static'
]);
[
fvec
,
jacob
]
=
fh_static
(
ys_init
,
exo_ss
,
...
params
);
if
max
(
abs
(
fvec
))
>
1e-12
ys
=
ys_init
-
jacob
\
fvec
;
...
...
matlab/homotopy1.m
View file @
e2dd3cb8
...
...
@@ -77,5 +77,5 @@ for i=1:step_nbr+1
oo_
.
exo_steady_state
(
values
(
ix
,
2
))
=
points
(
ix
,
i
);
oo_
.
exo_det_steady_state
(
values
(
ixd
,
2
))
=
points
(
ixd
,
i
);
steady_
;
steady_
(
M_
,
options_
,
oo_
)
;
end
matlab/homotopy2.m
View file @
e2dd3cb8
...
...
@@ -100,6 +100,6 @@ for i = 1:nv
disp
([
'HOMOTOPY mode 2: lauching solver with '
deblank
(
varname
)
' = '
num2str
(
v
)
' ...'
])
steady_
;
steady_
(
M_
,
options_
,
oo_
)
;
end
end
matlab/homotopy3.m
View file @
e2dd3cb8
...
...
@@ -91,7 +91,7 @@ while iter < step_nbr
old_ss
=
oo_
.
steady_state
;
try
steady_
;
steady_
(
M_
,
options_
,
oo_
)
;
if
length
([
kplus
;
kminus
])
==
nv
return
...
...
matlab/print_info.m
View file @
e2dd3cb8
...
...
@@ -50,21 +50,21 @@ if ~noprint
'that are not real or are infinite'
])
case
7
error
([
'One of the eigenvalues is is close to 0/0 (the absolute '
...
'value of numerator and denominator is smaller than 1e-6)
.
'
])
'value of numerator and denominator is smaller than 1e-6)'
])
case
19
error
(
'The steadystate file did not compute the steady state
(inconsistent deep parameters).
'
)
error
(
'The steadystate file did not compute the steady state'
)
case
20
error
([
'Impossible to find the steady state. Either the model'
...
' doesn
''
t have a unique steady state of the guess values'
...
' are too far from the solution'
])
case
21
error
(
'The steady state is complex
.
'
)
error
(
'The steady state is complex'
)
case
22
error
(
'The steady state contains NaN or Inf
.
'
)
error
(
'The steady state contains NaN or Inf'
)
case
23
error
(
'Some updated params are complex
.
'
)
error
(
'Some updated params are complex'
)
case
24
error
(
'Some updated params contain NaN or Inf
.
'
)
error
(
'Some updated params contain NaN or Inf'
)
case
30
error
(
'Variance can
''
t be computed'
)
case
41
...
...
@@ -91,21 +91,21 @@ if ~noprint
% Aim Code Conversions by convertAimCodeToInfo.m
case
102
error
(
'Aim: roots not correctly computed by real_schur
.
'
);
error
(
'Aim: roots not correctly computed by real_schur'
);
case
103
error
(
'Aim: too many big roots
.
'
);
error
(
'Aim: too many big roots'
);
case
135
error
(
'Aim: too many big roots, and q(:,right) is singular
.
'
);
error
(
'Aim: too many big roots, and q(:,right) is singular'
);
case
104
error
(
'Aim: too few big roots
.
'
);
error
(
'Aim: too few big roots'
);
case
145
error
(
'Aim: too few big roots, and q(:,right) is singular
.
'
);
error
(
'Aim: too few big roots, and q(:,right) is singular'
);
case
105
error
(
'Aim: q(:,right) is singular
.
'
);
error
(
'Aim: q(:,right) is singular'
);
case
161
error
(
'Aim: too many exact shiftrights
.
'
);
error
(
'Aim: too many exact shiftrights'
);
case
162
error
(
'Aim: too many numeric shiftrights
.
'
);
error
(
'Aim: too many numeric shiftrights'
);
otherwise
error
(
'This case shouldn
''
t happen. Contact the authors of Dynare'
)
end
...
...
preprocessor/DynareBison.yy
View file @
e2dd3cb8
...
...
@@ -99,7 +99,7 @@ class ParsingDriver;
%token FILENAME FILTER_STEP_AHEAD FILTERED_VARS FIRST_OBS
%token <string_val> FLOAT_NUMBER
%token FORECAST K_ORDER_SOLVER INSTRUMENTS
%token GAMMA_PDF GRAPH CONDITIONAL_VARIANCE_DECOMPOSITION
%token GAMMA_PDF GRAPH CONDITIONAL_VARIANCE_DECOMPOSITION
NOCHECK
%token HISTVAL HOMOTOPY_SETUP HOMOTOPY_MODE HOMOTOPY_STEPS HP_FILTER HP_NGRID
%token IDENTIFICATION INF_CONSTANT INITVAL INITVAL_FILE
%token <string_val> INT_NUMBER
...
...
@@ -821,6 +821,7 @@ steady_options : o_solve_algo
| o_homotopy_steps
| o_markowitz
| o_maxit
| o_nocheck
;
check : CHECK '
;
'
...
...
@@ -1977,6 +1978,7 @@ o_max_dim_cova_group : MAX_DIM_COVA_GROUP EQUAL INT_NUMBER { driver.option_num("
o_homotopy_mode : HOMOTOPY_MODE EQUAL INT_NUMBER {driver.option_num("homotopy_mode",$3); };
o_homotopy_steps : HOMOTOPY_STEPS EQUAL INT_NUMBER {driver.option_num("homotopy_steps",$3); };
o_nocheck : NOCHECK {driver.option_num("steadystate.nocheck","1"); };
o_controlled_varexo : CONTROLLED_VAREXO EQUAL '
(
' symbol_list '
)
' { driver.option_symbol_list("controlled_varexo"); };
o_parameter_set : PARAMETER_SET EQUAL PRIOR_MODE
...
...
preprocessor/DynareFlex.ll
View file @
e2dd3cb8
...
...
@@ -381,6 +381,7 @@ string eofbuff;
<DYNARE_STATEMENT>homotopy_mode {return token::HOMOTOPY_MODE; }
<DYNARE_STATEMENT>homotopy_steps {return token::HOMOTOPY_STEPS; }
<DYNARE_STATEMENT>nocheck {return token::NOCHECK; }
<DYNARE_STATEMENT>controlled_varexo {return token::CONTROLLED_VAREXO; }
<DYNARE_STATEMENT>parameter_set {return token::PARAMETER_SET; }
...
...
Write
Preview
Markdown
is supported
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