pt.sharp: Sharp ratio

Description Usage Arguments Examples

View source: R/pt.sharp.R

Description

The Sharpe Ratio of an asset return is the quotient of the annualized excess return of the asset minus the annualized risk-free rate over the annualized standard deviation of the asset return.

Usage

1
pt.sharp(r,n,m,rf)

Arguments

r

:a vector of asset returns

n

:number of years

m

:number of periods in a year; m = 12 if r is monthly returns

rf

:annulized risk-free rate

Examples

1
2
3
4
set.seed(20)
rtn <- runif(12,-0.5,1) # generate random number to simulate monthly returns
rfr <- 0.024 # set risk free rate at 2.4% annual
pt.sharp(rtn,1,12,rfr) # the return is for one year

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

Related to pt.sharp in YRmisc...