资源简介
ARIMA模型-matlab代码,可以根据自己的实际情况进行参数调节,实现所需要的效果。
代码片段和文件信息
% y=xlsread(‘D:\2017-研一\金泽1号测亭和吴江水质\test.xlsx‘‘金泽1号测亭COD‘‘B1:B31214‘)
%y=xlsread(‘D:\2017-研一\金泽1号测亭和吴江水质\全市水量数据\全市小时级别水量.xlsx‘‘sheet1‘‘B2:B247‘)
%%%%%%%%%%原始数据:
y=[ 842.760000000000 871.460000000000 882.460000000000 977.830000000000 836.960000000000 816.960000000000 803.390000000000 849.050000000000 822.230000000000 828.120000000000 857.100000000000 868.930000000000 874.240000000000 863.710000000000 867.940000000000 863.070000000000 890.460000000000 866.580000000000 874.530000000000 864.900000000000 873.730000000000 864.900000000000 852.420000000000 881.150000000000 866.090000000000 885.250000000000 868.380000000000 860.030000000000 848.830000000000 838.300000000000 869.140000000000 868.900000000000 858.300000000000 828.300000000000 806.330000000000 841.620000000000 847.830000000000 862.340000000000 850.690000000000 850.720000000000 825.410000000000 833.610000000000 842.100000000000 854.890000000000 846.680000000000 842.090000000000 845.230000000000 871.490000000000 868.320000000000 856.340000000000 863.130000000000 863.560000000000 842.170000000000 827.260000000000 828.810000000000];
%%%%%%%%%%预处理后的数据:
%y=[ 842.760000000000 871.460000000000 882.460000000000 977.830000000000 836.960000000000 816.960000000000 803.390000000000 849.050000000000 822.230000000000 828.120000000000 857.100000000000 868.930000000000 874.240000000000 863.710000000000 867.940000000000 863.070000000000 890.460000000000 866.580000000000 874.530000000000 864.900000000000 873.730000000000 864.900000000000 852.420000000000 881.150000000000 866.090000000000 885.250000000000 868.380000000000 860.030000000000 848.830000000000 838.300000000000 869.140000000000 868.900000000000 858.300000000000 828.300000000000 806.330000000000 841.620000000000 847.830000000000 862.340000000000 850.690000000000 850.720000000000 825.410000000000 833.610000000000 842.100000000000 854.890000000000 846.680000000000 842.090000000000 845.230000000000 871.490000000000 868.320000000000 856.340000000000 863.130000000000 863.560000000000 842.170000000000 827.260000000000 828.810000000000];
Data=y‘;%共60个数据
%Data=y;%共247个数据
%SourceData=Data(1:2501); %前250个训练集
%SourceData=Data(1:541); %前54个训练集
SourceData=Data(1:491); %前54个训练集
%SourceData=Data(2:2241); %前222个训练集
step=6;%后6个测试
%step=23 ;%后23 个测试
TempData=SourceData;
TempData=detrend(TempData);%去趋势线
TrendData=SourceData-TempData;%趋势函数
%--------差分,平稳化时间序列---------
H=adftest(TempData);
difftime=0;
SaveDiffData=[];
while ~H
SaveDiffData=[SaveDiffDataTempData(11)];
TempData=diff(TempData);%差分,平稳化时间序列
difftime=difftime+1;%差分次数
H=adftest(TempData);%adf检验,判断时间序列是否平稳化
end
%---------模型定阶或识别--------------
u = idda
- 上一篇:matlab风速仿真模型渐变风文件
- 下一篇:抗差最小二乘Matlab代码
评论
共有 条评论