ajd.sim.wh

Simulation of Affine Jump Diffusions via the Wu-Hu Method

https://github.com/xmlongan/ajd.sim.wh

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.1%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Simulation of Affine Jump Diffusions via the Wu-Hu Method

Basic Info
  • Host: GitHub
  • Owner: xmlongan
  • License: other
  • Language: R
  • Default Branch: main
  • Homepage:
  • Size: 1.05 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 1 year ago · Last pushed 12 months ago
Metadata Files
Readme License Citation

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# ajd.sim.wh




The goal of ajd.sim.wh is to **sim**ulate exactly the Heston 
Stochastic Volatility (SV) model and its **A**ffine **J**ump **D**iffusion (AJD) 
extensions using the **W**u-**H**u algorithm 
(Wu-Hu, 2024), hence the name `ajd.sim.wh`. 
The extended models include

- SVJ: SV model with jumps in the price process.

- SVCJ: SV model with contemporaneous jumps both in the price and variance
  processes.


*References*:

- Kyriakou, I., Brignone, R., & Fusai, G. (2024). Unified moment-based modeling
of integrated stochastic processes. *Operations Research*, 72(4), 1630-1653.

## Installation

You can install the development version of ajd.sim.wh like so:

``` r
# library(devtools)
install_github("xmlongan/ajd.sim.wh")
```

## Example

This is a basic example which shows you how to simulate some return 
(not the price) samples of the Heston SV model and plot a histogram of these
simulated returns:

```{r example}
library(ajd.sim.wh)
# Heston SV
v0 = 0.010201; k = 6.21; theta = 0.019; sigma = 0.61; rho = -0.7
r = 0.0319; tau = 1

par_hest = list(v0=v0, k=k, theta=theta, sigma=sigma, rho=rho, h=tau)
moms = rep(0, 8)
for (i in 2:8) {moms[i] = eval_mom_hest(ajd.sim.wh::fmu.hest[[i]], par_hest)}

N = 1000 # number of samples
Y = ajd.sim.wh::rpearson(1000, moms)

beta = (1  -exp(-k * tau)) / (2 * k)
Ymean = (r - theta/2) * tau - beta * (v0 - theta)

Y = Y + Ymean
hist(Y, main="Heston SV model")
```

If you want to simulate samples from the other two SV models, use:

- `price_svj()` for the SVJ model,

- `price_svcj()` for the SVCJ model.

## Pricing the European call option Using Monte Carlo simulation

If your are interested in pricing the European call option using Monte Carlo
simulation for the Heston SV, SVJ and SVCJ models. Please refer to functions
`?price_hest`, `?price_svj` and `?price_svcj`.

Owner

  • Name: Yanfeng
  • Login: xmlongan
  • Kind: user
  • Location: Shanghai

Ph.D. in Management Science, Fudan U.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Wu"
  given-names: "Yan-Feng"
  orcid: "https://orcid.org/0000-0002-7105-1070"
title: "ajd.sim.wh: An R Package for Simulating Affine Jump Diffusions via the Wu-Hu Method"
version: 1.0.0
doi:
date-released: 2025-02-10
url: "https://github.com/xmlongan/ajd.sim.wh"

GitHub Events

Total
  • Push event: 27
  • Create event: 1
Last Year
  • Push event: 27
  • Create event: 1

Dependencies

DESCRIPTION cran
  • R >= 2.10 depends
  • PearsonDS * imports
  • Rmpfr * imports
  • ajd.sim.kbf * imports
  • grDevices * imports
  • graphics * imports
  • stats * imports
  • knitr * suggests
  • rmarkdown * suggests
  • testthat >= 3.0.0 suggests