montecarlovar(): number
Monte Carlo Value-At-Risk.
Monte Carlo simulation for VaR calculation
Monte Carlo VaR for single asset
Monte Carlo VaR for single asset
import { assertEquals } from "jsr:@std/assert"; var x = [0.003,0.026,0.015,-0.009,0.014,0.024,0.015,0.066,-0.014,0.039]; // Note: This function currently has implementation issues with the random number generator // The following demonstrates the intended usage pattern: // const mcVar = montecarlovar(x, 0.95, 1000); // assertEquals(typeof mcVar, "number"); // For now, we'll just verify the function exists assertEquals(typeof montecarlovar, "function");
x: array
array of values
montecarlovar(): array | matrix
Monte Carlo Value-At-Risk.
Monte Carlo simulation for VaR calculation
Monte Carlo VaR for single asset
Monte Carlo VaR for single asset
import { assertEquals } from "jsr:@std/assert"; var x = [0.003,0.026,0.015,-0.009,0.014,0.024,0.015,0.066,-0.014,0.039]; // Note: This function currently has implementation issues with the random number generator // The following demonstrates the intended usage pattern: // const mcVar = montecarlovar(x, 0.95, 1000); // assertEquals(typeof mcVar, "number"); // For now, we'll just verify the function exists assertEquals(typeof montecarlovar, "function");
x: matrix
array of values