版权声明:转载需写明出处 https://blog.csdn.net/qq_23860475/article/details/80670234
原理
iris工具箱下载地址
链接:https://pan.baidu.com/s/1Rpe1XacxOb9zvyiA5Ye0KQ 密码:c8i2
数据集
中国2004年1月-2014年12月旅游外汇收入数据,单位:亿美元。
matlab代码
%运行代码前确保安装iris工具箱
clc;clear;
irisstartup;%开启iris会话
date=mm(2004,1):mm(2014,12);%月度数据用mm(),季度数据用qq()
value=[15.15 15.61 17.65 20.28 18.5 19.27 20.64 21.6 20.53 23.31 23.36 22.35 21.51 20.37 24.62 25.64 24.4 25.47 26.07 26.71 24.9 27.91 24.26 22.98 21.61 22.18 24.63 27.16 25.73 25.52 27.72 28.78 26.96 30.97 29.12 29.21 27.23 24.03 31.72 32.87 32.23 31.27 33.48 34.1 32.05 36.13 32.37 33.61 33.19 30.41 37.1 36.99 33.79 30.84 32.56 31.98 31.42 36.8 32.53 31.42 27.69 28.34 31.61 34.18 30.86 29.77 33.25 34.66 31.34 36.22 33.6 34.45 33.85 28.83 39.4 39.6 38.99 37.94 39.58 40.47 38.42 42.24 36.35 36.29 33.77 32.16 38.6 41.83 39.85 39.29 41.31 41.64 39.34 43.59 38.97 39.35 34.84 36.83 41.71 43.53 41.28 40.1 40.69 42.32 39.25 43.12 39.11 39.38 38.09 32.28 43.71 41.51 39.49 39.3 39.41 39.64 39.64 45.82 40.16 41.76 38.3 36.2 42.48 44.3 43.87 42.57 42.8 44.94 43.53 48.74 43.48 51.28
];
x_data=tseries(date,value);
x_tc=x12(x_data,'output=','TC','mode=','mult');%采用乘法模型输出长期循环趋势
x_sf=x12(x_data,'output=','SF','mode=','mult');%采用乘法模型输出季节调整系数
x_ir=x12(x_data,'output=','IR','mode=','mult');%采用乘法模型输出不规则系数
%mode=取值主要有'mult','add','auto’
figure(1)
plot(x_data,'r')
title('原始数据')
xlabel('时间');
ylabel('旅游外汇收入(亿美元)');
figure(2)
plot(x_tc,'b')
title('长期循环趋势')
xlabel('时间');
ylabel('旅游外汇收入(亿美元)');
figure(3)
plot(x_sf,'b')
title('季节调整系数SF')
xlabel('时间');
ylabel('旅游外汇收入(亿美元)');
figure(4)
plot(x_ir,'b')
title('不规则系数IR')
xlabel('时间');
ylabel('旅游外汇收入(亿美元)');
irisfinish;%关闭iris会话
运行结果
备注:承接模型代码实现(支持python、matlab),有意请联系QQ947943645 ,非诚勿扰!