matlab建立ar时间序列模型_金融时间序列模型在50ETF中的应用 Time Series Model for 50ETF...

1.数据和软件1.Data and Software现在金融数据的来源很多,常用的有国际著名公司的Bloomberg,以及国内的Wind,东方财富,聚源和聚宽等等。感兴趣的朋友可以根据自身的情况选择数据来。本文中的数据来自雅虎金融(Yahoo!Finance)。Nowadays, there are many ways to get financial data. The most we...
摘要由CSDN通过智能技术生成

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

925617096c2f6ff86c3307f873f59699.png

                           数据来源: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:

7951400fdd5444b55745eaf4b4cb900d.png

其中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-

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MATLAB,可以使用时间序列模型进行AR(自回归)建模。AR模型是一种根据过去的观测值来预测未来观测值的模型。 要使用AR时间序列模型,首先需要导入时间序列数据并将其转换为MATLAB时间序列对象。可以使用`timeseries`函数或`timetable`函数来完成这一步骤。 接下来,可以使用`arima`函数创建ARIMA模型对象。ARIMA模型是一种广义的自回归移动平均模型,它包括了AR模型作为其的一个特例。在创建ARIMA模型对象时,可以指定AR阶数(即自回归阶数)。 以下是一个示例代码,展示了如何在MATLAB创建AR时间序列模型: ```matlab % 导入时间序列数据并转换为时间序列对象 data = [2, 4, 6, 8, 10, 12]; ts = timeseries(data); % 创建ARIMA模型对象 ar_order = 2; % AR阶数 model = arima(ar_order, 0, 0); % 创建ARIMA模型对象 % 拟合AR模型 fit_model = estimate(model, ts); % 拟合AR模型 % 预测未来观测值 future_length = 3; % 预测未来3个观测值 forecast = forecast(fit_model, future_length); % 预测未来观测值 % 显示预测结果 disp(forecast); ``` 在上述示例代码,首先将包含观测值的向量转换为时间序列对象。然后,创建ARIMA模型对象,并通过`estimate`函数拟合AR模型。最后,使用`forecast`函数预测未来观测值,并将结果显示出来。 请注意,此示例仅为了说明如何在MATLAB使用AR模型。实际应用,可能需要进行更多的数据预处理、模型选择和模型评估等步骤。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值