Description Usage Arguments Value Examples
simprice
computes simulated lognormal price
paths, with or without jumps. Saves and restores random number
seed.
simprice(s0, v, r, tt, d, trials, periods = 1, jump = FALSE,
lambda = 0, alphaj = 0, vj = 0, seed = NULL, long = TRUE,
scalar_v_is_stddev = TRUE)
1 2  simprice(s0, v, r, tt, d, trials, periods, jump, lambda,
alphaj, vj, seed, long, scalar_v_is_stddev)

s0 
Initial price of the underlying asset 
v 
If scalar, default is volatility of the asset price,
defined as the annualized standard deviation of the
continuouslycompounded return. The parameter

r 
Annual continuouslycompounded riskfree interest rate 
tt 
Time to maturity in years 
d 
Dividend yield, annualized, continuouslycompounded 
trials 
number of simulated price paths 
periods 
number of equallength periods in each simulated path 
jump 
boolean controlling use of jump parameters 
lambda 
expected number of jumps in one year
( 
alphaj 
Expected continuously compounded jump percentage 
vj 
lognormal volatility of the jump amount 
seed 
random number seed 
long 
if 
scalar_v_is_stddev 
if 
A dataframe with trials
simulated stock price paths
1 2 3 4 5 6 7  # simple Monte Carlo option price example. Since there are two
# periods we can compute options prices for \code{tt} and
# \code{tt/2}
s0=40; k=40; v=0.30; r=0.08; tt=0.25; d=0;
st = simprice(s0, k, v, r, tt, d, trials=3, periods=2, jump=FALSE)
callprice1 = exp(r*tt/2)*mean(pmax(st[st$period==1,]  k, 0))
callprice2 = exp(r*tt)*mean(pmax(st[st$period==2,]  k, 0))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.