建設(shè)通網(wǎng)站公路查詢軟文案例
時序預(yù)測 | MATLAB實現(xiàn)EMD-iCHOA+GRU基于經(jīng)驗?zāi)B(tài)分解-改進黑猩猩算法優(yōu)化門控循環(huán)單元的時間序列預(yù)測
目錄
- 時序預(yù)測 | MATLAB實現(xiàn)EMD-iCHOA+GRU基于經(jīng)驗?zāi)B(tài)分解-改進黑猩猩算法優(yōu)化門控循環(huán)單元的時間序列預(yù)測
- 預(yù)測效果
- 基本介紹
- 程序設(shè)計
- 參考資料
預(yù)測效果
基本介紹
EMD-iCHOA+GRU基于經(jīng)驗?zāi)B(tài)分解-改進黑猩猩算法優(yōu)化門控循環(huán)單元的時間序列預(yù)測
1.時間序列單列輸入,如需多特征輸入需額外付費。經(jīng)過EMD分解后利用優(yōu)化后的GRU對每個分量進行預(yù)測最后集成相加,算法新穎~EMD也可以換成其他分解方法,GRU也可以換成BiLSTM等其他預(yù)測模型。
2.iCHOA改進的黑猩猩優(yōu)化算法改進點如下:
[1]利用Sobol序列初始化種群,增加種群的隨機性和多樣性,為算法全局尋優(yōu)奠定基礎(chǔ);
[2]其次,引入基于凸透鏡成像的反向?qū)W習(xí)策略,將其應(yīng)用到當(dāng)前最優(yōu)個體上產(chǎn)生新的個體,提高算法的收斂精度和速度;
[3]最后,將水波動態(tài)自適應(yīng)因子添加到攻擊者位置更新處,增強算法跳出局部最優(yōu)的能力。
3.直接替換Excel數(shù)據(jù)即可用,注釋清晰,適合新手小白
4.附贈測試數(shù)據(jù),輸入格式如圖3所示,可直接運行
程序設(shè)計
- 完整程序和數(shù)據(jù)下載方式私信博主回復(fù):MATLAB實現(xiàn)EMD-iCHOA+GRU基于經(jīng)驗?zāi)B(tài)分解-改進黑猩猩算法優(yōu)化門控循環(huán)單元的時間序列預(yù)測。
%% 參數(shù)設(shè)置
%% 訓(xùn)練模型
%% 模型預(yù)測%% 數(shù)據(jù)反歸一化
T_sim1 = mapminmax('reverse', t_sim1, ps_output);
T_sim2 = mapminmax('reverse', t_sim2, ps_output);
function [IW,B,LW,TF,TYPE] = elmtrain(P,T,N,TF,TYPE)
% ELMTRAIN Create and Train a Extreme Learning Machine
% Syntax
% [IW,B,LW,TF,TYPE] = elmtrain(P,T,N,TF,TYPE)
% Description
% Input
% P - Input Matrix of Training Set (R*Q)
% T - Output Matrix of Training Set (S*Q)
% N - Number of Hidden Neurons (default = Q)
% TF - Transfer Function:
% 'sig' for Sigmoidal function (default)
% 'sin' for Sine function
% 'hardlim' for Hardlim function
% TYPE - Regression (0,default) or Classification (1)
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% Output
% IW - Input Weight Matrix (N*R)
% B - Bias Matrix (N*1)
% LW - Layer Weight Matrix (N*S)
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% Example
% Regression:
% [IW,B,LW,TF,TYPE] = elmtrain(P,T,20,'sig',0)
% Y = elmtrain(P,IW,B,LW,TF,TYPE)
% Classification
% [IW,B,LW,TF,TYPE] = elmtrain(P,T,20,'sig',1)
% Y = elmtrain(P,IW,B,LW,TF,TYPE)
% See also ELMPREDICT
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if nargin < 2error('ELM:Arguments','Not enough input arguments.');
end
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if nargin < 3N = size(P,2);
end
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if nargin < 4TF = 'sig';
end
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if nargin < 5TYPE = 0;
end
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if size(P,2) ~= size(T,2)error('ELM:Arguments','The columns of P and T must be same.');
end
[R,Q] = size(P);
if TYPE == 1T = ind2vec(T);
end
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[S,Q] = size(T);
% Randomly Generate the Input Weight Matrix
IW = rand(N,R) * 2 - 1;
% Randomly Generate the Bias Matrix
B = rand(N,1);
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BiasMatrix = repmat(B,1,Q);
% Calculate the Layer Output Matrix H
tempH = IW * P + BiasMatrix;
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
switch TFcase 'sig'H = 1 ./ (1 + exp(-tempH));case 'sin'H = sin(tempH);case 'hardlim'H = hardlim(tempH);
end
% Calculate the Output Weight Matrix
LW = pinv(H') * T';
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
參考資料
[1] https://blog.csdn.net/article/details/126072792?spm=1001.2014.3001.5502
[2] https://blog.csdn.net/article/details/126044265?spm=1001.2014.3001.5502