Learn R Programming

ESGtoolkit (version 0.2.0)

esgmartingaletest: Martingale and market consistency tests

Description

This function performs martingale and market consistency (t-)tests.

Usage

esgmartingaletest(r, X, p0, alpha = 0.05)

Arguments

r

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

X

a time series object, containing payoffs or projected asset values.

p0

a numeric or a vector or a univariate time series containing initial price(s) of an asset.

alpha

1 - confidence level for the test. Default value is 0.05.

Value

The function result can be just displayed. Otherwise, you can get a list by an assignation, containing (for each maturity) :

  • the Student t values

  • the p-values

  • the estimated mean of the martingale difference

  • Monte Carlo prices

See Also

esgplotbands

Examples

Run this code
# NOT RUN {
r0 <- 0.03
S0 <- 100

set.seed(10)
eps0 <- simshocks(n = 100, horizon = 3, frequency = "quart")
sim.GBM <- simdiff(n = 100, horizon = 3, frequency = "quart",   
               model = "GBM", 
               x0 = S0, theta1 = r0, theta2 = 0.1, 
               eps = eps0)

mc.test <- esgmartingaletest(r = r0, X = sim.GBM, p0 = S0, 
alpha = 0.05)                               
esgplotbands(mc.test)                

# }

Run the code above in your browser using DataLab