- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 auto.arima
创建 30 天的预测来自 forecast
包裹。我想捕捉长期趋势,所以我将其插入 xreg
争论。
数据:
dput(data)
structure(list(TKDate = structure(c(15706, 15707, 15708, 15709,
15710, 15711, 15712, 15713, 15714, 15715, 15716, 15717, 15718,
15719, 15720, 15721, 15722, 15723, 15724, 15725, 15726, 15727,
15728, 15729, 15730, 15731, 15732, 15733, 15734, 15735, 15736,
15737, 15738, 15739, 15740, 15741, 15742, 15743, 15744, 15745,
15746, 15747, 15748, 15749, 15750, 15751, 15752, 15753, 15754,
15755, 15756, 15757, 15758, 15759, 15760, 15761, 15762, 15763,
15764, 15765, 15766, 15767, 15768, 15769, 15770, 15771, 15772,
15773, 15774, 15775, 15776, 15777, 15778, 15779, 15780, 15781,
15782, 15783, 15784, 15785, 15786, 15787, 15788, 15789, 15790,
15791, 15792, 15793, 15794, 15795, 15796, 15797, 15798, 15799,
15800, 15801, 15802, 15803, 15804, 15805, 15806, 15807, 15808,
15809, 15810, 15811, 15812, 15813, 15814, 15815, 15816, 15817,
15818, 15819, 15820, 15821, 15822, 15823, 15824, 15825, 15826,
15827, 15828, 15829, 15830, 15831, 15832, 15833, 15834, 15835,
15836, 15837, 15838, 15839, 15840, 15841, 15842, 15843, 15844,
15845, 15846, 15847, 15848, 15849, 15850, 15851, 15852, 15853,
15854, 15855, 15856, 15857, 15858, 15859, 15860, 15861, 15862,
15863, 15864, 15865, 15866, 15867, 15868, 15869, 15870, 15871,
15872, 15873, 15874, 15875, 15876, 15877, 15878, 15879, 15880,
15881, 15882, 15883, 15884, 15885, 15886, 15887, 15888, 15889,
15890, 15891, 15892, 15893, 15894, 15895, 15896, 15897, 15898,
15899, 15900, 15901, 15902, 15903, 15904, 15905, 15906, 15907,
15908, 15909, 15910, 15911, 15912, 15913, 15914, 15915, 15916,
15917, 15918, 15919, 15920, 15921, 15922, 15923, 15924, 15925,
15926, 15927, 15928, 15929, 15930, 15931, 15932, 15933, 15934,
15935, 15936, 15937, 15938, 15939, 15940, 15941, 15942, 15943,
15944, 15945, 15946, 15947, 15948, 15949, 15950, 15951, 15952,
15953, 15954, 15955, 15956, 15957, 15958, 15959, 15960, 15961,
15962, 15963, 15964, 15965, 15966, 15967, 15968, 15969, 15970,
15971, 15972, 15973, 15974, 15975, 15976, 15977, 15978, 15979,
15980, 15981, 15982, 15983, 15984, 15985, 15986, 15987, 15988,
15989, 15990, 15991, 15992, 15993, 15994, 15995, 15996, 15997,
15998, 15999, 16000, 16001, 16002, 16003, 16004, 16005, 16006,
16007, 16008, 16009, 16010, 16011, 16012, 16013, 16014, 16015,
16016, 16017, 16018, 16019, 16020, 16021, 16022, 16023, 16024,
16025, 16026, 16027, 16028, 16029, 16030, 16031, 16032, 16033,
16034, 16035, 16036, 16037, 16038, 16039, 16040, 16041, 16042,
16043, 16044, 16045, 16046, 16047, 16048, 16049, 16050, 16051,
16052, 16053, 16054, 16055, 16056, 16057, 16058, 16059, 16060,
16061, 16062, 16063, 16064, 16065, 16066, 16067, 16068, 16069,
16070, 16071, 16072, 16073, 16074, 16075, 16076, 16077, 16078,
16079, 16080, 16081, 16082, 16083, 16084, 16085, 16086, 16087,
16088, 16089, 16090, 16091, 16092, 16093, 16094, 16095, 16096,
16097, 16098, 16099, 16100, 16101, 16102, 16103, 16104, 16105,
16106, 16107, 16108, 16109, 16110, 16111, 16112, 16113, 16114,
16115, 16116, 16117, 16118), class = "Date"), spend = c(7984.39,
11476.06, 6555.57, 3981.45, 3963.83, 4827.72, 6309.32, 13503.36,
17075.89, 33353.71, 29324.34, 7968.68, 5540.63, 12113.45, 15596.38,
19328.67, 20224.68, 18977.55, 16128.27, 10633.56, 11887.79, 17881.11,
12613.46, 11607.55, 38232.11, 7861.25, 9397.88, 12056.02, 15115.87,
12275.93, 14537.35, 9594.26, 8215.83, 9632.52, 9993.15, 13478.37,
28509.38, 12016.33, 8907.76, 8757.43, 9513.09, 10299.5, 10385.03,
12515.62, 9008.95, 17825.68, 9320.47, 11189.58, 12902.31, 13341.35,
18675.32, 16989.53, 10114.53, 9876.65, 11203.39, 11718.73, 26264.95,
12414.19, 12275.16, 9242.85, 8883.97, 10095.72, 11581.55, 14815.78,
25064.12, 9297.07, 8047.91, 6876.37, 8881.63, 10982.85, 9975.33,
24124.62, 8514.66, 15719.84, 5807.39, 8422.38, 15184.95, 14757.58,
11087.61, 11070.78, 10425.67, 15517.8, 11257.69, 11915.47, 11720.37,
34064.62, 6493.41, 5757.4, 4387.54, 6520.58, 7806.81, 6356.63,
10916.36, 9013.43, 9722.41, 6044.25, 7971.7, 23933.54, 8627.85,
9722.77, 18660.13, 13011.36, 11445.11, 14219.2, 17138.92, 16016.68,
11434, 31379.03, 8494.25, 12493.85, 7708.1, 21583.05, 9026.17,
9379.35, 8287.13, 7298.16, 6097.03, 8076.57, 12871.87, 11346.89,
9115.82, 7737.98, 15065.38, 5262.73, 6522.58, 12743.94, 23945.16,
16109.26, 6985.89, 6345.08, 6246.93, 6824.66, 8491.42, 9654.99,
18976.58, 19565.68, 8075.47, 7219.79, 8629.04, 12491.64, 11915.89,
27533.16, 13554.35, 10102.21, 20029.15, 11641.82, 15855.19, 14139.17,
15376.63, 14625.99, 9098.87, 9396.64, 12015.84, 17532.75, 15131.65,
15815.5, 16048.65, 9769.63, 9582.12, 11201.8, 12810, 18857.38,
11822.71, 19289.08, 8911.29, 9437.55, 10987.14, 12995.65, 16675.26,
9741.82, 9723.57, 10328.24, 7738.04, 8432.16, 23021.73, 10367.28,
8210.53, 10468.4, 8024.25, 7296.25, 7445.34, 8539.59, 12386.23,
15335.72, 9013.49, 7994.95, 7759.46, 8789.38, 11242.38, 28653.23,
9750.96, 14398.62, 9248.74, 6766.08, 8159.14, 9899.38, 9453.35,
17588.96, 8958.16, 8256.61, 6240.4, 7235.24, 23841.62, 9002.73,
11839.47, 8693.31, 7161.37, 7046.39, 9221.53, 10004.93, 8698.76,
7948.68, 9013.27, 18536.68, 7980.38, 8968.95, 23594.14, 17744.66,
12615.73, 13646.05, 10512.58, 9066.02, 9665.15, 13183.2, 23864.45,
12017.52, 10831.07, 8954.76, 7276.41, 7882.9, 16616.41, 15384.68,
11046.53, 10621.01, 8094.74, 5451.26, 6237.79, 10717.69, 7076.38,
7044.62, 7047.45, 7774.77, 6496.21, 6340.9, 7110.53, 7691.28,
17482.02, 5576.19, 3763.79, 11477.68, 5710.5, 6519.51, 20022.61,
13153.68, 6526.28, 5885.28, 5656.17, 6270.04, 9795.38, 6320.95,
5741.98, 10808.72, 5150.87, 5416.52, 6305.05, 20953.12, 6569.02,
6360.21, 9376.68, 4973.93, 5034.48, 6380.45, 15307.28, 14386.65,
17705.88, 4779.52, 4784.79, 4737.05, 5350.28, 12112.11, 13153.72,
6049.69, 5430.46, 4627.59, 3637.2, 5482.43, 16705.15, 12221.16,
13198.88, 6484.54, 5590.86, 4979.09, 5771.75, 7311.92, 16111.86,
8047.77, 11706.91, 6042.14, 5670.74, 6905.07, 11261.89, 9700.4,
6643.03, 5693.85, 14778.67, 9128.14, 3682.01, 7911.5, 17742.85,
5093.31, 7867.97, 3202.78, 2843.35, 2598.77, 10930.81, 11204.67,
7289.62, 4000.17, 4178.89, 4507.33, 6671.48, 10317.48, 9368.98,
6156.41, 8375.24, 2762.76, 2457.59, 4707.51, 4584.52, 3749.82,
11667.82, 4271.67, 3614.3, 3715.83, 4510.57, 4872.36, 21805.71,
4757.04, 6515.92, 2834.25, 2685.19, 3509.28, 4479.35, 17817.99,
10357.67, 3412.15, 3044.95, 2840.24, 3348.91, 13671.68, 2027.42,
1616.25, 1177.73, 995.25, 1062.25, 1578.07, 1649.8, 1410.06,
1592.03, 3995.24, 6489.87, 6895.21, 8298.58, 7698.68, 5782.07,
7671.08, 19539.4, 7023.84, 6509.9, 6643.28, 19850.3, 6856.67,
13142.15, 5524.75, 5063.2, 4916.81, 6117.54, 6717.86, 9393.95,
10462.44, 10511.15, 4497.94, 4038.31, 5503.91, 5554.82, 5801.11,
12992.82, 4778.61, 4067.41, 4359.53, 6148.1, 9236.51, 5773.16,
11313.13, 4702.37, 4167.3, 4067.75, 4469.11, 9278.41, 9911.18,
5161.13, 4477.78, 4459.53, 4080.14, 5084.67, 7735.34, 10676.6,
5507.86, 8286.12, 4332.23, 4737.52, 5952.09, 7134.44)), .Names = c("TKDate",
"spend"), row.names = c(NA, 413L), class = "data.frame")
library(forecast)
explaining<-rep(1:length(data$TKDate))
predic<-rep((length(data$TKDate)+1):(length(data$TKDate)+31))
modArima <- auto.arima(data[,2],xreg=explaining)
fit<-forecast(modArima,h=30,xreg=explaining,newdata=predic)
plot(fit)
最佳答案
这是一个很难发现的错误,我承认。forecast.Arima()
采用不在 newdata
中的外部回归量的新值参数(与 predict.lm()
一样),但在 xreg
中范围。所以代替
fit <- forecast(modArima,h=30,xreg=explaining,newdata=predic)
explaining
的值进行预测的位置,不是
predic
的那些(不幸的是,如果您将数据提供给不存在的
forecast.Arima()
参数,
newdata
不会发出警告),请执行以下操作:
fit <- forecast(modArima,h=30,xreg=predic)
auto.arima()
或
arima()
返回,因为它们是由
lm()
返回,而是由
forecast.Arima()
返回):
plot(fit)
lines(fit$fitted,col="red")
关于r - 使用自动 Arima 预测,具有长期趋势线,30 天预测 "jumps",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22893612/
在 risc-v 规范中,它说 j 是 jal 的伪代码。我对它的工作原理感到困惑,因为 j (25 位立即数)和 jal (20 位立即数)的立即值范围不同 - 还有 jalr 带 12 位立即数。
希望这是我提出问题的正确位置。为什么不能使用这两个指令递归调用子例程? 提前致谢! 最佳答案 如果您“跳转并链接”,返回地址将存储在寄存器中。如果再次“跳转链接”,返回地址就会被新的地址覆盖,破坏原来
我正在尝试在运行服务器端口的数据库和另一台服务器之间创建一个 SSH 隧道,如下所示。 MySQL:3306 Server-A:3306 我想使用 Server-A:3306作为连接到数据库的数据库
我喜欢包含键:值的“跳转字典”的概念,其中值是函数。不过,我不确定我是否应该喜欢这个概念。 我想替换一长串 if if-else if 语句。 (我应该使用 switch 语句吗?) 有没有不用eva
我是 js 的新手我正在尝试通过 Prop isActive .但我收到一个错误。你们能告诉我为什么我会收到下面的错误代码吗?我在这一行收到了错误 import React from 'react'
我一直在创建自己的 UIControl 子类以用于我的调整 iDunnoU .我已经完成了 UIControl,但展开/折叠动画除外。这个动画的问题是它在展开/折叠时会向下/向上“跳跃”,而不是像我原
我正在尝试让相机在我的 LWJGL 程序中跳跃。我尝试编写一个 if/else 语句,它会说:“当你到达这个位置时,转到默认的起始位置。”到目前为止,它还在继续飞翔。这是我的代码: if (flyUp
在过去的一个半星期里,我一直在使用 Java 和 Swing 从头开始编写游戏。到目前为止,游戏运行一切顺利,除了一件事:跳跃。我正在尝试实现抛物线跳跃,以便玩家不只是向上传送一点点。相反,我希望
我如何处理 JuMP 中的稀疏矩阵? 例如,假设我想施加以下形式的约束: A * x == 0 哪里A是一个稀疏矩阵和 x变量向量。我假设 A 的稀疏性可以被利用来使优化更快。如何在 JuMP 中利用
我有一个文本字段,您通常在其中输入数字。但是,用户必须单击键盘上的数字按钮才能进入数字屏幕。有没有办法直接跳转到键盘上的屏幕并可以输入数字? 如有任何意见和建议,我们将不胜感激。 提前致谢。 最佳答案
粘性导航栏“跳跃” 我最近制作了一个导航栏,它在滚动时粘在屏幕顶部(进入网页时它从中间开始)。我是在 Mac 上做的,一切正常。但是,当在我的 Windows 桌面上进入网页时,整个导航栏要么跳动,跳
我有一个功能类似于 w3schools 的侧边栏,而 w3schools 的侧边栏显示相同的问题。侧边栏“跳跃”并在该区域留下难看的空间,当向下滚动页面和移动 chrome 的导航栏隐藏时,它在顶部留
我正在尝试创建一组在悬停时展开和收缩的 Font-Awesome 社交媒体图标。但是,当我停止将鼠标悬停在每个图标上时会出现问题,图标中间的图像会“跳跃”而不是像图标的其余部分那样平滑地折叠。这是代码
我的垂直自动滚动似乎在某些点不规律地停止,我想要一个平滑的滚动。其次,我希望垂直滚动自动重置(几乎无限循环或暗示它永无止境而不仅仅是跳跃)。我将如何着手完成这个?到目前为止,这是我的代码:http:/
我在 YouTube 上发布了一个视频,您可以在其中看到该问题。我放慢了视频速度,这样你就能真正看到跳跃。 链接:https://www.youtube.com/watch?v=17Wftj2-MRM
我在 Drupal 8 中构建了一个站点(但我认为这是一个 CSS 问题)。 当您重新加载页面时,页面“跳转”。它也会在您第一次访问时执行此操作,但如果您按“f5”,您会看得更清楚。我尝试删除 Log
如您所见,此背景将向下动画。我拥有我想要的一切正常工作,除了在动画完成后,它会跳转,这是我不想要的。我只希望它无休止地滚动而无需跳转到它。下面的 CodePen。 关于如何在大约 10 秒后继续滚动而
更新:这基本上是我想要的,但 div 固定在底部 - http://www.wduffy.co.uk/blog/wp-content/demos/jquery-scrolling-element/ 有
我正在 Python 3.4 中使用 numpy 和矩阵构建一个神经网络草图,以学习简单的 XOR。我的符号如下: a 是神经元的事件 z 是一个神经元的输入 W 是一个权重矩阵,大小为 R^{#上一
请原谅标题措辞不佳,希望我能在这里解释这个问题。 我用 jQuery 编写了一个简单的画廊控件,其中有六个图像和两个按钮控件,允许用户循环浏览整个图像集合。我的这部分工作正常,但是每当我单击一个按钮在
我是一名优秀的程序员,十分优秀!