Let's say I have a gappy time series x
, with a particular measurement through time. I also have a measure of uncertainty sx
(say the standard deviation of x
at a particular interval). I just basically want to gap-fill the time series, but I want to propagate the measurement uncertainty, and hopefully, the interpolation uncertainty. In the past, I have used Tikhonov regularisation to achieve this (i.e. adding a smoothness constraint), but I'd rather just use an out-of-the-box routine from scipy. I can see that the scipy spline interpolation routines take a smoothing parameter (that would be derived for sx
here), but it doesn't calculate the interpolated series' uncertainty.
I'm asking because I don't think it's a trivial calculation, and to see if anyone know whether this capability is available.
I am not sure what you mean by "propagate the measurement uncertainty, and hopefully, the interpolation uncertainty", but if I understand you correctly, you have a noisy measurement and an additional information about uncertainty. If the noise is white noise, or can be whitened, then you could use a Kalman filter to smoothen the regular measurement and to estimate measurements in gaps.
A Kalman filter uses a state model to predict future measurements and models the signal's white noise component using a covariance matrix. The uncertainty measure can be applied to modify the filter's "trust" weight between prediction and measurement. You can use the covariance matrix to determine a provisional uncertainty measure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With