Skip to content

Commit

Permalink
Expand the example page
Browse files Browse the repository at this point in the history
  • Loading branch information
iskandergaba committed Oct 25, 2024
1 parent 7c069a2 commit a76d8ae
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions docs/example.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Example
-------

Start by loading Mauna Loa Weekly Atmospheric CO2 Data from `statsmodels <https://www.statsmodels.org>`__
For this example, start by loading Mauna Loa Weekly Atmospheric CO2 Data from `statsmodels <https://www.statsmodels.org>`__
and downsampling its data to a monthly frequency.

.. code:: python
Expand All @@ -22,7 +21,25 @@ Use ``Autoperiod`` to find the list of periods based in this data (if any).
The detected periodicity length is 12 which suggests a strong yearly
seasonality given that the data has a monthly frequency.

To confirm this, we run the ``Autoperiod`` again on the same data resampled to a weekly and daily frequencies.

.. code:: python
>>> data = co2.load().data
>>> data = data.resample("W").mean().ffill()
>>> autoperiod = Autoperiod(data)
>>> autoperiod.fit()
array([52])
>>> data = co2.load().data
>>> data = data.resample("D").mean().ffill()
>>> autoperiod = Autoperiod(data)
>>> autoperiod.fit()
array([364])
As expected, the detected period lengths for weekly and daily frequencies are 52 and 364, respectively,
which confirms the strong yearly seasonality of the data.

You can use other estimation algorithms like ``CFDAutoperiod`` variant of ``Autoperiod``,
``ACFPeriodicityDetector``, or ``FFTPeriodicityDetector`` and compare results and performance.
All estimation algorithms can be used in the same manner as in the example above with different
optional parameters. Check the :doc:`api` for more details.
All the supported estimation algorithms can be used in the same manner as in the example above
with different optional parameters. Check the :doc:`api` for more details.

0 comments on commit a76d8ae

Please sign in to comment.