knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The package provides routines to calculate option prices using different closed-form solutions and Monte-Carlo simulations based on different stochastic motions
You can install the released version of fineng with
devtools::install_github("fineng")
We plan to add the following features in the next releases:
``` {R GBM} library(fineng) SinglePath <- SimGBM(100,0.03,0.25,2,100,"discrete") Path100 <- SimDGBM(100,0.03,0.25,2,100,10,"continuous") Path100Terminal <- SimTGBM(100,0.03,0.25,2,100,10,"continuous")
head(SinglePath) knitr::kable(head(Path100,10)) knitr::kable(Path100Terminal)
### Heston model ```{R example} ### Necessary Paramters PutCall <- "Call" # Option Properties S = 100 K = 100 tau = 0.5 r = 0.03 q = 0.02 # Heston model Properties kappa = 0.2 theta = 0.25 sigma = 0.3 lambda = 0 v0 = 0.02 rho = -0.8 # Mid-point Properties N = 1000 a = 1e-5 b = 100 ### Heston Price using Mid-point integration rule HestonPriceMP(PutCall, S, K, tau, r, q, kappa, theta, sigma, lambda, v0, rho, N, a, b) ### Comparison with Black-Scholes model BlackScholes("Call",S = 100, K = 100, tau = 0.5, r = 0.03, q = 0.02, sigma = 0.3)
This project is licensed under the GPL3 License
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.