Home
Introduction
TimeSeriesEcon
— ModuleTimeSeriesEcon
This package is part of the StateSpaceEcon ecosystem. TimeSeriesEcon.jl provides functionality to work with low-Frequency discrete macroeconomic time-series data.
Frequencies (abstract type):
- Unit
- Monthly
- Quarterly
- Yearly
Types:
MIT{Frequency}
(aka "Moment In Time")- a primitive type denoting monthly, quarterly, and yearly dates
TSeries{Frequency}
- an
AbstractVector
that can be indexed usingMIT
- an
Functions:
MIT
Constructors/Functionsmm(year::Int, period::Int)
: returns a monthlyMIT
type instanceqq(year::Int, period::Int)
: returns a quarterlyMIT
type instanceyy(year::Int)
: returns a yearlyMIT
type instanceii(x::Int)
: returns a unitMIT
type instanceyear(x::MIT)
: returns aInt64
year value associated withx
period(x::MIT)
: returns aInt64
period value associated withx
- Functions operating on
TSeries
mitrange(x::TSeries)
: returns aUnitRange{MIT{Frequency}}
for the givenx
firstdate(x::TSeries)
: returnsMIT{Frequency}
first date associated withx
lastdate(x::TSeries)
: returnsMIT{Frequency}
last date associated withx
ppy(x::TSeries)
: returns the number of periods per year forx::TSeries
. (ppy
also acceptsx::MIT
andx::Frequency
)shift(x::TSeries, i::Int64)
: shifts the dates ofx
byfirstdate(x) - i
shift!
: in-place version ofshift
pct(x::TSeries, shift_value::Int64; islog::Bool = false)
: calculates percent rate of change ofx::TSeries
apct(x::TSeries, islog::Bool = false)
: calculates annualized percent rate of change ofx::TSeries
nanrm!(x::TSeries, type::Symbol=:both)
: removesNaN
fromx::TSeries