pt.sharp {YRmisc} | R Documentation |
Sharp ratio
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
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
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
[Package YRmisc version 0.1.6 Index]