This is the code I am reverse-engineering while reading Artificial Intelligence for Financial Markets: The Polymodel Approach(https://www.amazon.com/Artificial-Intelligence-Financial-Markets-Mathematics/dp/3030973182) by Thomas Barrau and Raphael Douady.