Getting Started
TimeSeries
is a registered package. To add it to your Julia packages, simply do the following in REPL:
julia> Pkg.add("TimeSeries")
Throughout this tutorial, we'll be using historical financial data sets, which are made available in the MarketData
package. MarketData
is also registered and can be added:
julia> Pkg.add("MarketData")
To create dummy data without using the MarketData
package, simply use the following code block:
dates = collect(Date(1999,1,1):Date(2000,12,31))
mytime = TimeArray(dates, rand(length(dates)))
731x1 TimeSeries.TimeArray{Float64,1,Date,Array{Float64,1}} 1999-01-01 to 2000-12-31
│ │ │
├────────────┼────────┤
│ 1999-01-01 │ 0.1639 │
│ 1999-01-02 │ 0.1058 │
│ 1999-01-03 │ 0.0913 │
│ 1999-01-04 │ 0.2892 │
│ 1999-01-05 │ 0.6427 │
│ 1999-01-06 │ 0.8739 │
│ 1999-01-07 │ 0.0116 │
│ 1999-01-08 │ 0.4762 │
│ 1999-01-09 │ 0.3715 │
⋮
│ 2000-12-24 │ 0.9698 │
│ 2000-12-25 │ 0.4503 │
│ 2000-12-26 │ 0.6339 │
│ 2000-12-27 │ 0.1686 │
│ 2000-12-28 │ 0.5043 │
│ 2000-12-29 │ 0.3658 │
│ 2000-12-30 │ 0.5257 │
│ 2000-12-31 │ 0.6741 │