esgmccv: Convergence of Monte Carlo prices

Description Usage Arguments Details Value Author(s) Examples

View source: R/tests.R

Description

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

Usage

1
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

Details

Studying the convergence of the sample mean of :

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

towards its true value.

Value

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

Author(s)

Thierry Moudiki

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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))

ESGtoolkit documentation built on July 1, 2020, 11:24 p.m.