【发布时间】:2018-03-02 10:15:54
【问题描述】:
我目前在使用预测包 8.2 和 thetaf 功能时遇到问题:
dat<- structure(c(5, 0, 5, 0, 0, 2, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.9, 0, 2, 0, 1,
0, 2.1, 0, 2, 0, 1, 0, 0, 0, 2.5, 2, 2, 0, 1.7, 0, 1.5, 0, 1,
0, 0, 0, 2.5, 0), .Tsp = c(1999, 2003.91666666667, 12), class = "ts")
library(forecast)
thetaf(dat,h = 1)$mean
出现以下错误
Error in ets(object, lambda = lambda, allow.multiplicative.trend = allow.multiplicative.trend, :
y should be a univariate time series
Additional: Warnings:
1: In ets(x, "ANN", alpha = alpha, opt.crit = "mse", lambda = lambda, :
Missing values encountered. Using longest contiguous portion of time series
2: In fit$call <- match.call() : ...
错误与频率有关。如果它是 1 而不是 12,那么它可以工作。我看不出这会导致错误的原因。有任何想法吗?
【问题讨论】:
-
如果零是问题,如果我将频率降低到 1,为什么该函数会起作用?
标签: r time-series forecasting