BS_sim: Simulate Stock Price and Price of Underlying Asset

Description Usage Arguments See Also Examples

View source: R/BS_sim.R

Description

At least one of D, r, or T. needs to have the desired length of the simulated series. All vectors with length greater than one needs to have the same length.

Usage

1
BS_sim(vol, mu, dt, V_0, D, r, T.)

Arguments

vol

numeric scalar with σ value.

mu

numeric scalar with μ value.

dt

numeric scalar with time increments between observations.

V_0

numeric scalar with starting value of the underlying asset, S_{0}.

D

numeric vector or scalar with debt due in T..

r

numeric vector or scalar with risk free rates.

T.

numeric vector or scalar with time to maturity.

See Also

BS_fit

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(DtD)
set.seed(79156879)
sims <- BS_sim(
  vol = .1, mu = .05, dt = .2, V_0 = 100, T. = 1, D = rep(80, 20), r = .01)

# plot underlying
plot(sims$V)

# plot stock
plot(sims$S)

DtD documentation built on March 26, 2020, 7:45 p.m.