esgmccv | R Documentation |
Analyzes the convergence of Monte Carlo prices by computing average prices and confidence intervals as the number of simulations increases.
esgmccv(r, X, maturity, plot = TRUE, ...)
r |
Interest rate time series or constant |
X |
Price time series |
maturity |
Maturity time point |
plot |
Logical indicating whether to plot the convergence (default: TRUE) |
... |
Additional arguments passed to plotting functions |
The function computes the average price and confidence intervals for increasing numbers of simulations to analyze the convergence of Monte Carlo estimates. It discounts the price series using the provided interest rate and evaluates at the specified maturity.
If plot=TRUE, it creates a plot showing:
Confidence intervals as shaded area
Average price as a blue line
X-axis showing number of simulations
Y-axis showing Monte Carlo estimated prices
A list containing:
avg.price: Vector of average prices for different numbers of simulations
conf.int: Matrix of confidence intervals (lower and upper bounds)
# Generate sample data
r <- 0.05
X <- ts(matrix(rnorm(1000), 100, 10), start = 0, deltat = 0.1)
# Analyze convergence
convergence <- esgmccv(r, X, maturity = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.