R/pt.te.R

Defines functions pt.te

Documented in pt.te

###############################################################################################
##### tracking error
###############################################################################################

#' @name pt.te
#' @aliases pt.te
#' @title Tracking error
#' @description Tracking error, in finance, is a measure of risk in a portfolio that is due to active management
#' decisions made by the manager. It indicates how closely the portfolio follows the benchmark of choosing.
#' @usage pt.te(pr,br)
#' @param pr :portfolio return
#' @param br :benchmark return
#' @examples prtn <- runif(12,-1,1)
#' brtn <- runif(12,-1,1)
#' pt.te(prtn,brtn)

pt.te <- function(pr,br){

  te <- sqrt(var(pr - br))

  return(te)
}

Try the YRmisc package in your browser

Any scripts or data that you put into this service are public.

YRmisc documentation built on March 25, 2020, 5:13 p.m.