reichlab / sarimaTD

sarimaTD R package: SARIMA Models with Transformations and Seasonal Differencing
2 stars 2 forks source link

slow fits #16

Open elray1 opened 4 years ago

elray1 commented 4 years ago

Estimation process taking a long time for many fits recently. Seems to have to do with a call to optim under the if (method == "CSS-ML") { block in stats::arima, called from the if (approximation && !is.null(bestfit$arma)) { block in forecast::auto.arima.

Can we provide another option for method, a maxit for optim calls, or figure out what the underlying problem is? maybe we need to have lower limits on maxp and maxq for auto.arima?

elray1 commented 4 years ago

Seems like there are two issues.

  1. For some data sets, evaluating the likelihood function (armafn defined within stats::arima) is much slower than for other data sets. It would take substantial effort to figure out why.
  2. A change was made to the forecast package that sets a lower threshold for rejecting a model due to unit roots. This means a larger set of models may be fit in the search process in forecast::auto.arima.

I don't think there's much to do about either of these things.

The best option I can see would be to modify forecast::auto.arima to optionally return a list of any fully-fit models with parameter estimates, and accept such a list to use as initial values for parameters being estimated via MLE in the if(method == "CSS-ML") block in stats::arima. Then we could save the results from previous weeks or years fits and use them to get better(?) initial values for the current estimation task.

elray1 commented 4 years ago

setting max.p and max.q to 4 instead of 5 did not help