Worked example · fictitious teaching values · Published article, open code

BLEND persistence forecast: a worked example step by step

Worked example. All input values below are fictitious teaching values, not observations or results from the cited paper.

Result: with today’s 12:00 irradiance 600 W/m², yesterday’s 13:00 value 400 W/m² and a weight λ = 0.4 on the latest value, fitted on five past days, BLEND predicts 480 W/m² for 13:00.

The question

Should the next forecast follow the latest measurement or the recurring daily pattern? BLEND is a convex combination (a weighted average, weights between 0 and 1 adding up to 1) of both: persistence (the latest value) and cyclic persistence (the value at the same hour one cycle earlier), with one weight per hour of the day. CLIPER, in the table below, is the convex combination of persistence and the mean. The forecast: Î(t+h) = (1 − λ)·I(t+h−T) + λ·I(t), as in the article (I: irradiance in W/m²; t: forecast origin; h: horizon, here one hour; T: cycle length, here 24 hours; λ: weight of the latest value, between 0 and 1, no unit). Here the weight is a one-line least-squares fit on past days.

The theory

With \(r=I(t)\) the latest value, \(c=I(t+h-T)\) the value at the target hour one cycle earlier and \(y=I(t+h)\) the value to forecast:

$$\hat I(t+h)=(1-\lambda)\,c+\lambda\,r,$$ $$\lambda=\frac{\sum (y-c)(r-c)}{\sum (r-c)^2}\ \text{on past days, clipped to }[0,1].$$

\(\lambda\) minimises \(\sum\big(y-c-\lambda(r-c)\big)^2\): a one-line least-squares fit, one weight per hour of the day. Full theory: BLEND guide.

Calculate it, without using the future

  1. Set the forecast origin t to 12:00 today, horizon h to one hour and cycle T to 24 hours. The target is 13:00 today.
  2. For each past day, note r = I(12:00), c = I(13:00 the day before) and y = I(13:00), the value that was to be forecast.
  3. Fit the weight of the latest value: λ = Σ (y − c)(r − c) / Σ (r − c)² = 29,000 / 72,500 = 0.4. Keep λ between 0 and 1.
  4. Today, r = 600 and c = 400: Î(13:00) = (1 − λ) c + λ r = 0.6 × 400 + 0.4 × 600 = 480 W/m².
Five fictitious past days, all at the 12:00 origin (W/m²)
Dayr = I(12:00)c = I(13:00, day before)y = I(13:00)r − cy − c
Day −560050054010040
Day −4550650610-100-40
Day −370050058020080
Day −2450550510-100-40
Day −16506006205020
Fictitious comparison, same forecast target
ReferenceForecast W/m²
Ordinary persistence600
Cyclic persistence (previous cycle, target phase)400
BLEND, least-squares weight480

Run it

The table above, in five lines (Python 3, NumPy; executed on 22 October 2026). The MATLAB implementation is predict_P_BLEND_LS.m in the repository.

import numpy as np

r = np.array([600, 550, 700, 450, 650])   # I(12:00) on five past days, W/m2
c = np.array([500, 650, 500, 550, 600])   # I(13:00) the day before
y = np.array([540, 610, 580, 510, 620])   # I(13:00), the value to forecast
lam = np.clip(np.sum((y - c) * (r - c)) / np.sum((r - c) ** 2), 0, 1)
print(lam, (1 - lam) * 400 + lam * 600)

Output:

0.4 480.0

What the code shows

Out-of-sample benchmark of the MATLAB repository (v1.1.1, synthetic signal, 10 realizations, nRMSE, lower is better):

Out-of-sample nRMSE by horizon (steps, T = 24), synthetic signal, day and night, mean of 10 realizations. x: the series; CS: the clear-sky reference, marked yes when the operator uses it. Lowest value per horizon in bold.
ReferenceCSh = 1h = 2h = 3h = 6h = 9
CLIPER on the ratio to trend x/CS (clear-sky reference)yes0.2130.2870.3280.3540.354
BLEND (one weight) on the ratio to trend x/CS (clear-sky reference)yes0.2190.3030.3590.4130.398
Smart persistence, multiplicativeyes0.2300.3360.4210.5610.593
Stochastic persistenceyes0.2600.3880.4700.4740.468
CLIPER on the difference to trend x − μ(phase) (one weight)0.2230.2990.3370.3540.354
CLIPER, weight per phase0.2630.3230.3450.3540.354
BLEND, weight per phase (least squares)0.3020.3980.4450.4880.495
BLEND, one weight, raw signal0.3650.4570.4840.4980.499
BLEND, simplified weight per phase (1 + ρ)/20.4030.6240.7360.7440.602
Cyclic persistence0.5020.5020.5020.5020.502
Three panels of out-of-sample nRMSE versus horizon 1 to 9 steps. BLEND on the raw signal: weight per phase 0.302 to 0.495, one weight 0.365 to 0.499, simplified (1 + rho)/2 0.403 to 0.744; cyclic persistence 0.502. CLIPER without clear sky: one weight on the difference to trend 0.223 to 0.354, weight per phase 0.263 to 0.354. With clear sky: CLIPER on x/CS 0.213 to 0.354, BLEND on x/CS 0.219 to 0.413, smart multiplicative 0.230 to 0.593, stochastic 0.260 to 0.474.
All references and horizons: full results · CSV.

BLEND with a weight per phase improves on cyclic persistence at every horizon. Applying a reference to the ratio to trend x/CS (clear-sky reference) helps a lot on this signal: CLIPER on x/CS has the lowest mean errors, and stationary BLEND on x/CS is far better than BLEND on the raw signal. The simplified weight (1 + ρ)/2, also set for each phase, assumes the same mean at t and t + h; on a daily cycle it only helps at the first step.

What this study contributes

The published study develops a family of analytical forecasting operators for periodically correlated energy signals. The calculation illustrates its BLEND member; it does not reproduce the full benchmark of the article.

Limits that matter

A convex combination stays between its two inputs; this alone says nothing about forecast accuracy. The weight needs enough past cycles, changes with phase and horizon, and must not be fitted on the test period. Version 1.1.1 of the MATLAB code corrects errors of earlier versions and was audited independently.

Source definitions · MATLAB implementation (least-squares weight) · Full results table · Full method guide

Key point: weight the latest measurement (λ) and the same hour of the previous day (1 − λ), with one weight per hour fitted by least squares on past days. On the ratio to trend x/CS (the clear-sky index), persistence references become much stronger. A forecast and its observation must be aligned in time.

Authors, source and citation

Cyril Voyant, Candice Banes, Luis Garcia-Gutierrez, Gilles Notton, Milan Despotovic, Zaher Mundher Yaseen. Symmetry-constrained forecasting of periodically correlated energy processes. Applied Mathematical Modelling. doi:10.1016/j.apm.2026.116988 · BibTeX.

Cyril Voyant wrote this teaching page. The method belongs to the complete author team credited above.

Explore the research guide · Try the public-data comparison

Download the paper references (BibTeX, complete author lists)

See also: which forecast for which signal, with sliders · the course, slide by slide.

Need this method on your own data? Collaborate: a joint answer to a call for projects, a research contract with Mines Paris – PSL, or academic work with a clear valorization objective.