[R] slowness of auto.arima() from package forecast (was Execution time very high in linux)
Joao Santos
jcsantos at student.dei.uc.pt
Fri Nov 9 15:58:05 CET 2007
Hello,
EXAMPLE
##Create time series
bb_500 = scan("my_file.dat")
ts <- ts(bb_500, frequency=168)
ts
Time Series:
Start = c(1, 1)
End = c(3, 164)
Frequency = 168
[1] 61 60 60 59 58 58 58 58 58 61 64 65 65 64 64 64 63 63 62 61 60 60 60
59 58
[26] 58 58 57 57 57 57 56 57 57 58 59 59 59 60 60 60 61 60 60 60 60 60 59
58 57
[51] 57 56 55 55 55 56 60 71 76 78 77 78 80 80 80 79 76 71 68 66 65 64 63
62 61
[76] 60 60 59 59 60 63 73 77 79 78 78 80 81 81 80 77 71 67 67 66 65 63 62
61 60
[101] 60 60 60 60 64 74 78 80 79 79 81 81 81 80 76 68 66 65 65 64 63 62 61
60 60
[126] 60 59 60 64 73 77 79 79 78 80 80 80 80 76 70 67 66 65 64 63 61 61 60
60 59
[151] 59 60 63 73 77 78 78 78 79 80 80 79 74 69 65 64 63 62 61 60 60 59 58
58 58
[176] 58 59 61 63 64 63 63 63 63 64 63 63 61 60 60 59 59 58 58 57 56 55 55
54 54
[201] 54 54 55 55 56 56 57 57 58 58 58 58 57 57 57 57 57 56 55 55 54 54 54
55 60
[226] 72 76 77 77 77 79 80 80 79 76 70 66 65 64 63 62 61 61 60 60 59 58 59
63 72
[251] 76 77 77 77 79 80 80 79 76 71 66 65 64 63 62 61 60 58 58 57 57 58 62
71 75
[276] 76 77 76 78 79 79 77 74 69 65 64 63 62 62 60 59 58 58 58 58 58 62 69
75 78
[301] 78 73 64 61 58 57 56 56 55 54 53 53 53 53 53 57 69 74 75 75 75 76 75
76 75
[326] 71 65 60 58 54 53 53 52 52 51 51 49 50 51 52 55 58 60 60 59 59 60 60
59 59
[351] 57 57 56 56 55 55 54 54 54 53 53 53 53 53 53 54 54 55 55 55 56 56 56
56 56
[376] 56 56 55 55 55 54 54 53 53 53 52 53 57 68 73 74 74 74 76 76 77 76 72
67 64
[401] 63 62 61 60 59 59 58 58 57 57 58 61 71 75 76 76 76 78 78 78 77 74 69
65 64
[426] 63 62 59 58 56 53 51 51 51 48 53 67 73 75 77 78 78 78 74 68 65 63 63
62 61
[451] 59 59 58 57 57 57 57 61 71 75 77 77 77 78 79 79 78 75 69 66 65 64 63
61 60
[476] 59 58 58 58 58 59 62 72 76 77 78 78 78 79 79 78 74 68 64 63 62 61 60
59 58
##Find the best model using auto.arima() from package forecast
system.time(fit.500<-auto.arima(ts, d = NA, D = NA, max.p = 2, max.q = 2,
max.P = 1, max.Q = 1, max.order = 5,
start.p=0, start.q=0, start.P=0, start.Q=0,
stationary = FALSE, ic = c("aic","aicc", "bic"),
stepwise=FALSE, trace=TRUE))
ARIMA(0,0,0)(0,1,0)[168] : 1943.825
ARIMA(0,0,0)(0,1,0)[168] with drift : 1929.839
ARIMA(0,0,0)(0,1,1)[168] : 1945.061
ARIMA(0,0,0)(0,1,1)[168] with drift : 1937.518
ARIMA(0,0,0)(1,1,0)[168] : 1945.061
ARIMA(0,0,0)(1,1,0)[168] with drift : 2163.634
ARIMA(0,0,0)(1,1,1)[168] : 1947.061
ARIMA(0,0,0)(1,1,1)[168] with drift : 1932.075
ARIMA(0,0,1)(0,1,0)[168] : 1614.503
ARIMA(0,0,1)(0,1,0)[168] with drift : 1603.030
ARIMA(0,0,1)(0,1,1)[168] : 1615.747
ARIMA(0,0,1)(0,1,1)[168] with drift : 1608.540
ARIMA(0,0,1)(1,1,0)[168] : 1615.747
ARIMA(0,0,1)(1,1,0)[168] with drift : 1603.401
ARIMA(0,0,1)(1,1,1)[168] : 1617.747
ARIMA(0,0,1)(1,1,1)[168] with drift : 1605.401
ARIMA(0,0,2)(0,1,0)[168] : 1427.109
ARIMA(0,0,2)(0,1,0)[168] with drift : 1462.511
ARIMA(0,0,2)(0,1,1)[168] : 1427.255
ARIMA(0,0,2)(0,1,1)[168] with drift : 1468.507
ARIMA(0,0,2)(1,1,0)[168] : 1427.255
ARIMA(0,0,2)(1,1,0)[168] with drift : 1418.519
ARIMA(0,0,2)(1,1,1)[168] : 1429.255
ARIMA(0,0,2)(1,1,1)[168] with drift : 1420.519
ARIMA(1,0,0)(0,1,0)[168] : 1375.344
ARIMA(1,0,0)(0,1,0)[168] with drift : 1377.365
ARIMA(1,0,0)(0,1,1)[168] : 1374.959
ARIMA(1,0,0)(0,1,1)[168] with drift : 1376.827
ARIMA(1,0,0)(1,1,0)[168] : 1374.96
ARIMA(1,0,0)(1,1,0)[168] with drift : 1376.828
ARIMA(1,0,0)(1,1,1)[168] : 1376.960
ARIMA(1,0,0)(1,1,1)[168] with drift : 1378.828
ARIMA(1,0,1)(0,1,0)[168] : 1243.233
ARIMA(1,0,1)(0,1,0)[168] with drift : 1244.937
ARIMA(1,0,1)(0,1,1)[168] : 1241.591
ARIMA(1,0,1)(0,1,1)[168] with drift : 1243.213
ARIMA(1,0,1)(1,1,0)[168] : 1241.592
ARIMA(1,0,1)(1,1,0)[168] with drift : 1243.213
ARIMA(1,0,1)(1,1,1)[168] : 1243.591
ARIMA(1,0,1)(1,1,1)[168] with drift : 1245.214
ARIMA(1,0,2)(0,1,0)[168] : 1229.605
ARIMA(1,0,2)(0,1,0)[168] with drift : 1e+20
ARIMA(1,0,2)(0,1,1)[168] : 1e+20 *
ARIMA(1,0,2)(0,1,1)[168] with drift : 1e+20 *
ARIMA(1,0,2)(1,1,0)[168] : 1e+20 *
ARIMA(1,0,2)(1,1,0)[168] with drift : 1e+20 *
ARIMA(1,0,2)(1,1,1)[168] : 1e+20 *
ARIMA(1,0,2)(1,1,1)[168] with drift : 1e+20 *
ARIMA(2,0,0)(0,1,0)[168] : 1205.130
ARIMA(2,0,0)(0,1,0)[168] with drift : 1204.676
ARIMA(2,0,0)(0,1,1)[168] : 1e+20 *
ARIMA(2,0,0)(0,1,1)[168] with drift : 1e+20 *
ARIMA(2,0,0)(1,1,0)[168] : 1e+20 *
ARIMA(2,0,0)(1,1,0)[168] with drift : 1e+20 *
ARIMA(2,0,0)(1,1,1)[168] : 1e+20 *
ARIMA(2,0,0)(1,1,1)[168] with drift : 1e+20 *
ARIMA(2,0,1)(0,1,0)[168] : 1204.315
ARIMA(2,0,1)(0,1,0)[168] with drift : 1204.458
ARIMA(2,0,1)(0,1,1)[168] : 1e+20 *
ARIMA(2,0,1)(0,1,1)[168] with drift : 1e+20 *
ARIMA(2,0,1)(1,1,0)[168] : 1e+20 *
ARIMA(2,0,1)(1,1,0)[168] with drift : 1e+20 *
ARIMA(2,0,1)(1,1,1)[168] : 1e+20 *
ARIMA(2,0,1)(1,1,1)[168] with drift : 1e+20 *
ARIMA(2,0,2)(0,1,0)[168] : 1204.012
ARIMA(2,0,2)(0,1,0)[168] with drift : 1e+20
ARIMA(2,0,2)(0,1,1)[168] : 1e+20 *
ARIMA(2,0,2)(0,1,1)[168] with drift : 1e+20 *
ARIMA(2,0,2)(1,1,0)[168] : 1e+20 *
ARIMA(2,0,2)(1,1,0)[168] with drift : 1e+20 *
## user system elapsed
##19041.573 3806.364 22849.199 -> ~6 hours
I'm know from search the help page that stepwise=FALSE and trace=TRUE make
the function slower, but in this phase I would like to see what values are
picked in each interaction.
Sorry for any mistake on the creation off the post!!
João Santos
Prof Brian Ripley wrote:
>
> This is not about slowness of Linux nor of R but of a particular function
> in a contributed package. Few of us are familiar with that package, and
> you have not given a reproducible example. Please do as the posting guide
> asked and talk directly to the maintainer (who may well not read this
> list).
>
> I've altered the subject line to something less inappropriate.
>
> On Fri, 9 Nov 2007, Joao Santos wrote:
>
>>
>> Hello All,
>>
>> Sorry everybody for another message on this topic but I don't understand
>> the
>> times off execution that I have.
>>> From my search in the forum I found that linux old be better to this
>>> kind of
>> operation, so now I using a dualCore 2.33GHz with 8Gb RAM but the times
>> off
>> execution don´t decrease.
>>
>> Once again the function and the times and I get in linux:
>> system.time(fit_2323v_168f<-auto.arima(regts.ts, d = NA, D = NA, max.p =
>> 2,
>> max.q = 2,
>> max.P = 1, max.Q = 1, max.order = 5,
>> start.p=0, start.q=0, start.P=0, start.Q=0,
>> stationary = FALSE, ic = c("aic","aicc", "bic"),
>> stepwise=FALSE, trace=TRUE))
>> user system elapsed
>> 38389.75 3786.29 22849.73
>>
>>
>> There is some optimization that could be done?
>>
>>
>> Thanks in advance for the replies!!!
>>
>>
>> João Santos
>>
>> Joao Santos wrote:
>>>
>>> Hello again,
>>>
>>> Sorry but the code that I insert wasn't write. Should be like this:
>>>
>>> fit_2323v_168f<-auto.arima(regts.ts, d = NA, D = NA, max.p = 2, max.q =
>>> 2,
>>> max.P = 1, max.Q = 1, max.order = 5,
>>> start.p=0, start.q=0, start.P=0, start.Q=0,
>>> stationary = FALSE, ic = c("aic","aicc", "bic"),
>>> stepwise=TRUE, trace=TRUE)
>>>
>>> Sorry for the SPAM!!
>>>
>>> João Santos
>>>
>>>
>>> Joao Santos wrote:
>>>>
>>>> Hello,
>>>>
>>>> I using the fuction auto.arima() from package forecast to predict the
>>>> values of p,d,q and P,D,Q.
>>>> My problem is the execution time of this function, for example, a time
>>>> series with 2323 values with seasonality to the week take over 8 hours
>>>> to
>>>> execute all the possibilities.
>>>> I using a computer with Windows XP, a processor Intel Core2 Duo T7300
>>>> and 2Gb of RAM.
>>>>
>>>> fit_2323v_168f<-auto.arima(regts.ts, d = 1, D = 1, max.p = 2, max.q =
>>>> 2,
>>>> max.P = 1, max.Q = 1, max.order = 5,
>>>> start.p=0, start.q=0, start.P=0, start.Q=0,
>>>> stationary = FALSE, ic = c("aic","aicc",
>>>> "bic"),
>>>> stepwise=TRUE, trace=TRUE)
>>>>
>>>> It is any configuration to speed-up this?
>>>>
>>>>
>>>> Thanks in advance!
>>>>
>>>> João Santos
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
> --
> Brian D. Ripley, ripley at stats.ox.ac.uk
> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel: +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UK Fax: +44 1865 272595
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
--
View this message in context: http://www.nabble.com/Help-me-please...Large-execution-time-in-auto.arima%28%29-function-tf4771610.html#a13668367
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list