Periodic Epitaxy Superposition Prediction

This article includes the following:

  • The basic idea
  • code
  • Applications
  • problem discussion

The basic idea

A complex time series process can always be regarded as a process in which a finite number of periodic waves with different periods are superimposed on each other. If the period contained in the process can be analyzed and identified based on the measured data, the periodic waves can be epitaxied separately, and then linearly superimposed for prediction.
Obviously, the key problem of this method is how to perform periodic analysis on the measured data. The problems that need to be solved by cycle analysis are:

  • Whether a time series process has cycles
  • If there is a period, how long is the period
  • According to the cycle obtained by the analysis of the measured data, how reliable is it?

For an observation sample series, the method of ANOVA can be used to identify the period. Divide the sequence into several groups. When the number of groups is equal to the length of the period that exists objectively, the difference of each data within the group is small, while the difference of each data between groups is large; if the difference between groups is significantly greater than the difference within the group, the sequence exists period, and its length is the number of groups at this time. By choosing different confidence levels, the F-test is used to judge that the difference between groups is less significant than the difference between groups.

code

% 周期外延叠加预测
clear;clc;
load('Zhengzhou_prec_1951-2007.mat'); %加载原始数据
y=Dat(1:end-1); %计算数据,最后一个为预测对比
n=length(y);    %数据个数
m=fix(n/2);     %最大分组数
Fa(1)=0;
for b=2:m
    f1=b-1; f2=n-b; %自由度
    Fa(b)=finv(0.80,f1,f2); %F分布值
end    
for k=1:4   %最多识别4个周期波
    F=zeros(m,1);XX=[];
    for b=2:m    %b为组数
        a=ceil(n/b); %每组数据个数
        yy=[y;-9999*ones(size(y))];yy=yy(1:a*b);
        x=transpose(reshape(yy,b,a)); %分组排列数据,后面需考虑空值-9999的影响
        xm=[];
        for j=1:b
            xm(j)=mean(x((find(x(:,j)~=-9999)),j)); %每组均值
        end
        s1=sum((xm-mean(y)).^2);  %组间方差
        s2=0;
        for i=1:a
            for j=1:b
                if x(i,j)~=-9999
                    s2=s2+(x(i,j)-xm(j))^2; %组内方差
                end
            end
        end
        F(b)=(s1/b)/(s2/n);  %方差比
        pp=[];
        while length(pp)<n+1
            pp=[pp,xm];    %周期波扩展
        end
        XX(b,:)=pp(1:n+1); %获取周期波
    end
    Fs=F-transpose(Fa);   % F检验差值
    idx=find(Fs>0); %找出通过检验的值
    if isempty(idx)
        [Fm,B]=max(F); %记录最大方差比对应周期
        disp(strcat('第',num2str(k),'周期波周期为',num2str(B), ...
             ',方差比为',num2str(Fm),',未通过显著性检验'));
    else
        [Fm,B]=max(F(idx));B=idx(B);
        disp(strcat('第',num2str(k),'周期波周期为',num2str(B), ...
             ',方差比为',num2str(Fm)));
    end
    p(:,k)=transpose(XX(B,:)); %记录最大方差比对应周期波
    y=y-p(1:n,k);    %剔除周期波产生新序列   
end
ys=sum(p,2);  %周期波叠加结果
%作图
t=1951:2007;
figure(1);
for k=1:4
    subplot(2,2,k);
    plot(t,p(:,k));
    xlabel('年份'); ylabel(strcat('第',num2str(k),'周期波'))
    grid on;
end
figure(2);
plot(t,Dat,'r-*'); hold on;
plot(t(1:end-1),ys(1:end-1),'b--o');hold on;
plot(2007,ys(end),'go');
xlabel('年份'); ylabel('郑州年降水量(mm/yr)');
legend('实测值','周期波叠加','预测');
title('周期外延叠加预测结果');
grid on;

Applications

Taking the annual precipitation forecast in Zhengzhou as an example, the effect of period epitaxy superposition calculation is illustrated. Run the above program code, when the confidence level is 80%, extract 4 periodic waves, the screen output results are:

The first periodic wave period is 20, the variance ratio is 1.4790
The second periodic wave period is 26, the variance ratio is 1.4257
The third periodic wave period is 21, and the variance ratio is 1.3643, which fails the significance test
The fourth periodic wave period is 28, The variance ratio is 1.5495

The prediction results of each periodic wave and the superposition of periodic waves are shown in the figure below.
write picture description here
write picture description here

problem discussion

(1) When applying period epitaxy superposition for prediction, it is actually assumed that the period obtained by the analysis will remain unchanged in the future time. However, changes in the actual process do not cycle back and forth on a fixed cycle. Therefore, the cycle obtained by the analysis can only be used as a basis for forecasting within a period of time, and cannot be extrapolated indefinitely.
(2) The application of variance analysis to identify the cycle is judged by the F test, and the application of the F test needs to meet two conditions: one is that each group of data obeys a normal distribution; In practice, it is generally difficult to meet these conditions. Therefore, when performing cycle identification, an appropriate confidence level should be selected. If the reliability is chosen too high, it is easy for the period to fail the significance test.
(3) Generally speaking, the more periodic waves are identified, the better the fitting of the superposition result with the historical data. But from the point of view of forecasting, the cycle obtained is better to be stable. Therefore, the number of periodic waves to be extracted should not be too many, and 2 to 3 are appropriate.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326487768&siteId=291194637