Semiparametric Estimators for Long Memory

Functions to estimate the long memory parameter based on the log-periodogram regression. Estimators include the Geweke and Porter-Hudak estimators and the Whittle estimator.

LongMemory.LogPeriodEstimators.exact_whittle_est — Method
exact_whittle_est(x::AbstractArray; m::Real=0.8, l=0, demean::Bool = true)

Estimate the long memory parameter of a time series x using the exact Whittle log-likelihood function. See Shimotsu and Phillips (2005) for details.

Arguments

  • x::Vector: time series
  • m∈(0,1)::Float64: taper final
  • l∈(0,1)::Float64: taper initial
  • demean::Bool: If true, the time series is demeaned with the sample mean before estimation.

Output

  • d::Float64: long memory parameter

Notes

The function considers the periodogram of the time series x at the Fourier frequencies 2πj/T for j in [T^l,T^m] (rounded). The zero frequency is always excluded, so round(T^m) frequencies are used when l = 0. The condition l < m must hold. The default values of m and l are 0.8 and 0, respectively. The sample mean is a poor estimator of the mean when d > 1/2; see feasible_exact_whittle_est for a version that is robust to an unknown mean.

Examples

julia> exact_whittle_est(randn(100,1))
source
LongMemory.LogPeriodEstimators.exact_whittle_est_variance — Method
exact_whittle_est_variance(x::AbstractArray; m::Real=0.8)

Estimate the variance of the estimator for the long memory parameter of a time series x using the exact Whittle log-likelihood function.

Arguments

  • x::Vector: time series

Optional arguments

  • m∈(0,1)::Float64: taper final. Default is 0.8

Output

  • varb::Float64: variance of the estimator

Notes

Multiple dispatch is used for computation. If the first input is an integer, the function interprets it as the sample size; otherwise, it computes the sample size from the length of the time series. The variance is the same as the one from using the Whittle log-likelihood function.

Examples

julia> exact_whittle_est_variance(fi_gen(100,0.4))
source
LongMemory.LogPeriodEstimators.exact_whittle_est_variance — Method
exact_whittle_est_variance(T::Int; m::Real=0.8)

Estimate the variance of the estimator for the long memory parameter of a time series of length T using the exact Whittle log-likelihood function.

Arguments

  • T::Int: length of the time series

Optional arguments

  • m∈(0,1)::Float64: taper final. Default is 0.8

Output

  • varb::Float64: variance of the estimator

Notes

Multiple dispatch is used for computation. If the first input is an integer, the function interprets it as the sample size; otherwise, it computes the sample size from the length of the time series. The variance is the same as the one from using the Whittle log-likelihood function.

Examples

julia> exact_whittle_est_variance(100; m=0.8)
source
LongMemory.LogPeriodEstimators.exact_whittle_llk — Method
exact_whittle_llk(d, x::AbstractArray; m::Real=0.8, l=0)

Compute the exact Whittle log-likelihood function of a time series x for a given long memory parameter d. See Shimotsu and Phillips (2005) for details.

Arguments

  • d::Float64: long memory parameter
  • x::Vector: time series
  • m∈(0,1)::Float64: taper final
  • l∈(0,1)::Float64: taper initial

Output

  • Q::Float64: Whittle log-likelihood function

Notes

The function considers the periodogram of the time series x at the Fourier frequencies 2πj/T for j in [T^l,T^m] (rounded). The zero frequency is always excluded, so round(T^m) frequencies are used when l = 0. The condition l < m must hold. The default values of m and l are 0.8 and 0, respectively. The function demeans the time series x for long memory estimation.

Examples

julia> exact_whittle_llk(0.4,randn(100,1))
source
LongMemory.LogPeriodEstimators.feasible_exact_whittle_est — Method
feasible_exact_whittle_est(x::AbstractArray; m::Real=0.8, l=0)

Estimate the long memory parameter of a time series x with unknown mean using the feasible exact local Whittle estimator of Shimotsu (2010).

Arguments

  • x::Vector: time series
  • m∈(0,1)::Float64: taper final
  • l∈(0,1)::Float64: taper initial

Output

  • d::Float64: long memory parameter

Notes

The exact Whittle objective is evaluated on x - μ(d), where the mean estimate depends on d: μ(d) = w(d) x̄ + (1 - w(d)) x₁, with w(d) = 1 for d ≤ 1/2, w(d) = (1 + cos(4πd))/2 for 1/2 < d < 3/4, and w(d) = 0 for d ≥ 3/4. The sample mean is a good estimator of the mean for d < 1/2, while the first observation is a better one for d > 1/2. The objective is minimized over d∈[-1/2, 2] with Brent's method. The asymptotic variance is 1/(4m), the same as for the (exact) Whittle estimator, see exact_whittle_est_variance. The function considers the periodogram at the Fourier frequencies 2πj/T for j in [T^l,T^m] (rounded), excluding the zero frequency.

Examples

julia> feasible_exact_whittle_est(5 .+ fi_gen(500, 0.8))
source
LongMemory.LogPeriodEstimators.freq_band — Method
freq_band(T::Int, m::Real, l::Real)

Internal helper: indices into the output of periodogram for the Fourier frequencies λ_j = 2πj/T, j = max(1, round(T^l)), ..., round(T^m). The zero frequency (index 1) is always excluded, and the band is capped at the largest available Fourier frequency.

source
LongMemory.LogPeriodEstimators.gph_est — Method
gph_est(x::AbstractArray; m::Real=0.8, l=0, br=0::Int)

Estimate the long memory parameter of a time series x using the log-periodogram estimator. See Geweke and Porter-Hudak (1983) and Andrews and Guggenberger (2003) for details.

Arguments

  • x::Vector: time series
  • m∈(0,1)::Float64: taper final
  • l∈(0,1)::Float64: taper initial
  • br::Int64: number of bias reduction terms

Output

  • d::Float64: long memory parameter

Notes

The function considers the periodogram of the time series x at the Fourier frequencies 2πj/T for j in [T^l,T^m] (rounded). The zero frequency is always excluded, so round(T^m) frequencies are used when l = 0. The default values of m and l are 0.8 and 0, respectively. The condition l < m must hold.

The default value of br is 0 which returns the original GPH log-periodogram estimator.

Examples

julia> gph_est(randn(100,1))
source
LongMemory.LogPeriodEstimators.gph_est_variance — Method
gph_est_variance(x::AbstractArray; m::Real=0.8, l=0, br=0::Int)

Estimate the variance of the long memory parameter of a time series x using the log-periodogram estimator. See Geweke and Porter-Hudak (1983) and Andrews and Guggenberger (2003) for details.

Arguments

  • x::Vector: time series

Optional arguments

  • m∈(0,1)::Float64: taper final. Default is 0.8
  • br::Int64: number of bias reduction terms

Output

  • varb::Float64: variance of the long memory parameter

Notes

Multiple dispatch is used for computation. If the first input is an integer, the function interprets it as the sample size; otherwise, it computes the sample size from the length of the time series.

Examples

julia> gph_est_variance(fi_gen(100,0.4))
source
LongMemory.LogPeriodEstimators.gph_est_variance — Method
gph_est_variance(T::Int; m::Real=0.8, l=0, br=0::Int)

Estimate the variance of the long memory parameter of a time series of length T using the log-periodogram estimator. See Geweke and Porter-Hudak (1983) and Andrews and Guggenberger (2003) for details.

Arguments

  • T::Int: length of the time series

Optional arguments

  • m∈(0,1)::Float64: taper final. Default is 0.8
  • br::Int64: number of bias reduction terms

Output

  • varb::Float64: variance of the long memory parameter

Notes

Multiple dispatch is used for computation. If the first input is an integer, the function interprets it as the sample size; otherwise, it computes the sample size from the length of the time series.

Examples

julia> gph_est_variance(100; m=0.8)
source
LongMemory.LogPeriodEstimators.periodogram — Method
periodogram(x::AbstractArray)

Compute the periodogram of a time series x using the fast Fourier transform.

Arguments

  • x::Vector: time series

Output

  • I_w::Vector: periodogram
  • w::Vector: Fourier frequencies

Examples

julia> periodogram(randn(100,1))
source
LongMemory.LogPeriodEstimators.periodogram_plot — Method
periodogram_plot(x::AbstractArray; slope::Bool=false)

Plots the log-periodogram of a time series x.

Requires Plots.jl to be loaded, e.g. with using LongMemory, Plots.

Arguments

  • x::Vector: time series

Output

  • p1::Plots.Plot: log-periodogram

Optional arguments

  • slope::Bool: If true, the slope of the linear regression is displayed. Default is false.

Examples

julia> periodogram_plot(randn(100,1))
source
LongMemory.LogPeriodEstimators.whittle_est — Method
whittle_est(x::AbstractArray; m::Real=0.8, l=0)

Estimate the long memory parameter of a time series x using the Whittle log-likelihood function. See Künsch (1987) for details.

Arguments

  • x::Vector: time series
  • m∈(0,1)::Float64: taper final
  • l∈(0,1)::Float64: taper initial

Output

  • d::Float64: long memory parameter

Notes

The function considers the periodogram of the time series x at the Fourier frequencies 2πj/T for j in [T^l,T^m] (rounded). The zero frequency is always excluded, so round(T^m) frequencies are used when l = 0. The condition l < m must hold. The default values of m and l are 0.8 and 0, respectively.

Examples

julia> whittle_est(randn(100,1))
source
LongMemory.LogPeriodEstimators.whittle_est_variance — Method
whittle_est_variance(x::AbstractArray; m::Real=0.8)

Estimate the variance of the estimator for the long memory parameter of a time series x using the Whittle log-likelihood function. See Künsch (1987) for details.

Arguments

  • x::Vector: time series

Optional arguments

  • m∈(0,1)::Float64: taper final. Default is 0.8

Output

  • varb::Float64: variance of the estimator

Notes

Multiple dispatch is used for computation. If the first input is an integer, the function interprets it as the sample size; otherwise, it computes the sample size from the length of the time series. The variance is the same as the one from using the exact Whittle log-likelihood function.

Examples

julia> whittle_est_variance(fi_gen(100,0.4))
source
LongMemory.LogPeriodEstimators.whittle_est_variance — Method
whittle_est_variance(T::Int;m::Real=0.8)

Estimate the variance of the estimator for the long memory parameter of a time series of length T using the Whittle log-likelihood function. See Künsch (1987) for details.

Arguments

  • T::Int: length of the time series

Optional arguments

  • m∈(0,1)::Float64: taper final. Default is 0.8

Output

  • varb::Float64: variance of the estimator

Notes

Multiple dispatch is used for computation. If the first input is an integer, the function interprets it as the sample size; otherwise, it computes the sample size from the length of the time series. The variance is the same as the one from using the exact Whittle log-likelihood function.

Examples

julia> whittle_est_variance(100; m=0.8)
source
LongMemory.LogPeriodEstimators.whittle_llk — Method
whittle_llk(d, x::AbstractArray; m::Real=0.8, l=0)

Compute the Whittle log-likelihood function of a time series x for a given long memory parameter d. See Künsch (1987) for details.

Arguments

  • d::Float64: long memory parameter
  • x::Vector: time series
  • m∈(0,1)::Float64: taper final
  • l∈(0,1)::Float64: taper initial

Output

  • Q::Float64: Whittle log-likelihood function

Notes

The function considers the periodogram of the time series x at the Fourier frequencies 2πj/T for j in [T^l,T^m] (rounded). The zero frequency is always excluded, so round(T^m) frequencies are used when l = 0. The condition l < m must hold. The default values of m and l are 0.8 and 0, respectively.

Examples

julia> whittle_llk(0.4,randn(100,1))
source

Documentation for LongMemory.jl.