Skip to content

Merton model #12

@JADekker

Description

@JADekker

In order to work with e.g. the Merton model, some way of dealing with jump processes is necessary; is it possible to add e.g. JumpProcesses.jl to the dependencies? I think something like the following (untested) could then be used to specify the dynamics under the Merton model:


function LogGBMJProblem(μ, σ, λ, μⱼ, σⱼ, u0, tspan; seed = UInt64(0), kwargs...)
    f = function (u, p, t)
        return @. μ - 0.5 * σ^2  # Drift of log(S_t)
    end
    g = function (u, p, t)
        return @. σ  # Constant diffusion for log(S_t)
    end

    J = LogNormal(μⱼ, σⱼ)

    affect! = function (integrator)
        @. integrator.u[1] *= Distributions.rand(J)
        nothing
    end

    const_jump = ConstantRateJump(λ, affect!)

    noise = WienerProcess(tspan[1], 0.0)

    sde_f = SDEFunction(f, g)
    sde_prob = SDEProblem{false}(
        sde_f,
        u0,
        (tspan[1], tspan[2]),
        noise = noise,
        seed = seed,
        kwargs...,
    )
    return JumpProblem(sde_prob, Direct(), const_jump)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions