The definition of the process used here is:
dX_t = -a(X_t - mu) + sd*dW_t,
where (mu, a, sd) are the three real parameters.
rvasicek(n, m, x0 = 0, mu = 0, a = 1, sd = 1, T = 1, drop = TRUE)
dvasicek(x, mu=0, a=1, sd=1, T=1, log = FALSE)
lvasicek(x, mu=0, a=1, sd=1, T=1)
evasicek(x, a0=1, T=1)integer, number of paths.
integer, number of steps, the step size will be T/m.
double, the vector of the observed values of a Vasicek process.
double, the initial value.
double, the value on which the process is centered and has an attraction when it is away.
double, the coefficient of how strong is the mean reversion when the process is away from mu.
double, the volatility.
double, the final date on which the brownian motion is simulated.
logical, if n = 1 and drop = TRUE then the function returns the single path of the brownian motion as a vector instead of a matrix.
logical, if TRUE, returns the log-density, if FALSE, returns the density.
double, starting value of a in the estimation algorithm.
rvasicek returns a (n, m+1) matrix of n path of the Vasicek process. dvasicek returns a vector of size length(x)-1. Note that the first value has no density. lvasicek returns the log-liklihood associated to dvasicek and evasicek returns the Maximum Likelihood Estimator of the parameters (mu, a, sd).
https://en.wikipedia.org/wiki/Vasicek_model
# NOT RUN {
x <- rvasicek(5, 10)
dvasicek(x[1L, ])
# }
Run the code above in your browser using DataLab