Learn R Programming

ESGtoolkit (version 0.2.0)

esgmccv: Convergence of Monte Carlo prices

Description

This function computes and plots confidence intervals around the estimated average price, as functions of the number of simulations.

Usage

esgmccv(r, X, maturity, plot = TRUE, ...)

Arguments

r

a numeric or a time series object, the risk-free rate(s).

X

asset prices obtained with simdiff

maturity

the corresponding maturity (optional). If missing, all the maturities available in X are used.

plot

if TRUE (default), a plot of the convergence is displayed.

...

additional parameters provided to matplot

Value

a list with estimated average prices and the confidence intervals around them.

Details

Studying the convergence of the sample mean of :

$$E[X_T exp(-\int_0^T r_s ds)]$$

towards its true value.

Examples

Run this code
# NOT RUN {
r <- 0.03

set.seed(1)
eps0 <- simshocks(n = 100, horizon = 5, frequency = "quart")
sim.GBM <- simdiff(n = 100, horizon = 5, frequency = "quart",   
               model = "GBM", 
               x0 = 100, theta1 = 0.03, theta2 = 0.1, 
               eps = eps0)

# monte carlo prices
esgmcprices(r, sim.GBM)

# convergence to a specific price
(esgmccv(r, sim.GBM, 2))

# }

Run the code above in your browser using DataLab