# Role of trend argument compared to integral order in ARIMA model

I am currently studying ARIMA models. When I checked for a Python library to train one, I stumbled upon statsmodels which features ARIMA (and SARIMAX from which ARIMA inherits). However, there is one thing I'm not quite sure I understand.

When differencing, we account for a trend in the time series. Nevertheless, we can still specify a deterministic trend in the model argument.

From what I understood, setting a deterministic trend will:

• result in more accurate forecasts thanks to a fixed variance
• not be able to adjust if the trend changes. For instance if a metric goes from growing up rapidly to having a slight slope, the model with the deterministic trend will continue with the same slope.

What are the differences between the two options?

Is there a use case where it would be useful to put both a trend and a integral order?

• When differencing, we account for a trend in the time series. This makes sense for a stochastic trend (unit root) but usually not for a deterministic trend. See the concept of overdifferencing. Commented Nov 10, 2023 at 9:48
• Thank you @RichardHardy! Will look it up. It's a bummer that most examples of ARIMA model on the internet focuses on stochastic trend even on things like CO2 concentration in the atmosphere. Commented Nov 10, 2023 at 10:39

ARIMA Elements:

AR (AutoRegressive): Uses lag to measure the correlation between observations; in other words, it uses past values in the series to predict future values.

I (Integrated): that data has been differenced in order to make the time series steady. Differentiating a non-stationary series helps eliminate trends that are frequently seen in them. In essence, you're changing the series so that it now emphasises changes from one period to the next as opposed to absolute numbers. MA (Moving Average): This part models the time series error as a blend of previous error terms.

Deterministic Trend: An ARIMA model's deterministic trend is a predetermined, constant trend that the model incorporates. Common choices for this include a quadratic trend (accelerating change) or a linear trend (constant change across time). A less common choice is a cubic smoothing spline.

Considerations for Differencing and Deterministic Trends:

• Differencing is applied when your time series displays a trend or seasonality, particularly when these characteristics are due to a stochastic component rather than a deterministic one, to avoid the risk of over-differencing (see the end of this answr for further details on over-differencing). It aids in achieving stationarity, a fundamental assumption in ARIMA modelling.

• Inclusion of a deterministic trend implies you are acknowledging a specific pattern in your data for the model to consider. It's akin to incorporating specialist knowledge into your model.

• However, many practitioners overdifference their time series, introducing a moving-average unit-root component and raising the error variance. The presence of a deterministic trend or seasonality in the absence of a unit root (seasonal or not) does not justify differencing. See the edit below for further detail.

When to Use Both?

• If your data’s trend is suspected to change (e.g., from rapid growth to a moderate incline), sole reliance on differencing may be more apt. It allows the model to adapt to such temporal changes.

• To effectively analyse data that shows a stable underlying trend with periodic variations, it can be useful to combine differencing and a deterministic trend. The deterministic trend focuses on the consistent component, whereas differencing handles the variations.

For example, with econometric data showing steady growth over years but with cyclical variations, employing a deterministic trend for long-term growth and differencing for cyclical shifts is often employed..

Key Points

• Introducing a deterministic trend increases model complexity. It’s crucial to ensure this added complexity correlates with enhanced performance.

• A thorough grasp of your data and its context is required. A model with a constant deterministic trend, for example, may breakdown if the fundamental process generating the data changes (structural breaks).

• Always evaluate the efficacy of your model using appropriate metrics. Techniques such as cross-validation and out-of-sample testing can help you determine how well your model generalises.

To sum up, whether you use differencing, a deterministic trend, or both depends on your understanding of the data's features and the specific analytical context. There is no universal solution; instead, it is typically a combination of theoretical understanding and empirical validation.

Edit: To address the comment by Richard Hardy about over-differencing:

This tackles an important issue in time series analysis: the possibility of over-differencing. Over-differencing a time series that lacks a unit root (seasonal or otherwise) can add needless complexity and result in less accurate models.

• Unit Root Tests: It is a god idea to identify whether a unit root exists before opting to difference a time series. This is commonly accomplished through the use of tests such as the Augmented Dickey-Fuller (ADF) test, the Phillips-Perron test, or the KPSS test. If these tests do not show the presence of a unit root, differencing may not be required.

• Deterministic Trend vs Stochastic Trend:

• A deterministic trend (such as a linear or quadratic trend) can often be removed by including a trend component in the model rather than differencing.
• A stochastic trend, which implies a unit root, usually requires differencing to achieve stationarity.
• Consequences of Over-Differencing:

• Over-differencing can result in the model including a moving average unit root that is unneeded. - It can raise the error variance and potentially produce false patterns in the differenced series.
• Biassed estimations and inaccurate conclusions might result from over-differenced models.
• Alternatives to Differencing: If you detect a deterministic trend or seasonality in the absence of a unit root, investigate models that explicitly include these components. For seasonal components, for example, use a trend component in ARIMA (similar to trend='ct' in Python's statsmodels) or SARIMA.

• You're welcome. Glad to help. Thanks for accepting the answer. Please consider giving my answer your upvote too :) Commented Nov 10, 2023 at 10:38
• I did, but my vote was not casted due to my low reputation. I casted it again and it went through this time around! Commented Nov 10, 2023 at 11:06
• Differencing is applied when your time series displays a trend or seasonality. This kind of treatment leads all too many practitioners to overdifferene their time series, introducing a moving-average unit-root component and increasing the error variance. Existence of deterministic trend or seasonality without presence of a unit root (seasonal or not) does not warrant differencing. Commented Nov 10, 2023 at 11:12
• @RichardHardy I agree with you. I will update my answer accordingly. Commented Nov 10, 2023 at 11:28
• @RichardHardy thanks again, I have modified that sentence as per your suggestion. Cheers :) Commented Nov 10, 2023 at 13:29