Note that you can easily implement all kinds of diffusion processes just by summing RVs, e.g.:

`pm.Normal('x', mu=0, sigma=1).cumsum()`

If you want large jumps occasionally, you can do `cumsum()`

on a `StudentT`

.

Note that you can easily implement all kinds of diffusion processes just by summing RVs, e.g.:

`pm.Normal('x', mu=0, sigma=1).cumsum()`

If you want large jumps occasionally, you can do `cumsum()`

on a `StudentT`

.

I’m sure there’s a way to do this in PyMC3 but I never figured it out.

This paper details how to build Metropolis for SV with correlated errors

http://people.bu.edu/jacquier/papers/jpr.je2004.pdf

I would recommend using a particle filter for estimation, details and a general review estimation techniques can be found in this reference:

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=926373

Perhaps I’ve missed something fundamental here, but equation 18 in http://people.bu.edu/jacquier/papers/jpr.je2004.pdf appears to specify a fairly straightforward generative process which is discrete time with continuous parameters. I think that this requires only modifying the stochastic volatility example to include jumps drawn from a Student-T distribution and inducing correlation between the jumps and the movement in the latent process, right?

Yes that’s correct. The challenge was getting correlated error implemented. I hacked something together in PyMC3 for correlated errors in the discussion thread below using some workarounds but it was very slow and I couldn’t get it to work for a square root vol process, only a log vol process

Hello,

I’m reaching out to breathe new life into an older discussion thread, curious about any advancements or interesting implementations that might have emerged since the last time this topic was explored. My interest lies particularly in how the conversation around this subject matter has evolved and what new insights or techniques the community might have developed.

As part of my current work, I’ve implemented a Monte Carlo simulation using the simple Merton Jump model. Here’s a brief overview of the code snippet I’ve been working with:

pythonCopy code

```
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import numpy as np
def merton_jump_paths(S, T, r, sigma, lam, m, v, steps, Npaths):
size = (steps, Npaths)
dt = T/steps
poi_rv = np.multiply(np.random.poisson(lam * dt, size=size),
np.random.normal(m, v, size=size)).cumsum(axis=0)
geo = np.cumsum(((r - sigma**2 / 2 - lam * (m + v**2 * 0.5)) * dt +
sigma * np.sqrt(dt) *
np.random.normal(size=size)), axis=0)
return np.exp(geo + poi_rv) * S
S = 100 # current stock price
T = 1 # time to maturity
r = 0.02 # risk-free rate
m = 0 # mean of jump size
v = 0.3 # standard deviation of jump
lam = 1 # intensity of jump, i.e., number of jumps per annum
steps = 10000 # time steps
Npaths = 1 # number of paths to simulate
sigma = 0.2 # annual standard deviation, for Weiner process
```

While this approach has served its purpose, I’m keen on exploring how PyMC could be utilized to make this process more efficient and flexible. Therefore, I’m reaching out to see if anyone in the community has ventured down this path and could share insights or advice on integrating PyMC into such simulations.

Has there been any notable progress or examples in using PyMC for similar financial models? Any guidance or references to relevant work would be greatly appreciated as I navigate this exploration.

Thank you all for your time and looking forward to your insights.

Best regards,

Jonathan