File size: 1,327 Bytes
c729eec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
Inference Script for Flow Matching Generative Market Engine
============================================================
Author: Ramprasad Atluri (At1uri)
Repository: At1uri/flow-matching-generative-engine
"""

from flow_engine import ContinuousNormalizingFlowEngine

def run_flow_inference():
    engine = ContinuousNormalizingFlowEngine()

    regimes = [
        "steady_drift_regime",
        "heavy_tailed_volatility_clustering",
        "liquidity_crisis_flash_crash"
    ]

    print("=" * 70)
    print("CONTINUOUS NORMALIZING FLOW GENERATIVE INFERENCE (RK4 NEURAL ODE)")
    print("=" * 70)

    for reg in regimes:
        res = engine.sample(num_samples=1000, nfe_steps=8, regime=reg)
        print(f"\n[Regime: {reg.upper()}]")
        print(f"  NFEs (Function Evaluations): {res['nfe_steps']}")
        print(f"  Empirical Mean:             {res['mean']}")
        print(f"  Empirical Volatility (Std):  {res['std']}")
        print(f"  Generated Skewness:         {res['skewness']}")
        print(f"  Generated Kurtosis:         {res['kurtosis']} (Target: {'Heavy-Tailed' if res['kurtosis'] > 3.0 else 'Normal'})")
        print(f"  Absolute Autocorr (Lag 1):  {res['autocorr_lag1']}")
        print(f"  Sample Output Head:         {res['sample_head']}")

if __name__ == "__main__":
    run_flow_inference()