#' Constant rate function
#'
#' @param x spatial input
#' @param t temporal input
#' @param rate risk-free rate of return
#'
#' @description {Consant rate function for discounting.}
#' @return numeric
#' @export rate_constant
rate_constant <- function(x, t, rate)
{
rate
}
#' time-scaled rate function
#'
#' @param x spatial input
#' @param t temporal input
#' @param rate risk-free rate of return
#' @param maturity the time-horizon
#'
#' @description {Time decreasing risk-free rate.}
#' @return numeric
#' @export rate_decrease
rate_decrease <- function(x, t, rate, maturity)
{
rate*(maturity-t)
}
#' time-scaled rate function (increasing)
#'
#' @param x spatial input
#' @param t temporal input
#' @param rate risk-free rate of return
#'
#' @description {Time decreasing risk-free rate.}
#' @return numeric
#' @export rate_increase
rate_increase <- function(x, t, rate)
{
rate*t
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.