我有548周的数据,并且尝试使用tbats但收效甚微。我收到以下错误:
Error in checkForRemoteErrors(val) :
3 nodes produced errors; first error: function cannot be evaluated at initial parameters
我的数据:
weeklyu <-structure(list(V1 = c(18594L, 13593L, 9854L, 12040L, 12920L,
13302L, 12500L, 13073L, 13801L, 12895L, 13199L, 21568L, 19848L,
13418L, 13188L, 13560L, 21327L, 17724L, 11875L, 12475L, 15130L,
14497L, 16289L, 22388L, 17091L, 21104L, 19579L, 18432L, 13234L,
16728L, 15368L, 18105L, 14715L, 16763L, 16788L, 15701L, 17331L,
18725L, 24336L, 16186L, 14299L, 15144L, 17444L, 19384L, 17035L,
18611L, 25946L, 32773L, 41676L, 59446L, 74874L, 19839L, 18325L,
17417L, 14025L, 15225L, 15323L, 16075L, 14756L, 15567L, 19416L,
15190L, 14349L, 19137L, 17714L, 22033L, 20182L, 16660L, 23325L,
19769L, 19465L, 16379L, 20762L, 19084L, 17395L, 21461L, 17616L,
25190L, 22671L, 21138L, 15302L, 19633L, 18951L, 20609L, 16493L,
18680L, 19583L, 18474L, 17654L, 20000L, 26003L, 17507L, 16547L,
18051L, 18627L, 19451L, 17682L, 19522L, 26240L, 33652L, 44835L,
59187L, 84620L, 32522L, 19829L, 17226L, 14330L, 15146L, 16043L,
16891L, 14569L, 14405L, 15919L, 13953L, 13014L, 16951L, 19543L,
23729L, 21614L, 14385L, 18847L, 17892L, 13140L, 11989L, 31371L,
32555L, 27598L, 29342L, 20787L, 30886L, 31296L, 26188L, 18586L,
22866L, 23160L, 26679L, 19641L, 20722L, 23915L, 16546L, 21480L,
21822L, 32611L, 21739L, 19410L, 17950L, 20800L, 22238L, 22667L,
21158L, 29635L, 38873L, 51334L, 67618L, 102150L, 56709L, 27771L,
20496L, 15617L, 17840L, 19616L, 19477L, 19703L, 17789L, 22365L,
21165L, 19706L, 30054L, 28939L, 26935L, 24446L, 18319L, 27419L,
43941L, 21068L, 18139L, 18385L, 22229L, 23650L, 28577L, 22497L,
27637L, 32822L, 28892L, 22691L, 23788L, 23727L, 22212L, 19853L,
21458L, 24941L, 23761L, 22393L, 20688L, 30884L, 30939L, 19373L,
19446L, 22363L, 25349L, 24333L, 24361L, 25849L, 40634L, 52033L,
68422L, 112772L, 84959L, 31343L, 24789L, 22639L, 19352L, 22176L,
21494L, 20161L, 17960L, 22985L, 24113L, 20326L, 20605L, 23159L,
28641L, 34736L, 22614L, 28310L, 33962L, 23836L, 21205L, 19933L,
23414L, 24127L, 25762L, 27898L, 27069L, 37598L, 32451L, 31210L,
24470L, 26281L, 23764L, 24506L, 21034L, 27204L, 29456L, 26162L,
25692L, 33738L, 32727L, 22314L, 22937L, 23974L, 28979L, 26481L,
27885L, 28264L, 41185L, 53924L, 62340L, 109928L, 97952L, 33023L,
27537L, 19913L, 18757L, 24361L, 22391L, 22402L, 19865L, 23339L,
23995L, 19874L, 19599L, 24435L, 31449L, 24959L, 18649L, 22280L,
32005L, 23227L, 18678L, 17894L, 23540L, 26109L, 26178L, 36432L,
30085L, 34126L, 28556L, 22603L, 21849L, 27871L, 22422L, 23984L,
19919L, 26152L, 28189L, 23459L, 20078L, 28310L, 31234L, 22394L,
20988L, 21401L, 28869L, 29915L, 25649L, 28483L, 40985L, 56049L,
65034L, 107110L, 103296L, 28677L, 23472L, 21035L, 18810L, 21639L,
22750L, 22675L, 19938L, 20674L, 24204L, 18657L, 20852L, 24986L,
26861L, 34310L, 22236L, 32884L, 37194L, 24933L, 18839L, 19396L,
24473L, 27922L, 24582L, 30348L, 23238L, 33199L, 31392L, 24778L,
20016L, 28230L, 24011L, 21890L, 20894L, 25797L, 29816L, 23384L,
21111L, 23517L, 30393L, 32004L, 20316L, 19941L, 25712L, 27371L,
23985L, 26508L, 39417L, 56225L, 65534L, 106220L, 135823L, 34772L,
24237L, 21064L, 19184L, 22146L, 25044L, 21753L, 21482L, 22178L,
25718L, 21384L, 21099L, 26945L, 33711L, 35273L, 24807L, 22027L,
34099L, 29842L, 21348L, 18802L, 25595L, 27276L, 24056L, 29279L,
24938L, 36060L, 33213L, 30601L, 20955L, 24773L, 28693L, 31301L,
24287L, 24545L, 30910L, 27261L, 23929L, 25167L, 34285L, 35096L,
21831L, 22137L, 25630L, 26853L, 25871L, 27499L, 36479L, 52402L,
58148L, 83033L, 122756L, 58313L, 26249L, 22310L, 17733L, 19202L,
22390L, 20969L, 20553L, 17860L, 24034L, 20915L, 19864L, 25003L,
31461L, 30302L, 21518L, 21273L, 24785L, 28366L, 26014L, 20288L,
21098L, 23394L, 21124L, 26181L, 24367L, 33042L, 32558L, 27164L,
20895L, 24235L, 26494L, 26734L, 17734L, 19397L, 25407L, 23536L,
21434L, 22248L, 34186L, 25554L, 18707L, 17292L, 19123L, 23300L,
21337L, 23136L, 27681L, 49923L, 59344L, 77552L, 97665L, 68414L,
27532L, 21217L, 16269L, 17607L, 22626L, 21087L, 20776L, 15611L,
22448L, 20070L, 18562L, 22027L, 25401L, 33810L, 21264L, 28131L,
28179L, 39713L, 23450L, 20752L, 23593L, 27141L, 25511L, 30010L,
23526L, 29145L, 34520L, 32609L, 30214L, 25018L, 26091L, 22625L,
21205L, 21550L, 29100L, 27555L, 21273L, 22519L, 32719L, 29749L,
29160L, 19621L, 23631L, 27312L, 26380L, 25949L, 30285L, 46186L,
59925L, 71215L, 120941L, 87855L, 32558L, 23906L, 22984L, 19685L,
23324L, 20996L, 21947L, 17577L, 23871L, 22242L, 18914L, 18821L,
24463L, 33096L, 27962L, 20848L, 26917L, 34725L, 21951L, 18351L,
17952L, 24975L, 23563L, 23275L, 29248L, 28011L, 37056L)), .Names = "V1", class = "data.frame", row.names = c(NA,
-548L))
数据在闰年有53周,有两个季节性:52.25和209。
weeklyts <- msts(weeklyu, seasonal.period=c(52.25,209),
ts.frequency=52.25)
然后我尝试:
weeklytbat <- tbats(weeklyts)
然后得到上面的错误。
如果我将seasonal.periods
设置为c(52,209)
或c(52.3,209)
或c(52.2501,209)
,则会有效。
非常感谢任何帮助
答案 0 :(得分:0)
如果您在错误消息上运行traceback()
,则可以看到错误源自parallel
包中的函数调用。默认情况下,tbats
会尝试使用并行处理。
您可以放弃使用use.parallel = FALSE
进行并行处理,但是会出现一条与问题来源更紧密联系的错误消息。
weeklytbat <- tbats(weeklyts, use.parallel=F)
Error in optim(par = param.vector$vect, fn = calcLikelihoodTBATS, method = "Nelder-Mead", :
function cannot be evaluated at initial parameters
我建议您使用其他季节性时段,除非您想深入了解数据的优化例程。
HTH
答案 1 :(得分:0)
这是由于一个季节性时期是另一个季节性时期的一小部分而导致的功能错误。它现在已在https://github.com/robjhyndman/forecast的github版本中修复。 CRAN版本将在适当的时候更新。