Description Usage Arguments Value Examples
Calculates the Sharpe ratio of returns time series.
1 |
rets |
a numerical vector with returns time series. |
rf |
a double, the assumed risk-free return. Default=0. |
ann_factor |
a double, the annualization factor. If ann_factor=1 (default), no annualization is performed. For monthly returns, set ann_factor=12. For daily returns, set ann_factor=252, etc. |
an index vector of the position of NAs.
1 2 | data(sp500_rets)
srs <- apply(sp500_rets[,-1], 2, sr_calc)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.