tag:blogger.com,1999:blog-6894866515532737257.post8682325935361655867..comments2024-03-28T21:59:14.517-07:00Comments on Probably Overthinking It: The Price is Right ProblemAllen Downeyhttp://www.blogger.com/profile/01633071333405221858noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-6894866515532737257.post-32602316813430833482014-08-14T07:00:04.545-07:002014-08-14T07:00:04.545-07:00That's cool. Do you have your R code on GitHu...That's cool. Do you have your R code on GitHub or some other public repo? I think others would like to see it. Let me know and I will add a link to it.Allen Downeyhttps://www.blogger.com/profile/01633071333405221858noreply@blogger.comtag:blogger.com,1999:blog-6894866515532737257.post-87632892469646090692014-08-07T13:10:10.487-07:002014-08-07T13:10:10.487-07:00I was thinking along those lines. So, essentially,...I was thinking along those lines. So, essentially, we say (in R, sorry)<br />x <- seq(from=14000,to=64400,by=700)<br />Like <- dnorm(x-20000,mean=0,sd=sd(SC1Diff))<br />Prior <- approx(SC1PDF$x, SC1PDF$y, x)<br />Post <- Prior$y*Like<br />Post <- Post /sum(Post)<br />where SC1PDF is the kernel density approximation to the data sets. I do indeed match your chart in the book. Thanks! Love the book, but I'm translating it into R as I go, rather than using the Python framework, so it's just a bit tougher. Appreciate it.Anonymoushttps://www.blogger.com/profile/14813246182350894222noreply@blogger.comtag:blogger.com,1999:blog-6894866515532737257.post-55135986885358915062014-08-07T12:54:40.606-07:002014-08-07T12:54:40.606-07:00Hi Reuben,
P(20000 | H_x) is the probability that...Hi Reuben,<br /><br />P(20000 | H_x) is the probability that you guess 20000, given that the actual value is x, so that's the same as the probability that diff is (x-20000). We can't really compute that probability, but we can compute a density proportional to that probability by evaluating the PDF of diff at (x-20000).<br /><br />Does that make sense?Allen Downeyhttps://www.blogger.com/profile/01633071333405221858noreply@blogger.comtag:blogger.com,1999:blog-6894866515532737257.post-76739150248983838112014-08-07T12:47:31.294-07:002014-08-07T12:47:31.294-07:00My understanding is getting lost in the Python. Yo...My understanding is getting lost in the Python. You are trying to compute the posterior for "E = my guess is 20000", where<br /><br />P(H_x | 20000) = P(20000 | H_x) P(H_x) / P(20000),<br /><br />where x=0..75000 and H_x means the price is x, correct? You assume that the distribution of errors is proportional to e^{-x^2/2 sigma^2}, where sigma is the standard deviation of diff (which is $6899.91 for Showcase 1). But what is P(20000 | H_x)?Anonymoushttps://www.blogger.com/profile/14813246182350894222noreply@blogger.com