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

第68步 时间序列建模实战:ARIMA建模(Matlab)

基于WIN10的64位系统演示

一、写在前面

这一期,我们使用Matlab进行SARIMA模型的构建。

不同样,这里使用另一个数据:

采用《PLoS One》2015年一篇题目为《Comparison of Two Hybrid Models for Forecasting the Incidence of Hemorrhagic Fever with Renal Syndrome in Jiangsu Province, China》文章的公开数据做演示。数据为江苏省2004年1月至2012年12月肾综合症出血热月发病率。运用2004年1月至2011年12月的数据预测2012年12个月的发病率数据。

Matlab语言,估计很多人没听说过。

所以,直接上我封装好的Matlab小程序即可。

二、Matlab建立SARIMA实战

1.界面介绍

1.1.数据输入 输入用于预测的原始数据,如图一。

1.2.原始数据绘图 点击弹出原始数据曲线图,以便观察数据的消长趋势以及周期性。

1.3.实际值输入 如果用于测试模型的预测精度,此时要预测的数据已知,则输入该数据集。如果用于预测数据,则要预测的数据未知,此时全部输入0。例如要预测6个数据,则需输入6个0。

1.4.平稳检验和相关图模块

1.4.1.原始数据 点击原始数据按钮,在相关图模块显示原始数据的自相关图以及偏相关图,并在显示检验结果(是否平稳)。

1.4.2.一般拆分 填入拆分次数,点击一般拆分按钮,在相关图模块显示经过一般拆分数据的自相关图以及偏相关图,并在显示检验结果(是否平稳);拆分次数即为d值。

1.4.2.季节性拆分 填入拆分次数,点击季节性拆分按钮,在相关图模块显示经过季节性拆分数据的自相关图以及偏相关图,并在显示检验结果(是否平稳);拆分次数即为D值。

1.4.3.一般+季节性拆分 点击一般+季节性拆分按钮,在相关图模块显示经过一般和季节性拆分数据的自相关图以及偏相关图,并在显示检验结果(是否平稳)。

1.5.自动参数寻找模块

1.5.1.Log 勾选后,原始数据经过Log变换。此选项影响所有步骤,包括平稳性检验、模型构建、拟合和预测。

1.5.2寻找 必须手动输入参数d和D,周期s默认为12,可以根据实际情况修改。点击寻找按钮后,程序自动寻找最优p、q、P、Q参数(四个参数取值均从0至3);并将最优参数值输出。

1.6.预测模块

1.6.1.预测数目(个) 显示需要预测数据的个数,程序自动从实际值输入文本框识别个数并输出。

1.6.2.模型参数 输入模型7个参数,其中周期s默认为12,可以根据需要修改。

1.6.3.预测 点击预测按钮后,输出AIC值、BIC值、预测值、实际值,弹出模型参数检验的窗口,并在曲线图模块显示实际值和预测值的曲线图,在误差模块显示预测误差的四个指标。

1.7.曲线图模块

1.7.1.拟合 点击拟合按钮后,显示模型拟合效果曲线图,并在误差模块输出拟合误差的四个指标,弹出显示模型具体拟合值的窗口。

1.7.2.预测 点击拟合按钮后,显示模型拟合效果曲线图,并在误差模块输出拟合误差的四个指标。

1.8.误差模块

1.8.1.拟合误差 MAE 输出模型预测的平均绝对误差;

          MAPE 输出模型预测的平均相对误差;

          MSE 输出模型预测的均方误差;

          RMSE 输出模型预测的均方根误差。

1.8.2.预测误差 MAE 输出模型预测的平均绝对误差;

          MAPE 输出模型预测的平均相对误差;

          MSE 输出模型预测的均方误差;

          RMSE 输出模型预测的均方根误差。

2.实例演示

2.1.打开软件,输入原始数据实际值,点击原始数据绘图(这里我们用于测试模型精度,故实际值已知),如图

2.2.点击原始数据检验按钮,检验结果显示不平稳如图三;

2.3.可以看到12logs处数值很高,显示具有季节性需进行一次季节性拆分;在季节性拆分按钮后的文本框输入1,点击季节性拆分按钮,检验结果显示平稳如图四;

2.4.此时可在进行一次一般拆分,在一般拆分按钮后的文本框输入1,点击一般+季节性拆分按钮,检验结果显示平稳,如图

2.5.输入参数d、D,点击寻找按钮,程序开始寻找最优参数输出,如图六、七;

2.6.输入参数七个模型参数,点击预测按钮,输出AIC值、BIC值、预测值、实际值,弹出模型参数检验的窗口,并在曲线图模块显示实际值和预测值的曲线图,在误差模块显示预测误差的四个指标,如图

2.7.在曲线图模块点击拟合按钮,显示模型拟合效果曲线图,并在误差模块输出拟合误差的四个指标,弹出显示模型具体拟合值的窗口,如图

2.8.拟合预测结果比较

模型

预测误差

拟合误差

MAE

MAPE

MAE

MAPE

Matlab ARIMA

0.0074

0.4148

0.0085

0.4246

SPSS ARIMA

0.0090

0.4859

0.0089

0.4219

由以上图表可知,Matlab所构建的ARIMA模型拟合以及预测效果跟SPSS基本一致。

三、小软件安装在此处

1. 双击MCRInstaller.exe安装

2. 自动解压:

3. 无脑点击下一步

4. 安装完成。

四、底层代码

可能有需要,我就贴上吧:

function varargout = ARIMAb(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...'gui_Singleton',  gui_Singleton, ...'gui_OpeningFcn', @ARIMA2_OpeningFcn, ...'gui_OutputFcn',  @ARIMA2_OutputFcn, ...'gui_LayoutFcn',  [] , ...'gui_Callback',   []);
if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});
end
if nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
elsegui_mainfcn(gui_State, varargin{:});
end
function ARIMA2_OpeningFcn(hObject, eventdata, handles, varargin)
global objs
handles.output = hObject;
movegui(hObject,'north')
objs.log=handles.logp;
objs.axes = [handles.axes1;handles.axes2;handles.axes3];
objs.disps1=[handles.jianyanjieguo;handles.yibanchaifen;handles.jijiexingchaifen];
objs.disps2=[handles.ppx;handles.d;handles.q;handles.pp;handles.dd;handles.qq];
objs.disps3 =[handles.ppp;handles.d2;handles.q2;handles.pp2;handles.dd2;handles.qq2];
objs.disps4=[handles.aic2;handles.bic2;handles.yucezhi2;handles.shijizhi2];
objs.disps5=[handles.mae;handles.mse;handles.mape;handles.rmse;handles.mae2;handles.mse2;handles.mape2;handles.rmse2];
objs.disps6=[handles.yuceshumu2;handles.s;handles.s2];
guidata(hObject, handles);
function varargout = ARIMA2_OutputFcn(hObject, eventdata, handles) 
varargout{1} = handles.output;
function shujushuru_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
guidata(hObject,handles);
function shujushuru_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function yuanshishujujianyan_Callback(hObject, eventdata, handles)
global X objs
X = str2num(get(handles.shujushuru,'String'));
if isempty(X)return
end
if eq(get(objs.log,'Value'),1)X = log(X);
end
h = adftest (X);
if h == 1U = {'平稳'}set (handles.jianyanjieguo,'String',U);
elseU = {'不平稳'}set (handles.jianyanjieguo,'String',U);
end
axes(handles.axes1)
autocorr(X);
axes(handles.axes2)
parcorr(X);
guidata(hObject,handles);
function chaifenshujujianyan_Callback(hObject, eventdata, handles)
global X T W Z objs
X = str2num(get(handles.shujushuru,'String'));
W = str2num(get(handles.jijiexingchaifen,'String'));
Z = str2num(get(handles.zhouqi,'String'));
if isempty(X) || isempty(T) || isempty(W) || isempty(Z) return
end
if eq(get(objs.log,'Value'),1)X = log(X);
end
o = length (X')/Z;
for R = 1:1:o;
Q = X (:,((R-1)*Z+1):Z*R)
data{R} = Q
end;
for S= 1:1:W;
test =[];
for R = 1:1:(o-S);
sea = data{R+1} - data{R}
test=[test,sea] 
end
end;
h = adftest(test);
if h == 1U={'ƽÎÈ'}set(handles.jianyanjieguo,'String',U)
elseU={'²»Æ½ÎÈ'}set(handles.jianyanjieguo,'String',U)
end
axes(handles.axes1)
autocorr(test);
axes(handles.axes2)
parcorr(test);
guidata(hObject,handles);
function yuceshumu1_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','0')
end
guidata(hObject,handles);
function yuceshumu1_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function ppx_Callback(hObject, eventdata, handles)
function ppx_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction d_Callback(hObject, eventdata, handles)
function d_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function q_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','0')
end
guidata(hObject,handles);
function q_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function pp_Callback(hObject, eventdata, handles)
function pp_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function dd_Callback(hObject, eventdata, handles)
function dd_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function qq_Callback(hObject, eventdata, handles)
function qq_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction s_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','0')
end
guidata(hObject,handles);
function s_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function pushbutton5_Callback(hObject, eventdata, handles)
global X objs
X = str2num(get(handles.shujushuru,'String'));
ss = str2num(get(handles.s,'String'));
value1 = str2num(get(handles.d,'String'));
value2 = str2num(get(handles.dd,'String'));
if isempty(X) || isempty(value1) || isempty(value2) || isempty(ss)return
end
X = X';
if eq(get(objs.log,'Value'),1)X = log(X);
end
test =[];
ind = [];
for p =0:1:3 
for d = value1 
for q = 0:1:3
for dap =0:1:3 
for dad =value2; 
for daq = 0:1:3 ind = [ind;p d q dap dad daq];
end
end
end
end
end
end
T = size(ind,1);
tl = length(X);
v1 = zeros(T,1);
v2 = zeros(T,1);
h = waitbar(0,'1','Name','优化ARIMA参数',...'CreateCancelBtn',...'setappdata(gcbf,''canceling'',1)');
setappdata(h,'canceling',0)
for i = 1:Tif getappdata(h,'canceling')breakendp = ind(i,1);d = ind(i,2);q = ind(i,3);dap=ind(i,4);dad=ind(i,5);daq=ind(i,6);if eq(p,0) && eq(q,0) && eq(dap,0) && eq(daq,0)amodel = arima('D',d,'Seasonality',ss*dad,'Constant',0);elseif ~eq(p,0) && eq(q,0) && eq(dap,0) && eq(daq,0)amodel = arima('ARLags',1:p,'D',d,'Seasonality',ss*dad,'Constant',0);elseif  eq(p,0) && ~eq(q,0) && eq(dap,0) && eq(daq,0)amodel = arima('MALags',1:q,'D',d,'Seasonality',ss*dad,'Constant',0);elseif  eq(p,0) && eq(q,0) && ~eq(dap,0) && eq(daq,0)amodel = arima('SARLags',1:dap,'D',d,'Seasonality',ss*dad,'Constant',0);elseif  eq(p,0) && eq(q,0) && eq(dap,0) && ~eq(daq,0)amodel = arima('SMALags',1:daq,'D',d,'Seasonality',ss*dad,'Constant',0);elseif ~eq(p,0) && ~eq(q,0) && eq(dap,0) && eq(daq,0)amodel = arima('ARLags',1:p,'MALags',1:q,'D',d,'Seasonality',ss*dad,'Constant',0);elseif ~eq(p,0) && eq(q,0) && ~eq(dap,0) && eq(daq,0)amodel = arima('ARLags',1:p,'SARLags',(1:dap)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);elseif ~eq(p,0) && eq(q,0) && eq(dap,0) && ~eq(daq,0)amodel = arima('ARLags',1:p,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);elseif  eq(p,0) && ~eq(q,0) && ~eq(dap,0) && eq(daq,0)amodel = arima('MALags',1:q,'SARLags',(1:dap)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);elseif  eq(p,0) && ~eq(q,0) && eq(dap,0) && ~eq(daq,0)amodel = arima('MALags',1:q,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);elseif  eq(p,0) && eq(q,0) && ~eq(dap,0) && ~eq(daq,0)amodel = arima('SARLags',(1:dap)*ss,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);elseif ~eq(p,0) && ~eq(q,0) && ~eq(dap,0) && eq(daq,0)amodel = arima('ARLags',1:p,'MALags',1:q,'SARLags',(1:dap)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);elseif ~eq(p,0) && ~eq(q,0) && eq(dap,0) && ~eq(daq,0)amodel = arima('ARLags',1:p,'MALags',1:q,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);elseif ~eq(p,0) && eq(q,0) && ~eq(dap,0) && ~eq(daq,0)amodel = arima('ARLags',1:p,'SARLags',(1:dap)*ss,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);elseif  eq(p,0) && ~eq(q,0) && ~eq(dap,0) && ~eq(daq,0)amodel = arima('MALags',1:q,'SARLags',(1:dap)*ss,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);elseamodel = arima('ARLags',1:p,'MALags',1:q,'SARLags',(1:dap)*ss,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);endif numel(X) >= max(amodel.P + amodel.Q + 1);[EstMdl,VarCov,logL,info]=estimate(amodel,X,'Display','off');    f = length(X)-EstMdl.P;errors = sqrt(diag(VarCov));parameters = info.X;tvalues = parameters./errors;pvalues = zeros(size(tvalues));for ii = 1:length(pvalues)pvalues(ii) = (1-tcdf(abs(tvalues(ii)),f))*2;endn = size (VarCov,1);    [aic,bic] = aicbic (logL,n,tl);v1(i) = aic;v2(i) = bic;if length(pvalues)>2pvalues = pvalues(2:end-1);if any(pvalues>0.05)v1(i) = 3*10e8;endendelsev1(i) = 4*10e8;v2(i) = 4*10e8;endwaitbar(i/T,h,['Runing ',num2str(i),' out of ',num2str(T)]);
end
delete(h);
[a,b] = min(v1);
re = ind(b,:);
set(handles.ppx,'String',num2str(re(1)));
set(handles.d,'String',num2str(re(2)));
set(handles.q,'String',num2str(re(3)));
set(handles.pp,'String',num2str(re(4)));
set(handles.dd,'String',num2str(re(5)));
set(handles.qq,'String',num2str(re(6)));
set(handles.s,'String',num2str(12));
guidata(hObject,handles);
function yuanshishujuxiangguantu_Callback(hObject, eventdata, handles)
global X objs
if eq(get(objs.log,'Value'),1)X = log(X);
end
axes(handles.axes1)
autocorr(X);
axes(handles.axes2)
parcorr(X);
function chaifenshujuxiangguantu_Callback(hObject, eventdata, handles)
global X T W Z objs
X = str2num(get(handles.shujushuru,'String'));
T = str2num(get(handles.yibanchaifend,'String'));
W = str2num(get(handles.jijiexingchaifen,'String'));
Z = str2num(get(handles.zhouqi,'String'));
if eq(get(objs.log,'Value'),1)X = log(X);
end
o = length (X')/Z;
for R = 1:1:o;
Q= X (:,((R-1)*Z+1):Z*R)
data{R}=Q
end;
for S= 1:1:W;
test =[];
for R = 1:1:(o-S);
sea = data{R+1} - data{R};
test=[test,sea] ;
end
end;
Y = diff(test,T);
axes(handles.axes1)
autocorr(Y);
axes(handles.axes2)
parcorr(Y);
function yibanchaifend_Callback(hObject, eventdata, handles)
global X T objs
X = str2num(get(handles.shujushuru,'String'));
T = str2num(get(handles.yibanchaifen,'String'));
if isempty(X) || isempty(T) return
end
if eq(get(objs.log,'Value'),1)X = log(X);
end
X =X';
Y = diff (X,T);
h = adftest (Y);
if h == 1U={'ƽÎÈ'};set(handles.jianyanjieguo,'String',U)
elseU={'²»Æ½ÎÈ'};set(handles.jianyanjieguo,'String',U)
end
axes(handles.axes1)
autocorr(Y);
axes(handles.axes2)
parcorr(Y);
guidata(hObject,handles);
function yibanchaifend_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function jijiexingchaifen_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','0')
end
guidata(hObject,handles);
function jijiexingchaifen_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction zhouqi_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','0')
end
guidata(hObject,handles);
function zhouqi_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction jianyanjieguo_Callback(hObject, eventdata, handles)
function jianyanjieguo_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function shijizhi_Callback(hObject, eventdata, handles)
function shijizhi_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function aic_Callback(hObject, eventdata, handles)
function aic_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction yucezhi_Callback(hObject, eventdata, handles)
function yucezhi_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function yuceshumu2_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','0')
end
guidata(hObject,handles);
function yuceshumu2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction canshup_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','0')
end
guidata(hObject,handles);
function canshup_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function d2_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','NaN')
end
guidata(hObject,handles);
function d2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function q2_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','NaN')
end
guidata(hObject,handles);
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction pp2_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','NaN')
end
guidata(hObject,handles);
function pp2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function dd2_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','NaN')
end
guidata(hObject,handles);
function dd2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function qq2_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','NaN')
end
guidata(hObject,handles);
function qq2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function s2_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','NaN')
end
guidata(hObject,handles);
function s2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function yuce2_Callback(hObject, eventdata, handles)
global X K B C A E F G H I L M T objs model
X = str2num(get(handles.shujushuru,'String'));
K = str2num(get(handles.ppp,'String'));
B = str2num(get(handles.d2,'String'));
C = str2num(get(handles.q2,'String'));
A = str2num(get(handles.pp2,'String'));
E = str2num(get(handles.dd2,'String'));
F = str2num(get(handles.qq2,'String'));
G = str2num(get(handles.s2,'String'));
H = str2num(get(handles.yuceshumu2,'String'));
M = str2num(get(handles.shijizhishuru,'String'));
if isempty(X) || isempty(K) || isempty(B) || isempty(C) || isempty(A) || isempty(E) || isempty(F) || isempty(G) || isempty(H) ||isempty(M)return
end
if eq(get(objs.log,'Value'),1)I = log(X');
elseI = X';
end
p = K;d=B;q = C;dap=A;daq=F;dad=E;ss=G;
if eq(p,0) && eq(q,0) && eq(dap,0) && eq(daq,0)amodel = arima('D',d,'Seasonality',ss*dad,'Constant',0);
elseif ~eq(p,0) && eq(q,0) && eq(dap,0) && eq(daq,0)amodel = arima('ARLags',1:p,'D',d,'Seasonality',ss*dad,'Constant',0);
elseif  eq(p,0) && ~eq(q,0) && eq(dap,0) && eq(daq,0)amodel = arima('MALags',1:q,'D',d,'Seasonality',ss*dad,'Constant',0);
elseif  eq(p,0) && eq(q,0) && ~eq(dap,0) && eq(daq,0)amodel = arima('SARLags',1:dap,'D',d,'Seasonality',ss*dad,'Constant',0);
elseif  eq(p,0) && eq(q,0) && eq(dap,0) && ~eq(daq,0)amodel = arima('SMALags',1:daq,'D',d,'Seasonality',ss*dad,'Constant',0);
elseif ~eq(p,0) && ~eq(q,0) && eq(dap,0) && eq(daq,0)amodel = arima('ARLags',1:p,'MALags',1:q,'D',d,'Seasonality',ss*dad,'Constant',0);
elseif ~eq(p,0) && eq(q,0) && ~eq(dap,0) && eq(daq,0)amodel = arima('ARLags',1:p,'SARLags',(1:dap)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);
elseif ~eq(p,0) && eq(q,0) && eq(dap,0) && ~eq(daq,0)amodel = arima('ARLags',1:p,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);
elseif  eq(p,0) && ~eq(q,0) && ~eq(dap,0) && eq(daq,0)amodel = arima('MALags',1:q,'SARLags',(1:dap)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);
elseif  eq(p,0) && ~eq(q,0) && eq(dap,0) && ~eq(daq,0)amodel = arima('MALags',1:q,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);
elseif  eq(p,0) && eq(q,0) && ~eq(dap,0) && ~eq(daq,0)amodel = arima('SARLags',(1:dap)*ss,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);
elseif ~eq(p,0) && ~eq(q,0) && ~eq(dap,0) && eq(daq,0)amodel = arima('ARLags',1:p,'MALags',1:q,'SARLags',(1:dap)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);
elseif ~eq(p,0) && ~eq(q,0) && eq(dap,0) && ~eq(daq,0)amodel = arima('ARLags',1:p,'MALags',1:q,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);
elseif ~eq(p,0) && eq(q,0) && ~eq(dap,0) && ~eq(daq,0)amodel = arima('ARLags',1:p,'SARLags',(1:dap)*ss,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);
elseif  eq(p,0) && ~eq(q,0) && ~eq(dap,0) && ~eq(daq,0)amodel = arima('MALags',1:q,'SARLags',(1:dap)*ss,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);
elseamodel = arima('ARLags',1:p,'MALags',1:q,'SARLags',(1:dap)*ss,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);
endmodel3=amodel;
if numel(X) <= max(amodel.P + amodel.Q + 1);msgbox('待估计变量数目大于样本数目,无法计算!');return
end
[fit3,VarCov,logL,info] = estimate(model3,I);
f = length(I)-fit3.P;
errors = sqrt(diag(VarCov));
parameters = info.X;
tvalues = parameters./errors;
pvalues = zeros(size(tvalues));
for i = 1:length(pvalues)pvalues(i) = (1-tcdf(abs(tvalues(i)),f))*2;
end
strs = [];
if ~eq(p,0)for i = 1:pstrs = [strs,{['AR(',num2str(i),')']}];%%%%end
end
if ~eq(dap,0)for i = 1:dapstrs = [strs,{['SAR(',num2str(i*ss),')']}];%%%%end
end
if ~eq(q,0)for i = 1:qstrs = [strs,{['MA(',num2str(i),')']}];%%%%end
end
if ~eq(daq,0)for i=1:daqstrs = [strs,{['SMA(',num2str(i*ss),')']}];end
end
info1 = {'Parameter','Value','Standard Error','t Statistic','p Statistic'};
info2 = [{'Constant'},num2cell(0),{'Fixed'},{'Fixed'},{'Fixed'}];
info3 = [strs,{'Variance'}]';
info4 = [info.X(2:end),errors(2:end),tvalues(2:end),pvalues(2:end)];
info5 = [info1;info2;info3 num2cell(info4)];
f = figure;
setpixelposition(f,[680,558,560,220]);
uitable(f,'Data',info5,'unit','normalized','position',[0 0 1 1],'ColumnWidth',{100});
[yF,yMSE] = forecast(fit3,H,'Y0',I);
if eq(get(objs.log,'Value'),1)L = exp(yF);
end
M = M';
MAE = mean(abs(L - M));
MAPE = mean(abs(L - M)./M);
MSE = mse (L - M);
RMSE = sqrt(mse(L - M));
[hang,lie] = size (VarCov);
T = length(X);
[aic,bic] = aicbic (logL,hang,T);
set (handles.aic2,'String',num2str(aic));
set (handles.bic2,'String',num2str(bic));
set (handles.mae2,'String',num2str(MAE));
set (handles.mape2,'String',num2str(MAPE));
set (handles.mse2,'String',num2str(MSE));
set (handles.rmse2,'String',num2str(RMSE));
set (handles.yucezhi2,'String',num2str(L),'Max',2);
set (handles.shijizhi2,'String',num2str(M),'Max',2);
axes(handles.axes3)
plot(M,'r','LineWidth',2);
hold on
plot(L,'k--','LineWidth',1.5);
xlim([0,H])
title('预测效果拟合曲线')
legend('实际值','预测值','Location','NorthEast')
hold off
model = fit3;
guidata(hObject,handles);
function shijizhi2_Callback(hObject, eventdata, handles)
function shijizhi2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function aic2_Callback(hObject, eventdata, handles)
function aic2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction yucezhi2_Callback(hObject, eventdata, handles)
function yucezhi2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function nihexiaoguo_Callback(hObject, eventdata, handles)
global model X objs
if isempty(X) || isempty(model) return
end
if eq(get(objs.log,'Value'),1)y = log(X');
elsey = X';
end
yv = zeros(size(y));
h = waitbar(0,'ÇëµÈ´ý');
for i = model.P:length(yv)-1vF1 = forecast(model,1,'Y0',y(1:i));yv(i+1) = vF1;waitbar(i/(length(yv)-1),h);
end
delete(h);
yv(1:model.P) =[];
y(1:model.P)=[];
if eq(get(objs.log,'Value'),1)y = exp(y);yv=exp(yv);
end
f = figure;
dispdata = [{'y','yp'};num2cell([y yv])];
uitable(f,'Data',dispdata,'unit','normalized','position',[0 0 1 1],'ColumnWidth',{100});
MAE = mean(abs(y - yv));
MAPE = mean(abs(y - yv)./y);
MSE = mse(y - yv);
RMSE = sqrt(mse(y - yv));
set(objs.disps5(1),'String',MAE);
set(objs.disps5(2),'String',MSE);
set(objs.disps5(3),'String',MAPE);
set(objs.disps5(4),'String',RMSE);
axes(handles.axes3)
plot(y,'r','LineWidth',2);
hold on
plot(yv,'k--','LineWidth',1.5);
xlim([0,length(y)])
title('拟合曲线')
legend('实际值','拟合值','Location','NorthEast')
hold off
guidata(hObject,handles);
function yucexiaoguo_Callback(hObject, eventdata, handles)
global X K B C A E F G H I L M T objs model
X = str2num(get(handles.shujushuru,'String'));
K = str2num(get(handles.ppp,'String'));
B = str2num(get(handles.d2,'String'));
C = str2num(get(handles.q2,'String'));
A = str2num(get(handles.pp2,'String'));
E = str2num(get(handles.dd2,'String'));
F = str2num(get(handles.qq2,'String'));
G = str2num(get(handles.s2,'String'));
H = str2num(get(handles.yuceshumu2,'String'));
M = str2num(get(handles.shijizhishuru,'String'));
if isempty(X) || isempty(K) || isempty(B) || isempty(C) || isempty(A) || isempty(E) || isempty(F) || isempty(G) || isempty(H) ||isempty(M) ||isempty(model)return
end
if eq(get(objs.log,'Value'),1)I = log(X');
elseI = X';
end
fit3=model;
[yF,yMSE] = forecast(fit3,H,'Y0',I);
if eq(get(objs.log,'Value'),1)L = exp(yF);
endaxes(handles.axes3)
plot(M,'r','LineWidth',2);
hold on
plot(L,'k--','LineWidth',1.5);
xlim([0,H])
title('预测效果拟合曲线')
legend('实际值','预测值','Location','NorthEast')
hold off
model = fit3;
guidata(hObject,handles);
function mae_Callback(hObject, eventdata, handles)
function mae_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function mape_Callback(hObject, eventdata, handles)
function mape_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction mse_Callback(hObject, eventdata, handles)
function mse_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction rmse_Callback(hObject, eventdata, handles)
function rmse_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function mae2_Callback(hObject, eventdata, handles)
function mae2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function mape2_Callback(hObject, eventdata, handles)
function mape2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction mse2_Callback(hObject, eventdata, handles)
function mse2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction rmse2_Callback(hObject, eventdata, handles)
function rmse2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction ppp_Callback(hObject, eventdata, handles)
input = str2num(get(hObject,'String'));
if (isempty(input))set(hObject,'String','NaN')
end
guidata(hObject,handles);
function ppp_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function shijizhishuru_Callback(hObject, eventdata, handles)
global objs
num = str2num(get(hObject,'String'));
if length(num)>1set(objs.disps6(1),'String',num2str(length(num)));
end
guidata(hObject,handles);
function shijizhishuru_CreateFcn(hObject, eventdata, handles)if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function yuanshishujuhuitu_Callback(hObject, eventdata, handles)
global X T
X = str2num(get(handles.shujushuru,'String'));
if isempty(X)return
end
T = length (X);
figure
hold on
plot(X,'k-','LineWidth',1.5)
xlim([0,T])
title('原始数据曲线图')
hold off
guidata(hObject,handles);
function yibanjijiexingchaifen_Callback(hObject, eventdata, handles)
global X T W Z objs
X = str2num(get(handles.shujushuru,'String'));
T = str2num(get(handles.yibanchaifen,'String'));
W = str2num(get(handles.jijiexingchaifen,'String'));
Z = str2num(get(handles.zhouqi,'String'));
if isempty(X) || isempty(T) || isempty(W) || isempty(Z) return
end
if eq(get(objs.log,'Value'),1)X = log(X);
end
o = length (X')/Z;
for R = 1:1:o;
Q = X (:,((R-1)*Z+1):Z*R)
data{R} = Q
end;
for S= 1:1:W;
test =[];
for R = 1:1:(o-S);
sea = data{R+1} - data{R}
test=[test,sea] 
end
end;
Y = diff(test,T);
h = adftest(Y);
if h == 1U={'平稳'}set(handles.jianyanjieguo,'String',U)
elseU={'不平稳'}set(handles.jianyanjieguo,'String',U)
end
axes(handles.axes1)
autocorr(Y);
axes(handles.axes2)
parcorr(Y);
guidata(hObject,handles);
function bic2_Callback(hObject, eventdata, handles)
function bic2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function bic_Callback(hObject, eventdata, handles)
function bic_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
end
function pushbutton12_Callback(hObject, eventdata, handles)
global X K B C A E F G H I L M T
X = str2num(get(handles.shujushuru,'String'));
K = str2num(get(handles.ppx,'String'));
B = str2num(get(handles.d,'String'));
C = str2num(get(handles.q,'String'));
A = str2num(get(handles.pp,'String'));
E = str2num(get(handles.dd,'String'));
F = str2num(get(handles.qq,'String'));
G = str2num(get(handles.s,'String'));
H = str2num(get(handles.yuceshumu,'String'));
M = str2num(get(handles.shijizhishuru,'String'));
I = log(X');
model3 = arima('ARLags',K,'MALags',C,'D',B,'SARLags',A*G,'SMALags',F*G,'Seasonality',G,'Constant',0);
[fit3,VarCov,logL,info] = estimate(model3,I);
[yF,yMSE] = forecast(fit3,H,'Y0',I);
L = exp (yF);
M = M';
MAE = mean(abs(L - M));
MAPE = mean(abs(L - M)./M);
MSE = mse (L - M);
RMSE = sqrt(mse(L - M));
[hang,lie] = size (VarCov);
T = length(X);
[aic,bic] = aicbic (logL,hang,T);
set (handles.aic,'String',num2str(aic));
set (handles.bic,'String',num2str(bic));
set (handles.mae2,'String',num2str(MAE));
set (handles.mape2,'String',num2str(MAPE));
set (handles.mse2,'String',num2str(MSE));
set (handles.rmse2,'String',num2str(RMSE));
set (handles.yucezhi,'String',num2str(L),'Max',2);
set (handles.shijizhi,'String',num2str(M),'Max',2);
axes(handles.axes3)
plot(M,'r','LineWidth',2);
hold on
plot(L,'k--','LineWidth',1.5);
xlim([0,H])
title('Ô¤²âЧ¹ûÄâºÏÇúÏß')
legend('ʵ¼ÊÖµ','Ô¤²âÖµ','Location','NorthEast')
hold off
guidata(hObject,handles);
function yibanchaifen_Callback(hObject, eventdata, handles)
function yibanchaifen_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction logp_Callback(hObject, eventdata, handles)
global objs
for i = 1:length(objs.axes)cla(objs.axes(i))
end
set(objs.disps1,'String','');
set(objs.disps2,'String','');
set(objs.disps3,'String','');
set(objs.disps4,'String','');
set(objs.disps5,'String','');
function tStatistic= print1(Mdl, covariance)
if size(covariance,1) ~= size(covariance,2)error(message('econ:arima:print:NonSquareCovarianceMatrix'))
end
constant = Mdl.Constant;            
beta     = Mdl.Beta;                
beta     = beta(:)';                
AR  = reflect(getLagOp(Mdl, 'AR'));
SAR = reflect(getLagOp(Mdl, 'SAR'));
MA  = getLagOp(Mdl, 'MA');
SMA = getLagOp(Mdl, 'SMA');LagsAR  = AR.Lags;                  
LagsSAR = SAR.Lags;                 
LagsMA  = MA.Lags;                  
LagsSMA = SMA.Lags;                 
LagsAR  = LagsAR(LagsAR > 0);       
LagsSAR = LagsSAR(LagsSAR > 0);
LagsMA  = LagsMA(LagsMA > 0);
LagsSMA = LagsSMA(LagsSMA > 0);if isempty(LagsAR)AR = [];
elseAR = AR.Coefficients;AR = [AR{LagsAR}];               
endif isempty(LagsSAR)SAR = []; 
elseSAR = SAR.Coefficients;SAR = [SAR{LagsSAR}];          
endif isempty(LagsMA)MA = [];
elseMA = MA.Coefficients;MA = [MA{LagsMA}];               
end
if isempty(LagsSMA)SMA = []; 
elseSMA = SMA.Coefficients;SMA = [SMA{LagsSMA}];            
endisDistributionT    =  strcmpi(Mdl.Distribution.Name, 'T');
isVarianceConstant = ~isa(Mdl.Variance, 'internal.econ.LagIndexableTimeSeries');  nARIMA = 1 + numel(LagsAR) + numel(LagsSAR) + ...numel(LagsMA) + numel(LagsSMA) + numel(beta);
if isVarianceConstantif isDistributionTparameters          = zeros(nARIMA + 2,1);parameters(end - 1) = Mdl.Variance;parameters(end)     = Mdl.Distribution.DoF;elseparameters          = zeros(nARIMA + 1,1);parameters(end)     = Mdl.Variance;endparameters(1:nARIMA) = [constant AR  SAR  MA  SMA  beta];if numel(parameters) ~= numel(solve)error(message('econ:arima:print:ModelCovarianceInconsistency'))endelse  if isDistributionTparameters(nARIMA + 1) = Mdl.Distribution.DoF;parameters(1:nARIMA)   = [constant AR  SAR  MA  SMA  beta];elseparameters = [constant AR  SAR  MA  SMA  beta];end
endFix    = ~solve;
errors = sqrt(diag(covariance));
tStatistic = parameters ./ errors;end
function pushbutton13_Callback(hObject, eventdata, handles)
close ARIMAb
main
function pushbutton14_Callback(hObject, eventdata, handles)
set(handles.shujushuru,'String',[]);
set(handles.shijizhishuru,'String',[]);
set(handles.jianyanjieguo,'String',[]);
set(handles.yibanchaifen,'String',[]);
set(handles.jijiexingchaifen,'String',[]);
set(handles.zhouqi,'String',[]);
set(handles.ppx,'String',[]);
set(handles.d,'String',[]);
set(handles.p,'String',[]);
set(handles.pp,'String',[]);
set(handles.dd,'String',[]);
set(handles.qq,'String',[]);
set(handles.s,'String',[]);
set(handles.yuceshumu2,'String',[]);
set(handles.ppp,'String',[]);
set(handles.d2,'String',[]);
set(handles.p2,'String',[]);
set(handles.pp2,'String',[]);
set(handles.dd2,'String',[]);
set(handles.qq2,'String',[]);
set(handles.s2,'String',[]);
cla(handles.axes2);
cla(handles.axes3);
set(handles.aic2,'String',[]);
set(handles.bic2,'String',[]);
set(handles.yucezhi2,'String',[]);
set(handles.shijizhi2,'String',[]);
set(handles.mae,'String',[]);
set(handles.mape,'String',[]);
set(handles.mse,'String',[]);
set(handles.rmse,'String',[]);
cla(handles.axes1);
set(handles.mae2,'String',[]);
set(handles.mape2,'String',[]);
set(handles.mse2,'String',[]);
set(handles.rmse2,'String',[]);

五、软件和数据

链接:https://pan.baidu.com/s/1ZZtT6VTUnqGtQaAZ9NlyCg?pwd=hk4p

提取码:hk4p

相关文章:

第68步 时间序列建模实战:ARIMA建模(Matlab)

基于WIN10的64位系统演示 一、写在前面 这一期&#xff0c;我们使用Matlab进行SARIMA模型的构建。 不同样&#xff0c;这里使用另一个数据&#xff1a; 采用《PLoS One》2015年一篇题目为《Comparison of Two Hybrid Models for Forecasting the Incidence of Hemorrhagic …...

Gin学习记录3——模版与渲染

模版与渲染 一. 返回二. 模版2.1 基础模版2.2 同名模版2.3 模版继承2.4 模版语法 一. 返回 如果只是想返回数据&#xff0c;可以使用以下函数&#xff1a; func (c *Context) JSON(code int, obj any) func (c *Context) JSONP(code int, obj any) func (c *Context) String(…...

Python算法练习 9.11

leetcode 392 判断子序列 给定字符串 s 和 t &#xff0c;判断 s 是否为 t 的子序列。 字符串的一个子序列是原始字符串删除一些&#xff08;也可以不删除&#xff09;字符而不改变剩余字符相对位置形成的新字符串。&#xff08;例如&#xff0c;"ace"是"abcd…...

2023年中秋节和国庆节放假几天?用待办软件记录放假安排并提醒

进入公历9月&#xff0c;我们都期待着下个长假的到来。那么2023年中秋节和国庆节放假几天呢&#xff1f;因为今年的中秋节是公历的9月29日&#xff0c;所以今年的中秋节和国庆节是连在一起放假的。放假时间安排是9月29日至10月6日&#xff0c;一共放假8天。而10月7日和8日则是调…...

使用Python实现一个完整的声音采样和模拟,使用采样声音播放输入的文字,实现代码进行详细注释,并进行测试

目录 1.功能概述 2.原理介绍 2.1.声音采样原理 2.2.PCM系统原理 2.3.声音学习与训练...

测试----计算机网络

文章目录 计算机网络的历史OSI/RM 协议TCP/IP协议IP地址 计算机网络的历史 50-60年代 内部通讯功能&#xff08;连接的是同一台主机&#xff0c;只能主机和终端之间通信&#xff0c;终端和终端之间的通讯只能依靠主机来传输&#xff09;60-70年代 主机和主机之间能通讯70年代-…...

SVN 索引版本与打包版本号不匹配

今天突然遇到了一个问题&#xff0c;SVN上传不了&#xff0c;错误提示如下&#xff1a; 解决方法&#xff1a; 1.其实&#xff0c;这是SVN库不小心搞坏了&#xff0c;只能重新再创建一个SVN仓库了。...

HummerRisk V1.4.1 发布

HummerRisk V1.4.1发布&#xff1a; 大家好&#xff0c;增加检测整合报告下载&#xff0c;定制多云整合报告并下载PDF&#xff0c;增加K8s 检测规则组&#xff0c;Kubernetes、Rancher、KubeSphere 检测规则组以及规则。新增云账号管理页面关联菜单&#xff0c;新增资源同步日…...

php的html实体和字符之间的转换

html_entity_decode() 函数是 htmlentities() 函数的反函数。用于把HTML实体转换为字符。 html_entity_decode() 函数把 HTML 实体转换为字符。 $str "<© W3CS&ccedil;h&deg;&deg;&brvbar;&sect;>"; echo html_entity_decode($str…...

docker-compose deploy 高可用 elasticsearch TLS

文章目录 1.sysctl2. swap3. hosts4. 配置 instances.yaml5. 创建证书6. 部署7. 修改 kibanna 密码8. 清理 1.sysctl [rootgithub es_tls]# cat /etc/sysctl.conf # sysctl settings are defined through files in # /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/…...

让GPT成为您的科研加速器丨GPT引领前沿与应用突破之GPT4科研实践技术与AI绘图

GPT对于每个科研人员已经成为不可或缺的辅助工具&#xff0c;不同的研究领域和项目具有不同的需求。如在科研编程、绘图领域&#xff1a;1、编程建议和示例代码:无论你使用的编程语言是Python、R、MATLAB还是其他语言&#xff0c;都可以为你提供相关的代码示例。​2、数据可视化…...

工业互联网的破局密钥——低代码开发

纵观历史上三次工业革命的演进过程&#xff0c;以蒸汽机、电力、计算机为相应时代的“新型”基础设施建设&#xff0c;依托“通用技术”的广泛应用&#xff0c;带动了整个行业与市场的发展。 在发展数字经济成为必选题的今天&#xff0c;同样需要一个新型的、基础性的、通用型…...

JavaScript知识系列(2)每天10个小知识点

目录 系列文章目录JavaScript知识系列&#xff08;1&#xff09;每天10个小知识点 知识点**11. 如果 new 一个箭头函数的会怎么样****12. 箭头函数的 this 指向哪⾥&#xff1f;****13. 扩展运算符**的概念、作用、原理、特性、优点、缺点、区别、使用场景**14. Proxy**的概念、…...

Kotlin面向对象基础使用方法(继承、接口、Lambda、空指针检查机制等)

三、面向对象 1、继承 1.1 open改变类的继承属性 在kotlin设计时默认所有的非抽象类是无法被继承的&#xff0c;如果想要使得一个非抽象类可以被继承&#xff0c;我们需要使用open关键字。 open class Person {var name "";var age 0;fun eat() {println(name …...

Android USB电源管理

The USB peripheral detects the lack of 3 consecutive SOF packets as a suspend request from the USB host. 1 驱动shutdown顺序 系统关机或重启的过程中&#xff0c;会调用设备驱动的shutdown函数来完成设备的关闭操作&#xff0c;有需要的设备可以在驱动中定义该函数。其…...

YOLO目标检测——路标数据集+已标注voc和yolo格式标签下载分享

实际项目应用&#xff1a;自动驾驶、视频监控和安防、物体识别和分类、城市规划和地理信息系统等等数据集说明&#xff1a;YOLO路标目标检测数据集&#xff0c;真实场景的高质量图片数据&#xff0c;数据场景丰富&#xff0c;图片格式为jpg&#xff0c;共900张图片&#xff0c;…...

Item-Based Recommendations with Hadoop

Mahout在MapReduce上实现了Item-Based Collaborative Filtering&#xff0c;这里我尝试运行一下。 安装Hadoop 从下载Mahout并解压 准备数据 下载1 Million MovieLens Dataset&#xff0c;解压得到ratings.dat&#xff0c;用 sed ‘s/:&#x1f626;[0-9]{1,}):&#x1f626;…...

基于物理层网络编码的相位同步算法matlab仿真

目录 1.算法运行效果图预览 2.算法运行软件版本 3.部分核心程序 4.算法理论概述 5.算法完整程序工程 1.算法运行效果图预览 2.算法运行软件版本 matlab2022a 3.部分核心程序 ..........................................................................%数据长度 Len…...

数据结构——七大排序[源码+动图+性能测试]

本章代码gitee仓库&#xff1a;排序 文章目录 &#x1f383;0. 思维导图&#x1f9e8;1. 插入排序✨1.1 直接插入排序✨1.2 希尔排序 &#x1f38a;2. 选择排序&#x1f38b;2.1 直接选择排序&#x1f38b;2.2 堆排序 &#x1f38f;3. 交换排序&#x1f390;3.1 冒泡排序&#…...

G. The Morning Star

Problem - G - Codeforces 思路&#xff1a;想了挺长时间的&#xff0c;一直没想到一个简便的方法在瞎搞。我们发现对于某个点来说&#xff0c;其他的点如果能够跟他匹配&#xff0c;那么一定在这8个方向上&#xff0c;而同时这8个方向其实对应这4条直线&#xff0c;假设点为(x…...

电池的健康状态 SOH 估计

电池的健康状态 SOH 估计 SOH&#xff08;State of Health&#xff09;估计通常用于描述电池的健康状态&#xff0c;即电池当前容量与初始容量的比值。 一种常见的SOH估计方法是基于经验的电池寿命预测方法&#xff0c;包括循环周期数法、安时法与加权安时法、面向事件的老化…...

Web 安全之 Permissions Policy(权限策略)详解

什么是 Permissions Policy&#xff08;权限策略&#xff09;&#xff1f; Permissions Policy 为 web 开发人员提供了明确声明哪些功能可以在网站上使用&#xff0c;哪些功能不能在网站上使用的机制。可以设置一组策略&#xff0c;用于限制站点代码可以访问的 API 或者修改浏…...

【黄啊码】nginx如何设置php运行的

禁止访问 PHP 脚本可以通过 Nginx 服务器配置中的多种方式来实现。以下是其中的一些常见方法&#xff0c;您可以根据实际需求选择合适的方式&#xff1a; 1 禁用 PHP 解析&#xff1a; 在 Nginx 配置中&#xff0c;确保 PHP 脚本无法被解析&#xff0c;从而禁止 PHP 执行。 lo…...

无涯教程-JavaScript - ISPMT函数

描述 ISPMT函数计算在特定投资期间支付的利息。提供此功能是为了与Lotus 1-2-3兼容。 语法 ISPMT (rate, per, nper, pv)争论 Argument描述Required/OptionalRateThe interest rate for the investment.RequiredPerThe period for which you want to find the interest, an…...

LeetCode 面试题 03.05. 栈排序

文章目录 一、题目二、C# 题解 一、题目 栈排序。 编写程序&#xff0c;对栈进行排序使最小元素位于栈顶。最多只能使用一个其他的临时栈存放数据&#xff0c;但不得将元素复制到别的数据结构&#xff08;如数组&#xff09;中。该栈支持如下操作&#xff1a;push、pop、peek 和…...

构建微服务项目时启动网关服务失败的解决方案

启动网关服务时报“Unable to create the temporary folder: C:\WINDOWS\TEMP\/nio-file-upload”错误。 代码与之前没有任何变化&#xff0c;但就是启动不了&#xff0c;观察错误意思大概是不能创建临时文件夹&#xff1a;C盘下的WINDOWS下的TEMP目录下的nio-file-upload这个东…...

零基础教程:使用yolov8训练无人机VisDrone数据集

1.准备数据集 1.先给出VisDrone2019数据集的下载地址&#xff1a; 链接&#xff1a;https://pan.baidu.com/s/1e2Q0NgNT-H-Acb2H0Cx8sg 提取码&#xff1a;31dl 2.将数据集VisDrone放在datasets目录下面 2.数据集转换程序 1.在根目录下面新建一个.py文件&#xff0c;取名叫…...

【Mysql专题】使用Mysql做排行榜,线上实例

背景 我们这里有个需求&#xff0c;对存量用户的余额做排行处理&#xff0c;这个实现方式很多&#xff0c;这边介绍的是&#xff0c;通过Mysql直接实现&#xff0c;将排名也直接返回出来。 我知道大家在网上能找到一大把这种实例&#xff0c;我在这里可不是【重复造轮子】。我…...

matlab数据处理: cell table array+datetime

原数据文件.csv matlab xlsread(filename{i},B2:T2881) 会同于Excel最多1048576行 舍弃 a{1,i} xlsread(filename{i},‘B2:T2881’);%读取excel文件,选定区域’B2:G2881’ readcell(filename{i},Range,E2:M2881) 会全部读取 优选 对于日期 yyyy-MM-dd HH:mm:ss.000 matlab cel…...

如何应用运营商大数据精准营销?

如何应用运营商大数据精准营销&#xff1f; 越来越多的企业逐渐觉察到运营商大数据所带来的商业价值&#xff0c;精准营销也被他们用的越来越娴熟。那么&#xff0c;企业的大数据精准营销该如何应用呢&#xff1f;想必是很多资源有限的中小型公司最想了解的。 一 数据驱动运营…...

godaddy 搭建网站/百度竞价课程

2010-10-10 回答1&#xff0e;进位计数制 在采用进位计数的数字系统中&#xff0c;如果只用r个基本符号(例如&#xff0c;O&#xff0c;1&#xff0c;2&#xff0c;…&#xff0c;r一1)表示数值&#xff0c;则称其为基r数制(Radix-r Number System)&#xff0c;r称为该数制的基…...

施坦威网站关于我们/seo查询排名系统

建议不要使用Vitamio,各种深坑能够流畅播放720P甚至1080P高清MKV&#xff0c;FLV&#xff0c;MP4&#xff0c;MOV&#xff0c;TS&#xff0c;RMVB等常见格式的视频&#xff0c;支持 MMS, RTSP, RTMP, HLS(m3u8) 等常见的多种视频流媒体协议&#xff0c;包括点播与直播。1.下载V…...

做网站百度/如何建网站赚钱

1、 Java连接MySQL数据库之properties文件配置 2、 Java连接MySQL数据库——含步骤和代码...

网站备案工信部/app投放推广

新西兰程序员 ASP.NET网站中设置404自定义错误页面 在用ASP.NET WebForm开发一个网站时&#xff0c;需要自定义404错误页面. 做法是这样的 在网站根目录下建立了一个404.html的错误页面&#xff0c;然后在Global.asax文件中&#xff0c;加入如下代码&#xff1a; <% Applica…...

桂林北站地图/花都网站建设公司

原文地址 http://zhangyaochun.iteye.com/blog/1682605 原作者&#xff1a;zhangyaochun 转载于:https://www.cnblogs.com/yiliweichinasoft/p/3472317.html...

网站ui/360推广怎么收费

【科技犬】华为6月2日发布会上会公布鸿蒙系统第一批升级名单&#xff0c;并且会在5月31号开始归档&#xff0c;6月2日同步升级&#xff0c;后续再逐步公布各批次升级时间&#xff0c;其中首批名单包括&#xff1a;Mate40、Mate40 Pro、Mate40 Pro、Mate40 RS、MateX2、nova8、n…...