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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Selma Malmberg
dynare
Commits
d81fd1b5
Commit
d81fd1b5
authored
13 years ago
by
Stéphane Adjemian
Browse files
Options
Downloads
Patches
Plain Diff
Removed globals from check routine. Added texinfo header.
parent
3c818378
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/check.m
+53
-34
53 additions, 34 deletions
matlab/check.m
matlab/smm_objective.m
+2
-2
2 additions, 2 deletions
matlab/smm_objective.m
with
55 additions
and
36 deletions
matlab/check.m
+
53
−
34
View file @
d81fd1b5
function
[
result
,
info
]
=
check
% function result = check
% checks determinacy conditions by computing the eigenvalues
%
% INPUTS
% none
%
% OUTPUTS
% result [integer] scalar, equal to 1 if the derterministic steady state satisfies BK conditions.
%
% SPECIAL REQUIREMENTS
% none
function
[
result
,
info
]
=
check
(
M
,
options
,
oo
)
%
Checks
determinacy
conditions
by
computing
the
generalized
eigenvalues
.
%
@info
:
%!
@deftypefn
{
Function
File
}
{[
result
,
info
]
=
}
check
(
@var
{
M
},
@var
{
options
},
@var
{
oo
})
%!
@anchor
{
check
}
%!
@sp
1
%!
Checks
determinacy
conditions
by
computing
the
generalized
eigenvalues
.
%!
@sp
2
%!
@strong
{
Inputs
}
%!
@sp
1
%!
@table
@
@var
%!
@item
M
%!
Matlab
'
s
structure
describing
the
model
(
initialized
by
dynare
).
%!
@item
options
%!
Matlab
'
s
structure
describing
the
options
(
initialized
by
dynare
).
%!
@item
oo
%!
Matlab
'
s
structure
gathering
the
results
(
initialized
by
dynare
).
%!
@end
table
%!
@sp
2
%!
@strong
{
Outputs
}
%!
@sp
1
%!
@table
@
@var
%!
@item
result
%!
Integer
scalar
equal
to
one
(
BK
conditions
are
satisfied
)
or
zero
(
otherwise
).
%!
@item
info
%!
Integer
scalar
,
error
code
as
returned
by
@ref
{
resol
}.
%!
@end
table
%!
@sp
2
%!
@strong
{
This
function
is
called
by
:
}
%!
@sp
1
%!
@ref
{
smm_objective
}
%!
@sp
2
%!
@strong
{
This
function
calls
:
}
%!
@sp
1
%!
@ref
{
resol
}
%!
None
.
%!
@end
deftypefn
%
@eod
:
%
Copyright
(
C
)
2001
-
2011
Dynare
Team
%
...
...
@@ -28,46 +55,40 @@ function [result,info] = check
%
You
should
have
received
a
copy
of
the
GNU
General
Public
License
%
along
with
Dynare
.
If
not
,
see
<
http
:
//www.gnu.org/licenses/>.
global
M_
options_
oo_
temp_options
=
options_
;
tempex
=
oo_
.
exo_simul
;
if
~
options_
.
initval_file
&&
M_
.
exo_nbr
>
1
oo_
.
exo_simul
=
ones
(
M_
.
maximum_lead
+
M_
.
maximum_lag
+
1
,
1
)
*
oo_
.
exo_steady_state
'
;
if
~
options
.
initval_file
&&
M
.
exo_nbr
>
1
oo
.
exo_simul
=
ones
(
M
.
maximum_lead
+
M
.
maximum_lag
+
1
,
1
)
*
oo
.
exo_steady_state
'
;
end
options
_
.
order
=
1
;
options
.
order
=
1
;
if
isempty
(
options
_
.
qz_criterium
)
options
_
.
qz_criterium
=
1
+
1e-6
;
if
isempty
(
options
.
qz_criterium
)
options
.
qz_criterium
=
1
+
1e-6
;
end
[
dr
,
info
]
=
resol
(
oo
_
.
steady_state
,
1
);
[
dr
,
info
]
=
resol
(
oo
.
steady_state
,
1
);
oo
_
.
dr
=
dr
;
oo
.
dr
=
dr
;
if
info
(
1
)
~=
0
&&
info
(
1
)
~=
3
&&
info
(
1
)
~=
4
print_info
(
info
,
options_
.
noprint
);
end
oo_
.
exo_simul
=
tempex
;
print_info
(
info
,
options
.
noprint
);
end
eigenvalues_
=
dr
.
eigval
;
if
(
options
_
.
block
)
if
(
options
.
block
)
nyf
=
dr
.
nyf
;
else
nyf
=
nnz
(
dr
.
kstate
(:,
2
)
>
M
_
.
maximum_endo_lag
+
1
);
nyf
=
nnz
(
dr
.
kstate
(
:
,
2
)
>
M
.
maximum_endo_lag
+
1
);
end
;
[
m_lambda
,
i
]
=
sort
(
abs
(
eigenvalues_
));
n_explod
=
nnz
(
abs
(
eigenvalues_
)
>
options
_
.
qz_criterium
);
n_explod
=
nnz
(
abs
(
eigenvalues_
)
>
options
.
qz_criterium
);
result
=
0
;
if
(
nyf
==
n_explod
)
&&
(
dr
.
rank
==
nyf
)
result
=
1
;
end
if
options
_
.
noprint
==
0
if
options
.
noprint
==
0
disp
(
' '
)
disp
(
'
EIGENVALUES
:
'
)
disp
(
sprintf
(
'
%
16
s
%
16
s
%
16
s
\
n
','
Modulus
','
Real
','
Imaginary
'
))
...
...
@@ -82,6 +103,4 @@ if options_.noprint == 0
disp
(
'
The
rank
conditions
ISN
''
T
verified
!
'
)
end
disp
(
' '
)
end
options_
=
temp_options
;
\ No newline at end of file
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
matlab/smm_objective.m
+
2
−
2
View file @
d81fd1b5
...
...
@@ -32,7 +32,7 @@ function [r,flag] = smm_objective(xparams,sample_moments,weighting_matrix,option
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global
M_
options_
global
M_
options_
oo_
persistent
mainStream
mainState
persistent
priorObjectiveValue
...
...
@@ -71,7 +71,7 @@ save('estimated_parameters.mat','xparams');
% Check for local determinacy of the deterministic steady state.
noprint
=
options_
.
noprint
;
options_
.
noprint
=
1
;
[
local_determinacy_and_stability
,
info
]
=
check
;
options_
.
noprint
=
noprint
;
[
local_determinacy_and_stability
,
info
]
=
check
(
M_
,
options_
,
oo_
)
;
options_
.
noprint
=
noprint
;
if
~
local_determinacy_and_stability
r
=
priorObjectiveValue
*
(
1
+
info
(
2
));
flag
=
0
;
...
...
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