Time series
In the previous section, we looked at data regarding Apple (AAPL
) stock prices. This has a particular format with a date (or timestamp) as the first value in the row, followed by a series of related usually numeric values, and is termed a time series.
Time series are common when analyzing financial data and, in particular, the special discipline of econometrics.
Julia has a special type for time series and a package maintained by the Julia Stats group (https://juliastats.org/TimeSeries.jl/dev/timearray/) called TimeSeries
that defines the type for time array and provides several routines to manipulate the data in it.
Note
Be careful not to use the older package from the Julia Quant group (https://github.com/JuliaQuant/Timestamps.jl) as this has fallen somewhat into neglect recently.
We need to install the TimeSeries
package in the usual way (that is, with the Pkg manager) and create a time array directly from a CSV file.
This stocks4.csv
file contains...