Skip to content

databank.toArray (+databank)

Create numeric array from time series data

Syntax

[outputArray, names, dates] = databank.toArray(inputDb, names, dates, columns)

Input arguments

inputDb [ struct | Dictionary ]

Input databank from which the time series data will be retrieved and converted to a numeric array.

names [ string | @all ]

List of time series names whose data will be retrieved from the inputDb; names=@all means all time series fields will be included.

dates [ Dater | "unbalanced" | "balanced" ]

Dates for which the time series data will be retrieved; the date frequency of the dates must be consistent with the date frequency of all time series listed in names.

  • dates=Inf is the same as dates="unbalanced".

  • dates="unbalanced" means the dates will be automatically determined to cover an unbalanced panel of data (the earliest available observation among all time series to the latest).

  • dates="balanced" means the dates will automatically determined to cover a balanced panel of data (the earliest data at which data are available for all time series to the latest date at which data are available for all time series).

columns=1 [ numeric ]

Column or columns that will be retrieved from the time series data; if multiple columns are specified, the data will be flattened in 2nd dimension; columns=1 if omitted.

Output arguments

outputArray [ numeric ]

Numeric array created from the time series data from the fields listed in names and dates specified in dates.

names [ string ]

The names of the time series included in the outputArray; useful when the input argument names=@all.

dates [ Dater ]

The dates for which the time series data were retrieved and included in the outputArray; useful when the input argument dates=Inf.

Description

Examples