MyNixOS website logo
Description

Jump Diffusion Simulation and Calibration for Merton and Kou Models.

Implements the Merton (1976) <doi:10.1016/0304-405X(76)90022-2> and Kou (2002) <doi:10.1287/mnsc.48.8.1086.166> jump-diffusion models through a unified S4 object-oriented interface. Provides exact compound-Poisson asset price simulation, maximum likelihood parameter estimation with Hessian-based standard errors, Wald-type confidence intervals, European option pricing via the Merton analytic series expansion, and publication-quality diagnostic plots. All functionality operates entirely offline without market data dependencies.

JumpDiffSim

R-CMD-check test-coverage Lifecycle: stable License: MIT

JumpDiffSim is an R package that implements the Merton (1976) and Kou (2002) jump-diffusion models through a unified S4 object-oriented interface. It provides exact compound-Poisson asset price simulation, maximum-likelihood parameter estimation with Hessian-based standard errors, Wald-type confidence intervals, theoretical moment calculations, and publication-quality diagnostic plots — all designed to run entirely offline without any dependency on live market data.


Installation

Install the development version from GitHub:

# install.packages("devtools")
devtools::install_github("kennedy2244/JumpDiffSim")

Install a specific release version:

devtools::install_github("kennedy2244/[email protected]")

Quick Start

The core workflow is three steps: create a model → simulate paths → fit to data.

library(JumpDiffSim)

# ── Step 1: Create a Merton model object ─────────────────────
m <- MertonModel(
  mu      =  0.05,   # drift
  sigma   =  0.20,   # diffusion volatility
  lambda  =  1.00,   # average jumps per year
  mu_j    = -0.10,   # mean log-jump size
  sigma_j =  0.15    # std dev of log-jumps
)

show(m)
#> Merton Jump-Diffusion Model
#> ---------------------------
#>   mu      : 0.0500
#>   sigma   : 0.2000
#>   lambda  : 1.0000
#>   mu_j    : -0.1000
#>   sigma_j : 0.1500

# ── Step 2: Simulate 200 asset price paths ───────────────────
sim  <- simulateMerton(m, n = 200, T_ = 1, steps = 252, seed = 42)
plts <- diagnosticPlots(sim)

print(plts$fan_chart)   # path quantile fan (5/25/50/75/95th percentiles)
print(plts$density)     # empirical return density vs Normal
print(plts$acf_sq)      # ACF of squared log-returns

# ── Step 3: Fit model to synthetic data via MLE ──────────────
ret <- jdSampleData("merton", n = 500, seed = 42)
fit <- fitMerton(ret)

print(fit)
#> Merton MLE Fit Result
#> ---------------------
#>   Converged : TRUE
#>   Log-lik   : 487.2341
#>   Estimates (SE):
#>     mu       :  0.0489  (0.0021)
#>     sigma    :  0.1987  (0.0045)
#>     lambda   :  0.9823  (0.1234)
#>     mu_j     : -0.0998  (0.0187)
#>     sigma_j  :  0.1502  (0.0134)

confint(fit)
#>              2.5 %    97.5 %
#> mu       0.044710  0.053090
#> sigma    0.189896  0.207504
#> lambda   0.740434  1.224166
#> mu_j    -0.136443 -0.063157
#> sigma_j  0.123890  0.176510

Parameters

ParameterSymbolDescription
mu$\mu$Drift — expected continuous return per unit time
sigma$\sigma$Diffusion volatility of the Brownian component
lambda$\lambda$Jump intensity — average number of jumps per year
mu_j$\mu_J$Mean log-size of each jump
sigma_j$\sigma_J$Standard deviation of log-jump sizes

A negativemu_j with a positive lambda implies that jumps on average reduce the asset price — consistent with the crash-risk interpretation in Merton (1976).


Theoretical Moments

jumpMoments(m)
#>       mean   variance   skewness   kurtosis
#>   0.000489   0.046225  -0.003012   0.000451

Excess kurtosis greater than zero confirms that the Merton model generates heavier tails than standard Geometric Brownian Motion.


Package Structure

JumpDiffSim/
├── R/
│   ├── generics.R        # S4 generic function definitions
│   ├── merton_model.R    # MertonModel class + JDSimResult + JDFitResult
│   ├── merton_sim.R      # simulateMerton(), jdSampleData(), diagnosticPlots()
│   ├── merton_fit.R      # mertonLogLik(), fitMerton(), confint()
│   ├── utils.R           # jumpMoments()
│   ├── kou_model.R       # KouModel placeholder (v0.2.0)
│   ├── kou_sim.R         # simulateKou() placeholder (v0.2.0)
│   └── kou_fit.R         # fitKou() placeholder (v0.2.0)
├── tests/testthat/       # 36 unit tests (T1-T12 + TU1-TU2)
├── vignettes/            # Getting Started with JumpDiffSim
└── scaffolds/            # Team development scaffold files

Test Coverage

FileCoverage
R/utils.R100.00%
R/merton_sim.R98.86%
R/merton_fit.R96.72%
R/generics.R14.29%
R/merton_model.R20.83%
Overall85.57%

R CMD check result: 0 errors | 0 warnings | 0 notes


Vignette

A full introduction to the package is available in the vignette:

# After installation
vignette("JumpDiffSim-intro", package = "JumpDiffSim")

The vignette covers:

  1. Why jump-diffusion? Motivation and model equation
  2. Simulating asset price paths with simulateMerton()
  3. Fitting the model to data with fitMerton()
  4. Interpreting parameters
  5. Theoretical moments with jumpMoments()

Roadmap

VersionStatusFeatures
v0.1.0ReleasedMerton model — simulation, estimation, diagnostics, tests
v0.2.0PlannedKou (2002) model — double-exponential jumps
v0.3.0PlannedCross-model comparison vignette, CRAN submission

Team

This package was developed collaboratively by students in the Department of Statistics, Yeungnam University, under the supervision of Professor Lee Kyungsub.

MemberRole
Kennedy KayakiPackage Lead · Estimation Module
Dohyun OhS4 Architect
Ju Seong HyeonSimulation Engine
Lee SeeunUnit Testing (T1–T9)
Yuri ShinCoverage Reporting (T10–T12)
Choi JiwooVignette & README

References

  • Merton, R.C. (1976). Option pricing when underlying stock returns are discontinuous. Journal of Financial Economics, 3(1–2), 125–144.
  • Kou, S.G. (2002). A jump-diffusion model for option pricing. Management Science, 48(8), 1086–1101.
  • Wickham, H. and Bryan, J. (2023). R Packages (2nd ed.). O'Reilly Media. https://r-pkgs.org/

License

MIT © 2026 Kennedy Kayaki, Yeungnam University.

Metadata

Version

0.1.0

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows