广州快速建站公司推荐,百度网盘电脑版官网,wordpress主题授权机制,网站地图插件时序预测 | MATLAB实现ELM极限学习机时间序列预测未来 目录 时序预测 | MATLAB实现ELM极限学习机时间序列预测未来预测效果基本介绍程序设计参考资料 预测效果 基本介绍 1.MATLAB实现ELM极限学习机时间序列预测未来#xff1b; 2.运行环境Matlab2018及以上#xff0c;data为数…时序预测 | MATLAB实现ELM极限学习机时间序列预测未来 目录 时序预测 | MATLAB实现ELM极限学习机时间序列预测未来预测效果基本介绍程序设计参考资料 预测效果 基本介绍 1.MATLAB实现ELM极限学习机时间序列预测未来 2.运行环境Matlab2018及以上data为数据集单变量时间序列预测运行主程序ELMTSF即可其余为函数文件无需运行 3.递归预测未来数据可以控制预测未来大小的数目适合循环性、周期性数据预测 4.命令窗口输出R2、MAE、MAPE、MBE、MSE等评价指标。 程序设计
完整程序和数据下载方式私信博主回复MATLAB实现ELM极限学习机时间序列预测未来。
%% 参数设置
%% 训练模型
%% 模型预测%% 数据反归一化
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 sigH 1 ./ (1 exp(-tempH));case sinH sin(tempH);case hardlimH hardlim(tempH);
end
% Calculate the Output Weight Matrix
LW pinv(H) * T;
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
参考资料 [1] https://blog.csdn.net/article/details/126072792?spm1001.2014.3001.5502 [2] https://blog.csdn.net/article/details/126044265?spm1001.2014.3001.5502