五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

【lssvm預測】基于灰狼算法優(yōu)化LSSVM數(shù)據(jù)回歸預測含Matlab源碼

2022-05-05 07:18 作者:Matlab工程師  | 我要投稿

1 簡介

隨著現(xiàn)代智能交通系統(tǒng)的發(fā)展,準確的交通流量預測,尤其是短時交通流量的預測,對實時交通控制的重要性日益凸顯.為了解決交通流量數(shù)據(jù)強非線性對預測精度的影響,本文基于最小二乘支持向量機研究交通流量預測方法.提出了一種灰狼優(yōu)化算法優(yōu)化LSSVM的懲罰因子γ和核函數(shù)參數(shù)σ,實現(xiàn)對短時交通流的精準預測.實驗結果表明,GWO優(yōu)化LSSVM的泛化性能和魯棒性優(yōu)于其他同類方法,可以實現(xiàn)交通流的精準預測.



2 部分代碼

% Grey Wolf Optimizerfunction [Alpha_score,Alpha_pos,Convergence_curve]=GWO(SearchAgents_no,Max_iter,lb,ub,dim,fobj)% initialize alpha, beta, and delta_posAlpha_pos=zeros(1,dim);Alpha_score=inf; %change this to -inf for maximization problemsBeta_pos=zeros(1,dim);Beta_score=inf; %change this to -inf for maximization problemsDelta_pos=zeros(1,dim);Delta_score=inf; %change this to -inf for maximization problems%Initialize the positions of search agentsPositions=initialization(SearchAgents_no,dim,ub,lb);Convergence_curve=zeros(1,Max_iter);l=0;% Loop counter% Main loopwhile l<Max_iter ? ?for i=1:size(Positions,1) ? ? ? ? % Return back the search agents that go beyond the boundaries of the search space ? ? ? ?Flag4ub=Positions(i,:)>ub; ? ? ? ?Flag4lb=Positions(i,:)<lb; ? ? ? ?Positions(i,:)=(Positions(i,:).*(~(Flag4ub+Flag4lb)))+ub.*Flag4ub+lb.*Flag4lb; ? ? ? ? ? ? ? ? ? ? ?% Calculate objective function for each search agent ? ? ? ?fitness=fobj(Positions(i,:)); ? ? ? ?% Update Alpha, Beta, and Delta ? ? ? ?if fitness<Alpha_score ? ? ? ? ? ?Alpha_score=fitness; % Update alpha ? ? ? ? ? ?Alpha_pos=Positions(i,:); ? ? ? ?end ? ? ? ?if fitness>Alpha_score && fitness<Beta_score ? ? ? ? ? ?Beta_score=fitness; % Update beta ? ? ? ? ? ?Beta_pos=Positions(i,:); ? ? ? ?end ? ? ? ?if fitness>Alpha_score && fitness>Beta_score && fitness<Delta_score ? ? ? ? ? ?Delta_score=fitness; % Update delta ? ? ? ? ? ?Delta_pos=Positions(i,:); ? ? ? ?end ? ?end ? ?a=2-l*((2)/Max_iter); % a decreases linearly fron 2 to 0 ? ?% Update the Position of search agents including omegas ? ?for i=1:size(Positions,1) ? ? ? ?for j=1:size(Positions,2) ? ? ? ? ? ? ? ?r1=rand(); % r1 is a random number in [0,1] ? ? ? ? ? ?r2=rand(); % r2 is a random number in [0,1] ? ? ? ? ? ?A1=2*a*r1-a; % Equation (3.3) ? ? ? ? ? ?C1=2*r2; % Equation (3.4) ? ? ? ? ? ?D_alpha=abs(C1*Alpha_pos(j)-Positions(i,j)); % Equation (3.5)-part 1 ? ? ? ? ? ?X1=Alpha_pos(j)-A1*D_alpha; % Equation (3.6)-part 1 ? ? ? ? ? ?r1=rand(); ? ? ? ? ? ?r2=rand(); ? ? ? ? ? ?A2=2*a*r1-a; % Equation (3.3) ? ? ? ? ? ?C2=2*r2; % Equation (3.4) ? ? ? ? ? ?D_beta=abs(C2*Beta_pos(j)-Positions(i,j)); % Equation (3.5)-part 2 ? ? ? ? ? ?X2=Beta_pos(j)-A2*D_beta; % Equation (3.6)-part 2 ? ? ? ? ? ? ? ? ?r1=rand(); ? ? ? ? ? ?r2=rand(); ? ? ? ? ? ?A3=2*a*r1-a; % Equation (3.3) ? ? ? ? ? ?C3=2*r2; % Equation (3.4) ? ? ? ? ? ?D_delta=abs(C3*Delta_pos(j)-Positions(i,j)); % Equation (3.5)-part 3 ? ? ? ? ? ?X3=Delta_pos(j)-A3*D_delta; % Equation (3.5)-part 3 ? ? ? ? ? ? ? ? ? ? ? ?Positions(i,j)=(X1+X2+X3)/3;% Equation (3.7) ? ? ? ?end ? ?end ? ?l=l+1; ? ? ? ?Convergence_curve(l)=Alpha_score;end

3 仿真結果



4 參考文獻

[1]伍軼鳴, 孫博文, 成榮紅,等. 基于灰狼算法的LSSVM模型預測凝析氣藏露點壓力研究[J]. 西安石油大學學報:自然科學版, 2020, 35(2):7.

博主簡介:擅長智能優(yōu)化算法、神經(jīng)網(wǎng)絡預測、信號處理、元胞自動機、圖像處理、路徑規(guī)劃、無人機等多種領域的Matlab仿真,相關matlab代碼問題可私信交流。

部分理論引用網(wǎng)絡文獻,若有侵權聯(lián)系博主刪除。




【lssvm預測】基于灰狼算法優(yōu)化LSSVM數(shù)據(jù)回歸預測含Matlab源碼的評論 (共 條)

分享到微博請遵守國家法律
盘山县| 扎兰屯市| 武鸣县| 姚安县| 班玛县| 河西区| 昭平县| 保德县| 通渭县| 漳平市| 原阳县| 八宿县| 长岭县| 茶陵县| 桑日县| 武邑县| 晋江市| 嘉禾县| 尼木县| 嘉义县| 秦皇岛市| 始兴县| 陇西县| 油尖旺区| 通化县| 兴化市| 天长市| 日照市| 滕州市| 南丰县| 贵溪市| 邹城市| 济南市| 洛扎县| 庆元县| 四平市| 门源| 琼结县| 阿城市| 三都| 开阳县|