Code
import numpy as np
from scipy import stats
import matplotlib.pyplot as pltMajid Bastankhah
March 18, 2026
The Weibull distribution is the standard model for offshore wind speed frequency. Here we fit it to ERA5 10m wind speed data using maximum likelihood estimation.
x = np.linspace(0, 25, 200)
pdf_fitted = stats.weibull_min.pdf(x, c, loc, scale)
fig, ax = plt.subplots(figsize=(8, 4))
ax.hist(wind_speeds, bins=40, density=True, alpha=0.5, label='ERA5 data')
ax.plot(x, pdf_fitted, lw=2, label=f'Weibull fit (k={c:.2f})')
ax.set_xlabel('Wind speed (m/s)')
ax.set_ylabel('Probability density')
ax.legend()
plt.tight_layout()The MLE fit recovers the shape parameter closely. This fitted distribution feeds directly into AEP calculations via numerical integration against the turbine power curve.