Additional Functions

Useful or Helper Functions

Here are functions that have a usecase in other areas that fall not strictlly into any offical categories for trend estimation.

TrendDecomposition.greatestConvexMinorantFunction
greatestConvexMinorant(y :: Vector)

Computes greatest convex minorant of series y using the pool-adjecent-violators algorithm

Returns the coordinates of the knots as a tuple (x, y)

source
TrendDecomposition.leastConcaveMajorantMethod
leastConcaveMajorant(y :: Vector)

Computes least concave majorant (lcm) of series y using the pool-adjecent-violators algorithm

Returns the coordinates of the knots as a tuple (x, y)

source

Autocovariance

TrendDecomposition.autoCovarianceFunction
autoCovariance(X :: Vector, T::Int;
             maxLag::Int=T-1, method::Symbol=:classic, covar::Bool=false, demean::Bool=false)

Calculates the autocovariance of time series X with length T, by default it is assumed that the data is already centered (demean=false). For large series the method :fourier can be choosen, which uses the fast fourier transform.

Returns a (maxLag x 1) vector of the autocovariance. For the method :fourier with covar=true a tulpe containing the covariance scalar and autocovariance vector is returned.

source

Experimental

Here are functions that are only experimental in use but could be useful for some specific purposes.

TrendDecomposition.trendL1FilterFunction
trendL1Filter(y :: Vector, λ :: Real; m = 2, max_iter=20, method = :ADMM)

Placeholder for trendL1Filter extension, when using TrendDecomposition together with other Julia packages like Convex.jl and SCS.jl.

This function provides the generic use of serveral optimization methods to compute a numerical solution. Following methods are implmented: :ADMM -> alternating direction method of multipliers :ConvexSCS -> SCS solver with Convex.jl. Prerequisite! Import necessary modules with: using Convex, SCS

The function returns the estimated trend component

source