Zscore Model Tutorial

来源:https://uqer.io/community/share/54ab4407f9f06c276f6519ec

1. 什么是 Zscore Model

信用风险评分方法通常包括定性法、单变量法、多变量法,目前广泛采用多变量方法包括如判别分析(discriminant analysis)、逻辑回归(logit regression)和非线性模型如神经网络等。奥特曼博士于1968年发表的Z-score模型基于多变量判别分析方法。

Z-score模型基于各变量加权得分对企业是否破产进行判断,在Z-score原始模型中,得分高于2.99的属于“安全”区域、低于1.80的属于“困境”区域,两个得分之间的属于“灰色”区域。

Z-score模型在美国企业如柯达、通用汽车的破产预测得到了很好的结果。

2. 本模块提供的 Zscore Model

下面我们从原理,模型公式,划分区间三个方面来简单介绍一下本模块中的两个Z-score模型:

2.1 All Corporate Bonds

模型原理

  • No equity prices are needed
  • Uses discriminant analysis methodology
  • Coefficients are obtained from China distressed firm dataset from historical periods 模型公式
  1. ZScore = 0.517 - 0.460*TotalLiabilities/TotalAssets
  2. + 9.320*NetProfit/0.5*(TotalAssets+TotalAssets[last])
  3. + 0.388*WorkingCapital/TotalAssets
  4. + 1.158*RetainedEarnings/TotalAssets
  5. = 0.517 - 0.460*x1
  6. + 9.320*2/x2
  7. + 0.388*x3
  8. + 1.158*x4

划分区间

  • Z-score < 0.5: 已经违约
  • 0.5 < Z-score < 0.9: 有违约的可能性
  • Z-score > 0.9: 财务健康,短期内不会出现违约情况

2.2 Corporate Bonds with Equity Listings

模型原理

  • Uses Equity Prices: Information from equity set
  • Uses discriminant analysis methodology
  • Coefficients are obtained from China distressed firm dataset from historical periods 模型公式
  1. ZScore = 0.2086*x1 + 4.3465*x2 + 4.9601*x3
  2. x1: market value/book value of TotalLiabilities
  3. x2: total sales/TotalAssets
  4. x3: (TotalAssets-TotalAssets[last])/TotalAssets[last]
  5. coef = [0.2086, 4.3465, 4.9601]

划分区间

  • Z-score < 1.5408: 已经违约
  • Z-score > 1.5408: 财务健康,短期内不会出现违约情况

3. 如何实用本模块提供的 Zscore Model 接口

本模块目前提供了四个Z-score模型接口,分别如下:

3.1 zscore_ACB

  1. ---
  2. Interface for calculating zscore using ACB.
  3. parameter:
  4. ticker[string]: ticker code
  5. parameter[opt]:
  6. begin[int]: year begin, default 2010
  7. end[int]: year end, default 2014
  8. coef[list of int]: coefficients for Zscore Model, default [0.517, -0.460, 18.640, 0.388, 1.158]
  9. ---
  10. when success, will return factors and status code, as a dict;
  11. when failed for some reason, will return error message and error code, as a dict;
  12. ---
  13. Model ACB:
  14. All Corporate Bonds
  15. ZScore = 0.517 - 0.460*TotalLiabilities/TotalAssets
  16. + 9.320*NetProfit/0.5*(TotalAssets+TotalAssets[last])
  17. + 0.388*WorkingCapital/TotalAssets
  18. + 1.158*RetainedEarnings/TotalAssets
  19. = 0.517 - 0.460*x1
  20. + 9.320*2/x2
  21. + 0.388*x3
  22. + 1.158*x4
  23. coef = [0.517, -0.460, 18.640, 0.388, 1.158]

3.2 zscore_ACB_List

  1. ---
  2. Interface for calculating zscore using ACB.
  3. parameter:
  4. ticker[list]: ticker code
  5. parameter[opt]:
  6. begin[int or list]: year begin, default 2010
  7. end[int or list]: year end, default 2014
  8. coef[list of int]: coefficients for Zscore Model, default [0.517, -0.460, 18.640, 0.388, 1.158]
  9. ---

3.3 zscore_ACBEL

  1. ---
  2. Interface for calculating zscore using ACBEL.
  3. parameter:
  4. ticker[string]: ticker code
  5. parameter[opt]:
  6. begin[int]: year begin, default 2010
  7. end[int]: year end, default 2014
  8. coef[list of int]: coefficients for model, default [0.2086, 4.3465, 4.9601]
  9. ---
  10. when success, will return factors and status code, as a dict;
  11. when failed for some reason, will return error message and error code, as a dict;
  12. ---
  13. Model ACB:
  14. All Corporate Bonds with Equity Listings
  15. ZScore = 0.2086*x1 + 4.3465*x2 + 4.9601*x3
  16. x1: market value/book value of TotalLiabilities
  17. x2: total sales/TotalAssets
  18. x3: (TotalAssets-TotalAssets[last])/TotalAssets[last]
  19. coef = [0.2086, 4.3465, 4.9601]
  20. ---

3.4 zscore_ACBEL_List

  1. ---
  2. Interface for calculating zscore using ACBEL.
  3. parameter:
  4. ticker[list]: ticker code
  5. parameter[opt]:
  6. begin[int or list]: year begin, default 2010
  7. end[int or list]: year end, default 2014
  8. coef[list of int]: coefficients for Zscore Model, default [0.2086, 4.3465, 4.9601]
  9. ---

4. 一个 Zscore Model 实例

相关步骤说明如下:

  • 4.1 导出该模块
  • 4.2 输入股票代码,可选择性输入计算时间区间,以年为单位
  • 4.3 得到计算结果
  • 4.4 作图分析
  1. # 4.1 & 4.2
  2. GZMT = zscore_ACB('600519')
  3. # 4.3
  4. factors = GZMT['factors']
  5. # 4.4
  6. from matplotlib.pylab import plot
  7. plot(factors['zscore'])
  8. [<matplotlib.lines.Line2D at 0x4eda750>]

Zscore Model Tutorial - 图1

5. 本模块未来版本规划

为适应光大金融人士更加方便地使用 Z-Score Model,本模块将在以下几个方面对本模块的未来版本进行规划:

  • 更加简单:提供上传模板,用户只需按照一定格式上传自己持仓的 excel 表格,即可在零编码的情况下得到相应持仓债券、股票发行人的 Z-Score 情况;
  • 更加灵活:将会允许用户在我们定义的两个 Z-Score 模型的相关系数;
  • 更加智能:预计提供给用户将近50个公司财务相关的因子,由用户自定义因子和相关的系数来计算 Z-Score 值;