Jump-Variation Detector
Install and import#
npm install fintech-algorithmsimport { calculate } from "fintech-algorithms/volatility-and-covariance/realized-measures/jump-variation-detector";Signature#
calculate(data)Separate the observed variation difference from its uncertainty and threshold. Supplied-parameter educational reference; no fitted performance claim.
Parameters#
| Name | Type | Notes |
|---|---|---|
data | TopicInput | See data-contract/CONTRACT.md. |
Returns#
TopicResult
Structured result with readiness, values, parameters, and diagnostics.
Warm-up#
The first depends on window or model order positions are null prefix until minimum history exists.
Errors#
- When required data is missing, non-finite, malformed, or out of range — raises ContractError / Error
Complexity: time O(nw),
space Full diagnostic trace retained for teaching; see implementation for observation/window/matrix dimensions.
Worked example#
executed Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.
Input#
{
"returns": [0.01, -0.02, 0.03, -0.01],
"parameters": {
"window": 4,
"annualization_factor": 1,
"alpha": 0.05
}
}Call#
calculate(data)Returns#
object with 8 fields: topic_id, title, parameters, series, latest, ready, ready_at, diagnostics
{
"topic_id": "D10-F02-A04",
"title": "Jump-Variation Detector",
"parameters": {
"window": 4,
"annualization_factor": 1,
"alpha": 0.05
},
"series": [
null,
null,
null,
{
"realized_variance": 0.0015,
"bipower_variation": 0.001727875959474386,
"tripower_quarticity": 0.000003041375049273447,
"standard_error": 0.0006804738070197237,
"statistic": -0.33487837022326555,
"critical_value": 1.644853625133699,
"jump_detected": false,
"decision_status": "asymptotic",
"signed_difference": -0.000227875959474386,
"window_start": 0,
"window_end": 3
}
],
"latest": {
"realized_variance": 0.0015,
"bipower_variation": 0.001727875959474386,
"tripower_quarticity": 0.000003041375049273447,
"standard_error": 0.0006804738070197237,
"statistic": -0.33487837022326555,
"critical_value": 1.644853625133699,
"jump_detected": false,
"decision_status": "asymptotic",
"signed_difference": -0.000227875959474386,
"window_start": 0,
"window_end": 3
},
"ready": true,
"ready_at": 3,
"diagnostics": {
"causal": true,
"input_count": 4,
"annualization_factor": 1
}
}Diagrams#
Calculation flow#
Jump-Variation Detector — calculation-flow
flowchart TD
N0["Compute RV and unadjusted BV"]
N1["Compute tripower quarticity"]
N2["Standardize signed RV minus BV"]
N3["Compare Z with upper-tail quantile"]
N0 --> N1 --> N2 --> N3
Jump-Variation Detector — decision-boundary
flowchart TD
A["Supplied observations and parameters"] --> B{"Contract valid?"}
B -->|No| E["Reject with explicit error"]
B -->|Yes| C{"Required history available?"}
C -->|No| W["Withhold; never insert zero"]
C -->|Yes| D["Jump-Variation Detector calculation"]
D --> F["Inspect diagnostics and stated limits"]
How it works#
This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.
References#
- Scope of evidence