我需要为我正在尝试执行的预测获得 80% 和 95% 的置信水平,而简单的移动平均函数除了 95% 的置信水平之外不提供任何东西。有没有办法解决这个问题或任何一种变通方法来获得 80% 的置信水平?
这是一个示例代码,您会注意到下(上)界 80% 和下(上)界 95% 的输出完全相同。
library(smooth)
library(forecast)
iris
x1 = sma(iris$Sepal.Length, level = .80)
x2 = sma(iris$Sepal.Length, level = .95)
forecast(x1)
forecast(x2)
> forecast(x1)
Time Series:
Start = 151
End = 160
Frequency = 1
Point forecast Lower bound (2.5%) Upper bound (97.5%)
151 6.320000 5.153756 7.486244
152 6.244000 5.054660 7.433340
153 6.232800 5.010969 7.454631
154 6.179360 4.912203 7.446517
155 6.175232 4.845518 7.504946
156 6.230278 4.815333 7.645224
157 6.212334 4.755426 7.669243
158 6.206001 4.702861 7.709141
159 6.200641 4.648248 7.753034
160 6.204897 4.602211 7.807583
> forecast(x2)
Time Series:
Start = 151
End = 160
Frequency = 1
Point forecast Lower bound (2.5%) Upper bound (97.5%)
151 6.320000 5.153756 7.486244
152 6.244000 5.054660 7.433340
153 6.232800 5.010969 7.454631
154 6.179360 4.912203 7.446517
155 6.175232 4.845518 7.504946
156 6.230278 4.815333 7.645224
157 6.212334 4.755426 7.669243
158 6.206001 4.702861 7.709141
159 6.200641 4.648248 7.753034
160 6.204897 4.602211 7.807583