What are Fourier terms, and how are they used to represent seasonality in a regression or ML model?

Quick Overview

Asks what Fourier terms are and how sine and cosine features at a seasonal frequency let regression and ML models capture repeating patterns. Tests how the terms are built, how the number of harmonics is chosen, and how they compare with seasonal dummy variables.

What are Fourier terms, and how are they used to represent seasonality in a regression or ML model?

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Other

What are Fourier terms, and how are they used to represent seasonality in a regression or ML model? ```hint Count the features Compare the number of features that dummy variables need for a 365-day period with the number you would need to describe one smooth yearly curve. ``` ```hint Watch the number of harmonics Ask what each higher harmonic adds to the seasonal shape, and what happens to the fit when you keep adding them. ``` ### What a Strong Answer Covers - How the sine and cosine terms are built from the period and the harmonic index - Why a weighted sum of them can represent a seasonal shape, and what K controls - Advantages over seasonal dummies, including long, non-integer and multiple periods - How the terms enter regression, dynamic harmonic regression and tree models, and how K is chosen ### Follow-up Questions - Why do you need both a sine and a cosine at each frequency instead of only one? - What is the largest useful K for an integer period m, and what does the model look like at that K? - How would you model a seasonal pattern whose amplitude grows over time? - When would you add holiday or event dummies alongside Fourier terms?

Overview: Asks what Fourier terms are and how sine and cosine features at a seasonal frequency let regression and ML models capture repeating patterns. Tests how the terms are built, how the number of harmonics is chosen, and how they compare with seasonal dummy variables.

Nov 24, 2026
mediumData ScientistOtherStatistics & Math
0
0

What are Fourier terms, and how are they used to represent seasonality in a regression or ML model?

What a Strong Answer Covers Guidance

  • How the sine and cosine terms are built from the period and the harmonic index
  • Why a weighted sum of them can represent a seasonal shape, and what K controls
  • Advantages over seasonal dummies, including long, non-integer and multiple periods
  • How the terms enter regression, dynamic harmonic regression and tree models, and how K is chosen

Follow-up Questions Guidance

  • Why do you need both a sine and a cosine at each frequency instead of only one?
  • What is the largest useful K for an integer period m, and what does the model look like at that K?
  • How would you model a seasonal pattern whose amplitude grows over time?
  • When would you add holiday or event dummies alongside Fourier terms?