| Title: | Jump Diffusion Simulation and Calibration for Merton and Kou Models |
|---|---|
| Description: | 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. |
| Authors: | Kennedy Titus Kayaki [aut, cre], Dohyun Oh [aut], Ju Seong Hyeon [aut], Lee Se Eun [aut], Choi Jiwoo [aut], Yuri Shin [aut] |
| Maintainer: | Kennedy Titus Kayaki <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.0 |
| Built: | 2026-06-03 18:30:48 UTC |
| Source: | https://github.com/cran/JumpDiffSim |
Creates three diagnostic plots for a JDSimResult object: a simulated path fan chart, a histogram of log-returns with a normal density overlay, and the autocorrelation function of squared log-returns.
diagnosticPlots(object)diagnosticPlots(object)
object |
A JDSimResult object. |
A named list of three ggplot objects:
fan_chart: simulated path quantile fan chart.
density: histogram of log-returns with a normal overlay.
acf_sq: autocorrelation of squared log-returns with 95\
m <- MertonModel() sim <- simulateMerton(m, n = 50, T_ = 1, steps = 100) plts <- diagnosticPlots(sim) print(plts$fan_chart) print(plts$density) print(plts$acf_sq)m <- MertonModel() sim <- simulateMerton(m, n = 50, T_ = 1, steps = 100) plts <- diagnosticPlots(sim) print(plts$fan_chart) print(plts$density) print(plts$acf_sq)
Fit Model to Log-Returns via MLE
fit(object, log_returns, ...)fit(object, log_returns, ...)
object |
A JumpDiffModel object. |
log_returns |
Numeric vector of observed log returns. |
... |
Passed to |
A JDFitResult object.
Maximises the log-likelihood of the Merton (1976) model using L-BFGS-B optimisation. Returns a JDFitResult object containing parameter estimates, standard errors, and convergence info.
fitMerton( log_returns, start = c(mu = 0.05, sigma = 0.2, lambda = 1, mu_j = -0.1, sigma_j = 0.15), dt = 1/252, N_max = 50L, verbose = FALSE )fitMerton( log_returns, start = c(mu = 0.05, sigma = 0.2, lambda = 1, mu_j = -0.1, sigma_j = 0.15), dt = 1/252, N_max = 50L, verbose = FALSE )
log_returns |
Numeric vector of observed log asset returns. |
start |
Named numeric vector of starting values.
Defaults to |
dt |
Numeric. Time step length (default 1/252). |
N_max |
Integer. Mixture truncation (default 50). |
verbose |
Logical. Print progress? (default FALSE). |
A JDFitResult object.
ret <- jdSampleData("merton", n = 500, seed = 42) fit <- fitMerton(ret, verbose = TRUE) print(fit) confint(fit)ret <- jdSampleData("merton", n = 500, seed = 42) fit <- fitMerton(ret, verbose = TRUE) print(fit) confint(fit)
JDFitResult: MLE Estimation Output Class
## S4 method for signature 'JDFitResult' show(object) ## S4 method for signature 'JDFitResult' confint(object, parm, level = 0.95, ...)## S4 method for signature 'JDFitResult' show(object) ## S4 method for signature 'JDFitResult' confint(object, parm, level = 0.95, ...)
object |
A JDFitResult object. |
parm |
Ignored (all parameters returned). |
level |
Confidence level (default 0.95). |
... |
Unused. |
confint(JDFitResult): Wald-type 95\
estimatesNamed numeric. Parameter estimates.
seNamed numeric. Standard errors.
loglikNumeric. Log-likelihood at optimum.
convergedLogical. Did optimisation converge?
model_typeCharacter. Model name.
Convenience function for generating reproducible synthetic log-returns for use in examples, tests, and vignettes. All package examples and tests use this function to avoid any dependency on live market data.
jdSampleData( model = "merton", n = 500, mu = 0.05, sigma = 0.2, lambda = 1, mu_j = -0.1, sigma_j = 0.15, dt = 1/252, seed = 42L )jdSampleData( model = "merton", n = 500, mu = 0.05, sigma = 0.2, lambda = 1, mu_j = -0.1, sigma_j = 0.15, dt = 1/252, seed = 42L )
model |
Character. Model type: |
n |
Integer. Number of log-returns to generate (default 500). |
mu |
Numeric. Drift (default 0.05). |
sigma |
Positive numeric. Diffusion vol (default 0.20). |
lambda |
Non-negative numeric. Jump intensity (default 1). |
mu_j |
Numeric. Mean log-jump (default -0.10). |
sigma_j |
Positive numeric. Std dev of log-jumps (default 0.15). |
dt |
Numeric. Time step (default 1/252). |
seed |
Integer. Random seed (default 42). |
Numeric vector of n log-returns.
ret <- jdSampleData("merton", n = 200, seed = 42) head(ret) hist(ret, breaks = 40, main = "Synthetic Merton Returns")ret <- jdSampleData("merton", n = 200, seed = 42) head(ret) hist(ret, breaks = 40, main = "Synthetic Merton Returns")
JDSimResult: Simulation Output Class
pathsMatrix. Simulated price paths (n x steps+1).
timesNumeric vector. Time grid.
paramsList. Model parameters used in simulation.
model_typeCharacter. Model name.
Abstract base class. Do not instantiate directly. Concrete subclasses: MertonModel.
muNumeric. Drift parameter (annualised).
sigmaPositive numeric. Diffusion volatility.
lambdaNon-negative numeric. Jump intensity (jumps per year).
Theoretical Moments of the Log-Return Distribution
jumpMoments(object)jumpMoments(object)
object |
A JumpDiffModel object. |
Named numeric vector: mean, variance, skewness, kurtosis.
Returns the theoretical mean, variance, skewness, and excess kurtosis of the log-return distribution under the Merton (1976) model.
## S4 method for signature 'MertonModel' jumpMoments(object)## S4 method for signature 'MertonModel' jumpMoments(object)
object |
A MertonModel object. |
Named numeric vector with elements
mean, variance, skewness, kurtosis.
m <- MertonModel(mu = 0.05, sigma = 0.20, lambda = 1, mu_j = -0.10, sigma_j = 0.15) jumpMoments(m)m <- MertonModel(mu = 0.05, sigma = 0.20, lambda = 1, mu_j = -0.10, sigma_j = 0.15) jumpMoments(m)
Compute Negative Log-Likelihood
loglik(object, log_returns, ...)loglik(object, log_returns, ...)
object |
A JumpDiffModel object. |
log_returns |
Numeric vector of log asset returns. |
... |
Passed to methods. |
Scalar negative log-likelihood value.
Evaluates the negative log-likelihood of observing log_returns
under the Merton (1976) model. The density is approximated by a
Gaussian mixture truncated at N_max = 50 terms.
mertonLogLik(params, log_returns, dt = 1/252, N_max = 50L)mertonLogLik(params, log_returns, dt = 1/252, N_max = 50L)
params |
Named numeric vector:
|
log_returns |
Numeric vector of observed log asset returns. |
dt |
Numeric. Length of each time step (default 1/252). |
N_max |
Integer. Number of mixture terms (default 50). |
Scalar. Negative log-likelihood. Returns Inf for
invalid parameter values.
ret <- jdSampleData("merton", n = 200, seed = 42) p <- c(mu = 0.05, sigma = 0.2, lambda = 1, mu_j = -0.1, sigma_j = 0.15) mertonLogLik(p, ret)ret <- jdSampleData("merton", n = 200, seed = 42) p <- c(mu = 0.05, sigma = 0.2, lambda = 1, mu_j = -0.1, sigma_j = 0.15) mertonLogLik(p, ret)
Create a MertonModel Object
MertonModel(mu = 0.05, sigma = 0.2, lambda = 1, mu_j = -0.1, sigma_j = 0.15)MertonModel(mu = 0.05, sigma = 0.2, lambda = 1, mu_j = -0.1, sigma_j = 0.15)
mu |
Numeric. Drift (default 0.05). |
sigma |
Positive numeric. Diffusion volatility (default 0.20). |
lambda |
Non-negative numeric. Jump intensity (default 1). |
mu_j |
Numeric. Mean log-jump size (default -0.10). |
sigma_j |
Positive numeric. Std dev of log-jumps (default 0.15). |
A validated MertonModel object.
m <- MertonModel(mu = 0.05, sigma = 0.20, lambda = 1, mu_j = -0.10, sigma_j = 0.15) show(m)m <- MertonModel(mu = 0.05, sigma = 0.20, lambda = 1, mu_j = -0.10, sigma_j = 0.15) show(m)
Extends JumpDiffModel with log-normal jump parameters.
## S4 method for signature 'MertonModel' show(object)## S4 method for signature 'MertonModel' show(object)
object |
A MertonModel object. |
mu_jNumeric. Mean log-jump size.
sigma_jPositive numeric. Std dev of log-jump sizes.
Merton, R.C. (1976). Option pricing when underlying stock returns are discontinuous. Journal of Financial Economics, 3(1-2), 125-144.
Computes the European call or put price under the Merton (1976) jump-diffusion model using the analytic series expansion. The price is expressed as a Poisson-weighted sum of Black-Scholes prices with jump-adjusted drift and volatility.
The formula is:
where ,
,
and .
priceEuropean( fit, S = 100, K = 100, r = 0.05, T_ = 1, type = "call", N_max = 50L )priceEuropean( fit, S = 100, K = 100, r = 0.05, T_ = 1, type = "call", N_max = 50L )
fit |
A JDFitResult object from
|
S |
Positive numeric. Current asset price. |
K |
Positive numeric. Strike price. |
r |
Numeric. Continuously compounded risk-free rate. |
T_ |
Positive numeric. Time to expiry in years. |
type |
Character. Either |
N_max |
Integer. Number of series terms (default 50). |
A named list with elements:
price |
Merton jump-diffusion option price. |
bs_price |
Black-Scholes benchmark price (no jumps). |
jump_premium |
Difference between Merton and BS price. |
params |
List of inputs and fitted parameters used. |
Merton, R.C. (1976). Option pricing when underlying stock returns are discontinuous. Journal of Financial Economics, 3(1-2), 125-144.
ret <- jdSampleData("merton", n = 500, seed = 42) fit <- fitMerton(ret) price <- priceEuropean(fit, S = 100, K = 100, r = 0.05, T_ = 1, type = "call") print(price)ret <- jdSampleData("merton", n = 500, seed = 42) fit <- fitMerton(ret) price <- priceEuropean(fit, S = 100, K = 100, r = 0.05, T_ = 1, type = "call") print(price)
Simulate Asset Price Paths
simulate(object, n, T_, steps, seed = NULL, ...)simulate(object, n, T_, steps, seed = NULL, ...)
object |
A JumpDiffModel object. |
n |
Integer. Number of simulated paths. |
T_ |
Positive numeric. Time horizon in years. |
steps |
Positive integer. Number of time steps. |
seed |
Optional integer seed for reproducibility. |
... |
Additional arguments passed to methods. |
A JDSimResult object.
Generates n exact compound-Poisson asset price paths under the
Merton (1976) jump-diffusion model. Simulation is exact in the sense
that jump arrivals are drawn directly from the Poisson process rather
than approximated via Euler discretisation.
simulateMerton(object, n = 100, T_ = 1, steps = 252, S0 = 1, seed = NULL, ...)simulateMerton(object, n = 100, T_ = 1, steps = 252, S0 = 1, seed = NULL, ...)
object |
A MertonModel object. |
n |
Integer. Number of paths to simulate. |
T_ |
Positive numeric. Time horizon in years (default 1). |
steps |
Positive integer. Number of time steps (default 252). |
S0 |
Numeric. Initial asset price (default 1). |
seed |
Optional integer. Random seed for reproducibility. |
... |
Unused. |
A JDSimResult object.
m <- MertonModel() sim <- simulateMerton(m, n = 10, T_ = 1, steps = 252, seed = 42) dim(sim@paths) # should be 200 x 253m <- MertonModel() sim <- simulateMerton(m, n = 10, T_ = 1, steps = 252, seed = 42) dim(sim@paths) # should be 200 x 253