histvar(): number
Historical Value-At-Risk.
Univariate historical simulation. Single asset
Daily VaR at 95% confidence level
Daily VaR at 95% confidence level
import { assertEquals } from "jsr:@std/assert"; const x = [0.003, 0.026, 0.015, -0.009, 0.014, 0.024, 0.015, 0.066, -0.014, 0.039]; assertEquals(histvar(x, 0.95), 0.013999999999999999);
x: array
array or matrix of values
histvar(): array | matrix
Historical Value-At-Risk.
Univariate historical simulation. Single asset
Daily VaR at 95% confidence level
Daily VaR at 95% confidence level
import { assertEquals } from "jsr:@std/assert"; const x = [0.003, 0.026, 0.015, -0.009, 0.014, 0.024, 0.015, 0.066, -0.014, 0.039]; assertEquals(histvar(x, 0.95), 0.013999999999999999);
x: matrix
array or matrix of values