简体   繁体   中英

How long for forecast::auto.arima to work?

I am working through some demo code that accompanied a medium post on high frequency time series forecasting using the forecast::auto.arima function. Whether in this application or when I have tried other datasets, I have never been able to get a result from this function - it does seem to stop calculating once I have executed it. Others have, obviously; so I'm asking how long you need to wait to get a result from the function.

Example

Data on hourly energy use can be downloaded from Kaggle.

Using that data:

library(tidyverse)
library(forecast)

duq_pc <- read.csv(file.choose(),stringsAsFactors = F)

duq_new <- duq_pc[duq_pc$Datetime >= '2013-01-01 00:00:00' & duq_pc$Datetime <= '2017-09-30 00:00:00',]

duq_train <- duq_new[duq_new$Datetime <= '2016-12-31',]
duq_test <- duq_new[duq_new$Datetime >= '2017-01-01',]
msts_power <- msts(duq_train$DUQ_MW, seasonal.periods = c(24,24*7,24*365.25), start = decimal_date(as.POSIXct("2013-01-01 00:00:00")))

#Dynamic Harmonic regression with Auto Arima

fourier_power <- auto.arima(msts_power, seasonal=FALSE, lambda=0,
                            xreg=fourier(msts_power, K=c(10,10,10)))

Very interested to hear whether this is something that I would need to leave running overnight or whether other people are getting results in minutes.

In my case, running your code and measuring the times in between, it took about 40 minutes to finish. For what it's worth, I launched the script on a computer with an AMD Ryzen 2700 Eight-Core Processor 3.20 GHZ, 16 GB of RAM.

证据

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM