我试图了解"crost {ts间歇性}“和"croston {预测}”是如何计算样本内(培训)值的具体细节。他们似乎给出了相似的,但不同的结果。(参见下面的示例代码)我不确定这两种计算是不同的,还是没有比较相同的结果(每个包使用不同的术语)。
library (tsintermittent)
library (forecast)
# create an intermittent time-series
x = c(5,5,5,5,5,5,6,8,0,8,0,8,0,0,4,0,0,6,7,0,0,0,9,0,11,0,0)
x_crost = crost(x,h=5) # from the tsintermittent package
x_croston=croston(x,h=5) # from the forecast package
x_croston$fitted
y=data.frame(x,x_crost$frc.in,x_croston$fitted)
y # viex_croston results
plot(x_croston)
lines(x_croston$fitted, col="red")
lines(x_crost$frc.in,col="blue")
发布于 2016-04-11 22:26:24
一种使用优化的参数,另一种则不使用。forecast::croston
适合于非零需求序列的两个ETS(A,N,N)模型和非零需求之间的时间,具有共同的平滑参数(默认为alpha=0.1
),初始状态设置为每个序列的第一个值。tsintermittent::crost
适用于相同的两个模型,但优化了平滑参数的值和初始值(默认情况下使用平均绝对率)。
https://stackoverflow.com/questions/36556022
复制相似问题