Parametric Estimators for Long Memory

Functions to estimate time series long memory models by parametric methods. Of particular interest is the ARFIMA model. Moreover, a method to estimate the HAR model, a specification usually used as a proxy for long memory dynamics, is also available.

LongMemory.ParametricEstimators.csa_cor_valsMethod
csa_cor_vals(T::Int, p::Real, q::Real)

Computes the autocorrelation function of the CSA process with parameters p and q at lags 0, 1, ..., T-1.

Arguments

  • T::Int: The number of lags to compute.
  • p::Real: The first parameter of the CSA process.
  • q::Real: The second parameter of the CSA process.

Output

  • acf::Array: The autocorrelation function of the CSA process with parameters p and q at lags 0, 1, ..., T-1.

Notes

This function uses csavarvals() to compute the autocovariance function and then normalizes by the variance (first computed value).

Examples

julia> csa_cor_vals(20, 0.4, 0.6)
source
LongMemory.ParametricEstimators.csa_llkMethod
csa_llk(p::Real, q::Real, x::Array)

Computes the log-likelihood of the CSA process with parameters p and q given the data x.

Arguments

  • p::Real: The first parameter of the CSA process.
  • q::Real: The second parameter of the CSA process.
  • x::Array: The data.

Output

  • llk::Real: The log-likelihood of the CSA process with parameters p and q given the data x.

Notes

This function computes the concentrated log-likelihood function of the CSA process with parameters p and q given the data x.

Examples

julia> csa_llk(1.4, 1.8, randn(100,1))
source
LongMemory.ParametricEstimators.csa_mle_estMethod
csa_mle_est(x::Array)

Computes the maximum likelihood estimate of the parameters p and q of the CSA process and the standard deviation of the CSA process given the data x.

Arguments

  • x::Array: The data.

Output

  • p::Real: The maximum likelihood estimate of the first parameter of the CSA process.
  • q::Real: The maximum likelihood estimate of the second parameter of the CSA process.
  • σ::Real: The maximum likelihood estimate of the standard deviation of the CSA process.

Notes

This function uses the Optim package to minimize the log-likelihood function.

Examples

julia> csa_mle_est(randn(100,1))
source
LongMemory.ParametricEstimators.csa_var_matrixMethod
csa_var_matrix(T::Int, d::Real)

Constructs the autocovariance matrix of the CSA process with parametersp and q at lags 0, 1, ..., T-1.

Arguments

  • T::Int: The number of lags to compute.
  • p::Real: The first parameter of the CSA process.
  • q::Real: The second parameter of the CSA process.

Output

  • V::Array: The autocovariance matrix of the CSA process with parameters p and q at lags 0, 1, ..., T-1.

Examples

julia> csa_var_matrix(10, 1.4, 1.8)
source
LongMemory.ParametricEstimators.csa_var_valsMethod
csa_var_vals(T::Int, p::Real, q::Real)

Computes the autocovariance function of the CSA process with parameters p and q at lags 0, 1, ..., T-1.

Arguments

  • T::Int: The number of lags to compute.
  • p::Real: The first parameter of the CSA process.
  • q::Real: The second parameter of the CSA process.

Output

  • acf::Array: The autocovariance function of the CSA process with parameters p and q at lags 0, 1, ..., T-1.

Notes

This function uses the recursive formula for the autocovariance function of the CSA process.

Examples

julia> csa_var_vals(20, 0.4, 0.6)
source
LongMemory.ParametricEstimators.fi_cor_valsMethod
fi_cor_vals(T::Int,d::Real)

Computes the autocorrelation function of the fractional differenced process with parameter d at lags 0, 1, ..., T-1.

Arguments

  • T::Int: The number of lags to compute.
  • d::Real: The fractional differencing parameter.

Output

  • vars::Array: The autocorrelation function of the fractional differenced process with parameter d at lags 0, 1, ..., T-1.

Notes

This function uses fivarvals() to compute the autocovariance function and then normalizes by the variance (first computed value).

Examples

julia> fi_cor_vals(10, 0.4)
source
LongMemory.ParametricEstimators.fi_llkMethod
fi_llk(d::Real, x::Array)

Computes the log-likelihood of the fractional differenced process with parameter d given the data x.

Arguments

  • d::Real: The fractional differencing parameter.
  • x::Array: The data.

Output

  • llk::Real: The log-likelihood of the fractional differenced process with parameter d given the data x.

Notes

This function computes the concentrated log-likelihood function of the fractional differenced process with parameter d given the data x.

Examples

julia> fi_llk(0.4, randn(100,1))
source
LongMemory.ParametricEstimators.fi_mle_estMethod
fi_mle_est(x::Array)

Computes the maximum likelihood estimate of the fractional differencing parameter and the standard deviation of the fractional differenced process given the data x.

Arguments

  • x::Array: The data.

Output

  • d::Real: The maximum likelihood estimate of the fractional differencing parameter.
  • σ::Real: The maximum likelihood estimate of the standard deviation of the fractional differenced process.

Notes

This function uses the Optim package to minimize the log-likelihood function.

Examples

julia> fi_mle_est(randn(100,1))
source
LongMemory.ParametricEstimators.fi_var_matrixMethod
fi_var_matrix(T::Int, d::Real)

Constructs the autocovariance matrix of the fractional differenced process with parameter d at lags 0, 1, ..., T-1.

Arguments

  • T::Int: The number of lags to compute.
  • d::Real: The fractional differencing parameter.

Output

  • V::Array: The autocovariance matrix of the fractional differenced process with parameter d at lags 0, 1, ..., T-1.

Examples

julia> fi_var_matrix(10, 0.4)
source
LongMemory.ParametricEstimators.fi_var_valsMethod
fi_var_vals(T::Int,d::Real)

Computes the autocovariance function of the fractional differenced process with parameter d at lags 0, 1, ..., T-1.

Arguments

  • T::Int: The number of lags to compute.
  • d::Real: The fractional differencing parameter.

Output

  • vars::Array: The autocovariance function of the fractional differenced process with parameter d at lags 0, 1, ..., T-1.

Notes

This function uses the recursive formula for the autocovariance function of the fractional differenced process.

Examples

julia> fi_var_vals(10, 0.4)
source
LongMemory.ParametricEstimators.har_estMethod
har_est(x::Array; m::Array = [1 , 5 , 22])

Estimates the parameters of the Heterogenous Autoregressive (HAR) model given the data x. See Corsi (2009).

Arguments

  • x::Array: The data.

Optional arguments

  • m::Array: An array with the lags to use in the estimation. By default, the lags are 1, 5, and 22; as suggested by the original paper.

Output

  • β::Array: The estimated parameters of the HAR model.
  • σ::Real: The estimated standard deviation of the HAR model.

Examples

julia> har_est(randn(100,1))
source
LongMemory.ParametricEstimators.my_toeplitzMethod
my_toeplitz(coefs::Array)

Constructs a Toeplitz matrix from the given coefficients.

Arguments

  • coefs::Array: An array of coefficients.

Output

  • Toep::Array: The Toeplitz matrix constructed from the given coefficients.

Examples

julia> my_toeplitz([1, 2, 3])
source

Documentation for LongMemory.jl.