R/Return.excess.R
Return.excess.RdCalculates the returns of an asset in excess of the given "risk free rate" for the period.
Return.excess(R, Rf = 0)Ideally, your risk free rate will be for each period you have returns observations, but a single average return for the period will work too.
Mean of the period return minus the period risk free rate
$$\overline{(R_{a}-R_{f})}$$
OR
mean of the period returns minus a single numeric risk free rate
$$\overline{R_{a}}-R_{f}$$
Note that while we have, in keeping with common academic usage, assumed that the second parameter will be a risk free rate, you may also use any other timeseries as the second argument. A common alteration would be to use a benchmark to produce excess returns over a specific benchmark, as demonstrated in the examples below.
Bacon, Carl. Practical Portfolio Performance Measurement and Attribution. Wiley. 2004. p. 47-52
data(managers)
head(Return.excess(managers[,1,drop=FALSE], managers[,10,drop=FALSE]))
#> HAM1 > US 3m TR
#> 1996-01-31 0.00284
#> 1996-02-29 0.01532
#> 1996-03-31 0.01179
#> 1996-04-30 -0.01338
#> 1996-05-31 0.00317
#> 1996-06-30 -0.00802
head(Return.excess(managers[,1,drop=FALSE], .04/12))
#> HAM1 > Rf
#> 1996-01-31 0.004066667
#> 1996-02-29 0.015966667
#> 1996-03-31 0.012166667
#> 1996-04-30 -0.012433333
#> 1996-05-31 0.004266667
#> 1996-06-30 -0.007233333
head(Return.excess(managers[,1:6], managers[,10,drop=FALSE]))
#> HAM1 > US 3m TR HAM2 > US 3m TR HAM3 > US 3m TR HAM4 > US 3m TR
#> 1996-01-31 0.00284 NA 0.03034 0.01764
#> 1996-02-29 0.01532 NA 0.03112 0.01552
#> 1996-03-31 0.01179 NA 0.02209 -0.01351
#> 1996-04-30 -0.01338 NA 0.04062 0.01932
#> 1996-05-31 0.00317 NA 0.03087 -0.00163
#> 1996-06-30 -0.00802 NA -0.03442 -0.00602
#> HAM5 > US 3m TR HAM6 > US 3m TR
#> 1996-01-31 NA NA
#> 1996-02-29 NA NA
#> 1996-03-31 NA NA
#> 1996-04-30 NA NA
#> 1996-05-31 NA NA
#> 1996-06-30 NA NA
head(Return.excess(managers[,1,drop=FALSE], managers[,8,drop=FALSE]))
#> HAM1 > SP500 TR
#> 1996-01-31 -0.0266
#> 1996-02-29 0.0100
#> 1996-03-31 0.0059
#> 1996-04-30 -0.0238
#> 1996-05-31 -0.0182
#> 1996-06-30 -0.0077