lukego / blog

Luke Gorrie's blog
566 stars 11 forks source link

kons-9 ad-hoc posterior predictive check #39

Open lukego opened 1 year ago

lukego commented 1 year ago

I'm doing ad-hoc Bayesian posterior predictive checks with kons-9 today :sunglasses:

https://user-images.githubusercontent.com/13791/235634919-a508e2f2-7c3f-44a8-a257-021bc8b6c10c.mov

Earlier (#38 #37) we used kons-9 to visualize abstract data: a population of proposed models for explaining some data. Each model was mapped to a 3D point and the X/Y/Z coordinate represented the gradient/intercept/stddev parameters of that model. Initially the models were random but they were gradually conditioned to explain some synthetic data. This is an application of Sequential Monte Carlo simulation (aka particle filtering) for Bayesian parameter inference.

Now we are looking at the same simulation from a different viewpoint: what predictions would we make based on the population of models that we have? This simulation starts off with a wild random terrain and gradually works out the line with Gaussian noise that matches the data. This is moving from parameter inference, i.e. what model parameters are plausible, to posterior predictive checking, i.e. do those parameters lead to sensible predictions.

I'm still really enjoying the novelty of visualizing a simulation in real-time while it runs. This one even works as a poor-man's profiler: we can see the heightmap updating gradually point-at-a-time which suggests that the function calculating heights is expensive.

Cool stuff. Being able to "feel the bits between my toes" really stimulates ideas for simulation improvements.

aykaramba commented 1 year ago

Neat to watch what can be done using Kons9