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
Dóra Kocsis
dynare
Commits
ebc08c6d
Commit
ebc08c6d
authored
13 years ago
by
Stéphane Adjemian
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug related to the names of the matlab's structures.
parent
f2ca6d0a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/initial_estimation_checks.m
+33
-33
33 additions, 33 deletions
matlab/initial_estimation_checks.m
with
33 additions
and
33 deletions
matlab/initial_estimation_checks.m
+
33
−
33
View file @
ebc08c6d
function
oo
=
initial_estimation_checks
(
xparam1
,
d
ataset
,
M
,
estim_params
,
options
,
bayestopt
,
oo
);
%initial_estimation_checks(xparam1,gend,data,data_index,number_of_observations,no_more_missing_observations
function
DynareResults
=
initial_estimation_checks
(
xparam1
,
DynareD
ataset
,
M
odel
,
EstimatedParameters
,
DynareOptions
,
BayesInfo
,
DynareResults
)
% function initial_estimation_checks(xparam1,gend,data,data_index,number_of_observations,no_more_missing_observations)
% function initial_estimation_checks(xparam1,gend,data,data_index,number_of_observations,no_more_missing_observations)
% Checks data (complex values, ML evaluation, initial values, BK conditions,..)
% Checks data (complex values, ML evaluation, initial values, BK conditions,..)
%
%
...
@@ -30,54 +30,54 @@ function oo = initial_estimation_checks(xparam1,dataset,M,estim_params,options,b
...
@@ -30,54 +30,54 @@ function oo = initial_estimation_checks(xparam1,dataset,M,estim_params,options,b
% You should have received a copy of the GNU General Public License
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if
d
ataset
.
info
.
nvobs
>
M
.
exo_nbr
+
e
stim
_param
s
.
nvn
if
DynareD
ataset
.
info
.
nvobs
>
M
odel
.
exo_nbr
+
E
stim
atedParameter
s
.
nvn
error
([
'initial_estimation_checks:: Estimation can
''
t take place because there are less shocks than observed variables!'
])
error
([
'initial_estimation_checks:: Estimation can
''
t take place because there are less shocks than observed variables!'
])
end
end
if
o
ptions
.
dsge_var
if
DynareO
ptions
.
dsge_var
[
fval
,
cost_flag
,
info
]
=
DsgeVarLikelihood
(
xparam1
,
gend
);
[
fval
,
cost_flag
,
info
]
=
DsgeVarLikelihood
(
xparam1
,
gend
);
else
else
[
fval
,
cost_flag
,
ys
,
trend_coeff
,
info
]
=
DsgeLikelihood
(
xparam1
,
dataset_
,
o
ptions
_
,
M
_
,
estim_params_
,
bayestopt_
,
oo_
);
[
fval
,
cost_flag
,
ys
,
trend_coeff
,
info
]
=
DsgeLikelihood
(
xparam1
,
DynareDataset
,
DynareO
ptions
,
M
odel
,
EstimatedParameters
,
BayesInfo
,
DynareResults
);
end
end
% when their is an analytical steadystate, check that the values
% when their is an analytical steadystate, check that the values
% returned by *_steadystate match with the static model
% returned by *_steadystate match with the static model
if
o
ptions
.
steadystate_flag
if
DynareO
ptions
.
steadystate_flag
[
ys
,
check
]
=
feval
([
M
.
fname
'_steadystate'
],
...
[
ys
,
check
]
=
feval
([
M
odel
.
fname
'_steadystate'
],
...
oo
.
steady_state
,
...
DynareResults
.
steady_state
,
...
[
oo
.
exo_steady_state
;
...
[
DynareResults
.
exo_steady_state
;
...
oo
.
exo_det_steady_state
]);
DynareResults
.
exo_det_steady_state
]);
if
size
(
ys
,
1
)
<
M
.
endo_nbr
if
size
(
ys
,
1
)
<
M
odel
.
endo_nbr
if
length
(
M
.
aux_vars
)
>
0
if
length
(
M
odel
.
aux_vars
)
>
0
ys
=
add_auxiliary_variables_to_steadystate
(
ys
,
M
.
aux_vars
,
...
ys
=
add_auxiliary_variables_to_steadystate
(
ys
,
M
odel
.
aux_vars
,
...
M
.
fname
,
...
M
odel
.
fname
,
...
oo
.
exo_steady_state
,
...
DynareResults
.
exo_steady_state
,
...
oo
.
exo_det_steady_state
,
...
DynareResults
.
exo_det_steady_state
,
...
M
.
params
,
...
M
odel
.
params
,
...
o
ptions
.
bytecode
);
DynareO
ptions
.
bytecode
);
else
else
error
([
M
.
fname
'_steadystate.m doesn
''
t match the model'
]);
error
([
M
odel
.
fname
'_steadystate.m doesn
''
t match the model'
]);
end
end
end
end
oo
.
steady_state
=
ys
;
DynareResults
.
steady_state
=
ys
;
% Check if the steady state obtained from the _steadystate file is a
% Check if the steady state obtained from the _steadystate file is a
% steady state.
% steady state.
check1
=
0
;
check1
=
0
;
if
isfield
(
o
ptions
,
'unit_root_vars'
)
&&
o
ptions
.
diffuse_filter
==
0
if
isfield
(
DynareO
ptions
,
'unit_root_vars'
)
&&
DynareO
ptions
.
diffuse_filter
==
0
if
isempty
(
o
ptions
.
unit_root_vars
)
if
isempty
(
DynareO
ptions
.
unit_root_vars
)
if
~
o
ptions
.
bytecode
if
~
DynareO
ptions
.
bytecode
check1
=
max
(
abs
(
feval
([
M
.
fname
'_static'
],
...
check1
=
max
(
abs
(
feval
([
M
odel
.
fname
'_static'
],
...
oo
.
steady_state
,
...
DynareResults
.
steady_state
,
...
[
oo
.
exo_steady_state
;
...
[
DynareResults
.
exo_steady_state
;
...
oo
.
exo_det_steady_state
],
M
.
params
)))
>
o
ptions
.
dynatol
;
DynareResults
.
exo_det_steady_state
],
M
odel
.
params
)))
>
DynareO
ptions
.
dynatol
;
else
else
[
info
,
res
]
=
bytecode
(
'static'
,
'evaluate'
,
oo
.
steady_state
,
...
[
info
,
res
]
=
bytecode
(
'static'
,
'evaluate'
,
DynareResults
.
steady_state
,
...
[
oo
.
exo_steady_state
;
...
[
DynareResults
.
exo_steady_state
;
...
oo
.
exo_det_steady_state
],
M
.
params
);
DynareResults
.
exo_det_steady_state
],
M
odel
.
params
);
check1
=
max
(
abs
(
res
))
>
o
ptions
.
dynatol
;
check1
=
max
(
abs
(
res
))
>
DynareO
ptions
.
dynatol
;
end
end
if
check1
if
check1
error
([
'The seadystate values returned by '
M
.
fname
...
error
([
'The seadystate values returned by '
M
odel
.
fname
...
'_steadystate.m don
''
t solve the static model!'
])
'_steadystate.m don
''
t solve the static model!'
])
end
end
end
end
...
@@ -86,10 +86,10 @@ end
...
@@ -86,10 +86,10 @@ end
if
info
(
1
)
>
0
if
info
(
1
)
>
0
disp
(
'Error in computing likelihood for initial parameter values'
)
disp
(
'Error in computing likelihood for initial parameter values'
)
print_info
(
info
,
o
ptions
.
noprint
)
print_info
(
info
,
DynareO
ptions
.
noprint
)
end
end
if
any
(
abs
(
oo
.
steady_state
(
bayestopt
.
mfys
))
>
1e-9
)
&&
(
o
ptions
.
prefilter
==
1
)
if
any
(
abs
(
DynareResults
.
steady_state
(
bayestopt
.
mfys
))
>
1e-9
)
&&
(
DynareO
ptions
.
prefilter
==
1
)
disp
([
'You are trying to estimate a model with a non zero steady state for the observed endogenous'
])
disp
([
'You are trying to estimate a model with a non zero steady state for the observed endogenous'
])
disp
([
'variables using demeaned data!'
])
disp
([
'variables using demeaned data!'
])
error
(
'You should change something in your mod file...'
)
error
(
'You should change something in your mod file...'
)
...
...
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