Reference guide

Reference guide

Index

Public API

The ARCHModels package for Julia. For documentation, see https://s-broda.github.io/ARCHModels.jl/dev.

source
ARCHModels.BG96Constant.
BG96

Data from Bollerslev and Ghysels (JBES 1996).

source
ARCHModels.ARCHType.
ARCH{q, T<:AbstractFloat} <: VolatilitySpec{T}

ARCH{q}(coefs) -> VolatilitySpec

Construct an ARCH specification with the given parameters.

Example:

julia> ARCH{2}([1., .3, .4])
TGARCH{0,0,2} specification.

               ω  α₁  α₂
Parameters:  1.0 0.3 0.4
source
ARCHLMTest(am::UnivariateARCHModel, p=max(o, p, q, ...))

Conduct Engle's (1982) LM test for autoregressive conditional heteroskedasticity with p lags in the test regression.

source
ARCHLMTest <: HypothesisTest

Engle's (1982) LM test for autoregressive conditional heteroskedasticity.

source
ARCHLMTest(u::Vector, p::Integer)

Conduct Engle's (1982) LM test for autoregressive conditional heteroskedasticity with p lags in the test regression.

source
ARCHModel <: StatisticalModel
source
ARCHModels.ARMAMethod.
ARMA{p, q}(coefs::Vector)

Create an ARMA(p, q) model.

source
DQTest <: HypothesisTest

Engle and Manganelli's (2004) out-of-sample dynamic quantile test.

source
ARCHModels.DQTestMethod.
DQTest(data, vars, level, p=1)

Conduct Engle and Manganelli's (2004) out-of-sample dynamic quantile test with p lags in the test regression. vars shoud be a vector of out-of-sample Value at Risk predictions at level level.

source
EGARCH{o, p, q, T<:AbstractFloat} <: VolatilitySpec{T}
source
ARCHModels.EGARCHMethod.
EGARCH{o, p, q}(coefs) -> VolatilitySpec

Construct an EGARCH specification with the given parameters.

Example:

julia> EGARCH{1, 1, 1}([-0.1, .1, .9, .04])
EGARCH{1,1,1} specification.

                ω  γ₁  β₁   α₁
Parameters:  -0.1 0.1 0.9 0.04
source
GARCH{p, q, T<:AbstractFloat} <: VolatilitySpec{T}

GARCH{p, q}(coefs) -> VolatilitySpec

Construct a GARCH specification with the given parameters.

Example:

julia> GARCH{2, 1}([1., .3, .4, .05 ])
TGARCH{0,2,1} specification.

               ω  β₁  β₂   α₁
Parameters:  1.0 0.3 0.4 0.05
source
Intercept{T} <: MeanSpec{T}

A mean specification with just an intercept.

source
Intercept(mu)

Create an instance of Intercept. mu can be passed as a scalar or vector.

source
MeanSpec{T}

Abstract supertype that mean specifications inherit from.

source
NoIntercept{T} <: MeanSpec{T}

A mean specification without an intercept (i.e., the mean is zero).

source
NoIntercept(T::Type=Float64)
NoIntercept{T}()
NoIntercept(v::Vector)

Create an instance of NoIntercept.

source
Standardized{D<:ContinuousUnivariateDistribution, T}  <: StandardizedDistribution{T}

A wrapper type for standardizing a distribution from Distributions.jl.

source
StandardizedDistribution{T} <: Distributions.Distribution{Univariate, Continuous}

Abstract supertype that standardized distributions inherit from.

source
StdGED{T} <: StandardizedDistribution{T}

The standardized (mean zero, variance one) generalized error distribution.

source
ARCHModels.StdGEDMethod.
StdGED(p)

Create a standardized generalized error distribution parameter p. p can be passed as a scalar or vector.

source
StdNormal{T} <: StandardizedDistribution{T}

The standard Normal distribution.

source
StdNormal(T::Type=Float64)
StdNormal(v::Vector)
StdNormal{T}()

Construct an instance of StdNormal.

source
ARCHModels.StdTType.
StdT{T} <: StandardizedDistribution{T}

The standardized (mean zero, variance one) Student's t distribution.

source
ARCHModels.StdTMethod.
StdT(v)

Create a standardized t distribution with v degrees of freedom. ν` can be passed as a scalar or vector.

source
TGARCH{o, p, q, T<:AbstractFloat} <: VolatilitySpec{T}
source
ARCHModels.TGARCHMethod.
TGARCH{o, p, q}(coefs) -> VolatilitySpec

Construct a TGARCH specification with the given parameters.

Example:

julia> TGARCH{1, 1, 1}([1., .04, .9, .01])
TGARCH{1,1,1} specification.

               ω   γ₁  β₁   α₁
Parameters:  1.0 0.04 0.9 0.01
source
UnivariateARCHModel{T<:AbstractFloat,
          		    VS<:VolatilitySpec,
          			SD<:StandardizedDistribution{T},
          			MS<:MeanSpec{T}
          			} <: StatisticalModel
source
UnivariateARCHModel(spec::VolatilitySpec, data::Vector; dist=StdNormal(),
          			meanspec=NoIntercept(), fitted=false
          			)

Create a UnivariateARCHModel.

Example:

julia> UnivariateARCHModel(GARCH{1, 1}([1., .9, .05]), randn(10))

TGARCH{0,1,1} model with Gaussian errors, T=10.


                             ω  β₁   α₁
Volatility parameters:     1.0 0.9 0.05
source
VolatilitySpec{T}

Abstract supertype that volatility specifications inherit from.

source
ARCHModels.VaRsFunction.
VaRs(am::UnivariateARCHModel, level=0.01)

Return the in-sample Value at Risk implied by am.

source
ARCHModels.meansMethod.
means(am::UnivariateARCHModel)

Return the conditional means of the model.

source
selectmodel(::Type{VS}, data; kwargs...) -> UnivariateARCHModel

Fit the volatility specification VS with varying lag lengths and return that which minimizes the BIC.

Keyword arguments:

  • dist=StdNormal: the error distribution.
  • meanspec=Intercept: the mean specification, either as a type or instance of that type.
  • maxlags=3: maximum lag length to try in each parameter of VS.
  • criterion=bic: function that takes a UnivariateARCHModel and returns the criterion to minimize.
  • show_trace=false: print criterion to screen for each estimated model.
  • algorithm=BFGS(), autodiff=:forward, kwargs...: passed on to the optimizer.

Example

julia> selectmodel(EGARCH, BG96)

EGARCH{1,1,2} model with Gaussian errors, T=1974.


Mean equation parameters:

        Estimate  Std.Error   z value Pr(>|z|)
μ    -0.00900018 0.00943948 -0.953461   0.3404

Volatility parameters:

       Estimate Std.Error   z value Pr(>|z|)
ω    -0.0544398 0.0592073 -0.919478   0.3578
γ₁   -0.0243368 0.0270414 -0.899985   0.3681
β₁     0.960301 0.0388183   24.7384   <1e-99
α₁     0.405788  0.067466    6.0147    <1e-8
α₂    -0.207357  0.114161  -1.81636   0.0693
source
ARCHModels.simulateFunction.
simulate(am::UnivariateARCHModel; warmup=100)
simulate(am::UnivariateARCHModel, nobs; warmup=100)
simulate(spec::VolatilitySpec, nobs; warmup=100, dist=StdNormal(), meanspec=NoIntercept())

Simulate a UnivariateARCHModel.

source
simulate!(am::UnivariateARCHModel; warmup=100)

Simulate a UnivariateARCHModel, modifying am in place.

source
volatilities(am::UnivariateARCHModel)

Return the conditional volatilities.

source
StatsBase.fit!Method.
fit!(am::UnivariateARCHModel; algorithm=BFGS(), autodiff=:forward, kwargs...)

Fit the UnivariateARCHModel specified by am, modifying am in place. Keyword arguments are passed on to the optimizer.

source
StatsBase.fitMethod.
fit(am::UnivariateARCHModel; algorithm=BFGS(), autodiff=:forward, kwargs...)

Fit the UnivariateARCHModel specified by am and return the result in a new instance of UnivariateARCHModel. Keyword arguments are passed on to the optimizer.

source
StatsBase.fitMethod.
fit(VS::Type{<:VolatilitySpec}, data; dist=StdNormal, meanspec=Intercept,
    algorithm=BFGS(), autodiff=:forward, kwargs...)

Fit the ARCH model specified by VS to data.

Keyword arguments:

  • dist=StdNormal: the error distribution.
  • meanspec=Intercept: the mean specification, either as a type or instance of that type.
  • algorithm=BFGS(), autodiff=:forward, kwargs...: passed on to the optimizer.

Example: EGARCH{1, 1, 1} model without intercept, Student's t errors.

julia> fit(EGARCH{1, 1, 1}, BG96; meanspec=NoIntercept, dist=StdT)

EGARCH{1,1,1} model with Student's t errors, T=1974.


Volatility parameters:

       Estimate Std.Error   z value Pr(>|z|)
ω    -0.0162014 0.0186806 -0.867286   0.3858
γ₁   -0.0378454  0.018024  -2.09972   0.0358
β₁     0.977687  0.012558   77.8538   <1e-99
α₁     0.255804 0.0625497   4.08961    <1e-4

Distribution parameters:

     Estimate Std.Error z value Pr(>|z|)
ν     4.12423   0.40059 10.2954   <1e-24
source
StatsBase.fitMethod.
fit(::Type{SD}, data; algorithm=BFGS(), kwargs...)

Fit a standardized distribution to the data, using the MLE. Keyword arguments are passed on to the optimizer.

source
StatsBase.predictMethod.
predict(am::UnivariateARCHModel, what=:volatility; level=0.01)

Form a 1-step ahead prediction from am. what controls which object is predicted. The choices are :volatility (the default), :variance, :return, and :VaR. The VaR level can be controlled with the keyword argument level.

source
residuals(am::UnivariateARCHModel; standardized=true)

Return the residuals of the model. Pass standardized=false for the non-devolatized residuals.

source