Nothing
#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/atoms/cvar.R
#####
## CVXPY SOURCE: atoms/cvar.py
## CVaR -- Conditional Value at Risk
#' Conditional Value at Risk (CVaR)
#'
#' CVaR at confidence level beta: average of the (1-beta) largest values.
#'
#' @param x An Expression (vector)
#' @param beta Confidence level in [0, 1)
#' @returns An Expression representing the CVaR
#' @export
cvar <- function(x, beta) {
x <- as_expr(x)
if (beta < 0 || beta >= 1) {
cli_abort("{.arg beta} must be in [0, 1), got {.val {beta}}.")
}
if (min(x@shape) != 1L) {
cli_abort("{.fn cvar} requires a vector input, got shape {x@shape[1]}x{x@shape[2]}.")
}
k <- (1 - beta) * expr_size(x)
SumLargest(x, k) / k
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.