Questions
找到一种合适检测夏普比率的方法
hypothesis testing
Bailey and Marcos Lopez de Prado designed a method do exactly that. They use the fact that
Sharpe Ratio's are asymptotically normal distributed, even if the returns are not
.
设计关于Sharpe Ratio
的检验方法主要基于如下事实,即使收益率序列不满足正态分布,Sharpe Ratio
是满足近似正态分布的,且
(
S
R
^
−
S
R
)
→
a
N
(
0
,
1
+
1
2
S
R
2
−
γ
3
S
R
+
γ
4
−
3
4
S
R
2
n
)
(\widehat{SR}-SR)\xrightarrow{a} \mathcal{N}(0, \frac{1+\frac{1}{2}SR^2-\gamma_3SR+\frac{\gamma_4-3}{4}SR^2}{n})
(SR
−SR)aN(0,n1+21SR2−γ3SR+4γ4−3SR2)
其中
γ
3
\gamma_3
γ3表示偏度(skewness
),即三阶矩信息;
γ
4
\gamma_4
γ4表示峰度(kurtosis
),即四阶矩信息. 可以推出概率分布
P
(
S
R
∗
)
=
Z
[
(
S
R
^
−
S
R
∗
)
n
−
1
1
−
γ
^
3
S
R
^
+
γ
^
4
−
1
4
S
R
^
2
]
\mathbb{P}(SR^*)=\mathcal{Z}\bigg[\frac{(\widehat{SR}-SR^*)\sqrt{n-1}}{\sqrt{1-\hat{\gamma}_3\widehat{SR}+\frac{\hat{\gamma}_4-1}{4}\widehat{SR}^2}}\bigg]
P(SR∗)=Z[1−γ^3SR
+4γ^4−1SR
2(SR
−SR∗)n−1]
其中
S
R
∗
SR^*
SR∗为零假设(null hypothesis
)下的Sharpe Ratio
, 在5%
的显著水平下,当
P
>
0.95
\mathbb{P}>0.95
P>0.95那么
S
R
SR
SR的值显著高于
S
R
∗
SR^*
SR∗
peer performance analysis in R
function
shrpeTesting(x, y, control=list())
参数含义
arguments | meanings |
---|---|
x | vector (of length T) of returns for the first fund, NA values are allowed. |
y | vector (of length T) of returns for the second fund, NA values are allowed. |
control | control parameters |
细节解释
The Sharpe ratio is one industry standard for measuring the absolute risk adjusted performance of hedge funds. This function performs the testing of Sharpe ratio difference for two funds using the approach by Ledoit and Wolf (2002).
在假设检验中,只有两列数据均为非NA
值才会被使用,参数control
提供了额外的函数信息
value | function |
---|---|
type | asymptotic approach (type=1 ) or studentized circular bootstrap approach(type=2 ). Default:type=1 |
ttype | test based on ratio (type=1 ) or product (type=2 ). Default type=2 |
hac | heteroscedastic-autocorrection consistent standard errors. Default: hac=FALSE |
minObs | minimum number of concordant obs. to compute the ratios. Default: minObs=10 |
nBoot | number of bootstrap replications for computing the p-value . Default: nBoot=499 |
bBoot | block length in the circular bootstrap. Default: bBoot=1 , bBoot=0 uses optimal block-length |
pBoot | symmetric p-value(pBoot=1 ) or asymmetric p-value(pBoot=2 ). Default: pBoot=1 |
返回值
return value | meanings |
---|---|
n | number of non-NA concordant obs. |
sharpe | vector (of length 2) of unconditional Sharpe ratios. |
dsharpe | Sharpe ratios difference. |
tstat | t-stat of Sharpe ratios differences |
pval | pvalues of test of Sharpe ratios differences |
## demo
library(PeerPerformance)
# Ctrl+L clear the console
# load data (randomized data of monthly hedge fund returns)
data("hfdata")
x=hfdata[, 1]
y=hfdata[, 2]
# Sharpe testing (asymptotic)
ctr = list(type=1) # 设置控制参数
ans = sharpeTesting(x, y, control=ctr)
print(ans)
# Sharpe testing (asymptotic hac)
ctr = list(type=1, hac=TRUE)
ans = sharpeTesting(x, y, control=ctr)
print(ans)
# Sharpe testing (iid bootstrap)
set.seed(1008)
ctr=list(type=1, nBoot=250)
ans = sharpeTesting(x, y, control = ctr)
print(ans)
# Sharpe testing (circular bootstrap)
set.seed(1008)
ctr = list(type=1, nBoot=250, bBoot=5)
ans = sharpeTesting(x, y, control=ctr)
print(ans)
参考资料
R-finance
Testing Sharpe Ratio significance
rdrr.io sharpeTesting
testing equality of modified Sharpe ratios
the peer performance ratios of hedge funds
the sharpe ratio efficient frontier
Robust performance hypothesis testing with the Sharpe ratio