I would like to use my fitted Heston model to generate paths to price an exotic type of option, but I have a couple questions I can't seem to answer with the docs and examples.
Why does the GaussianMultiPathGenerator
or GaussianSobolMultiPathGenerator
only take the process and not the model? The model contains the fitted parameters with the help of the volatility surfaces, but the process doesn't seem to contain a reference to those, how is it working? Should I fit the model, take the parameters and create a new process with the fitted parameters?
Additionally, as I'm working with futures, I was planning to pass the rates and yield curves as 0 for all points. Would that work so the process has no drift?
dt = 1/252
# number of days from today to 31 march 2026
days = np.busday_count(pd.Timestamp.today().date(),pd.Timestamp('2026-03-31').date())
T = days*dt
N_paths = 10000
N_steps = days
busines_days = pd.bdate_range(start_date,periods=days)
uniform_gen = ql.UniformRandomSequenceGenerator(int(2*N_steps),ql.UniformRandomGenerator())
gaussian_gen = ql.GaussianRandomSequenceGenerator(uniform_gen)
times = list(ql.TimeGrid(T, int(N_steps)))
multipath = ql.GaussianMultiPathGenerator(heston_process, times, gaussian_gen, False)
I would like to use my fitted Heston model to generate paths to price an exotic type of option, but I have a couple questions I can't seem to answer with the docs and examples.
Why does the GaussianMultiPathGenerator
or GaussianSobolMultiPathGenerator
only take the process and not the model? The model contains the fitted parameters with the help of the volatility surfaces, but the process doesn't seem to contain a reference to those, how is it working? Should I fit the model, take the parameters and create a new process with the fitted parameters?
Additionally, as I'm working with futures, I was planning to pass the rates and yield curves as 0 for all points. Would that work so the process has no drift?
dt = 1/252
# number of days from today to 31 march 2026
days = np.busday_count(pd.Timestamp.today().date(),pd.Timestamp('2026-03-31').date())
T = days*dt
N_paths = 10000
N_steps = days
busines_days = pd.bdate_range(start_date,periods=days)
uniform_gen = ql.UniformRandomSequenceGenerator(int(2*N_steps),ql.UniformRandomGenerator())
gaussian_gen = ql.GaussianRandomSequenceGenerator(uniform_gen)
times = list(ql.TimeGrid(T, int(N_steps)))
multipath = ql.GaussianMultiPathGenerator(heston_process, times, gaussian_gen, False)
Share
Improve this question
edited Mar 3 at 21:50
Félix Rodriguez Moya
asked Mar 3 at 16:29
Félix Rodriguez MoyaFélix Rodriguez Moya
12 bronze badges
1 Answer
Reset to default 0The path generator, which is generic, takes a process because not all processes have a corresponding model class.
In C++, once the Heston model is calibrated, one can call model->process()
to obtain the process with the correct parameters. However, that method seems to have been overlooked in the Python wrappers. I'll make it available in one of the next releases, but for now, as you said, you'll have to take the parameters and create a new process.
As for the rates: passing 0 would give you no drift but also no discounting, which is probably not what you want. Instead, you can do what the BlackProcess
class does; pass a dividend yield equal to the risk-free rate, so they cancel out in the drift but you still have the correct interest rates for discounting.