LQM Registry / risk
Dynamic EWMA Covariance & Correlation
Multivariate exponentially weighted covariance engine with current covariance, correlation, volatility and a bounded covariance-path tail for dynamic risk monitoring.
Model key
lq.risk.dynamic-ewma-covarianceVersion1.0.0
Runtimepython-process
Model contract
Inputs are explicit.
{
"type": "object",
"required": [
"returns"
],
"properties": {
"returns": {
"type": "array",
"minItems": 20
}
}
}Output contract
Outputs are explicit.
{
"type": "object",
"required": [
"latest_covariance",
"latest_correlation",
"latest_volatility",
"annualized_volatility",
"assets"
]
}Default parameters
{
"decay": 0.939999999999999946709294817992486059665679931640625,
"periods_per_year": 252,
"demean": true,
"path_tail": 20
}Example input
{
"returns": [
[
0.01000000000000000020816681711721685132943093776702880859375,
0.005000000000000000104083408558608425664715468883514404296875
],
[
-0.008000000000000000166533453693773481063544750213623046875,
-0.0040000000000000000832667268468867405317723751068115234375
],
[
0.0120000000000000002498001805406602215953171253204345703125,
0.00600000000000000012490009027033011079765856266021728515625
],
[
-0.00600000000000000012490009027033011079765856266021728515625,
-0.003000000000000000062450045135165055398829281330108642578125
],
[
0.00899999999999999931998839741709161899052560329437255859375,
0.0040000000000000000832667268468867405317723751068115234375
],
[
0.01400000000000000029143354396410359186120331287384033203125,
0.00899999999999999931998839741709161899052560329437255859375
],
[
-0.0109999999999999993616217608405349892564117908477783203125,
-0.008000000000000000166533453693773481063544750213623046875
],
[
0.008000000000000000166533453693773481063544750213623046875,
0.00600000000000000012490009027033011079765856266021728515625
],
[
-0.005000000000000000104083408558608425664715468883514404296875,
-0.00200000000000000004163336342344337026588618755340576171875
],
[
0.01000000000000000020816681711721685132943093776702880859375,
0.007000000000000000145716771982051795930601656436920166015625
],
[
0.00600000000000000012490009027033011079765856266021728515625,
0.0040000000000000000832667268468867405317723751068115234375
],
[
-0.00899999999999999931998839741709161899052560329437255859375,
-0.00600000000000000012490009027033011079765856266021728515625
],
[
0.01299999999999999940325512426397835952229797840118408203125,
0.008000000000000000166533453693773481063544750213623046875
],
[
-0.007000000000000000145716771982051795930601656436920166015625,
-0.0040000000000000000832667268468867405317723751068115234375
],
[
0.0109999999999999993616217608405349892564117908477783203125,
0.00600000000000000012490009027033011079765856266021728515625
],
[
0.0040000000000000000832667268468867405317723751068115234375,
0.003000000000000000062450045135165055398829281330108642578125
],
[
-0.00600000000000000012490009027033011079765856266021728515625,
-0.005000000000000000104083408558608425664715468883514404296875
],
[
0.00899999999999999931998839741709161899052560329437255859375,
0.005000000000000000104083408558608425664715468883514404296875
],
[
0.0120000000000000002498001805406602215953171253204345703125,
0.008000000000000000166533453693773481063544750213623046875
],
[
-0.01000000000000000020816681711721685132943093776702880859375,
-0.007000000000000000145716771982051795930601656436920166015625
],
[
0.007000000000000000145716771982051795930601656436920166015625,
0.0040000000000000000832667268468867405317723751068115234375
],
[
0.005000000000000000104083408558608425664715468883514404296875,
0.003000000000000000062450045135165055398829281330108642578125
],
[
-0.008000000000000000166533453693773481063544750213623046875,
-0.005000000000000000104083408558608425664715468883514404296875
],
[
0.0109999999999999993616217608405349892564117908477783203125,
0.007000000000000000145716771982051795930601656436920166015625
]
]
}