✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
由于风速具有间歇性,随机性及波动性等特点,导致大规模风电并网对电力系统的安全,稳定运行带来严重影响.文章提出一种基于最大相关最小冗余(Maximum Correlation Minimum Redundancy,MRMR)的离群鲁棒极限学习机(Outlier Robust Extreme Learning Machine,ORELM)的短期风速预测新方法.首先分析影响风速的属性特征,采用MRMR算法来衡量不同风速属性特征与风速的相关性,进而确定风速属性特征的输入维度;然后对极限学习机(Extreme Learning Machine,ELM)进行优化,构建ORELM风速预测模型.最后以美国某大型风电场实测数据为依据进行风速预测,仿真结果表明该方法具有较高的预测精度.
⛄ 部分代码
=========================================================================
% Outlier-robust extreme learning machine, Version 2.0
%
% ----------------------------------------------------------------------
% Permission to use, copy, or modify this software and its documentation
% for educational and research purposes only and without fee is here
% granted, provided that this copyright notice and the original authors'
% names appear on all copies and supporting documentation. This program
% shall not be used, rewritten, or adapted as the basis of a commercial
% software or hardware product without first obtaining permission of the
% authors. The authors make no representations about the suitability of
% this software for any purpose. It is provided "as is" without express
% or implied warranty.
%----------------------------------------------------------------------
%
% This is an implementation of the algorithm for "SinC" function regression
%
% Please cite the following paper if you use this code:
%
% Zhang, Kai, and Minxia Luo. "Outlier-robust extreme learning machine for regression problems."
% Neurocomputing 151 (2015): 1519-1527.
%
%--------------------------------------------------------------------------
function [nn, acc_train] = elm_train(X, Y, nn)
% beta f(Wx+b) = y
tic;
ndata = size(X,2);
tempH = nn.W*X + repmat(nn.b,1,ndata);
switch lower(nn.activefunction)
case{'s','sig','sigmoid'}
H = 1 ./ (1 + exp(-tempH));
case{'t','tanh'}
H = tanh(tempH);
end
clear tempH;
switch(nn.method)
case 'ELM'
[beta] = regressor(H', Y', 0);
case 'RELM'
[beta] = regressor(H', Y', nn.C);
case 'WRELM'
[beta] = regressor(H', Y', nn.C);
e = beta'*H - Y;
%s = iqr(e)/(2*0.6745);
%e = sum(abs(e),1);
s = median(abs(e))/0.6745;
w = weight_fun(e, nn.wfun, s);
[beta] = regressor(repmat(sqrt(w'),1,size(H,1)).*H', repmat(sqrt(w'),1,size(Y,1)).*Y', nn.C);
case 'ORELM'
[beta] = regressor_alm(H', Y', nn.C, 20);
end
nn.time_train = toc;
nn.beta = beta';
Y_hat = nn.beta*H;
if ismember(nn.type,{'c','classification','Classification'})
[~,label_actual] = max(Y_hat,[],1);
[~,label_desired] = max(Y,[],1);
acc_train = sum(label_actual==label_desired)/ndata;
else
normfro = norm(Y-Y_hat,'fro');
acc_train = sqrt(normfro^2/ndata);
% acc_train = sqrt(mse(Y-Y_hat));
end
nn.trainlabel = Y_hat;
nn.acc_train = acc_train;
⛄ 运行结果
⛄ 参考文献
[1]陈明帆, 宁光涛, 何礼鹏,等. 基于分位回归鲁棒极限学习机的短时负荷预测方法[J]. 水电能源科学, 2018, 36(10):4.