#
TimeAxisArrays.collapse
— Function.
collapse(A::TimeAxisArray, tsreducer::Function, reducer::Function=tsreducer)
Collapses the timestamps of A
to a single observation in the time dimension using tsreducer
. Data is collapsed in the time dimension using reducer
, which defaults to tsreducer
.
#
TimeAxisArrays.downsample
— Function.
downsample(A::TimeAxisArray, splitter::Function, tsreducer::Function, reducer::Function=tsreducer)
Combines split
, collapse
, and vcat
to partition A
according to sequential values in the mapping of splitter
over the timestamps of A
, then collapses each of the split TimeAxisArrays according to tsreducer
(for timestamps) and reducer
(for data), before recombining the collapsed values.
#
TimeAxisArrays.dropif
— Method.
dropif(selector::Function, predicate::Function, A::TimeAxisArray)
Drops observations at timestamps where selector
(e.g. any
, all
) data values statisfy predicate
.
#
TimeAxisArrays.dropnan
— Function.
dropnan(selector::Function, A::TimeAxisArray)
Drops observations at timestamps where selector
(e.g. any
, all
) data values are NaN. Equivalent to dropif(selector, isnan, A)
#
TimeAxisArrays.lag
— Function.
lag(A::TimeAxisArray, k::Int=1)
Shifts all observations in A
later in time by k
timestamps.
#
TimeAxisArrays.lead
— Function.
lead(A::TimeAxisArray, k::Int=1)
Shifts all observations in A
earlier in time by k
timestamps.
#
TimeAxisArrays.moving
— Method.
moving(A::TimeAxisArray, reducer::Function, n::Int)
Applies a time-wise reduction specified by reducer
to a moving window of n
observations, storing the result at the last timestamp in the window.
#
TimeAxisArrays.percentchange
— Method.
percentchange(A::TimeAxisArray; logdiff::Bool=false)
Computes the percent change between observations in time in A
. If logdiff
is true, returns the difference of log-transformed values.
#
Base.LinAlg.diff
— Function.
diff(A::TimeAxisArray, k::Int=1)
Perform k
th order differencing across time observations in A
.
#
Base.split
— Method.
split(A::TimeAxisArray, f::Function)
Returns an array containing sequential fragments of A
, split according to clusters of values in the mapping of f
over the timestamps of A
. split(f, A)
is also defined so as to support do-notation.