上市公司尾部风险测度检验(基于风险调整收益率)部二

检验分组后三因子、五因子风险调整收益率

# 直接生成表格 
m1=numeric();m2=numeric();m3=numeric();m4=numeric();m5=numeric();m6=numeric()
for(o in 1:2){
  for(i in 1:5){
    m1[i+(o-1)*12]=mean(lapply(paste0("a",0:4,"b",o),get)[[i]])}
  m1[i+(o-1)*12+1]=mean(lapply(paste0("a",0:4,"b",o),get)[[1]]-lapply(paste0("a",0:4,"b",o),get)[[5]])
  
  for(i in 1:5){
    m1[i+(o-1)*12+6]=t.test(lapply(paste0("a",0:4,"b",o),get)[[i]])$statistic[[1]]}
  m1[i+(o-1)*12+7]=t.test(lapply(paste0("a",0:4,"b",o),get)[[1]]-lapply(paste0("a",0:4,"b",o),get)[[5]])$statistic[[1]]}

# 投资组合收益率经过CAPM模型回归的截距项
for(o in 1:2){
  for(i in 1:5){
    m2[i+(o-1)*12]=mean(lapply(paste0("a",0:4,"d",o),get)[[i]])}
  m2[i+(o-1)*12+1]=mean(lapply(paste0("a",0:4,"d",o),get)[[1]]-lapply(paste0("a",0:4,"d",o),get)[[5]])
  
  for(i in 1:5){
    m2[i+(o-1)*12+6]=t.test(lapply(paste0("a",0:4,"d",o),get)[[i]])$statistic[[1]]}
  m2[i+(o-1)*12+7]=t.test(lapply(paste0("a",0:4,"d",o),get)[[1]]-lapply(paste0("a",0:4,"d",o),get)[[5]])$statistic[[1]]}

#投资组合收益率经过FF3模型回归的截距项
for(o in 1:2){
  for(i in 1:5){
    m3[i+(o-1)*12]=mean(lapply(paste0("a",0:4,"e",o),get)[[i]])}
  m3[i+(o-1)*12+1]=mean(lapply(paste0("a",0:4,"e",o),get)[[1]]-lapply(paste0("a",0:4,"e",o),get)[[5]])
  
  for(i in 1:5){
    m3[i+(o-1)*12+6]=t.test(lapply(paste0("a",0:4,"e",o),get)[[i]])$statistic[[1]]}
  m3[i+(o-1)*12+7]=t.test(lapply(paste0("a",0:4,"e",o),get)[[1]]-lapply(paste0("a",0:4,"e",o),get)[[5]])$statistic[[1]]}

#投资组合收益率经过FF5模型回归的截距项
for(o in 1:2){
  for(i in 1:5){
    m4[i+(o-1)*12]=mean(lapply(paste0("a",0:4,"g",o),get)[[i]])}
  m4[i+(o-1)*12+1]=mean(lapply(paste0("a",0:4,"g",o),get)[[1]]-lapply(paste0("a",0:4,"g",o),get)[[5]])
  
  for(i in 1:5){
    m4[i+(o-1)*12+6]=t.test(lapply(paste0("a",0:4,"g",o),get)[[i]])$statistic[[1]]}
  m4[i+(o-1)*12+7]=t.test(lapply(paste0("a",0:4,"g",o),get)[[1]]-lapply(paste0("a",0:4,"g",o),get)[[5]])$statistic[[1]]}

mm1<-matrix(c(m1,m2,m3,m4),16,6,byrow=TRUE)
#经过规模细分的投资组合收益率经过FF5模型回归的截距项
for(o in 1:2){
  for(v in 1:5){
    for(l in 1:5){
      m5[l+(v-1)*5+(o-1)*60]=mean(lapply(paste0("a",0:4,"f",o),get)[[v]][[l]])}}
  for(l in 1:5){
    m5[l+(v-1)*5+(o-1)*60+5]=mean(lapply(paste0("a",0:4,"f",o),get)[[1]][[l]]-lapply(paste0("a",0:4,"f",o),get)[[5]][[l]])}
  
  for(v in 1:5){
    for(l in 1:5){
      m5[l+(v-1)*5+(o-1)*60+30]=t.test(lapply(paste0("a",0:4,"f",o),get)[[v]][[l]])$statistic[[1]]}}
  for(l in 1:5){
    m5[l+(v-1)*5+(o-1)*60+35]=t.test(lapply(paste0("a",0:4,"f",o),get)[[1]][[l]]-lapply(paste0("a",0:4,"f",o),get)[[5]][[l]])$statistic[[1]]}}

# 平均
for(o in 1:2){
  for(v in 1:5){
    m6[v+(o-1)*12]=mean(apply(do.call("cbind",lapply(paste0("a",0:4,"f",o),get)[[v]]),1,mean))}
  m6[v+(o-1)*12+1]=mean(apply(do.call("cbind",lapply(paste0("a",0:4,"f",o),get)[[1]]),1,mean)-
                          apply(do.call("cbind",lapply(paste0("a",0:4,"f",o),get)[[5]]),1,mean))
  
  for(v in 1:5){   
    m6[v+(o-1)*12+6]=t.test(apply(do.call("cbind",lapply(paste0("a",0:4,"f",o),get)[[v]]),1,mean))$statistic[[1]]}
  m6[v+(o-1)*12+7]=t.test(apply(do.call("cbind",lapply(paste0("a",0:4,"f",o),get)[[1]]),1,mean)-
                            apply(do.call("cbind",lapply(paste0("a",0:4,"f",o),get)[[5]]),1,mean))$statistic[[1]]}

mm2<-matrix(m6,4,6,byrow = TRUE)
mm3<-rbind(mm1,matrix(m5[1:30],5,6),mm2[1,],matrix(m5[31:60],5,6),mm2[2,],matrix(m5[61:90],5,6),mm2[3,],matrix(m5[91:120],5,6),mm2[4,])
write.csv(mm3,"E:/R/tail risk/table/mm.csv",row.names = FALSE)

# 计算出各值
# 尾部beta分组
for(o in 1:2){
  for(i in 1:5){
    print(mean(lapply(paste0("a",0:4,"b",o),get)[[i]]))}
  print(mean(lapply(paste0("a",0:4,"b",o),get)[[1]]-lapply(paste0("a",0:4,"b",o),get)[[5]]))}

for(o in 1:2){
  for(i in 1:5){
    print(t.test(lapply(paste0("a",0:4,"b",o),get)[[i]])$statistic[[1]])}
  print(t.test(lapply(paste0("a",0:4,"b",o),get)[[1]]-lapply(paste0("a",0:4,"b",o),get)[[5]])$statistic[[1]])}
# 差价分组1
for(o in 1:2){
  for(i in 1:5){
    print(mean(lapply(paste0("a",0:4,"c",o),get)[[i]]))}
  print(mean(lapply(paste0("a",0:4,"c",o),get)[[1]]-lapply(paste0("a",0:4,"c",o),get)[[5]]))}

for(o in 1:2){
  for(i in 1:5){
    print(t.test(lapply(paste0("a",0:4,"c",o),get)[[i]])$statistic[[1]])}
  print(t.test(lapply(paste0("a",0:4,"c",o),get)[[1]]-lapply(paste0("a",0:4,"c",o),get)[[5]])$statistic[[1]])}
# 差价分组2
for(o in 1:2){
  for(i in 1:5){
    print(mean(lapply(paste0("a",0:4,"d",o),get)[[i]]))}
  print(mean(lapply(paste0("a",0:4,"d",o),get)[[1]]-lapply(paste0("a",0:4,"d",o),get)[[5]]))}

for(o in 1:2){
  for(i in 1:5){
    print(t.test(lapply(paste0("a",0:4,"d",o),get)[[i]])$statistic[[1]])}
  print(t.test(lapply(paste0("a",0:4,"d",o),get)[[1]]-lapply(paste0("a",0:4,"d",o),get)[[5]])$statistic[[1]])}
# 差价分组3
for(o in 1:2){
  for(i in 1:5){
    print(mean(lapply(paste0("a",0:4,"e",o),get)[[i]]))}
  print(mean(lapply(paste0("a",0:4,"e",o),get)[[1]]-lapply(paste0("a",0:4,"e",o),get)[[5]]))}

for(o in 1:2){
  for(i in 1:5){
    print(t.test(lapply(paste0("a",0:4,"e",o),get)[[i]])$statistic[[1]])}
  print(t.test(lapply(paste0("a",0:4,"e",o),get)[[1]]-lapply(paste0("a",0:4,"e",o),get)[[5]])$statistic[[1]])}
# 差价分组4
for(o in 1:2){
  for(i in 1:5){
    print(mean(lapply(paste0("a",0:4,"g",o),get)[[i]]))}
  print(mean(lapply(paste0("a",0:4,"g",o),get)[[1]]-lapply(paste0("a",0:4,"g",o),get)[[5]]))}

for(o in 1:2){
  for(i in 1:5){
    print(t.test(lapply(paste0("a",0:4,"g",o),get)[[i]])$statistic[[1]])}
  print(t.test(lapply(paste0("a",0:4,"g",o),get)[[1]]-lapply(paste0("a",0:4,"g",o),get)[[5]])$statistic[[1]])}
# 差价分组5
for(o in 1:2){
  for(v in 1:5){
    for(l in 1:5){
      print(mean(lapply(paste0("a",0:4,"f",o),get)[[v]][[l]]))}}
  for(l in 1:5){
    print(mean(lapply(paste0("a",0:4,"f",o),get)[[1]][[l]]-lapply(paste0("a",0:4,"f",o),get)[[5]][[l]]))}}

for(o in 1:2){
  for(v in 1:5){
    for(l in 1:5){
      print(t.test(lapply(paste0("a",0:4,"f",o),get)[[v]][[l]])$statistic[[1]])}}
  for(l in 1:5){
    print(t.test(lapply(paste0("a",0:4,"f",o),get)[[1]][[l]]-lapply(paste0("a",0:4,"f",o),get)[[5]][[l]])$statistic[[1]])}}
# 平均
for(o in 1:2){
  for(v in 1:5){
    print(mean(apply(do.call("cbind",lapply(paste0("a",0:4,"f",o),get)[[v]]),1,mean)))}
  print(mean(apply(do.call("cbind",lapply(paste0("a",0:4,"f",o),get)[[1]]),1,mean)-
               apply(do.call("cbind",lapply(paste0("a",0:4,"f",o),get)[[5]]),1,mean)))}

for(o in 1:2){
  for(v in 1:5){
    print(t.test(apply(do.call("cbind",lapply(paste0("a",0:4,"f",o),get)[[v]]),1,mean))$statistic[[1]])}
  print(t.test(apply(do.call("cbind",lapply(paste0("a",0:4,"f",o),get)[[1]]),1,mean)-
                 apply(do.call("cbind",lapply(paste0("a",0:4,"f",o),get)[[5]]),1,mean))$statistic[[1]])}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
VaR(Value at Risk)是一种常用的风险测度方法,通常用于金融领域对市场风险测度与管理。利用VaR对股票收益率进行预测的相关文献较为丰富,以下是一些相关文献综述: 1. "Value at Risk and Expected Tail Loss: Estimating the Extremes of Stock Returns",作者为Glen McLeod和William Remus,发表于2002年。该文献介绍了利用VaR和Expected Tail Loss(ETL)对股票收益率进行预测的方法,并对比了两种方法的优劣。 2. "Forecasting Stock Market Returns by Combining Forecasts from Different Methods",作者为Antonio Rubia和Trino-Manuel Ñíguez,发表于2010年。该文献提出了一种基于VaR的预测方法,通过将来自不同方法的预测结果进行组合,提高了预测的准确性。 3. "Modeling and Forecasting the Volatility of the S&P 100 Index using GARCH Models and Value-at-Risk",作者为Jin Zhang和Haiming Liu,发表于2016年。该文献利用GARCH模型和VaR方法对S&P 100指数的波动率进行建模和预测,并探讨了VaR在预测中的应用。 4. "A Comparison of VaR Estimation Methods for Stock Market Returns",作者为Kathleen M. Auerbach和David R. Peterson,发表于2004年。该文献比较了不同的VaR估计方法在股票收益率预测中的表现,并提供了一种基于Monte Carlo模拟的VaR估计方法。 5. "Value-at-Risk Estimation and Forecasting with the Generalized Autoregressive Score Model: Evidence from Emerging and Developed Stock Markets",作者为Hernando Vargas,发表于2006年。该文献利用广义自回归得分模型(GAS模型)和VaR方法对新兴市场和发达市场的股票收益率进行预测,结果表明该方法在预测上的表现优于其他方法。 总之,利用VaR对股票收益率进行预测的方法具有一定的实用性和优越性,但在具体应用中需要结合实际情况选择合适的VaR估计方法和模型。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值