-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARIMA model #245
Comments
It is! 👍🏻 Also equivalent to an ARMA(1, 1) |
I find it much slower than the R package forecast's ARIMA function. How can I increase it speed? |
Can you post both R and Julia codes? |
R
Julia
|
I think the problem is the time to first plot issue, for more information please see https://discourse.julialang.org/t/roadmap-for-a-faster-time-to-first-plot/22956/16. One possible solution is to make the first julia> using StateSpaceModels
julia> data = randn(100);
julia> model = SARIMA(data, order = (1, 0, 1))
SARIMA(1, 0, 1)x(0, 0, 0, 0) model
julia> @time fit!(model)
16.776509 seconds (56.96 M allocations: 2.864 GiB, 8.90% gc time)
SARIMA(1, 0, 1)x(0, 0, 0, 0) model
julia> @time fit!(model)
0.002102 seconds (4.01 k allocations: 450.500 KiB)
SARIMA(1, 0, 1)x(0, 0, 0, 0) model
julia> data = randn(100_000);
julia> model = SARIMA(data, order = (1, 0, 1))
SARIMA(1, 0, 1)x(0, 0, 0, 0) model
julia> @time fit!(model)
0.692014 seconds (5.93 k allocations: 23.525 MiB, 1.28% gc time)
SARIMA(1, 0, 1)x(0, 0, 0, 0) model > require(forecast)
> data <- rnorm(100000)
> system.time(arima(data, c(1, 0, 1)))
usuário sistema decorrido
4.219 0.474 4.952
Warning message:
In arima(data, c(1, 0, 1)) :
possible convergence problem: optim gave code = 1 For 100000 observations the Julia code seems to be faster than forecast. |
My understanding is that precompilation time is fixed. For computationally intensive tasks, there is no need to warm up a function with smaller data. You seem to suggest the precompilation time is not fixed. |
Honestly I am not sure if the precompilation time is fixed, but it is a good practice to keep the results from the second time you run I think it is fairer to compare the times after the precompilation is done. To be even fairer we should benchmark the packages in the same data. StateSpaceModels.jl might also not be faster than R forecast in all cases, which uses C++ under the hood. In all cases the estimation times of the packages are comparable. I ran for 10M observations this time julia> data = randn(10_000_000);
er = (1, 0, 1))
@time fit!(model)
julia> model = SARIMA(data, order = (1, 0, 1))
SARIMA(1, 0, 1)x(0, 0, 0, 0) model
julia> @time fit!(model)
32.786926 seconds (2.80 k allocations: 2.175 GiB, 2.53% gc time)
SARIMA(1, 0, 1)x(0, 0, 0, 0) model > data <- rnorm(10000000)
system.time(arima(data, c(1, 0, 1)))
> system.time(arima(data, c(1, 0, 1)))
usuário sistema decorrido
35.186 1.274 38.186 |
Thanks for your explanation! I really like your great package. The name SpaceStateModels scared me off when I was trying to find an ARIMA modeling package in Julia. I have no idea what space state models mean. By reading the documents, I find it offers many common time series modeling functions. This package seems to be much more general than its name suggests. |
I agree that the name is not super accurate, it is closer to R forecast than from any control toolbox. Thank you for your feedback, I am always happy to see people using it :) |
I am looking for an ARIMA package in Julia. I want to make sure fitting an ARIMA(1, 0, 1) is coded as
The text was updated successfully, but these errors were encountered: