#' Kelly criterion for a geometric Brownian motion
#'
#' @param drift the drift coefficient of the stock price process
#' @param rate the risk-neutral rate of return, or the return on the bond/money market account, etc
#' @param volat the volatility coefficient of the stock price process
#' @description {The Kelly criterion formula under GBM.}
#' @details {The equation is given by \eqn{(\mu-r)/\sigma^2}, where \eqn{dS_t =\mu S_t dt +\sigma S_T dB_T} and \eqn{r} is the risk-free rate of return.}
#' @return Numerical
#' @export kelly_gbm
kelly_gbm <- function(drift, rate, volat)
{
(drift-rate)/volat^2
}
#' Growth/entropy rate of Kelly criterion under GBM
#'
#' @param alpha the fraction of wealth to bet
#' @param mu the drift rate of the stock
#' @param rate the money-market account interest rate
#' @param volat the annual volatility of the stock (std of daily log-returns)
#' @param t time-span, default to one year growth period
#'
#' @description {This is the function optimized by the Kelly criterion. It is equal to the expected log wealth.}
#' @details {See .pdf for details.}
#' @return numeric
#' @export entropy_gbm
entropy_gbm <- function(alpha, mu, rate, volat, t = 1)
{
((mu-rate)*alpha+rate-0.5*(volat^2)*(alpha^2))*t
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.