Commit 05e06aaf authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Rewrote description of dseries' constructors. Added a list of the dseries class' members.

parent 75ca1632
......@@ -83,6 +83,10 @@
@code{dates }
@end macro
@macro dseries
@code{dseries }
@end macro
@c %**end of header
@copying
......@@ -8977,46 +8981,88 @@ ans = <dates: 1945Q4, 1939Q1, 1973Q2>
@end deftypefn
@node dseries class
@section dseries class
@section dseries
The Matlab/Octave @dseries class handles time series data. As any Matlab/Octave statements, this class can be used in a Dynare's mod file. A @dseries object has eight members:
@deftypefn {dseries} dseries (@code{dates})
@deftypefnx {dseries} dseries (@code{FILENAME})
@deftypefnx {dseries} dseries (@code{DOUBLE_MATRIX}, @code{dates}, @code{CELLSTR}, @code{CELLSTR})
@deftypefnx {dseries} dseries (@code{DOUBLE_MATRIX}, @code{STRING}, @code{CELLSTR}, @code{CELLSTR})
Returns a @code{dseries} object that represents one or more time
series.
@table @code
@anchor{dseries class members}
If a @code{dates} argument is provided, instantiate an empty
@code{dseries} with an inital date equal to the input argument.
@item nobs
A scalar integer, the number of observations.
If a @code{FILENAME} is passed as input, a @code{dseries} object
will be created from the named file. Valid file types are @file{.m}
file, @file{.mat} file, and @file{.csv}.
@item vobs
A scalar integer, the number of variables.
If the data is not read from a file, it can be provided via a
@math{T}x@math{N} matrix as the first argument to @code{dseries}, with
@math{T} representing the number of observations on @math{N}
variables. The second argument in such a calling sequence can be
either a @code{dates} representing the period of the first
observation or a @code{STRING} which would be used to instantiate a
@code{dates}. The third argument is a @code{CELLSTR} of size
@math{N} with one entry for each variable name. The final argument is
a @code{CELLSTR} of size @math{N} composed of the @LaTeX{} names
associated with the variables. Input arguments three and four are
optional.
@item name
A cell of strings, the names of the variables.
@examplehead
@item tex
A cell of strings, the tex names of the variables.
An example of various ways to create a @code{dynSeries} object:
@item freq
A scalar integer equal to 1, 4, 12 or 52, the frequency of the dataset.
@item init
A single element @dates object, the initial date of the sample.
@item dates
A @dates object with @code{nobs} element, the dates of the sample.
@item data
A @code{nobs} by @code{vobs} array of doubles, the data.
@end table
@noindent The following constructors are available:
@deftypefn {dseries} dseries ()
@deftypefnx {dseries} dseries (@var{INITIAL_DATE})
Instantiates an empty @dseries object, with, if defined, an initial date given by the single element @dates object @var{INITIAL_DATE} (the frequency is then set accordingly).
@end deftypefn
@sp 1
@deftypefn {dseries} dseries (@var{FILENAME})
Instantiates and populates a @dseries object with a data file specified by @var{FILENAME}, a string passed as input. Valid file types are @file{.m} file, @file{.mat} file, and @file{.csv}.
@example
do1 = dynSeries(dynDate(1999));
do2 = dynSeries(`filename.csv');
do3 = dynSeries([1; 2; 3], dynDate(1999), @{`var123'@}, @{`var_@{123@}'@});
@end example
@end deftypefn
@sp 1
@deftypefn {dseries} dseries (@var{DATA_MATRIX}, @var{INITIAL_DATE}, @var{LIST_OF_NAMES}, @var{LIST_OF_TEX_NAMES})
If the data is not read from a file, it can be provided via a @math{T}x@math{N} matrix as the first argument to @code{dseries}' constructor, with @math{T} representing the number of observations on @math{N} variables. The second argument, @var{INITIAL_DATE}, can be either a @dates object representing the period of the first observation or a string which would be used to instantiate a @dates object. The third argument, @var{LIST_OF_NAMES}, is a @math{1} by @math{N} cell of strings with one entry for each variable name. The final argument, @var{LIST_OF_TEX_NAMES}, is a @math{1} by @math{N} cell of strings composed of the @LaTeX{} names associated with the variables. Input arguments three and four are optional.
@end deftypefn
@sp 1
@exampleshead
Various ways to create a @code{dseries} object:
@sp 1
@example In a mod file:
do1 = dseries(1999Q3);
do2 = dseries(`filename.csv');
do3 = dseries([1; 2; 3], 1999Q3, @{`var123'@}, @{`var_@{123@}'@});
@end example
@sp1
@example In a Matlab/Octave script:
do1 = dseries(dates('1999Q3'));
do2 = dseries(`filename.csv');
do3 = dseries([1; 2; 3], dates('1999Q3'), @{`var123'@}, @{`var_@{123@}'@});
@end example
@node Reporting
@chapter Reporting
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment