econometric modeler unacceptably slow with acceptably large values of SAR and SMA

2 views (last 30 days)
I am currently using the malab econometric modeler to run some analysis with the regression SARIMAX model. I discovered that matlab becomes unacceptably slow when I estimate my regARIMA model by using large values of the seasonal AR and MA lags, independently on the value I assign to the seasonality. Is there any reason why this happens?
Thank you.
Here is a portion of my model, for reference (AR, MA, SAR, S, and SMA are assigned before this part):
SARv = S : S : S*SAR;
SMAv = S : S : S*SMA;
% arima model
Mdl = regARIMA('Intercept', 0, 'ARLags', 1:AR, 'D', 0, 'MALags', 1:MA, 'SARLags', SARv, ...
'Seasonality', S, 'SMALags', SMAv, 'Distribution', 'Gaussian');
validIndices = find(~any(isnan([data{1, 1}, data{1, 2}, data{1, 3}, data{1, 4}, data{1, 5}]), 2));
preSN = Mdl.P;
preSR = data{1, 1}(validIndices(1:preSN));
estimateR = data{1, 1}(validIndices(preSN+1:end));
% external variables
coeret = [data{1, 2}, data{1, 3}, data{1, 4}, data{1, 5}];
coeret_for = [data_fore{1, 2}, data_fore{1, 3}, data_fore{1, 4}, data_fore{1, 5}];
% size of the dataset, and of the presample and estimation period
[EstMdl, ~, ~] = estimate(Mdl, estimateR, ...
'X', coeret(preSN+1:end, :), 'Display', 'off');

Answers (1)

Sai Pavan
Sai Pavan on 6 Dec 2023
Hi Daniele,
I understand that you are trying to know the reasons for SARIMAX model running slow in econometric modeler with large values of the seasonal AR (SAR) and MA (SMA) lag values.
Here are a few reasons why MATLAB might become slow when estimating these models with large SAR and SMA lags:
  • Number of Parameters: A higher number of AR and MA terms means more parameters to estimate, which increases the computational burden. This is further compounded in seasonal models where the seasonality can lead to a large number of additional parameters.
  • State Space Representation: SARIMAX models are often represented in state-space form for estimation, and the size of the state-space matrices grows with the number of lags.
  • Optimization Routine: The estimation process typically involves numerical optimization to find the best-fitting parameters. With more parameters, the optimization problem becomes more complex, and it may take longer to converge to an optimal solution.
  • Data Size: The length of the time series and the number of observations can also affect the estimation time. If the dataset is large, the algorithms need to process more data, which can slow down the estimation.
  • Matrix Operations: The estimation of ARIMA models involves matrix operations such as inversions and multiplications. The complexity and computational cost of these operations increase with the size of the matrices, which is related to the number of lags.
  • Convergence Criteria: The settings for the convergence criteria of the optimization algorithm can also affect the estimation time. Tighter convergence thresholds can lead to longer estimation times.
To mitigate the issue of slow estimation, the following workarounds can be considered:
  • Simplify the model by reducing the number of lags if possible. Use model selection criteria (e.g., AIC, BIC) to find a more parsimonious model that still captures the essential dynamics of the data.
  • Ensure that the data is handled efficiently in your MATLAB code.
  • If you have access to the Parallel Computing Toolbox, you can try to speed up the estimation by running the optimization in parallel on multiple cores.
  • If you are performing rolling or recursive estimation, consider using incremental estimation techniques that update the parameter estimates as new data becomes available, rather than re-estimating the entire model from scratch.
Hope it helps.
Regards,
Sai Pavan

Categories

Find more on Conditional Mean Models in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!