DynareMain1.cc
-
Houtan Bastani authored
This only concerns the situation when `savemacro` is also passed. When `linemacro` is passed, the macro expanded .mod file is the same as before When `linemacro` is not passed, the macro expanded .mod file is equivalent to what it was before when both `noemptylinemacro` and `nolinemacro` were passed. closes #44 closes #45 (cherry picked from commit 1dbbd87d)
Houtan Bastani authoredThis only concerns the situation when `savemacro` is also passed. When `linemacro` is passed, the macro expanded .mod file is the same as before When `linemacro` is not passed, the macro expanded .mod file is equivalent to what it was before when both `noemptylinemacro` and `nolinemacro` were passed. closes #44 closes #45 (cherry picked from commit 1dbbd87d)
Time Series
Dynare provides a MATLAB/Octave class for handling time series data, which is based on a class for handling dates. Dynare also provides a new type for dates, so that the user does not have to worry about class and methods for dates. Below, you will first find the class and methods used for creating and dealing with dates and then the class used for using time series. Dynare also provides an interface to the X-13 ARIMA-SEATS seasonal adjustment program produced, distributed, and maintained by the U.S. Census Bureau (2020).
Dates
Dates in a mod file
Dynare understands dates in a mod file. Users can declare annual, bi-annual, quarterly, or monthly dates using the following syntax:
1990Y
1990S2
1990Q4
1990M11
Behind the scene, Dynare’s preprocessor translates these expressions
into instantiations of the MATLAB/Octave’s class dates
described
below. Basic operations can be performed on dates:
plus binary operator (+)
An integer scalar, interpreted as a number of periods, can be added to a date. For instance, ifa = 1950Q1
thenb = 1951Q2
andb = a + 5
are identical.
plus unary operator (+)
Increments a date by one period.+1950Q1
is identical to1950Q2
,++++1950Q1
is identical to1951Q1
.
minus binary operator (-)
Has two functions: difference and subtraction. If the second argument is a date, calculates the difference between the first date and the secmond date (e.g.1951Q2-1950Q1
is equal to5
). If the second argument is an integerX
, subtractsX
periods from the date (e.g.1951Q2-2
is equal to1950Q4
).
minus unary operator (-)
Subtracts one period to a date.-1950Q1
is identical to1949Q4
. The unary minus operator is the reciprocal of the unary plus operator,+-1950Q1
is identical to1950Q1
.
colon operator (:)
Can be used to create a range of dates. For instance,r = 1950Q1:1951Q1
creates adates
object with five elements:1950Q1, 1950Q2, 1950Q3, 1950Q4
and1951Q1
. By default the increment between each element is one period. This default can be changed using, for instance, the following instruction:1950Q1:2:1951Q1
which will instantiate adates
object with three elements:1950Q1
,1950Q3
and1951Q1
.
horzcat operator ([,])
Concatenates dates objects without removing repetitions. For instance[1950Q1, 1950Q2]
is adates
object with two elements (1950Q1
and1950Q2
).
vertcat operator ([;])
Same as horzcat
operator.
eq operator (equal, ==)
Tests if twodates
objects are equal.+1950Q1==1950Q2
returnstrue
,1950Q1==1950Q2
returnsfalse
. If the compared objects have bothn>1
elements, theeq
operator returns a column vector,n
by1
, of logicals.
ne operator (not equal, ~=)
Tests if twodates
objects are not equal.+1950Q1~=
returnsfalse
while1950Q1~=1950Q2
returnstrue
. If the compared objects both haven>1
elements, thene
operator returns ann
by1
column vector of logicals.
lt operator (less than, <)
Tests if adates
object preceeds anotherdates
object. For instance,1950Q1<1950Q3
returnstrue
. If the compared objects have bothn>1
elements, thelt
operator returns a column vector,n
by1
, of logicals.
gt operator (greater than, >)