Skip to content

Commit

Permalink
Added plots and beer style seasonality
Browse files Browse the repository at this point in the history
  • Loading branch information
meshkova committed Dec 22, 2023
1 parent f6a9127 commit d34ddd4
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 10 deletions.
7 changes: 0 additions & 7 deletions Beer style seasonality.md

This file was deleted.

2 changes: 1 addition & 1 deletion Conclusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ Our analysis provides a detailed snapshot of how beer preferences have uniquely

This analysis offers a comprehensive look into the dynamics of the beverage market and consumer behavior, highlighting the evolving relationship between beer styles, ABV, and regional preferences. For further research, we can explore the factors driving these trends, the role of craft beers in these changes, and how these preferences might continue to evolve.

And after all the analysis and statistics we can finish our project with CHEERS!
And after all the analysis and statistics we can finish our current investigation with CHEERS!

<iframe src="https://giphy.com/embed/L0BKzeibXgQSm8tJAi" width="480" height="270" frameBorder="0" class="giphy-embed" allowFullScreen></iframe><p><a href="https://giphy.com/gifs/cheers-drinks-happyhour-L0BKzeibXgQSm8tJAi"></a></p>
75 changes: 73 additions & 2 deletions Seasonality.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,80 @@ _When keeping the residuals, the second peak in Europe looks more like a plateau
</div>

<br>
<hr>

<iframe width="800" height="600" frameborder="0" seamless="seamless" scrolling="no" src="./plots/html/peak_seasonality.html"></iframe>
### Let's address both of the _suspects_

The seasonal component, particularly its phases, is crucial. Employing Fourier Analysis, we perform a Fourier transform to extract the mode corresponding to the annual cycle. Given the monthly data, this corresponds to a periodicity of 12 months (after frequency transformation).

Assessing all beer styles along with their phases enables us to identify which styles contribute to seasonality and during which phase (time of the year).

Fourier analysis for **Europe**:

![Fourier analysis for EU](./plots/fft_beer_style_eu.png)

Fourier analysis for **North America**:

![Fourier analysis for NA](./plots/fft_beer_style_na.png)

<br>

**Note:** Maybe looking at the seasonality of beer styles will help us understand its cause better? -> [Beer style seasonality](/ada-welovepandas-webpage/Beer%20style%20seasonality)
- **Observation:**
- EU data is overall much noisier, which we already expected in the initial seasonality plot, this leads (since we normalised to 1) to reduced peaks, which does not matter here, but this normalisation allows to filter the very noisy data out that does not have a main peak in a yearly cycle

- We clearly see that only few styles contribute to seasonality, hence this motivates to filter those styles that do not show significant differences at 12 months period

- Interestingly, there are beers like e.g. **Dark Lagers** that show some mode at 10 months but not (or only marginal) at 12 months.

It makes sense to filter out all beer styles that do not seem to contribute to annual periodicity.

![Normalised FT of filtered beer styles](./plots/normalised_fft_eu_na.png)

- **Observation:**
The FT-plots look much cleaner already now that only significant contributors to annual periodicity remain:
- We still see some additional modes, that we do not further investigate here (because we are mainly interested in annual cycle), notably in Northern America with Dark Lagers at 8-, and 10-month cycles.
- There seem to be more beers in NA with significant seasonality than EU
- Considering the normalised FT values allowed us to consider e.g. Pale Lagers as well, even though the amplitude is small at 12 months, it stands out significantly compared to any other mode due to very low noise in the data.

In a next step we want to properly summarise and display our findings, also combining the phase information as well. We start by creating new data frame's that contain all FFT data points of all styles for Europe and North America.

![Beer style contributors of seasonal component](./plots/contributors_beer_styles.png)

This is already quite interesting - note though that we did the approximation that only the here considered beer styles contribute to seasonality at all (which is reasonable though when we consider the peaks below the chosen threshold as residual noise)!

- **Observation:**
- Specialty beer contributes the most to seasonality, due to it's huge seasonal effect

- Beers such as IPA show remarkable contribution to seasonality in North America, even though they do not show a very high seasonal mode, but the huge weight due to its popularity (reflected in # of reviews) even a marginal seasonality can contribute a lot to the total (we observe similar effects in Pale Lagers f.e.)

- We observe that it's similar styles contribute to seasonality in EU and NA, even though fewer in EU overall

- Also it's not the same order of contribution in EU and NA, wheat beers or Hybrids contribute much more in EU than in NA for example

An important factor is missing here: **The phase**. We do not see yet which contribution peaks in ABV at what time of year!

To present the final result of seasonality, we intend to summarise all findings in one plot.

<iframe width="800" height="600" frameborder="0" seamless="seamless" scrolling="no" src="./plots/html/peak_seasonality.html"></iframe>

- **Observation:**
- $\approx$ 80% of the seasonal contribution in North America are peaking in the winter months (Dec.-Feb.), in the EU it's only around 65%. As we see, North America in most years has a higher winterly peak than Europe and does not flatten down as quickly as Europe, since we multiple styles contributing to higher ABV until February;

- We observe **the effect of Oktoberfest**! Each year in October we see a peak contribution from Dark Lagers, which contain typical Oktoberfest beers such as Märzen. This however is hardly visible in the annual pattern because we're in transition from lower summer ABV towards higher Winter, and the contribution is only $\approx 5$%;

- Europe has a second peak in May, where we see sort of a second small peaking or sort of a Plateau that we do not observe in North America. This seems to be due to Porters and Strong Ales contributing $\approx$ 28% of EU's seasonality, whereas this effect is marginal in North America with 13% from stouts in May and Porters in June;

- It seems this is the main culprit that accounts for the quite different seasonality pattern in Europe.

To recall the initial seasonality we plot it once more here and highlight the off-peak contributions from Porters (EU only) and Dark Lagers.

![Seasonality highlighted in May and October](./plots/seasonality_may_oktober_highlighted.png)

- **Observation:**
- EU shows a clear plateau each May.

- Oktoberfest is barely noticeable here.

- North America often holds the peak value longer, due to styles peaking their contribution in February as well.

#### So regarding all the above we can release the suspects <sub>for now</sub>.
Binary file added plots/contributors_beer_styles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/fft_beer_style_eu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/fft_beer_style_na.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/normalised_fft_eu_na.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/seasonality_may_oktober_highlighted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d34ddd4

Please sign in to comment.