This blog post demonstrates how to use the (work in progress) stochastic simulation API provided by techtonique.net to generate scenarios using various diffusion models. We’ll explore how to simulate paths using:
These models are particularly useful for:
We’ll walk through examples showing how to:
The API supports (for now) various parameters including (also, read the docs):
Let’s get started!
First, get a token from: https://www.techtonique.net/token.
Now, here’s how to use the token in API requests for stochatic simulations. The JSON response contains a key “sims”. Each list is a future scenario, as envisaged by the chosen model, and based on the initial value 100.
Note that you can use https://curlconverter.com/ to translate the following request in your favorite programming language.
# Replace YOUR_TOKEN_HERE with your actual token curl -X GET "https://www.techtonique.net/scenarios/simulate/?model=GBM&n=6&horizon=5&frequency=quarterly&x0=100&theta1=0.1&theta2=0.2&theta3=0.3&seed=123" \ -H "accept: application/json" \ -H "Authorization: Bearer YOUR_TOKEN_HERE"
Note that you can use https://curlconverter.com/ to translate the following request in your favorite programming language.
curl -X GET "https://www.techtonique.net/scenarios/simulate/?model=CIR&n=6&horizon=5&frequency=quarterly&x0=100&theta1=0.1&theta2=0.2&theta3=0.3&seed=123" \ -H "accept: application/json" \ -H "Authorization: Bearer YOUR_TOKEN_HERE"
Note that you can use https://curlconverter.com/ to translate the following request in your favorite programming language.
curl -X GET "https://www.techtonique.net/scenarios/simulate/?model=OU&n=6&horizon=5&frequency=quarterly&x0=100&theta1=0.1&theta2=0.2&theta3=0.3&seed=123" \ -H "accept: application/json" \ -H "Authorization: Bearer YOUR_TOKEN_HERE"
Note that you can use https://curlconverter.com/ to translate the following request in your favorite programming language.
curl -X GET "https://www.techtonique.net/scenarios/simulate/?model=shocks&n=6&horizon=5&frequency=quarterly&seed=123" \ -H "accept: application/json" \ -H "Authorization: Bearer YOUR_TOKEN_HERE"