Giter Club home page Giter Club logo

Comments (5)

junpenglao avatar junpenglao commented on September 28, 2024 1

Yep that's where we should update it (removing the check and add period diff to the design_matrix)
AFAIK this is also how Statsmodel deal with SARIMAX (when you choose simple_differencing=True) https://github.com/statsmodels/statsmodels/blob/581119c64e43b6021bf247aa300b13abdfd5ef3b/statsmodels/tsa/statespace/sarimax.py#L551-L560

from bookcode_edition1.

junpenglao avatar junpenglao commented on September 28, 2024 1

Yeah that sentence is pretty confusing - what we are trying to say should be "Usually we have either ... but not both". The reason being that it gets a bit confusing in interpretation with the interaction regressors and the seasonality (especially if the regressors contain some seasonal information). But you can definitely have both in your SARIMAX set up.

from bookcode_edition1.

junpenglao avatar junpenglao commented on September 28, 2024
  1. It is actually exercise 6H15 - we are in the process of release the solution of the exercise, please stay tuned
  2. It is totally possible to combine SARIMA with external regressor, it just that it gets confusing, and many implementations actually opt to disallow it. We will update the text "Note that we can have either seasonal (SARIMA) or exogenous regressors (ARIMAX) but not both." in the 2nd to clarify this point.

from bookcode_edition1.

scroobiustrip avatar scroobiustrip commented on September 28, 2024

Oh fantastic (look forward to going through them!) okay that's great - so is it just a case of fitting a Normal prior over a holiday beta and just passing in the index of 1's and 0's?

Or does this bit need to be changed so that it doesn't set the seasonal period to 0?

# Dynamic regression
if design_matrix is not None:
    assert ps.rank(design_matrix) >= 2
    assert ps.shape(design_matrix)[-2] == observed.shape[-1]

    # seasonal adjustment
    if self.period > 0:
        warnings.warn("""
            Can not model seasonal difference with Dynamic regressions,
            Setting D to 0 ...
        """)
        self.period = 0

    self.design_matrix = tf.convert_to_tensor(
        np.diff(design_matrix, n=self.d, axis=0), dtype=dtype)
else:
    self.design_matrix = None

Many thanks again!

from bookcode_edition1.

elanmart avatar elanmart commented on September 28, 2024

Hi @junpenglao I know that this issue is closed, but maybe you have some extra reference on why seasonality + exogenous regressors is a tricky combination?

I was scratching my head over the "Note that we can have either seasonal (SARIMA) or exogenous regressors (ARIMAX) but not both." sentence for almost an hour 😃

Why is it that you can't simply replace

$$ \begin{split} y_t = \alpha + \sum_{i=1}^{p}\phi_i y_{t-period-i} + \sum_{j=1}^{q}\theta_j \epsilon_{t-period-j} + \epsilon_t \end{split} $$

with

$$ \begin{split} y_t = \mathbf{X} \beta + \sum_{i=1}^{p}\phi_i y_{t-period-i} + \sum_{j=1}^{q}\theta_j \epsilon_{t-period-j} + \epsilon_t \end{split} $$

EDIT:
The section number is 6.3.2, equation (6.9)
https://bayesiancomputationbook.com/markdown/chp_06.html#s-ar-i-ma-x

from bookcode_edition1.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.