当前位置: 首页 > news >正文

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

时序预测 | 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 '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

http://www.lryc.cn/news/165463.html

相关文章:

  • 【数据分享】1901-2022年我国省市县镇四级的逐年平均气温数据(免费获取/Shp/Excel格式)
  • 【Axure高保真原型】日历日期原型模板
  • 深入了解接口测试:Postman 接口测试指南
  • 【ROS】Ubuntu20.04+ROS Noetic 配置PX4-v1.12.2和Gazebo11联合仿真环境【教程】
  • Java 代理模式之静态代理与动态代理
  • 打造基于终端命令行的IDE,Termux配置Vim C++开发环境
  • 【初阶C语言】操作符2---表达式求值
  • 代码随想录day50|123. 买卖股票的最佳时机 III188. 买卖股票的最佳时机 IV
  • Word 表格单元格无法垂直居中
  • python实现Flask POST Demo
  • 3-Pytorch张量的运算、形状改变、自动微分
  • 用户权限数据转换为用户组列表(3/3) - Excel PY公式
  • VS2022+CMAKE+OPENCV+QT+PCL安装及环境搭建
  • JavaScript的内置类
  • 6.英语的十六种时态(三面旗):主动、被动、肯定、否定、一般疑问句、特殊疑问句。
  • SpringBoot连接Redis与Redisson【代码】
  • ardupilot开发 --- MAVSDK 篇
  • 腾讯云AI超级底座新升级:训练效率提升幅度达到3倍
  • AB测试结果分析
  • Python模块和包:sys模块、os模块和变量函数的使用
  • 计算机软件工程毕业设计题目推荐
  • 嵌入式学习笔记(25)串口通信的基本原理
  • c++学习第十三
  • java复习-线程的同步和死锁
  • Qt指示器设置
  • 计算机网络第四节 数据链路层
  • Vue.js not detected解决方法
  • Window10安装PHP7.4
  • 【C++刷题】二叉树进阶刷题
  • 有效的数独