Forecasting space weather using “similar day” approach

Carl Haines –

Space weather is a natural threat that requires good quality forecasting with as much lead time as possible. In this post I outline the simple and understandable analogue ensemble (AnEn) or “similar day” approach to forecasting. I focus mainly on exploring the method itself and, although this work forecasts space weather through a timeseries of ground level observations, AnEn can be applied to many prediction tasks, particularly time series with strong auto-correlation. AnEn has previously been used to predict wind speed [1], temperature [1] and solar wind [2]. The code for AnEn is available at should you wish to try out the method for you own application. 

The idea behind AnEn is to take a set of recent observations, look back in a historic dataset for analogous periods, then take what happened following those analogous periods as the forecast. If multiple analogous periods are used, then an ensemble of forecasts can be created giving a distribution of possible outcomes with probabilistic information. 

Figure 1 – An example of AnEn applied to a space weather event with forecast time t0. The black line shows the observations, the grey line shows the ensemble members, the red line shows the median of the ensemble and the yellow and green lines are reference forecasts. 

Figure 1 is an example of a forecast made using the AnEn method where the forecast is made at t0. The 24-hours of observations (black) prior to tare matched to similar periods in the historic dataset (grey). Here I have chosen to give the most recent observations the most weighting as they hold the most relevant information. The grey analogue lines then flow on after t0 forming the forecast. Combined, these form an ensemble and the median of these is shown in red. The forecast can be chosen to be the median (or any percentile) of the ensemble or a probability of an event occurring can be given by counting how many of the ensemble member do/don’t experience the event.  

Figure 1 also shows two reference forecasts, namely 27-day recurrence and climatology, as benchmarks to beat. 27-day recurrence uses the observation from 27-days ago as the forecast for today. This is reasonable because the Sun rotates every 27-days as seen from earth so broadly speaking the same part of the Sun is emitting the relevant solar wind on timescales larger than 27-days. 

To quantify how well AnEn works as a forecast I ran the forecast on the entire dataset by repeatedly changing the forecast time t0 and applied two metrics, namely mean absolute error (MAE) and skill, to the median of the ensemble members. MAE is the size of the mean difference between the forecast made by AnEn and what was actually observed. The mean of the absolute errors over all the forecasts (taken as median of the ensemble) is taken and we end up with a value for each lead time. Figure 2 shows the MAE for AnEn median and the reference forecasts. We see that AnEn has the smallest (best) MAE at short lead times and outperforms the reference forecasts for all lead times up to a week. 

Figure 2 – The mean absolute error of the AnEn median and reference forecasts.

An error metric such as MAE cannot take into account that certain conditions are inherently more difficult to forecast such as storm times. For this we can use a skill metric defined by  

{\text{Skill} = 1 - \frac{\text{Forecast error}}{\text{Reference error}}}

where in this case we use climatology as the reference forecast. Skill can take any value between -\infty and 1 where a perfect forecast would receive a value of 1 and an unskilful forecast would receive a value of 0. A negative value of skill signifies that the forecast is worse than the reference forecast. 

Figure 3 shows the skill of AnEn and 27-day recurrence with respect to climatology. We see that AnEn is most skilful for short lead times and outperforms 27-day recurrence for all lead times considered.  

Figure 3 – The skill of the AnEn median and 27-day recurrence with respect to climatology.

In summary, the analogue ensemble forecast method matches current conditions with historical events and lifts the previously seen timeseries as the prediction. AnEn seems to perform well for this application and outperforms the reference forecasts of climatology and 27-day recurrence. The code for AnEn is available at

The work presented here makes up a part of a paper that is under review in the journal of Space Weather. 

Here, AnEn has been applied to a dataset from the space weather domain. If you would like to find out more about space weather then take a look at these previous blog posts from Shannon Jones ( and I ( 

[1] Delle Monache, L., Eckel, F. A., Rife, D. L., Nagarajan, B., & Searight, K.(2013) Probabilistic Weather Prediction with an Analog Ensemble. doi: 10.1175/mwr-d-12-00281.1 

[2] Owens, M. J., Riley, P., & Horbury, T. S. (2017a). Probabilistic Solar Wind and Ge-704omagnetic Forecasting Using an Analogue Ensemble or “Similar Day” Approach. doi: 10.1007/s11207-017-1090-7 

The Variation of Geomagnetic Storm Duration with Intensity


Haines, C., M. J. Owens, L. Barnard, M. Lockwood, and A. Ruffenach, 2019: The Variation of Geomagnetic Storm Duration with Intensity. Solar Physics, 294,

Variability in the near-Earth solar wind conditions can adversely affect a number of ground- and space-based technologies. Some of these space weather impacts on ground infrastructure are expected to increase primarily with geomagnetic storm intensity, but also storm duration, through time-integrated effects. Forecasting storm duration is also necessary for scheduling the resumption of safe operating of affected infrastructure. It is therefore important to understand the degree to which storm intensity and duration are related.

In this study, we use the recently re-calibrated aa index, aaH to analyse the relationship between geomagnetic storm intensity and storm duration over the past 150 years, further adding to our understanding of the climatology of geomagnetic activity. In particular, we construct and test a simple probabilistic forecast of storm duration based on storm intensity.

Using a peak-above-threshold approach to defining storms, we observe that more intense storms do indeed last longer but with a non-linear relationship (Figure 1).

Figure 1: The mean duration (red) and number of storms (blue) plotted as a function of storm intensity.

Next, we analysed the distribution of storm durations in eight different classes of storms dependent on the peak intensity of the storm. We found them to be approximately lognormal with parameters depending on the storm intensity. A lognormal distribution is defined by the mean of the logarithm of the values, μ, and the standard deviation of the logarithm of the values, σ. These parameters were found from the observed durations in each intensity class through Maximum Likelihood Estimation (MLE) and used to create a lognormal distribution, plotted in Figure 2 in dark purple. The light purple distribution shows a histogram of the observed data as an estimate of the probability density function (PDF). By eye, the lognormal distribution provides a reasonable first-order match at all intensity thresholds.

Figure 2: The distribution of duration for storms with a peak between 150 and 190nT.

On this basis we created a method to probabilistically predict storm duration given peak intensity. For each of the peak intensity classes, we have calculated the values of μ and σ for the lognormal fits to the duration distributions shown as the black points in Figure 3. It is clear from the points in the left panel of Figure 3 that μ increases as intensity increases, agreeing with the previous results in Figure 1 (i.e., duration increases as intensity increases).

The parameter μ can be approximated as a function of storm intensity by:

μ(intensity) = A ln (B intensity−C)

where A, B and C are free parameters. A least squares fit was implemented, and the coefficients A, B and C were found to be 0.455, 4.632, 283.143 respectively and this curve is plotted, along with uncertainty bars, in Figure 3 (left). Although the fit is based on weighted bin-centres of storm intensity, the equation can be used to interpolate for a given value of intensity. σ can be approximated by a linear fit to give σ as a function of the peak intensity. Figure 3 (right) shows the best fit line which has a shallow gradient of −5.08×10−4 and y-intercept at 0.659.

Figure 3: (Left) The mean of the log-space as a function of intensity. (Right) The standard deviation of the log-space as a function of intensity.

These equations can be used to find lognormal parameters as a function of storm peak intensity. From these, a distribution of duration can be created and hence a probabilistic estimate of the duration of this storm is available. This can be used to predict the probability a storm will last at least e.g. 24 hours. Figure 4 shows the output of the model for a range of storm peak intensity compared against a test set of the aaH index. The model has good agreement with the observations and provides a robust method for estimating geomagnetic storm duration.

The results demonstrate significant advancements in not only understanding the properties and structure of storms, but also how we can predict and forecast these dynamic and hazardous events.

For more information, please see the open-access paper.

Figure 4: The probability that a storm will last at least 24 hours plotted as a function of storm intensity. The black line shows the observed probability and the red line shows the model output.