0
$\begingroup$

I've started studying time series analysis and I'm looking at additive vs multiplicative models.

I've taken a sample dataset of flights and I've used python statsmodels to plot the seasonal decomposition using both the additive and multiplicative approach.

First I load the data and plotting it ...

from statsmodels.graphics.tsaplots import plot_acf
import statsmodels.api as sm
import pandas as pd
import matplotlib.pyplot as plt

flights = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/flights.csv')
flights['day'] = '01'
flights['year'] = flights['year'].astype(str)
flights['date'] = flights[['year', 'month', 'day']].apply(
                    lambda x: '-'.join(x), axis=1)
flights = flights.set_index( pd.to_datetime( flights['date']) )
_ = flights['passengers'].plot()

enter image description here

Additive model

Here, I plot charts using the additive model:

decomposition = sm.tsa.seasonal_decompose(flights['passengers'],
                model='additive')
fig = decomposition.plot()
plt.show()

enter image description here

Multiplicative model

Here, I plot charts using the multiplicative model:

decomposition = sm.tsa.seasonal_decompose(flights['passengers'], 
                model='multiplicative')
fig = decomposition.plot()
plt.show()

enter image description here

Questions

  1. I can only see a difference in the Residual charts. Is this expected?
  2. What does the difference in the Residual charts represent?
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.