Description Usage Arguments Details Value Note Examples
Run N
monte carlo simulations to generate asset price paths following
a geometric brownian motion process with constrant drift rate and constant
volatility.
1 2 | monteCarlo(mu, sigma, N = 100, time = 1, steps = 52,
starting_value = 100)
|
mu |
annualized expected return |
sigma |
annualized standard deviation |
N |
number of simulations |
time |
length of simulation (in years) |
steps |
number of time steps |
starting_value |
asset price starting value |
The Geometric Brownian Motion process to describe small movements in prices is given by
d S_t = μ S_t dt + σ dz_t
ln S is simulated rather than simulating S directly such that
S_t = S_{t-1} exp((μ - 0.5 σ^2) dt + σ √{dt} ε)
where:
S_t is the asset price at time t
S_t-1 is the asset price at time t-1
mu is the constant drift rate
sigma is the constant volatility rate
epsilon is a standard normal random variable
matrix of simulated price paths where each column represents a price path
This function returns an m x N matrix of simulated price paths where m is the number of steps + 1 and N is the number of simulations. This can be very memory and computatitonally intensive with a large number of steps and/or a large number of simulations. More efficient methods in terms of speed and memory should be used, for example, to price options.
1 2 3 | library(GARPFRM)
mc <- monteCarlo(0.05, 0.25, 500, 1, 52, 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.