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

news2025/1/19 11:03:40

基于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{:});
else
    gui_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 == 1
    U = {'平稳'}
    set (handles.jianyanjieguo,'String',U);
else
    U = {'不平稳'}
    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 == 1
    U={'ƽÎÈ'}
    set(handles.jianyanjieguo,'String',U)
else
    U={'²»Æ½ÎÈ'}
    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');
end
 
function 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');
end
 
function 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:T
    if getappdata(h,'canceling')
        break
    end
    p = 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);
    else
        amodel = arima('ARLags',1:p,'MALags',1:q,'SARLags',(1:dap)*ss,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);
    end
    if 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;
    end
    n = size (VarCov,1);    
    [aic,bic] = aicbic (logL,n,tl);
    v1(i) = aic;
    v2(i) = bic;
    if length(pvalues)>2
        pvalues = pvalues(2:end-1);
        if any(pvalues>0.05)
            v1(i) = 3*10e8;
        end
    end
    else
        v1(i) = 4*10e8;
        v2(i) = 4*10e8;
    end
    waitbar(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 == 1
    U={'ƽÎÈ'};
    set(handles.jianyanjieguo,'String',U)
else
    U={'²»Æ½ÎÈ'};
    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');
end
 
function 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');
end
 
function 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');
end
 
function 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');
end
 
function 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');
end
 
function 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');
else
    I = 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);
else
    amodel = arima('ARLags',1:p,'MALags',1:q,'SARLags',(1:dap)*ss,'SMALags',(1:daq)*ss,'D',d,'Seasonality',ss*dad,'Constant',0);
end
 
model3=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:p
    strs = [strs,{['AR(',num2str(i),')']}];%%%%
    end
end
if ~eq(dap,0)
    for i = 1:dap
    strs = [strs,{['SAR(',num2str(i*ss),')']}];%%%%
    end
end
if ~eq(q,0)
    for i = 1:q
        strs = [strs,{['MA(',num2str(i),')']}];%%%%
    end
end
if ~eq(daq,0)
    for i=1:daq
    strs = [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');
end
 
function 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');
else
    y = X';
end
yv = zeros(size(y));
h = waitbar(0,'ÇëµÈ´ý');
for i = model.P:length(yv)-1
       vF1 = 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');
else
    I = X';
end
fit3=model;
[yF,yMSE] = forecast(fit3,H,'Y0',I);
if eq(get(objs.log,'Value'),1)
    L = exp(yF);
end
 
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 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');
end
 function mse_Callback(hObject, eventdata, handles)
function mse_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
 
function 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');
end
 function mse2_Callback(hObject, eventdata, handles)
function mse2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
 
function rmse2_Callback(hObject, eventdata, handles)
function rmse2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
 
function 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)>1
    set(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 == 1
    U={'平稳'}
    set(handles.jianyanjieguo,'String',U)
else
    U={'不平稳'}
    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');
end
 function 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 = [];
else
   AR = AR.Coefficients;
   AR = [AR{LagsAR}];               
end
 if isempty(LagsSAR)
   SAR = []; 
else
   SAR = SAR.Coefficients;
   SAR = [SAR{LagsSAR}];          
end
 if isempty(LagsMA)
   MA = [];
else
   MA = MA.Coefficients;
   MA = [MA{LagsMA}];               
end
if isempty(LagsSMA)
   SMA = []; 
else
   SMA = SMA.Coefficients;
   SMA = [SMA{LagsSMA}];            
end
 isDistributionT    =  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 isVarianceConstant
   if isDistributionT
      parameters          = zeros(nARIMA + 2,1);
      parameters(end - 1) = Mdl.Variance;
      parameters(end)     = Mdl.Distribution.DoF;
   else
      parameters          = zeros(nARIMA + 1,1);
      parameters(end)     = Mdl.Variance;
   end
      parameters(1:nARIMA) = [constant AR  SAR  MA  SMA  beta];
    if numel(parameters) ~= numel(solve)
      error(message('econ:arima:print:ModelCovarianceInconsistency'))
   end
 else  
   if isDistributionT
      parameters(nARIMA + 1) = Mdl.Distribution.DoF;
      parameters(1:nARIMA)   = [constant AR  SAR  MA  SMA  beta];
   else
      parameters = [constant AR  SAR  MA  SMA  beta];
   end
end
 Fix    = ~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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/991730.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

65.Linux系统上库文件的生成与使用

目录 1.什么是库文件 2.静态库的生成与使用 2.1静态库的生成 2.2静态库的使用 3.共享库的生成和使用 3.1共享库的生成 3.2共享库的使用 4、静态库和共享库的区别 1.什么是库文件 库是一组预先编译好的方法的集合。Linux系统存储的库的位置一般在&#xff1a;/lib 和 /…

云服务器下如何部署Django项目详细操作步骤

前期本人完成了“编写你的第一个 Django 应用程序”&#xff0c;有了一个简单的项目代码&#xff0c;在本地window系统自测没问题了&#xff0c;接下来就想办法部署到服务器上&#xff0c;可以通过公网访问我们的Django项目。将开发机器上运行的开发版软件实际安装到服务器上进…

四川玖璨电子商务有限公司:抖店代运营

抖店代运营是一种新兴的电商服务模式&#xff0c;通过专业团队全程管理店铺运营&#xff0c;帮助商家快速扩大销售规模。抖店代运营的出现&#xff0c;为很多创业者和传统实体店提供了一个转型升级的机会。 抖店代运营首先需要了解抖音这个平台的特点和用户群体&#xff0c;根…

史上最详细的Python安装教程,小白建议收藏!

前言&#xff1a;Hello大家好&#xff0c;我是小哥谈。Python是一种高级、通用、解释型的编程语言&#xff0c;由Guido van Rossum于1989年开始设计&#xff0c;1991年首次发布。它以简洁易读的语法而著称&#xff0c;并且强调代码的可读性和简洁性&#xff0c;使得程序员能够更…

出版行业常用软件系统开发

出版行业使用多种软件系统来支持各种出版任务&#xff0c;包括编辑、排版、制作、销售和管理。以下是出版行业中常用的一些软件系统以及它们各自的主要功能&#xff0c;希望对大家有所帮助。北京木奇移动技术有限公司&#xff0c;专业的软件外包开发公司&#xff0c;欢迎交流合…

【Java】传输层协议TCP

传输层协议TCP TCP报文格式首部长度保留位32位序列号和32位确认应答号标记ACKSYNFINRSTURGPSH 16位窗口大小16位校验和16位紧急指针选项 TCP特点可靠传输实现机制-确认应答超时重传连接管理机制三次握手四次挥手特殊情况 滑动窗口流量控制拥塞控制延迟应答捎带应答面向字节流粘…

Java网络编程( 一 )数据如何在网络上传输

数据如何在网络上传输 网络发展背景发送端和接收端网络协议分层封装 & 分用封装&#xff1a;分用&#xff1a; 传输补充&#xff08;数据链路层&#xff08;以太网&#xff09;&#xff09;&#xff1a;ARP协议 网络发展背景 单机阶段—>局域网阶段—>广域网阶段—&…

Leetcode129. 求根到叶子节点数字之和

力扣&#xff08;LeetCode&#xff09;官网 - 全球极客挚爱的技术成长平台 给你一个二叉树的根节点 root &#xff0c;树中每个节点都存放有一个 0 到 9 之间的数字。 每条从根节点到叶节点的路径都代表一个数字&#xff1a; 例如&#xff0c;从根节点到叶子节点的路径 1 ->…

基于v-md-editor的在线文档编辑实现

概述 前面的文章讲到了基于语雀的在线文档编辑器的实现&#xff0c;在本文&#xff0c;将基于v-md-editor实现在线文档的编辑。 实现后效果 实现 说明&#xff1a;本文是基于Vue3实现的&#xff0c;实现了&#xff1a;1.Markdown的在线编辑和预览&#xff1b;2. 文件的上传和…

了解静电消除器离子风嘴的作用

离子风嘴在工业用途中很广泛。属于用压缩气系列的除静电的一种设备。具有安装简单、性能稳定、风速强劲、除静电迅速的特点。 离子风嘴可以产生许多的带着有正电荷负电荷的气体&#xff0c;被压缩气吹出&#xff0c;可以把设备上带的电荷中和掉。当设备表面上带有的电荷为负电荷…

Java认识异常(超级详细)

目录 异常的概念和体系结构 异常的概念 异常的体系结构 异常的分类 1.编译时异常 2.运行时异常 异常的处理 防御式编程 LBYL EAFP 异常的抛出 异常的捕获 异常声明throws try-catch捕获并处理 finally 异常的处理流程 异常的概念和体系结构 异常的概念 在Java中…

文件操作(个人学习笔记黑马学习)

C中对文件操作需要包含头文件<fstream > 文件类型分为两种: 1.文本文件&#xff1a;文件以文本的ASCII码形式存储在计算机中 2.二进制文件&#xff1a;文件以文本的二进制形式存储在计算机中&#xff0c;用户一般不能直接读懂它们 操作文件的三大类: 1.ofstream: 写操作 …

Tableau自四部曲_Part1:Tableau介绍与安装

文章目录 一、Tableau的优势1. Excel2. SQL3. Python/R4. Tableau 二、Tableau、PowerBI、FineBI到底应该学哪个1. 功能全面性2. 易学程度3. 学习顺序 三、Tableau下载与安装1. 下载2. 注册3. 安装4. 试用5. 激活6. 秘钥管理7. 学生账号申请 一、Tableau的优势 1. Excel 容易…

Java集合学习详解(2023年史上最全版)

java集合学习目录 一、基本概要0. 辅助工具类0.1 Collection 和 Collections 有什么区别&#xff1f;0.2 comparable 和 comparator的区别&#xff1f; 1.什么是集合2.集合的分类2.1 Collection接口2.2 Map接口 二、集合框架底层数据结构1. &#x1f60a;Collection1.1 ❤List1…

大麦订单生成 大麦订单购票成功截图生成

后台一键生成链接&#xff0c;后台管理 教程&#xff1a;解压源码&#xff0c;修改数据库config/Congig 不会可以看源码里有教程 下载程序&#xff1a;https://pan.baidu.com/s/16lN3gvRIZm7pqhvVMYYecQ?pwd6zw3

微信小程序中 vant weapp 使用外部的icon作为图标的步骤

微信小程序中 vant weapp 使用外部的icon作为图标的步骤 1. 在项目中创建静态资源文件夹2. 前往iconfont图标官网&#xff0c;添加图标并拷贝在线链接3. 下载iconfont代码&#xff0c;解压之后拷贝到小程序的目录中4. 修改iconfont.wxss 将本地链接替换为在线链接5. 在项目的ap…

Springboot+druid

1.Druid是Java语言中最好的数据库连接池。Druid能够提供强大的监控和扩展功能。 2.配置maven <dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>${druid-version}</version></dependency>…

Wireshark TS | 网络路径不一致传输丢包问题

问题背景 网络路径不一致&#xff0c;或者说是网络路径来回不一致&#xff0c;再专业点可以说是网络路径不对称&#xff0c;以上种种说法&#xff0c;做网络方向的工程师肯定会更清楚些&#xff0c;用简单的描述就是&#xff1a; A 与 B 通讯场景&#xff0c;C 和 D 代表中间…

Tomcat配置ssl

Tomcat配置ssl 部署tomcat服务&#xff0c;项目做到用https访问&#xff0c;使用nginx去做&#xff0c;访问任意一个子网站&#xff0c;都是https 或者 医美项目需要 上传jdk 456 tomcat war包 [nginx-stable] namenginx stable repo baseurlhttp://nginx.org/packages/…

一文看懂微信小程序新版隐私协议(附带弹窗组件)

一、前言 微信小程序近期又迎来了一次改革–9月15日之后如果小程序涉及调用微信的隐私接口获取用户的信息的&#xff0c;需要用户手动同意协议后才可正常调用接口&#xff0c;否则会返回报错信息。 隐私接口目前常用的有&#xff1a;手机号快捷获取、读取照片、获取用户的头像…