'Add custom seasonality in fbprophet

I have a dataset with monthly frequency(one record per month). It has two seasonalities in it:

  1. 12(monthly)
  2. 96(8 years)

How do I add these in my fbprophet model using add_seasonality?

I tried:

m = Prophet(seasonality_mode='additive', 
            yearly_seasonality=True, 
            weekly_seasonality=False, 
            daily_seasonality=False).add_seasonality(name='8_years', period=96, fourier_order = 20)

Is this the correct method?



Solution 1:[1]

You can find everything in the doc.

The inputs to this function are a name, the period of the seasonality in days, and the Fourier order for the seasonality.

Your script should be

m = Prophet(seasonality_mode='additive', 
        yearly_seasonality=True, 
        weekly_seasonality=False, 
        daily_seasonality=False).add_seasonality(name='8_years', period=8*365, fourier_order = 20)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Harold G