3 ms·
What are you basing that on? Looks like you've misplaced the decimals there someplace, because you're concluding that the likely rate is around 1/10 of the obs
by emn13 10y ago
What are you basing that on? Looks like you've misplaced the decimals there someplace, because you're concluding that the likely rate is around 1/10 of the observed rate. Depending on your priors, you can get some difference of course, but that sounds absurd - can you more precisely explain the method you used to arrive at that conclusion?
- yummyfajitas 10y agoTake a uniform prior for gamma = fatality probability | drive one mile. Use Bayes rule. Here is a tutorial: https://www.chrisstucchio.com/blog/2013/bayesian_analysis_conversion_rates.html https://www.chrisstucchio.com/blog/2013/bayesian_analysis_co... Finding that the lower end of a credible interval close to zero is an order of magnitude below the top end is pretty common. It just means you need more data, that the beta hasn't approached a gaussian yet.
- GFK_of_xmaspast 10y agoSome people, when their posterior doesn't match the facts, update their prior.
- yummyfajitas 10y agoAre you asserting that the posterior I described doesn't match the facts? If so, can you explain?
- emn13 10y agoMore detail; you're assuming a binomial likelihood function? What exactly is "uniform prior for gamma" supposed to mean?
- yummyfajitas 10y agoPlease go read the tutorial I linked to. It explains exactly how this analysis works. Here's the code: In [1]: from scipy.stats import beta In [2]: from numpy import percentile In [3]: data = beta(1, 100e6+1).rvs(1e7) In [4]: percentile(data, 0.5), percentile(data, 50), percentile(data, 99.5) Out[4]: (5.0460240722165642e-11, 6.9295652915902601e-09, 5.3005747758871231e-08)
- emn13 10y agoYou're definitely messing something up somewhere in that analysis. Where's that numpy/betadistribution snippet coming from? Back to basics: If you assume that each mile is uncorrelated, (on the large not a crazy assumption), then the overall number of accidents over N miles can be modeled by a binomial distribution with N trials and some crash probability p. You're trying to use bayesian analysis to estimate that p. The core concept there is that the probability of the observation given a certain p is directly proportional to the probability of the p given a certain observation. Given p, it's trivial to compute the chance of the observation; just plug it into the pmf. For exactly one crash (and a small p), you can even quite accurately approximate it by Np/exp(Np) due to the trivial binomial coefficient for k=1 and the taylor expansion of the base-near-1 power. So regardless of the numerical analysis that lead you to believe otherwise: you can just plug in numbers can get a numeric approximation of the (scaled) distribution of the probability mass for p. When I do that, both with an exponential prior (i.e. p in 0.1-0.01 is as likely as p in 0.01-0.001) or a uniform prior (i.e. p in 0.1-0.2 is as likely as p in 0.2-0.3) I get the unsurprising result that the maximum likelihood estimation for p is 1/N, and that the median p is a little lower; at around 1 accident in 1.5e8 miles In practice that means that common sense is correct: if you observe 1 accident in N miles, a reasonable approximation of the best guess of the true accident rate per mile is 1/N. Now, you can do this analytically, and the conjugate prior of the binomial is indeed a beta distribution. But that forces you to pick parameters for the prior from that beta distribution, and it's easy to do that wrongly. A reasonable prior might be Beta[1,3] which assumes p is likely closer to 0 than 1. Analytically [then](http://www.johndcook.com/blog/conjugate_prior_diagram/ http://www.johndcook.com/blog/conjugate_prior_diagram/), the posterior distribution is Beta[1+1,3+1e8-1]; with a mean p of 2e-8 (but note that the details of the chosen parameters definitely impact the outcome). This is quite close to the numerically derived p, though probably less accurate since it is constrained to a unreasonable prior. So I'm not sure exactly what your python script is computing, but commonsense, numerical analysis, and Bayesian analysis all arrive at roughly 1/N in my case - you probably made some mistake in your reasoning somewhere (if you elaborate in detail how you arrive at this numpy snippet, maybe we'll find the error).
- yummyfajitas 10y ago