R/pt.annsd.R

Defines functions pt.annsd

Documented in pt.annsd

###############################################################################################
##### annualized standard deviation
###############################################################################################

#' @name pt.annsd
#' @aliases pt.annsd
#' @title Annualized standard deviation
#' @description The annualized standard deviation is the standard deviation multiplied by the
#' square root of the number of periods in one year.
#' @usage pt.annsd(r,n)
#' @param r :a vector of a risk asset return
#' @param n :number of periods in a year
#' @examples rtn <- runif(30, -1, 1)
#' n <- 30
#' pt.annsd(rtn,n)

pt.annsd <- function(r,n){

  s <- sd(r)

  asd <- s * sqrt(n)

  return(asd)
}

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.