BS_fit {DtD} | R Documentation |
Function to estimate the volatility, σ, and drift, μ. See
vignette("Distance-to-default", package = "DtD")
for details. All
vectors with length greater than one needs to have the same length. The
Nelder-Mead method from optim
is used when
method = "mle"
. Either time
or dt
should be passed.
BS_fit(S, D, T., r, time, dt, vol_start, method = c("iterative", "mle"), tol = 1e-12, eps = 1e-08)
S |
numeric vector with observed stock prices. |
D |
numeric vector or scalar with debt due in |
T. |
numeric vector or scalar with time to maturity. |
r |
numeric vector or scalar with risk free rates. |
time |
numeric vector with the observation times. |
dt |
numeric scalar with time increments between observations. |
vol_start |
numeric scalar with starting value for σ. |
method |
string to specify which estimation method to use. |
tol |
numeric scalar with tolerance to |
eps |
numeric scalar with convergence threshold. |
A list with the following components
ests |
estimates of σ, and drift, μ. |
n_iter |
number of iterations when |
success |
logical for whether the estimation method converged. |
Choosing tol >= eps
or roughly equal may make the method alternate
between two solutions for some data sets.
library(DtD) set.seed(83486778) sims <- BS_sim( vol = .1, mu = .05, dt = .1, V_0 = 100, T. = 1, D = rep(80, 20), r = .01) with(sims, BS_fit(S = S, D = D, T. = T, r = r, time = time, method = "mle"))