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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
43607acf
Verified
Commit
43607acf
authored
3 years ago
by
Sébastien Villemot
Browse files
Options
Downloads
Plain Diff
Merge branch 'resolveheader' of git.dynare.org:JohannesPfeifer/dynare
See merge request
!1875
parents
18a172bd
32e1f345
No related branches found
No related tags found
1 merge request
!1875
dynare_resolve.m: correct header and change naming of globals
Pipeline
#5512
passed
3 years ago
Stage: build
Stage: test
Stage: pkg
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/dynare_resolve.m
+30
-62
30 additions, 62 deletions
matlab/dynare_resolve.m
with
30 additions
and
62 deletions
matlab/dynare_resolve.m
+
30
−
62
View file @
43607acf
function
[
A
,
B
,
ys
,
info
,
Model
,
DynareOptions
,
DynareResults
]
=
dynare_resolve
(
Model
,
DynareOptions
,
DynareResults
,
mode
)
function
[
A
,
B
,
ys
,
info
,
M_
,
options_
,
oo_
]
=
dynare_resolve
(
M_
,
options_
,
oo_
,
mode
)
% function [A,B,ys,info,M_,options_,oo_] = dynare_resolve(M_,options_,oo_,mode)
% Computes the linear approximation and the matrices A and B of the transition equation.
% Computes the linear approximation and the matrices A and B of the transition equation.
%
% Inputs:
% - M_ [structure] Matlab's structure describing the model
% - options_ [structure] Matlab's structure containing the options
% - oo_ [structure] Matlab's structure containing the results
% - mode [string] if provided, use restricted state space
%
% Outputs:
% - A [double] State transition matrix (potentially for restricted state space)
% - B [double] shock impact matrix (potentially for restricted state space)
% - ys [double] vector of steady state values
% - info [double] 4 by 1 vector with exit flag and information
% - M_ [structure] Matlab's structure describing the model
% - options_ [structure] Matlab's structure containing the options
% - oo_ [structure] Matlab's structure containing the results
%
@info
:
% Copyright (C) 2001-2021 Dynare Team
%!
@deftypefn
{
Function
File
}
{[
@var
{
A
},
@var
{
B
},
@var
{
ys
},
@var
{
info
},
@var
{
Model
},
@var
{
DynareOptions
},
@var
{
DynareResults
}]
=
}
resol
(
@var
{
Model
},
@var
{
DynareOptions
},
@var
{
DynareResults
})
%!
@anchor
{
dynare_resolve
}
%!
@sp
1
%!
Computes
the
linear
approximation
and
the
matrices
A
and
B
of
the
transition
equation
.
%!
@sp
2
%!
@strong
{
Inputs
}
%!
@sp
1
%!
@table
@
@var
%!
@item
Model
%!
Matlab
'
s
structure
describing
the
model
(
initialized
by
dynare
,
see
@ref
{
M_
}).
%!
@item
DynareOptions
%!
Matlab
'
s
structure
describing
the
options
(
initialized
by
dynare
,
see
@ref
{
options_
}).
%!
@item
DynareResults
%!
Matlab
'
s
structure
gathering
the
results
(
initialized
by
dynare
,
see
@ref
{
oo_
}).
%!
@item
mode
%!
Passed
argument
if
restricted
state
-
space
is
required
,
not
passed
otherwise
%!
@end
table
%!
@sp
2
%!
@strong
{
Outputs
}
%!
@sp
1
%!
@table
@
@var
%!
@item
A
%!
Matrix
of
doubles
,
transition
matrix
of
the
state
equation
.
%!
@item
B
%!
Matrix
of
doubles
,
matrix
relating
the
endogenous
variables
to
the
innovations
in
the
state
equation
.
%!
@item
ys
%!
Vector
of
doubles
,
steady
state
level
of
the
endogenous
variables
in
declaration
order
%!
@item
info
%!
Integer
scalar
,
error
code
as
given
by
@ref
{
resol
}.
%!
@item
Model
%!
Matlab
'
s
structure
describing
the
model
(
initialized
by
dynare
,
see
@ref
{
M_
}).
%!
@item
DynareOptions
%!
Matlab
'
s
structure
describing
the
options
(
initialized
by
dynare
,
see
@ref
{
options_
}).
%!
@item
DynareResults
%!
Matlab
'
s
structure
gathering
the
results
(
initialized
by
dynare
,
see
@ref
{
oo_
}).
%!
@end
table
%!
@sp
2
%!
@strong
{
This
function
is
called
by
:
}
%!
@sp
1
%!
@ref
{
dsge_likelihood
},
@ref
{
DsgeLikelihood_hh
},
@ref
{
DsgeVarLikelihood
},
@ref
{
dsge_posterior_kernel
},
@ref
{
DsgeSmoother
},
@ref
{
dynare_sensitivity
},
@ref
{
gsa
/
thet2tau
},
@ref
{
gsa
/
stab_map
},
@ref
{
identification_analysis
},
@ref
{
imcforecast
},
@ref
{
thet2tau
}
%!
@sp
2
%!
@strong
{
This
function
calls
:
}
%!
@sp
1
%!
@ref
{
resol
},
@ref
{
kalman_transition_matrix
}
%!
@end
deftypefn
%
@eod
:
%
Copyright
(
C
)
2001
-
2020
Dynare
Team
%
%
% This file is part of Dynare.
% This file is part of Dynare.
%
%
...
@@ -66,7 +34,7 @@ function [A,B,ys,info,Model,DynareOptions,DynareResults] = dynare_resolve(Model,
...
@@ -66,7 +34,7 @@ function [A,B,ys,info,Model,DynareOptions,DynareResults] = dynare_resolve(Model,
% 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 <https://www.gnu.org/licenses/>.
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
[
dr
,
info
,
M
odel
,
DynareOptions
,
DynareResults
]
=
compute_decision_rules
(
Model
,
DynareOptions
,
DynareResults
);
[
dr
,
info
,
M
_
,
options_
,
oo_
]
=
compute_decision_rules
(
M_
,
options_
,
oo_
);
if
info
(
1
)
>
0
if
info
(
1
)
>
0
A
=
[];
A
=
[];
...
@@ -81,26 +49,26 @@ end
...
@@ -81,26 +49,26 @@ end
switch
nargin
switch
nargin
case
3
case
3
endo_nbr
=
M
odel
.
endo_nbr
;
endo_nbr
=
M
_
.
endo_nbr
;
nstatic
=
M
odel
.
nstatic
;
nstatic
=
M
_
.
nstatic
;
nspred
=
M
odel
.
nspred
;
nspred
=
M
_
.
nspred
;
iv
=
(
1
:
endo_nbr
)
'
;
iv
=
(
1
:
endo_nbr
)
'
;
if
~
DynareO
ptions
.
block
if
~
o
ptions
_
.
block
ic
=
[
nstatic
+
(
1
:
nspred
)
endo_nbr
+
(
1
:
size
(
DynareResults
.
dr
.
ghx
,
2
)
-
nspred
)
]
'
;
ic
=
[
nstatic
+
(
1
:
nspred
)
endo_nbr
+
(
1
:
size
(
oo_
.
dr
.
ghx
,
2
)
-
nspred
)
]
'
;
else
else
ic
=
DynareResults
.
dr
.
restrict_columns
;
ic
=
oo_
.
dr
.
restrict_columns
;
end
end
case
4
case
4
iv
=
DynareResults
.
dr
.
restrict_var_list
;
iv
=
oo_
.
dr
.
restrict_var_list
;
ic
=
DynareResults
.
dr
.
restrict_columns
;
ic
=
oo_
.
dr
.
restrict_columns
;
otherwise
otherwise
error
(
'dynare_resolve:: Error in the calling sequence!'
)
error
(
'dynare_resolve:: Error in the calling sequence!'
)
end
end
if
nargout
==
1
if
nargout
==
1
A
=
kalman_transition_matrix
(
DynareResults
.
dr
,
iv
,
ic
,
M
odel
.
exo_nbr
);
A
=
kalman_transition_matrix
(
oo_
.
dr
,
iv
,
ic
,
M
_
.
exo_nbr
);
return
return
end
end
[
A
,
B
]
=
kalman_transition_matrix
(
DynareResults
.
dr
,
iv
,
ic
,
M
odel
.
exo_nbr
);
[
A
,
B
]
=
kalman_transition_matrix
(
oo_
.
dr
,
iv
,
ic
,
M
_
.
exo_nbr
);
ys
=
DynareResults
.
dr
.
ys
;
ys
=
oo_
.
dr
.
ys
;
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