Skip to content
LQM Registry / risk

Historical VaR & Expected Shortfall

Empirical historical Value at Risk, CVaR/Expected Shortfall, volatility and drawdown from a return series.

Model keylq.risk.historical-var
Version1.0.0
Runtimepython-process
Model contract

Inputs are explicit.

{
    "type": "object",
    "required": [
        "returns"
    ],
    "properties": {
        "returns": {
            "type": "array",
            "items": {
                "type": "number"
            },
            "minItems": 10
        }
    }
}
Output contract

Outputs are explicit.

{
    "type": "object",
    "required": [
        "var",
        "cvar_expected_shortfall",
        "annualized_volatility",
        "max_drawdown"
    ]
}
Default parameters
{
    "confidence": 0.9499999999999999555910790149937383830547332763671875,
    "periods_per_year": 252
}
Example input
{
    "returns": [
        0.0120000000000000002498001805406602215953171253204345703125,
        -0.008000000000000000166533453693773481063544750213623046875,
        0.0040000000000000000832667268468867405317723751068115234375,
        -0.0210000000000000013045120539345589349977672100067138671875,
        0.01700000000000000122124532708767219446599483489990234375,
        0.00600000000000000012490009027033011079765856266021728515625,
        -0.01299999999999999940325512426397835952229797840118408203125,
        0.00899999999999999931998839741709161899052560329437255859375,
        -0.0040000000000000000832667268468867405317723751068115234375,
        0.01499999999999999944488848768742172978818416595458984375,
        -0.0109999999999999993616217608405349892564117908477783203125,
        0.003000000000000000062450045135165055398829281330108642578125,
        0.007000000000000000145716771982051795930601656436920166015625,
        -0.0179999999999999986399767948341832379810512065887451171875,
        0.021999999999999998723243521681069978512823581695556640625
    ]
}