Downloads · 30 days
0
Akjha2026/Stochastics
Stochastics is a machine learning model from Akjha2026. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains the numerical implementation and validation code for the paper "A Stochastic Thermodynamics Approach to Price Impact and Round-Trip Arbitrage: Theory and Empirical Implications.https://arxiv.o…
Downloads · 30 days
0
Access
Public
Updated Dec 4, 2025
Repo size
—
Likes
1
Public
Click a slice to open those files.
.cpp3.1 KB · 31%
From the Hugging Face model README
This repository contains the numerical implementation and validation code for the paper "A Stochastic Thermodynamics Approach to Price Impact and Round-Trip Arbitrage: Theory and Empirical Implications.https://arxiv.org/abs/2512.03123"
The code verifies the Financial Second Law and the Fluctuation Theorems derived in the paper by simulating trading trajectories under linear permanent impact and strictly convex temporary impact.
quant.py: A Python prototype for rapid verification and plotting.quant.cpp: A high-performance C++ implementation for production-grade simulation.pip install numpy)Run the script to see the comparison between Numerical integration and Analytical formulas.
--- TRIANGULAR STRATEGY --- Work (Numerical): 100.0000 Work (Analytical): 100.0000 Var (Numerical): 8333.3333 Var (Analytical): 8333.3333 Fluctuation Bound: 1.499622e-07 Accuracy check: PASS
--- RAMP STRATEGY --- Work (Numerical): 33.3333 Work (Analytical): 33.3333 Var (Numerical): 3333.3333 Var (Analytical): 3333.3333 Fluctuation Bound: 1.888756e-02 Accuracy check: PASS
Compile and run the high-performance implementation.
g++ -o quant quant.cpp ./quant
Theoretical Alignment
This code strictly adheres to the corrected Linear Permanent Impact assumption ($\mathcal{I}(v) = \lambda v$). Under this framework, the permanent impact component integrates to zero over any closed round-trip cycle, meaning the dissipated work is governed solely by the temporary impact coefficient $\alpha = \eta$.
MIT License.
Free to use for academic and research purposes.