AI Glossary / Probabilistic machine learning / Intermediate
Periodic kernel
Definition
A periodic kernel is a covariance function that represents repeating relationships in a Gaussian process or another suitable kernel model. Inputs separated by whole periods can have the same covariance relationship as inputs at the same phase. It encodes a repeating pattern rather than merely observing that some past values happened to recur.
What it means
Many processes have cycles, such as daily or weekly patterns. A periodic covariance function connects observations according to their position within a cycle. Two times can be far apart chronologically yet close in phase.
Strict periodicity is a strong assumption: the underlying repeating component does not gradually change from one cycle to the next. Real observations can still differ because of noise or additional nonperiodic components. If the cycle's shape evolves, a locally periodic or quasi-periodic construction may be more appropriate than a purely periodic component.
How it works
One common one-dimensional kernel is k(x, x′) = sigma² exp[−2 sin²(pi(x − x′)/p) / ell²]. Here p is the period, sigma² is signal variance, and ell controls how quickly covariance falls as phase separation increases.
This kernel can be obtained by mapping each input onto a circle using sine and cosine, then applying a squared-exponential kernel to those circular coordinates. The construction ensures a valid covariance function.
Fit or specify the parameters and combine the kernel with observation noise. Additional kernels can represent trends or other variation. Multiplying a periodic kernel by a decaying kernel allows dependence to weaken across distant cycles, while adding a trend kernel gives an additive decomposition. These operations express different assumptions and should be selected deliberately.
Three practical examples
- Demand modeling: represent a repeating weekly component while separately accounting for a longer-term trend and observation noise.
- Sensor analysis: model a known mechanical cycle and inspect residual variation that the periodic component does not explain.
- Seasonal forecasting research: compare fixed periodicity with a slowly changing cycle using held-out future periods rather than random observation splits alone.
Think of it this way
Think of wrapping a timeline around a clock face. Times one full turn apart land at the same position, while opposite phases land across the circle. The analogy has limits: choosing the clock's period is part of the model, and a real process may change its shape or timing. A repeating covariance assumption does not prove that the same event will happen every cycle.
Worked example
Consider an original weekly kernel with p = 7 days, signal variance sigma² = 4, and ell = 1. At separation zero, the sine term is zero and the covariance is 4.
At a separation of 7 days, sin(pi) = 0, so covariance is again 4. At a separation of 3.5 days, sin(pi/2) = 1, giving covariance 4 exp(−2), approximately 0.541341. The corresponding latent correlation is exp(−2), approximately 0.135335, because both marginal variances are 4.
For the zero-mean latent periodic component, the variance of the difference between values exactly one period apart is 4 + 4 − 2 × 4 = 0. This expresses exact repetition of that component at those inputs.
Now add independent observation noise with variance 1 to each measurement. Their observed variances become 5, but their cross-covariance remains 4, so their observed correlation is 4/5 = 0.8. Exact latent repetition does not require identical noisy measurements. These numbers illustrate the stated kernel, not evidence that a real weekly process has those parameters.
Illustrative case study
Fictional case: Pine Scheduling models a weekly workload pattern. A purely periodic component captures recurring structure, but later weeks show a changing amplitude. Analysts compare an additive trend model with a locally periodic construction and inspect future-period prediction errors.
They also test whether an apparent weekly cycle is an artifact of the data collection schedule. The selected model is documented with its period assumptions and uncertainty limits. The team does not interpret a fitted cycle as a guarantee about holidays or operational changes. This scenario illustrates model assessment, not a reported business result.
Common misconceptions and mistakes
Period and length scale are different parameters. The period determines when the pattern repeats; the phase length scale determines how similar nearby positions within that cycle are.
A periodic kernel is not the same as fitting one sine wave. A Gaussian process with this kernel can represent a range of repeating shapes.
Do not assume that a large time gap must imply low covariance: exact multiples of the period remain strongly related in a strictly periodic kernel.
Finally, covariance periodicity alone does not force a nonperiodic mean function to repeat. Statements about exact repetition should identify the latent periodic component or use a compatible mean specification.
Business use
Periodic kernels can make cycle assumptions explicit in forecasting and monitoring. Their usefulness depends on whether the repetition remains stable enough for the intended prediction horizon.
Compare forecasts across complete future cycles, inspect period ambiguity, and assess sensitivity to trend and noise components. Record units carefully: a period of 7 only means a week if the input is measured in days. Where known disruptions alter the cycle, include relevant information or revise the model rather than expecting the kernel to anticipate unsupported changes.
People also ask
Must the period be known in advance?
No. It can be estimated, but limited or irregular observations can make the estimate ambiguous.
Does a periodic kernel imply a sinusoidal mean?
No. It specifies covariance; the mean is a separate modeling choice.
How can cycles change over time?
A locally periodic construction can combine periodic phase structure with covariance that decays over elapsed time, allowing distant cycles to differ.
Check your understanding
Under the example's strictly periodic kernel, what is the covariance between latent values separated by 14 days?
Answer: It is 4, since 14 days is two whole periods and sin(2pi) = 0. Adding observation noise changes marginal variances, not that cross-covariance between separate noisy measurements.
Related terms
- Gaussian process
- Phase (Fourier)
- Covariance kernel
- period
- phase
- length scale
- signal variance
- locally periodic kernel
- seasonality
- observation noise
Learn next
Review covariance and correlation, then calculate the kernel at zero, half a period, and a full period. Compare an additive trend-plus-periodic model with a product that permits cycle evolution. Evaluate each on future cycles to see which repeating assumptions the data actually support.
More in Probabilistic machine learning
- Partial least squares regression - Partial least squares regression, or PLS regression, predicts one or more responses using a smaller set of components constructed from the predictors with...
- Partial regression - Partial regression examines the linear relationship between an outcome and a predictor after removing the linear contributions of other specified predictors.
- Particle path degeneracy - Particle path degeneracy is the loss of diversity in the earlier parts of trajectories represented by a particle filter.
- Persistent contrastive divergence - Persistent contrastive divergence, or PCD, is a learning method for energy-based models that maintains sampling chains across parameter updates.
- Perturb-and-MAP sampling - Perturb-and-MAP sampling generates random configurations by perturbing an objective or energy function and then optimizing the perturbed function.
- Poisson regression - Poisson regression models a nonnegative count outcome using a Poisson distribution whose mean depends on predictors.
Sources
Rasmussen and Williams, Gaussian Processes for Machine Learning, chapter 4, circular mapping and periodic covariance construction: https://gaussianprocess.org/gpml/chapters/RW4.pdf GPML Chapter 4 Equation 4.31 and its circular embedding derivation were independently consulted.
Previous: Period disambiguation Next: Permutation language modeling