Reference guide

Index

API

HypothesisTests.LjungBoxTestMethod
LjungBoxTest(data::Vector{T}, vars::Vector{T}, lag::Integer=1)

Compute the Ljung-Box Q statistic to test the null hypothesis of independence in the violations/hits sequence that is implied by the vectors of realizations (data) and Value-at-Risk forecasts(vars). lag specifies the number of lags used in the construction of Q

source
ValueAtRisk.BacktestResultMethod
BacktestResult(dataset::String, vm::VaRModel, windowsize::Integer, level::T1
               data::Vector{T1}, vars::Vector{T1}; lags::Integer=1) where T1<:Real

Create an object of type BacktestResult. dataset specifies the name of the dataset on which Value-at-Risk backtesting was performed. vm specifies the VaRModel used for obtaining Value-at-Risk estimates. windowsize specifies the number of in-sample observations that were used to obtain each out-of-sample VaR forecast. level is VaR quantile level. data is the vector of realizations, while vars is the vector of VaR estimates. The optional parameter lags specifies the number of lags used in the DQTest and LjungBoxTest for testing the time independence of the violations/hits sequence of VaR estimates.

source
ValueAtRisk.LRucTestType
DQTest <: HypothesisTest

Christoffersen's (1998) Unconditional Coverage Likelihood Ratio test (out of sample)

source
ValueAtRisk.LRucTestMethod
LRucTest(violations::AbstractArray{Bool},level)

Conduct Christoffersen's (1998) Unconditional Coverage Likelihood Ratio test by passing a a AbstractArray{Bool} representing the violations/hits sequence and the VaRModel quantile level

source
ValueAtRisk.LRucTestMethod
LRucTest(data::Vector{T}, vars::Vector{T},level)

Conduct Christoffersen's (1998) Unconditional Coverage Likelihood Ratio test by passing a a vector of realizations accompanied by a vector of the correponding VaR forecasts and the VaRModel quantile level

source
StatsAPI.predictMethod
predict(vm::VaRModel, data::AbstractVector)

Return a one-step ahead VaR forecast with VaRModel vm for the provided data vector

source
ValueAtRisk.backtestMethod
backtest(vms::Vector{<:VaRModel}, data::Vector{<:Real},
              windowsize::Integer;dataset_name::String="Dataset name not specified",
              lags::Integer=5)

Backtests a single VaRModel on the supplied dataset. windowsize specifies the number of in-sample observations used for forecasting Value-at-Risk. backtest(...) returns an object of type BacktestResult. The optional parameter lags controls the number of lags used in the the tests of time independence. dataset_name may be provided in order to be included in the BacktestResult

source
ValueAtRisk.backtestMethod
backtest(vms::Vector{<:VaRModel}, data::Vector{<:Real},
              windowsize::Integer;dataset_name::String="Dataset name not specified",
              lags::Integer=5)

Backtest multiple VaRModels on the supplied dataset. windowsize specifies the number of in-sample observations used for forecasting Value-at-Risk. backtest(...) returns a vector of BacktestResults. The optional parameter lags controls the number of lags used in the the tests of time independence. dataset_name may be provided in order to be included in the BacktestResult

source
ValueAtRisk.dupefitMethod
dupefit(asp::ARCHSpec, data::AbstractVector; prefitted::Union{ARCHMode[l,Nothing}=nothing])

A wrapper around flexfit(asp::ARCHSpec, data::AbstractVector) that fits an ARCHModel only once if multiple VaR models depend on the same underlying ARCHSpec in order to avoid wasted repetitions

source
ValueAtRisk.flexfitMethod
flexfit(asp::ARCHSpec, data::AbstractVector)

A wrapper around fit(VS::Type{<:UnivariateVolatilitySpec}, data; dist=StdNormal, meanspec=Intercept, algorithm=BFGS(), autodiff=:forward, kwargs...) that catches AssertionErrors thrown when the requested ARCHSpec could not be fitted and falls back to fitting GARCH{1,1} as the volatility specification

source
ValueAtRisk.shares_arch_dynamicsMethod
shares_arch_dynamics(vm::VaRModel)

Whether the given model contains a specification for autoregressive conditionaly heteroskedastic dynamics. If models share such a specification the model is fitted only once during backtesting

source
ValueAtRisk.shortnameMethod
shortname(asp::ARCHSpec)

Print a short description for the ARCHSpec given. Orders of ARCH models and mean specifications are ignored

source