backtest_lr: Exact finite‑sample back‑test for a VaR exception series

View source: R/wrappers.R

backtest_lrR Documentation

Exact finite‑sample back‑test for a VaR exception series

Description

Exact finite‑sample back‑test for a VaR exception series

Usage

backtest_lr(
  x,
  alpha = 0.05,
  type = c("uc", "ind", "cc"),
  sig = 0.05,
  prune_threshold = 1e-15
)

Arguments

x

0/1 exception series.

alpha

Exception probability.

type

"uc", "ind" or "cc".

sig

Significance level (default 0.05).

prune_threshold

Passed to the dynamic‑programming engine.

Value

An object of class "ExactVaRBacktest" (a named list) with components: stat (numeric LR statistic), pval (numeric exact p-value in [0,1]), reject (logical; TRUE if p < sig), type (character; one of "uc", "ind", "cc"), alpha (numeric model exception probability), sig (numeric significance level), n (integer sample size).

Examples

set.seed(123)
x <- rbinom(250, 1, 0.01)
backtest_lr(x, alpha = 0.01, type = "uc")

ExactVaRTest documentation built on Aug. 23, 2025, 1:11 a.m.