1.数据和软件
1.Data and Software
现在金融数据的来源很多,常用的有国际著名公司的Bloomberg,以及国内的Wind,东方财富,聚源和聚宽等等。感兴趣的朋友可以根据自身的情况选择数据来。本文中的数据来自雅虎金融(Yahoo!Finance)。
Nowadays, there are many ways to get financial data. The most well-known financial data provider is Bloomberg. For Chinese financial data, you can get them from Wind, Choice, Gildata or joinquant etc.
现在各类分析软件也很多,例如Python,Matlab, R, SAS等等。它们都可以做统计分析,都可以用来研究时间序列模型。读者可以根据自己的使用习惯,选择合适的软件进行数据分析。本文使用的是R语言。
Also, there are lots of data analysispackages, for example Python, Matlab, R, SAS etc. All of them can analyze financialtime series models. You can choose whichever you are familiar with. In this paper,R language is used and data is from Yahoo!Finance.
2.50ETF及其对数收益率
2.50ETF & its log returns
我们来看AR模型在金融分析中的应用案例。图1是2007年1月以来50ETF的收盘价。
50ETF tracks the performance of Shanghai Stock Exchange 50 (SSE50) Index. SSE 50 Index includes 50 large cap stocks in China from top banks to real estate companies. Not only ICBC, CCB, ABC, but also famous white wine company Mao-tai are included in SSE 50 index. Simply speaking you can think SSE 50 as S&P 500 or Dow 30 Index in the US market. Figure 1 is the closing prices of 50ETF from Jan. 4, 2007 to May 27,2019.
图1.50ETF 收盘价
Figure 1. Closing Prices of 50ETF
数据来源:Yahoo!Finance
Source:Yahoo!Finance
由于股票价格的对数收益率符合正态分布,所以我们先要把50ETF每天的收盘价变成对数收益率,然后在进行分析,见图2。所谓对数收益率,就是对数股票价格的差,也就是:
Since the log returns of stocks are normal distributed, I first change 50ETF closing prices to log returns. Then I can analyze them. Log returns are calculated as follow:
其中Rt是对数收益率,Pt和Pt-1分别是股票或者其他资产在t日和t-1日的收盘价。
Where Rt are the log returns, Pt and Pt-1 are closing prices of stocks at day t and day t-