Fourier Seasonality Tool Calculator

Turn raw time series into seasonal signals fast. Choose period and harmonics, then compare errors. Download tables and summaries for reports and reviews teams.

Calculator
Paste your time series, set the period, choose harmonics, and compute a Fourier-based seasonal component.
Examples: 7 (weekly), 12 (monthly), 24 (hourly/day).
Higher K captures sharper seasonality, risks overfit.
Outputs seasonal-only projection for future steps.
Tip: You can paste from spreadsheets. Non-numeric tokens are ignored.
Formula used

The calculator fits a linear regression with Fourier seasonality terms:

y(t) = c + d·t + Σk=1..K [ ak·cos(2πk t / P) + bk·sin(2πk t / P) ] + ε(t)
  • P is the seasonal period, K is the number of harmonics.
  • c is the intercept and d·t is an optional linear trend.
  • Coefficients are estimated by ordinary least squares using normal equations.
  • The seasonal component is the Fourier sum (cosine/sine part only).
  • Deseasonalized series is computed as: y(t) − seasonal(t).
How to use this calculator
  1. Paste your time series values in order (oldest to newest).
  2. Set the period P that matches the repeating cycle.
  3. Start with K = 1 to 3, then increase if needed.
  4. Enable trend if the series drifts upward or downward.
  5. Submit to see seasonal component, fitted values, and errors.
  6. Export CSV for full tables, or PDF for a summary.
Example data table

Example: monthly values with P = 12 and K = 3.

tyComment
1120Start of cycle
2128Seasonal rise
3135Higher demand
4142Peak building
5138Stabilizing
6130Mid-cycle dip
The default sample in the input box extends this pattern.
Article

Fourier features for seasonal learning

Fourier seasonality converts repeating behavior into structured cosine and sine predictors that many machine learning models handle well. Instead of storing dozens of lag indicators, the tool builds a compact basis using a period P and K harmonics. Each harmonic adds two signals that represent phase and intensity. This is useful for demand, traffic, energy, and sensor streams where stable cycles exist. The result is a seasonal component you can plug into forecasting pipelines.

Selecting period and harmonics

Choose P using business rhythm: 7 for daily data with weekly cycles, 12 for monthly cycles in yearly patterns, and 24 for hourly data with daily cycles. Harmonics K control shape. Low K captures smooth waves, while higher K captures sharper peaks such as weekends or month-end effects. A practical rule is to start with K between 1 and 3, then increase until RMSE improvement becomes marginal, or residuals stop showing obvious periodic structure.

Interpreting fit metrics

The tool reports R² and RMSE from the fitted regression. R² measures variance explained by trend plus seasonality, which helps compare candidate settings for P and K on the same dataset. RMSE gives error in original units, making it easier to judge operational impact. When trend is enabled, the model separates slow drift from cyclical movement. Robust clipping can reduce sensitivity to spikes so seasonal estimates reflect typical behavior rather than rare anomalies.

Using deseasonalized output

Deseasonalized values remove the estimated seasonal component, leaving a cleaner baseline for anomaly detection, changepoint monitoring, or downstream learners that prefer stationarity. For example, you can train a regression on the deseasonalized series and add seasonality back later for final predictions. Residuals highlight unexplained variation and can be monitored with control limits. If residuals still show periodic patterns, revisit P or increase K carefully to avoid overfitting noise.

Operational reporting with exports

Teams often need traceable outputs for audits, stakeholder updates, and model documentation. The CSV export provides row-level values for y, seasonal, deseasonalized, fitted, and residual columns, which can be pivoted by phase to summarize average seasonal lift. The PDF export gives a compact snapshot with coefficients and key metrics for quick reviews. Together, these exports help align analysts and engineers, and make seasonality choices reproducible across environments at scale.

FAQs

1) What does the seasonal component represent?

It is the sum of the cosine and sine terms at each time step. It captures recurring variation around the baseline and optional trend, expressed in the same units as the original series.

2) How do I pick the right period P?

Use known cycle length first, such as 7, 12, 24, or 52. If uncertain, try plausible periods and select the one with lower RMSE and residuals that look less periodic.

3) What happens if I set too many harmonics?

Higher K can fit noise and create unstable seasonal shapes, especially with limited data. If R² increases but RMSE barely improves, or residuals look erratic, reduce K.

4) Should I enable the linear trend option?

Enable it when the series has a sustained upward or downward drift. Disabling trend is better when the average level is stable and you want seasonality around a constant baseline.

5) Why use robust clipping?

Clipping winsorizes extreme values so occasional spikes do not dominate coefficient estimates. It helps when outages, promotions, or measurement glitches create outliers that are not seasonal.

6) Does the forecast block predict future y values?

No. It projects only the seasonal component for the chosen P and K. Combine it with your own baseline or forecasting model to produce full future predictions.

Related Calculators

GRU Forecast CalculatorSeasonality Detection ToolAuto ARIMA SelectorMAPE Error CalculatorMAE Error CalculatorCross Validation ForecastRolling Window SplitOutlier Detection SeriesAnomaly Detection SeriesChange Point Detection

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.