我不确定这是否是预期的行为。考虑以下代码片段 -
library(forecast)
x <- c(
0, 0, 0, 0, 0.00217764964493354, 0.00339032724317772, 0.00357374918778428,
0.00282328811130057, 0.00272679331678393, 0.0030360769697858,
0.00316665914235777, 0.00163300219677676, 0.00249817841157489,
0.00207838479809976, 0.00192104504850639, 0.00209700948212983,
0.00216356555603635, 0.00250983016815862, 0.0017474879860201
)
tsData <- ts(data = x, start = 2000, frequency = 1)
df <- data.frame(
x = x,
fittedets = fitted(forecast(ets(tsData), h = 7)),
fittedarima = fitted(forecast(auto.arima(tsData), h = 7))
)
df
x fittedets fittedarima
1 0.000000000 -6.997521e-07 0.000000000
2 0.000000000 -7.065016e-11 0.000000000
3 0.000000000 -7.133162e-15 0.000000000
4 0.000000000 -7.201966e-19 0.000000000
5 0.002177650 0.000000e+00 0.000000000
6 0.003390327 2.177430e-03 0.002007587
7 0.003573749 3.390205e-03 0.003125561
8 0.002823288 3.573731e-03 0.003294659
9 0.002726793 2.823364e-03 0.002602805
10 0.003036077 2.726803e-03 0.002513846
11 0.003166659 3.036046e-03 0.002798976
12 0.001633002 3.166646e-03 0.002919360
13 0.002498178 1.633157e-03 0.001505474
14 0.002078385 2.498091e-03 0.002303084
15 0.001921045 2.078427e-03 0.001916074
16 0.002097009 1.921061e-03 0.001771022
17 0.002163566 2.096992e-03 0.001933245
18 0.002509830 2.163559e-03 0.001994603
19 0.001747488 2.509795e-03 0.002313826
实际值在第五个值之前为 0,而在两种模型的情况下,拟合值在第六个值之前约为 0。
对于前五个值,我假设它们大约为 0,例如x
列。我错过了一些基本的东西吗?