I recreated the analysis found here. I understand that currently PyMC does not have an INLA SPDE api available to it. So, I tried doing it using an HSGP. You can see my work here. If you scroll down to the end you will see the out of sample posterior predictive from the HSGP approach compared to the INLA-SPDE approach. At least to me, they seem pretty close.
My question is this:
What are the pros and cons of selecting one approach over the other?
Both are approximations of a GP, so ideally they should give you the same answer every time, which is the answer than an unapproximated GP would give. In practice though there are tradeoffs and different approximations are going to work better in different situations. The HSGP and SPDE just take different approaches to approximating the GP.
I haven’t played too much with the INLA SPDE approach myself, so I can’t say too much about it, though I know it’s really popular in spatial applications.
The HSGP approximation is particularly well suited to being a part of a larger probabilistic model. There are a couple new examples up here, here and here. It works well up to 3 dimensions, so it’s good for pretty good for spatial models. It has a hard time if the lengthscale is really small, and I would expect the SPDE approach would win here.
One thing about your case study, so the HSGP
only uses the power spectral density of the covariance function. So when you subclassed pm.gp.cov.Matern32
to make Matern32Chordal
, it unfortunately didn’t pick any of that up and just used pm.gp.cov.Matern32.power_spectral_density
to fit the model, so the chordal distance part wasn’t accounted for.
But, that’s a really cool example, and I wish we had more spatial examples. If you have the time, please feel free to add it to PyMC Examples and tag me I’d be happy to help you merge it.
@bwengals Thank you for the explanation I wasn’t sure if the SPDE approach was doing anything beyond just approximating the GP. And thank you for the examples, I hadn’t seen the advanced HSGP example notebook before so I will definitely work through that. Yes, I would be happy to add it to PyMC examples. I will clean it up first and then if you don’t mind me PMing you on here once it is ready? Or would you prefer I open up a pull request and tag you there?
Take a look at the contribution guide (though don’t stress the timelines in there they are pretty optimistic). The first step is to make an issue describing what you’d like to do for the case study. Feel free to tag me on that!