Bayesian sample size estimation for given HPD

Thanks! This is an interesting idea and fairly easy to implement and understand! The only concern is that the process can be non-linear. May be try a GP here?

The actual goal, after discussing with a colleague, is to estimate the smallest dataset size at which the 95% HDI width of the estimate is certain value, say, 0.2. A sample of data (a vector of 1s and 0s) is given and can be used to “bootstrap” the model.

The Ch. 13 of John Kruschke’s “puppy book” looks very relevant. I read it fairly quickly and didn’t understand it enough to apply on my data immediately. Osvaldo Martin kindly implemented some of the code in Python. Need to look more into how to use it.