Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Houtan Bastani
obsmacro-dynare-json
Commits
0fcd79b0
Verified
Commit
0fcd79b0
authored
Jan 27, 2020
by
Houtan Bastani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more small changes, still testing the CI
parent
034434a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
dynare-preprocessor-w-json.rst
dynare-preprocessor-w-json.rst
+9
-11
No files found.
dynare-preprocessor-w-json.rst
View file @
0fcd79b0
...
...
@@ -554,20 +554,19 @@ this node given the ``dseries`` contained in ``ds``.
end
In
the
evaluation
of
the
observed
variable
(``
X
``
in
this
local
function
,
``
Y
``
in
the
main
routine
),
what
's important to us is lines 313-342. In particular,
our OLS routine handles an observable variable declared as an endogenous or
exogenous variable, with or without a unary operator applied to it. Given the
case it falls in (``VariableNode`` or ``UnaryOpNode``), the LHS (``node``) is
evaluated using the ``dseries`` (``ds``) and the corresponding ``dseries``
vector is returned.
in
the
main
routine
),
what
's important to us is lines 313-342 as we know it'
s
either
a
``
VariableNode
``
or
a
``
UnaryOpNode
``.
Regardless
of
the
type
of
node
it
is
,
it
's evaluated using the ``dseries`` (``ds``) and the corresponding
``dseries`` vector is returned. In our case, the interest rate ``r`` is
evaluated on line 317 by looking up its value in ``ds``.
Though our work for ``Y`` was easy,
the work to
comput
e
the matrix of
regressors and the
vector of constants
,
will
tak
e a bit more
work
.
Though our work for ``Y`` was easy, comput
ing
the matrix of
regressors and the
vector of constants will
b
e a bit more
involved
.
Back in the main function, before we can create the matrix of regressors ``X``,
we decompose the RHS (``arg2``) of the equation into additive terms, storing
them in a cell array called ``terms``. We do this by calling the locally
defined function
``decomposeAdditiveTerms``
:
defined function:
.. code-block:: MATLAB
:linenos: inline
...
...
@@ -602,8 +601,7 @@ As you can see, ``decomposeAdditiveTerms`` is a recursive, tree-traversal
function that breaks down terms separated by ``+`` or ``-``, storing them in
the return value, ``terms``. Each cell in the return value is comprised of a
pair of elements: the root node of the sub-tree representing the additive node
and the sign in preceding this node. That sign will be used in the construction
of the matrix, setting the sign of the data accordingly.
and the sign preceding this node (``1`` or ``-1``).
Given the equation we want to estimate (shown here from
``Smets_Wouters_2007.mod`` as a reminder),
...
...
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