的tbats
的...
參數將被傳遞給auto.arima
,從文檔(?tbats
)
...: Additional arguments to be passed to ‘auto.arima’ when
choose an ARMA(p, q) model for the errors. (Note that
xreg will be ignored, as will any arguments concerning
seasonality and differencing, but arguments controlling
the values of p and q will be used.)
望着文檔auto.arima
我們看到有爭論用於設置p
和q
的值。
auto.arima(y, d = NA, D = NA, max.p = 5, max.q = 5, max.P = 2,
max.Q = 2, max.order = 5, max.d = 2, max.D = 1, start.p = 2,
start.q = 2, start.P = 1, start.Q = 1, stationary = FALSE,
seasonal = TRUE, ic = c("aicc", "aic", "bic"), stepwise = TRUE,
trace = FALSE, approximation = (length(x) > 150 | frequency(x) > 12),
truncate = NULL, xreg = NULL, test = c("kpss", "adf", "pp"),
seasonal.test = c("ocsb", "ch"), allowdrift = TRUE, allowmean = TRUE,
lambda = NULL, biasadj = FALSE, parallel = FALSE, num.cores = 2,
x = y, ...)
所以,你正在做的工作,增加了論據start.p
,start.q
,並trace
到tbats
呼叫控制初始值,看到了搜索。
在這個例子中,最好的模型是ARIMA(0, 0, 0) with zero mean
。 BATS(0, {0,0}, 0.979, -)
告訴我們選擇了{p, q} = {0, 0}
的值。
library(forecast)
omega <- USJudgeRatings[,1]
tbats(y = omega,
use.box.cox = TRUE,
use.trend = TRUE,
use.damped.trend = TRUE,
use.arma.errors = TRUE,
start.p = 3,
start.q = 2,
trace = TRUE)
#
# ARIMA(3,0,2) with non-zero mean : Inf
# ARIMA(0,0,0) with non-zero mean : -55.63664
# ARIMA(1,0,0) with non-zero mean : -53.50348
# ARIMA(0,0,1) with non-zero mean : -53.47905
# ARIMA(0,0,0) with zero mean : -57.75828
# ARIMA(1,0,1) with non-zero mean : -51.19495
#
# Best model: ARIMA(0,0,0) with zero mean
#
# BATS(0, {0,0}, 0.979, -)
#
# Call: tbats(y = omega, use.box.cox = TRUE, use.trend = TRUE, use.damped.trend = TRUE,
# use.arma.errors = TRUE, start.p = 3, start.q = 2, trace = TRUE)
#
# Parameters
# Lambda: 0
# Alpha: -0.04239053
# Beta: 0.04362955
# Damping Parameter: 0.978616
#
# Seed States:
# [,1]
# [1,] 1.917976
# [2,] 0.017468
#
# Sigma: 0.1206409
# AIC: 163.774
這將是更容易幫助你,如果你提供的[重複的例子(https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)通過示例數據和代碼,您試圖清楚您要做什麼。 – MrFlick