Solar forecasting basics: a worked example on ten years of Ajaccio data

Cyril Voyant · Mines Paris – PSL · from the course UE14 (2026) · Published 2026-10-20

Result first. On ten years of hourly measurements in Ajaccio (Corsica), forecasting global irradiance one hour ahead, a linear AR(2) model with 2 coefficients reaches a daytime nRMSE of 21.3 %, smart persistence 22.0 %, and an Extreme Learning Machine with about 200 coefficients 20.5 %. Removing the solar cycle and choosing the right reference matter more than the model.

This page follows the course step by step, in English, with the actual numbers. It is meant for students and engineers who want the method, not only the vocabulary. Data: Météo-France, Ajaccio station, hourly global horizontal irradiance (GHI), 1998–2007.

1. Why forecast, and in which unit

PV output follows irradiance: P ≈ η · S · G. With a module efficiency η ≈ 20 %, 10 m² under 800 W/m² give about 1.6 kW. Forecasting GHI is therefore forecasting production. Grid operators need it to keep frequency stable, to charge or discharge storage at the right time, to schedule hydro or gas, and to sell energy at the best price.

Grid operator balancing PV, batteries, hydro/gas and consumers
A one-hour forecast lets the grid operator act before clouds arrive.

Irradiance is a power (W/m²); irradiation is an energy (Wh/m²). Hourly irradiation in Wh/m² equals the mean irradiance of that hour in W/m². Météo-France files give J/cm²: 1 J/cm² = 2.78 Wh/m², so Wh/m² = J/cm² / 0.36.

Hourly GHI at Ajaccio in 2007
Hourly GHI measured at Ajaccio in 2007: 8,760 values, maximum 1,025 Wh/m², daytime mean 368 Wh/m² over 1998–2007.

Ten years are split chronologically: 1998–2005 to learn, 2006 to tune, 2007 to test, once, on data never seen.

2. Remove the solar cycle: the clear-sky index

Raw GHI is not stationary: its mean depends on the hour and the month. A clear-sky model gives the irradiance without clouds; the course uses Solis (Ineichen, 2008), whose clear-sky error at Ajaccio is about 32 Wh/m². The clear-sky index is then taken as a difference:

CSI(t) = GHI(t) − GHIcs(t)   (≈ 0 under clear sky, 0 at night, negative under clouds)

GHI, clear-sky GHI and clear-sky index on three days
Top: measured and clear-sky GHI on a clear, a variable and an overcast day. Bottom: the clear-sky index; the daily cycle has gone.

Why a difference rather than the usual ratio GHI / GHIcs? The ratio is 0/0 at night and explodes near sunrise and sunset, so it requires filtering on solar elevation (for example above 10°). The difference works day and night with no filter. Its monthly mean stays between −105 and −43 Wh/m², against 163 to 521 Wh/m² for raw GHI: approximately stationary. It is then centred: y(t) = CSI(t) − μ, with μ ≈ −33 Wh/m².

3. How variable, how forecastable? sCV and F

The stochastic coefficient of variation (sCV) measures how far GHI departs from clear sky at a site; it does not depend on the horizon. Forecastability F adds the memory of clouds: F(h) = 1 − sCV · (1 − ρmax(h)), where ρmax(h) is the strongest remaining correlation of the clear-sky gap (Voyant et al., Renewable Energy 2026, doi:10.1016/j.renene.2025.123913).

Forecastability F as a function of horizon at Ajaccio
Ajaccio 1998–2007: sCV = 0.52 (fixed). F = 0.92 at 1 h, 0.74 at 3 h, 0.53 at 6 h: cloud memory fades within a few hours.

4. A first model, with numbers: AR(1)

y(t+1) = w · y(t) + ε(t+1), so the forecast h hours ahead is ŷ(t+h) = wh · y(t). At Ajaccio, w ≈ 0.84. A cloud gives CSI = −300 Wh/m², so y = −267. One hour later: 0.84 × (−267) = −224, i.e. a forecast CSI of −257 Wh/m², then −221 and −191 at 2 h and 3 h: the forecast returns towards the mean.

AR(1) forecast of the clear-sky index returning to its mean
The forecast clear-sky index returns towards its mean as the horizon grows.

5. AR(p) is a linear regression: least squares

With p lags, y = X w + ε, where each row of X holds the p previous values. Example with p = 2 and five centred values (−10, −25, −240, −180, −30): the rows are (−25, −10 → −240), (−240, −25 → −180), (−180, −240 → −30). The least-squares solution is exact, in one step: ŵ = (XᵀX)⁻¹ Xᵀy. At Ajaccio, AR(2) gives ŵ = (0.97, −0.15), computed in 6 ms on about 70,000 rows: the last value weighs by far the most.

How many lags? The PACF suggests p ≈ 2 (PACF(1) = 0.84, PACF(2) = −0.15), but with 70,000 points almost everything is “significant”. The wrapper approach trains AR(p) for p = 1…12 and measures the validation error:

Validation RMSE as a function of the number of lags
Validation RMSE (2006, daytime): 78.0 (p = 1), 77.7 (p = 2), 77.3 Wh/m² (p = 12). Parsimony: the smallest p within 0.5 % of the best, p = 2.

6. Always compare with a reference

A model that does not beat a simple reference brings nothing. Three references: simple persistence GHI(t+1) = GHI(t) (ignores the Sun's course); clear sky GHI(t+1) = GHIcs(t+1) (ignores clouds); smart persistence GHI(t+1) = GHI(t) − GHIcs(t) + GHIcs(t+1) (keeps the gap to clear sky; an AR(1) with w = 1). Two rules for every model: forecast 0 when the Sun is below the horizon, and replace negative forecasts by 0.

Reference forecasts on a variable day
A variable day of 2007, 1-h forecasts: measurement, simple persistence, clear sky, smart persistence.

Errors: nMBE (bias, should stay below 1 % in magnitude), MAE, RMSE, nRMSE = RMSE / mean GHI. The skill score SS = 1 − RMSE / RMSE(smart persistence) compares with smart persistence; the NICEᵏ metrics compare with simple persistence on three error norms (Voyant et al., 2025, doi:10.1016/j.seta.2025.104588).

Model (test 2007, 1 h)RMSE day (W/m²)nRMSE daynRMSE day + nightSSNICEΣ
Simple persistence13536.4 %51.5 %−0.661.00
Clear sky14839.9 %56.4 %−0.821.06
Smart persistence8222.0 %31.0 %0.000.59
AR(2)7921.3 %30.1 %+0.030.58
ELM (L = 50, best draw)7620.5 %28.9 %+0.070.55

Smart persistence divides the RMSE of simple persistence by 1.7; AR(2) gains 3 % on it, the ELM 7 %. Daytime: 4,380 hours, mean GHI 372 W/m². Day + night: 8,759 hours, mean 186 W/m².

Day only or day + night? Adding night hours lowers the RMSE of AR(2) from 79 to 56 W/m² (everyone is right at night) but halves the mean (372 → 186), so the nRMSE rises from 21 % to 30 %. The ranking does not change; the numbers do. Always say which hours you used.

Hourly forecast and measurement over four days
Four days of October 2007, 1-h forecasts: both models follow regular days and miss sudden changes, because an arriving cloud is not visible in the past.

7. Extreme Learning Machine: nonlinear, still least squares

An ELM is a one-hidden-layer network whose input weights and biases are drawn at random and frozen; only the output weights are learnt, by (ridge) least squares: H = g(X Win + b), β = (HᵀH + αI)⁻¹ Hᵀy (Huang et al., 2006). Same equation as AR, other columns. At Ajaccio, L = 50 neurons is enough (validation RMSE 85.2 at L = 5, 75.9 at L = 50, no gain beyond), and 20 random draws give a test nRMSE between 20.37 and 20.51 %.

Extreme Learning Machine schematic
ELM: random frozen input weights, output weights learnt by least squares.

Stationarize or give the time? A linear AR needs the clear-sky index; an ELM given sin/cos encodings of hour and day can learn the solar cycle from raw GHI (Voyant et al., Solar Energy 2025, doi:10.1016/j.solener.2025.113490).

Daytime nRMSE of AR and ELM for four input variants
Daytime nRMSE, test 2007: raw GHI, raw GHI + sin/cos, CSI, CSI + sin/cos, for AR(2) and ELM.

8. Online learning and frugality

With a sliding window, the model is re-estimated every hour on the last W hours (11 µs per update for AR, 38 µs for the ELM). AR(2) stays at 21.3–21.5 % even with one month of data; the ELM degrades to 25.6 % with one month: the more parameters, the more data a model needs.

Daytime nRMSE as a function of training window length
Daytime nRMSE on 2007 as a function of the training window, from one month to eight years.
ModelLearnt coefficientsTraining costData needednRMSE day (test)
Smart persistence0none1 hour22.0 %
AR(2)26 ms1 month is enough21.3 %
ELM (L = 50)51 (+150 random)58 ms per drawseveral years20.5 %
AR, 1-month sliding window211 µs per hour720 hours21.5 %

Timings on a laptop; only orders of magnitude matter. The right question is not “which model is best?” but “does the gain justify the cost?” in computation, data, maintenance and monitoring. See also the PV_ELM_pred benchmark and persistence and BLEND.

Takeaways

Questions and answers

How do you forecast solar irradiance one hour ahead?

Remove the deterministic solar cycle with a clear-sky model (here Solis), forecast the clear-sky index with a linear autoregressive model fitted by least squares, add the clear-sky irradiance back, and compare the result with smart persistence. On ten years of Ajaccio data, AR(2) reaches a daytime nRMSE of 21.3 % at 1 h, against 22.0 % for smart persistence.

Should the clear-sky index be a difference or a ratio?

Both remove the daily and annual cycle. The difference CSI = GHI − GHIcs (in W/m²) is defined day and night (0 − 0 = 0) and needs no solar-elevation filter. The ratio GHI / GHIcs is unitless and common in the literature, but undefined at night and unstable near sunrise and sunset, so it needs a filter such as solar elevation above 10°.

What is smart persistence in solar forecasting?

Smart (clear-sky) persistence assumes the sky stays the same: it keeps the current gap to the clear-sky irradiance, GHI(t+1) = GHI(t) − GHIcs(t) + GHIcs(t+1). It is an AR(1) with weight 1 and the reference of the skill score. At Ajaccio it divides the RMSE of simple persistence by about 1.7.

Why must forecast errors state day-only or day-and-night hours?

At night every model predicts zero and is right, so adding night hours lowers the RMSE (79 → 56 W/m² for AR(2) at Ajaccio) but halves the mean irradiance (372 → 186 W/m²), which raises the nRMSE (21 % → 30 %). The ranking of models does not change, but the numbers do.

Is an Extreme Learning Machine worth it over a linear AR model?

At Ajaccio, 1 h ahead, an ELM with 50 hidden neurons reaches 20.5 % daytime nRMSE against 21.3 % for AR(2): about 4 points of skill score for roughly 100 times more coefficients, a result that depends on the random draw, and several years of training data. The useful question is whether the gain justifies the cost.

How to cite

Voyant, C. (2026). Solar forecasting basics: a worked example on ten years of Ajaccio data. From the course UE14 “Prévision de la ressource solaire intermittente”, Mines Paris – PSL. https://cyrilvoyant.github.io/teaching/solar-forecasting-basics.html. Licence CC BY 4.0. When you reuse a method, also cite the article behind it.

References

The course rests on articles written with colleagues; authors are listed in the order of each article, with ORCID links when the publisher metadata provides them.

Data: Météo-France, Ajaccio station. All figures drawn by the author from these data. Course page (French, slides for students): Forecasting the intermittent solar resource.