时序预测 | MATLAB实现ELM极限学习机时间序列预测未来

这篇具有很好参考价值的文章主要介绍了时序预测 | MATLAB实现ELM极限学习机时间序列预测未来。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

时序预测 | MATLAB实现ELM极限学习机时间序列预测未来

预测效果

时序预测 | MATLAB实现ELM极限学习机时间序列预测未来,时间序列,ELM,极限学习机
时序预测 | MATLAB实现ELM极限学习机时间序列预测未来,时间序列,ELM,极限学习机
时序预测 | MATLAB实现ELM极限学习机时间序列预测未来,时间序列,ELM,极限学习机
时序预测 | MATLAB实现ELM极限学习机时间序列预测未来,时间序列,ELM,极限学习机
时序预测 | MATLAB实现ELM极限学习机时间序列预测未来,时间序列,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 < 2
    error('ELM:Arguments','Not enough input arguments.');
end
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if nargin < 3
    N = size(P,2);
end
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if nargin < 4
    TF = 'sig';
end
%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if nargin < 5
    TYPE = 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  == 1
    T  = 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 TF
    case '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文章来源地址https://www.toymoban.com/news/detail-702994.html

到了这里,关于时序预测 | MATLAB实现ELM极限学习机时间序列预测未来的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包