[Python] Quantlib pyhton heston model path generation

Discussão em 'Python' iniciado por Stack, Março 3, 2025.

  1. Stack

    Stack Membro Participativo

    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?

    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)

    Continue reading...

Compartilhe esta Página