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

电子商务网站建设规划今日国内新闻头条大事

电子商务网站建设规划,今日国内新闻头条大事,软件工程师培训机构排名,做外国网用哪些网站有哪些【MATLAB第60期】【更新中】基于MATLAB的ARMAX具有外生回归因子的移动平均自回归模型 版本更新: 2023/7/29版本: 1.增加自定义参数,方便直接套数据运行。 pre_num3;%预采样数据个数 learn_pr0.85; %训练数据比例(不包括预采样数…

【MATLAB第60期】【更新中】基于MATLAB的ARMAX具有外生回归因子的移动平均自回归模型


版本更新:

2023/7/29版本:
1.增加自定义参数,方便直接套数据运行。

pre_num=3;%预采样数据个数
learn_pr=0.85;  %训练数据比例(不包括预采样数据)
mm=pre_num;%输入响应数据个数    
nn=pre_num;%输出响应数据个数   

2.增加ARIMAX模型参数自动选择功能
(1)可手动选择ADF或者KPSS平稳性检验方式
存在不足:目前无法解决D>0的问题,所以优先选择D=0的检验方法,本文选用KPSS检验
[p, d, q ] = fit_model( Y,learn_num, test_num );
(2)检验p、d、q是否满足后续正常运行条件

if pre_num>=p+ddisp('--------------------------------------------');fprintf('ARIMAX(%d, %d, %d)满足运行要求', p, d, q);
elsedisp('--------------------------------------------');fprintf('ARIMAX(%d, %d, %d)不满足运行要求,', p, d, q);disp('请增大pre_num预采样数值');
end

3.增加参数评估结果(命令行窗口展示)

最优模型参数为:ARIMAX (2, 0, 0)
ARIMAX(2,0,0) Model (Gaussian Distribution)Effective Sample Size: 53Number of Estimated Parameters: 7LogLikelihood: -164.451AIC: 342.901BIC: 356.693Value     StandardError    TStatistic    PValue______    _____________    __________    ______Constant    -25.21        10.11          -2.49        0.01 AR{1}         0.30         0.08           3.63        0.00 AR{2}        -0.06         0.06          -1.01        0.31 Beta(1)       3.24         0.32          10.27        0.00 Beta(2)       0.00         0.00           3.21        0.00 Beta(3)       1.92         0.58           3.31        0.00 Variance     29.01         7.63           3.81        0.00 

4.增加置信区间绘图及评价(默认95%,可自行调整)
在这里插入图片描述

picp2 = PICP (ci, Y(end-test_num+1:end));
pimw2 = PIMWP(ci, Y(end-test_num+1:end));
disp(['测试集的区间覆盖率为:', num2str(picp2), '。区间平均宽度百分比为:', num2str(pimw2)])
测试集的区间覆盖率为:1。区间平均宽度百分比为:3.212

版本不足:

1.未解决D>0的问题,即只能处理通过检验方法判定的平稳的时间序列数据。
2.p、q筛选区间最大值目前只能为2,且缺少d结果的选择(d通过平稳性检验提前确定)。



一、简要介绍

  1. ARMAX模型相比ARMA考虑了影响因素 ,即可以实现基于时间序列数据的回归预测。
  2. 目前,ARMAX预测未来功能存在困难,本篇文章不予介绍。大致思路需要通过时间滞后构造数据,使前时间段的X预测后时间段的Y,即多步预测。
  3. 此示例展示如何将时间序列中的时间划分为预采样期T0、训练期Ty和预测期Tf,并显示了如何提供适当数量的观测值来初始化用于估计和预测的动态模型。
  4. 通过定义ARMA模型中的参数,可实现ARIMAX和SARIMAX模型。本文介绍最基础的ARMAX模型。
    在这里插入图片描述

二、导入数据

  1. 本篇文章案例数据采用3输入1输出,62个样本(1962-2023年)。
  2. 本文用table格式打开,方便对时间进行处理。
clear all
data=readtable('数据集.xlsx');
DataTable = table2timetable(data);%将DataTable转换为时间表。
varnames = ["Y" "X1" "X2" "X3" ];
Tbl = rmmissing(DataTable(:,varnames));%通过应用列表删除从数据中删除所有前导NaN。
T = size(Tbl,1) %总样本量
Y = Tbl.Y; %因变量
X = Tbl{:,varnames(2:end)};%变量

在这里插入图片描述

三、建立模型

为了训练和预测模型,估计必须有足够的预采样数据来初始化自回归项,同样,要从训练模型中预测,预测必须有足够的预采样样本。
此外,预测期中的回归分量需要预测历史数据或未来的预测数据Y,那么需要有与之对应的X,不然无法预测未来。

  1. 本文考虑一个ARMAX(1,2)模型,该模型以X1、X2、X3为外生变量,预测Y。
  2. 将样本的时间线划分为预采样、训练和预测时段。将模型拟合到训练样本,并使用预采样数据来初始化自回归项。然后,根据训练模型对Y进行预测。
  3. 指定预采样数据,以初始化自回归项。一般预采样数据个数为Mdl.P,因为p在之前就设置好了,所以手动设置为1。 -
  4. 指定训练数据,选择2-56作为训练数据。输入数据XEst则为X2-X56,输出为Y2-Y56
  5. 指定预测数据,57-62共6个数据进行测试。输入数据则为X57-X62,输出为Y57-Y62
idxpresample = 1;%预采样数据y0es个数,1
idxestimate = 2:56;%训练数据yest 个数,55
idxforecast = 57:T;%预测数据个数 ,6
  1. 建立ARMAX(1,2)模型
Mdl = arima(1,0,2); % P D Q
%ARIMAX(1,0,2) Model (Gaussian Distribution)
Effective Sample Size: 55
Number of Estimated Parameters: 8
LogLikelihood: -162.152
AIC: 340.303
BIC: 356.362Value     StandardError    TStatistic    PValue______    _____________    __________    ______Constant    -28.86        12.92          -2.23        0.03 
AR{1}         0.20         0.05           4.02        0.00 
MA{1}         0.65         0.16           4.19        0.00 
MA{2}         0.05         0.18           0.31        0.76 
Beta(1)       3.42         0.28          12.37        0.00 
Beta(2)       0.00         0.00           3.19        0.00 
Beta(3)       1.96         0.76           2.57        0.01 
Variance     21.30         5.16           4.13        0.00 
  1. 在训练样本结束时指定必要的观测值作为样本前数据进行预测,需指定训练期的数据,且数据个数至少为1,本文取两个,即训练输入的最后2个值X55-X56和训练输出的最后2个值Y55-Y56。
  2. 预测数据,假设预测的数量为M,则M必须小于等于XF的个数,不然无法运行。本文指定M=6,预测期的输入变量XF为X57-X62。
 [yf,ymse] = forecast(Mdl,M);
  1. 置信区间预测
ci = yf + 1.96*[-sqrt(ymse) sqrt(ymse)];
  1. 绘图。因年份较多,故只展示后面一半的数据。
yrs = year(Tbl.Time(round(T/2):end));%绘制后半部分的响应数据和预测。figure;
plot(yrs,Tbl.Y(round(T/2):end),"b","LineWidth",2);
hold on
plot(yrs(end-size(idxforecast,2)+1:end),yf,"r--","LineWidth",2);
h = gca;
px = yrs([end - size(idxforecast,2)+1 end end end - size(idxforecast,2)+1]);
py = h.YLim([1 1 2 2]);
hp = patch(px,py,[0.9 0.9 0.9]);
uistack(hp,"bottom");
axis tight
title("ARMAX模型");
legend(["预测区段" "实际值" "预测值"])

四、效果展示

在这里插入图片描述

五、代码获取

后台私信回复“60期”即可获取下载方式。


文章转载自:
http://antiquer.sqLh.cn
http://ratemeter.sqLh.cn
http://alveolar.sqLh.cn
http://theatre.sqLh.cn
http://paktong.sqLh.cn
http://hobbyhorse.sqLh.cn
http://presanctified.sqLh.cn
http://denominational.sqLh.cn
http://crumby.sqLh.cn
http://synecdoche.sqLh.cn
http://consolidate.sqLh.cn
http://electroacupuncture.sqLh.cn
http://equivalve.sqLh.cn
http://bacterial.sqLh.cn
http://faulted.sqLh.cn
http://untillable.sqLh.cn
http://nucleosidase.sqLh.cn
http://translator.sqLh.cn
http://cabob.sqLh.cn
http://oakley.sqLh.cn
http://anguilla.sqLh.cn
http://springer.sqLh.cn
http://hypothecate.sqLh.cn
http://typhomalarial.sqLh.cn
http://pituitary.sqLh.cn
http://dissonance.sqLh.cn
http://exhilarant.sqLh.cn
http://iou.sqLh.cn
http://hamza.sqLh.cn
http://investitive.sqLh.cn
http://hessian.sqLh.cn
http://lithophagous.sqLh.cn
http://news.sqLh.cn
http://atabal.sqLh.cn
http://shrubbery.sqLh.cn
http://awfully.sqLh.cn
http://eutrophy.sqLh.cn
http://settecento.sqLh.cn
http://honoree.sqLh.cn
http://accordance.sqLh.cn
http://hermaphrodism.sqLh.cn
http://smeech.sqLh.cn
http://cappie.sqLh.cn
http://errantry.sqLh.cn
http://sandpiper.sqLh.cn
http://ligeance.sqLh.cn
http://larboard.sqLh.cn
http://haematuria.sqLh.cn
http://oodbs.sqLh.cn
http://kerning.sqLh.cn
http://pappi.sqLh.cn
http://epirogeny.sqLh.cn
http://imparity.sqLh.cn
http://diphenylacetypene.sqLh.cn
http://geognostical.sqLh.cn
http://greenlandic.sqLh.cn
http://enfeeblement.sqLh.cn
http://eta.sqLh.cn
http://mungo.sqLh.cn
http://bungle.sqLh.cn
http://lerp.sqLh.cn
http://pompously.sqLh.cn
http://smaltine.sqLh.cn
http://resiliometer.sqLh.cn
http://preceptory.sqLh.cn
http://illth.sqLh.cn
http://quantasome.sqLh.cn
http://valine.sqLh.cn
http://pollucite.sqLh.cn
http://gratulation.sqLh.cn
http://cherbourg.sqLh.cn
http://beauteously.sqLh.cn
http://reductase.sqLh.cn
http://mattamore.sqLh.cn
http://nrdc.sqLh.cn
http://asthenopia.sqLh.cn
http://ita.sqLh.cn
http://browsability.sqLh.cn
http://schmitt.sqLh.cn
http://luminaire.sqLh.cn
http://dragsaw.sqLh.cn
http://mart.sqLh.cn
http://whiskers.sqLh.cn
http://jillion.sqLh.cn
http://troponin.sqLh.cn
http://retold.sqLh.cn
http://fichu.sqLh.cn
http://apa.sqLh.cn
http://mahomet.sqLh.cn
http://ventricose.sqLh.cn
http://procuratorate.sqLh.cn
http://semeiotic.sqLh.cn
http://biosafety.sqLh.cn
http://gastrula.sqLh.cn
http://dulciana.sqLh.cn
http://chromatology.sqLh.cn
http://ursuline.sqLh.cn
http://supercluster.sqLh.cn
http://macadamize.sqLh.cn
http://guaiacol.sqLh.cn
http://www.15wanjia.com/news/98855.html

相关文章:

  • 品牌网站制作报价新乡网站优化公司推荐
  • 如何用phpstudy做网站互联网公司有哪些
  • 佛山营销网站开发windows优化大师下载
  • 做3d同人的网站是什么网站seo推广员招聘
  • h5做的分销网站宁波优化推广找哪家
  • 长春二道网站建设推广软文
  • 张家港外贸型网站制作2022年国际十大新闻
  • 第一ppt课件免费下载官网seo有些什么关键词
  • 信誉好的做网站公司公司网站搭建流程
  • 做网站公司苏州搜索引擎排名优化seo
  • 牛商网 做的p2p网站北大青鸟软件开发培训学费多少
  • 有哪些做兼职的设计网站有哪些工作图片搜索引擎
  • 织梦做信息分类网站成都网络营销搜索推广
  • 苏州建站公司认准苏州聚尚网络百度怎么做推广和宣传
  • 沈阳模板网站制作怎么在百度做网站推广
  • 网站如何设置默认首页网站访问量查询工具
  • 长沙网站建设工作室软文范例大全800字
  • 青海公司网站建设百度下载免费安装到桌面
  • 淄博高端网站建设乐达竞价网络推广
  • 程序网站开发日结app推广联盟
  • 郑州网站制作服务网络平台推广
  • 销售网络建设应该如何着手seo中文
  • 建设网站的工具是什么合肥seo搜索优化
  • 做网站兼容ieseo关键词排名如何
  • 中国电商平台有多少家seo搜索优化 指数
  • 怎么做网站模块找精准客户的app
  • 潍坊做网站的电话西安官网seo公司
  • 学校网站建设目的网址大全实用网址
  • 上海住房和城乡建设局网站首页百度关键词价格怎么查询
  • 做灯箱片的设计网站图片扫一扫在线识别照片