A: 

Well, it really depends on what you are doing with the smoothed data. One thing you might try is to have an exponentially weighted smoothing of the blob velocity in addition to its location, where NaNs contribute a value of zero. When you encounter a NaN, you can then replace it with the projected position based on the previous position and the smoothed velocity. By smoothing the velocity you can prevent a whole sequence of NaNs from producing a completely crazily large or small value. This can result in values being out of [-45,45], which should capture that it is out of view and the side to which it left the view. Now, you will have to actually verify that this gives good results in your computer vision algorithm. If not, you might also want to try replacing NaNs with the previous value, or with zero, or to simply ignore the NaNs and see what works best.

Michael Aaron Safyan
One problem is that I want to _preserve_ the `NaN` s when they appear in a group, so that I can be sure that the blob is out of view, and not just tricky to spot. The blob in question is fixed, the camera is moving, and the blob may also be obscured, which further complicates the issue
Eric
+1  A: 

How about keeping two distributions? The first one can be your smoothed blob heading as usual, except if you get a NaN you instead just enter whatever the last seen non-NaN value was (or some other default); the other is a "NaN-distribution", which simply gets a 0 for every non-NaN value and 1 for every NaN (or something like that).

This way, even if it gets obscured, your primary distribution will keep predicting based on "last known heading", without getting garbage data or messing up the smoothing, but you'll also get a simultaneous spike on the NaN-distribution letting you know that something's up.

tzaman