plot_var: Plot returns with the one-step-ahead Value at Risk

View source: R/risk.R

plot_varR Documentation

Plot returns with the one-step-ahead Value at Risk

Description

Plots the returns with -VaR and -ES from var_es and marks the exceedances, the returns below -VaR.

Usage

plot_var(x, level = NULL, dates = NULL)

Arguments

x

A data.table returned from var_es.

level

The level to plot. The default is the largest level in x.

dates

Optional vector of dates with one element for each observed return, used for the x-axis.

Value

ggplot object.

See Also

var_es, backtest_var

Examples


opt <- estimate_parameters(spy$log_return, model = "skew_t_leverage", silent = TRUE)
plot_var(var_es(opt, level = 0.99), dates = spy$date)


stochvolTMB documentation built on Nov. 7, 2026, 5:08 p.m.