GaussianRandomWalk distribution seems to have the implicit assumption that data are regularly spaced in time. Would it be possible to implement a version (maybe called
GaussianRandomIrregular?) where you can specify a vector of time points for which you have observations? The pdf would have to take that into account with the
sd, but I think that would just be
sqrt(sd*dt) because of the variance sum law, where
dt is the time between current and previous observations?
I had a quick look at the
GaussianRandomWalk class, but I’m still on my training wheels with both python and PyMC3, so don’t feel confident on how to implement this. Would be interested in whether this is a vaguely sensible idea?
Or maybe this is a silly idea. Maybe the approach is to have a latent GRW for regularly spaced time points, but which you just have observations for irregular time points?
I think the real trouble here is data. You would need a function that perhaps takes one argument for t’s or dt’s and one for x’s?
If the data is simply sparse but regular (or somewhat so), a masked array (NA’s where data is missing) would work out of the box.
I’m insufficiently well-read on GRW to be sure, but if you stand by
sqrt(sd*dt), your problem is solved, eg simply use
pm.GaussianRandomWalk(sd=tt.pow(dt, sd, 0.5), mu=0, observed=x)