valueAtRisk#
- swordfish.function.valueAtRisk()#
Calculate Value at Risk (VaR) to predict the minimum return within a given confidence level (e.g. 95% or 99%) over a specific time frame.
- Parameters:
returns (Constant) – A numeric vector representing the returns. The element must be greater than -1 and cannot be empty.
method (Constant) –
A string indicating the VaR calculation method, which can be:
’normal’: parametric method with normal distribution.
’logNormal’: parametric method with log-normal distribution.
’historical’: historical method.
’monteCarlo’: Monte Carlo simulation.
confidenceLevel (Constant, optional) – A numeric scalar representing the confidence level, with a valid range of (0,1), by default DFLT.
- Returns:
A DOUBLE value indicating the absolute value of the minimum return.
- Return type: