Hi PyMC discourse,
This is a common example, but I found it in McElreath - measuring points on a globe to determine the proportion that is water (see code). I’d like to know how to expand this into a situation with multiple globes, which may have slightly different proportions of water. I’m looking to share information between the globes, though, to determine the expected overall proportion of water on any globe.
Single globe example:
import pymc3 as pm #A value of 0 signifies a land observation, a value of 1 signifies a water observation observations = [0, 0, 1, 0, 1] water_observations = sum(observations) total_observations = len(observations) with pm.Model() as planet_model: # Prior p_water = pm.Uniform("p_water", 0 ,1) # Likelihood w = pm.Binomial("w", p=p_water, n=total_observations, observed=water_observations) # Inference Run/ Markov chain Monte Carlo trace_5_obs = pm.sample(5000, chains=2)
My first thought is to just change the shape parameters, but there are a large number of individual measurements - is this the best approach? As an example, in the multiple globes case, one might have:
observation_globe1 = [0, 0, 1, 0, 1]
observation_globe2 = [0, 0, 1, 0, 1, 0, 0, 1]
observation_globe3 = [0, 1]
observation_globe650000 = [1, 0, 0, 0, 1]
After this I may stratify into groups of globes and do a hierarchical run, but this is just the first step.