An EWMA smooths a noisy series by giving recent points more weight:
Implement ewma(x, alpha) returning a NumPy array the same length as x.
Missing values: if x[t] is NaN, carry the previous smoothed value forward (s_t = s_{t-1}). If the series starts with NaNs, output NaN until the first real value, which becomes the starting point.
Example
ewma([10, 20, 30], alpha=0.5) # array([10., 15., 22.5])