import osif"KERAS_BACKEND"notin os.environ:# set this to "torch", "tensorflow", or "jax" os.environ["KERAS_BACKEND"] ="jax"import matplotlib.pyplot as pltimport numpy as npimport bayesflow as bf
INFO:bayesflow:Using backend 'jax'
In this example we build a model that estimates the IQ score of three participants (\(i \in (1, 2, 3)\)), each taking part in three IQ tests (\(j \in (1, 2, 3)\)). The Bayesian graphical model is as follows
We use rather uninformative priors both for \(\mu\) and for \(\sigma\). Follow this example and the book questions will lead to you to customizing this workflow with different custom priors!
Simulator
Again, we will use handcrafted summary statistics - in this case, we just calculate the mean and standard deviation for each person.