0

I am working on a time series that contains daily sales data over 2 and a half years. The aim of the project is to estimate the impact of marketing expenditure on the sales, while accounting for seasonality and trend.

I was planning on using Unobserved Components from the statsmodel package. My question is if the coefficients for exogenous factors are estimated together with the seasonality, trend and cycle components or if the exogenous factors are estimated on the residuals after subtracting the seasonality, trend and cycle?

1 Answers1

1

Everything is estimated together, meaning that it is not the case that the coefficients on the exogenous parameters are estimated on residuals after the other components are first estimated separately.

There are two different ways to estimate the coefficients on the exogenous data (again, though, either way has all of the components and coefficients estimated at the same time, not sequentially):

First, if mle_regression=True (this is the default), then the coefficients on the exogenous variables are estimated via maximum likelihood (along with the other parameters of the model, which usually include the variance terms for the trend, seasonal, etc), and then the vector exog.dot(coeffs) is used as the intercept of the model.

If mle_regression=False, then the coefficients are estimated via the Kalman filter.

In large samples, these two approaches are equivalent, and even in small samples they usually give almost exactly the same estimates.

cfulton
  • 2,855
  • 2
  • 14
  • 13