ProbabilityNot Wiki Rss Feedhttp://probabilitynot.codeplex.com/wikipageProbabilityNot Wiki Rss DescriptionUpdated Wiki: Documentationhttp://probabilitynot.codeplex.com/documentation?version=7<div class="wikidoc"><h1>Usage</h1>
For first time usage, point your web browser at <a href="http://d0.phys.washington.edu/~gwatts/prob" class="externalLink">http://d0.phys.washington.edu/~gwatts/prob<span class="externalLinkIcon"></span></a>. Once the <i>Probability Not</i> application has loaded enter the expected background and its width (it is always taken to be a gaussian). The gaussian and poisson distrubtions will appear representing those numbers. You can then enter the # of events or the probability (or even grab the slider next to the probability entry box). The program will fill in the one you didn't. It will also shade the plots to show the area represented by the probability.<br /><br /><img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=ProbabilityNot&DownloadId=99031" alt="demo.png" title="demo.png" /><br /><br />If you wish, you can install <i>Probability Not</i> localy by right-clicking on the application and selecting "Install onto this computer...". In that case, just in case I do actually update it, you might click the tiny tiny "update" button in the lower left hand corner (control-click on a Mac).<br />
<h1>Warnings</h1>
Two warnings I can think of... I'm sure there are more. :-)<br />
<ul><li>Currently this is using a very crude form of area-under-a-curve integration to calculate the probability. This is bad, and not accurate! I will upgrade to a real math library now that I sort-of know what I'm doing with Silverlight.</li>
<li>There is a random number generator and trials involved in this calculation (see below). As a result, you can expect repeated answers to not be exact. The trials are only thrown if you alter the # of expected background events or the expected background's width.</li>
<li>If you put in a very large wdith (say 1e5) it will appear the program has hung. This isn't what has happened, however, it will take a very long time to do the calculation, and it is being done on the main thread and that causes a hang - so just wait, or kill it and try again. :-)</li>
<li>Very small guassian widths on the expected background are not well delt with - so the answer will either come out almost right or it will come out zero... depending on how the randome number generator works. When I use a real math library this will get fixed.</li></ul>
<h1>The Calculation</h1>
The calculation is actually dirt simple, and contains a number of things that make the number that comes out slightly untrustworthy.<br />
<ol><li>A gaussian with mean and width of the specified expected background value and width is created. It is normalized to one (it could be truncated at zero - no negative probability is allowed here).</li>
<li>A crude calculation is performed to determine the xmin and xmax of the plot.</li>
<li>The length of the axis is sampled uniformly 1000 times, and the guassian function gives an exact weight for each sample.</li>
<li>The Poisson distribution for the expected background is created and weighted by the gaussian weight.</li>
<li>The ~2000 Poisson distributions are then added up (and re-normalized in order to deal with the truncated plot).</li></ol>
<br />The actual number of trials is about 20 times the number of bins. The code does its best to make sure there are atleast 50 bins under the main part of the Gaussian, but for performance reasons limits itself to a total of 2000 bins for the full axis.<br /><br />This is how the two curves are generated. Calculating the probability is done with simple interpolation. The Poisson distribution is really not continuous, so I use a sample interpolation (assuming P(1) is the same value from 1.0 -> 2.0).<br /><br /></div><div class="ClearBoth"></div>gwattsTue, 29 Dec 2009 22:01:11 GMTUpdated Wiki: Documentation 20091229100111PUpdated Wiki: Documentationhttp://probabilitynot.codeplex.com/documentation?version=6<div class="wikidoc"><h1>Usage</h1>
For first time usage, point your web browser at <a href="http://d0.phys.washington.edu/~gwatts/prob" class="externalLink">http://d0.phys.washington.edu/~gwatts/prob<span class="externalLinkIcon"></span></a>. Once the <i>Probability Not</i> application has loaded enter the expected background and its width (it is always taken to be a gaussian). The gaussian and poisson distrubtions will appear representing those numbers. You can then enter the # of events or the probability (or even grab the slider next to the probability entry box). The program will fill in the one you didn't. It will also shade the plots to show the area represented by the probability.<br /><br /><img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=ProbabilityNot&DownloadId=99031" alt="demo.png" title="demo.png" /><br /><br />If you wish, you can install <i>Probability Not</i> localy by right-clicking on the application and selecting "Install onto this computer...". In that case, just in case I do actually update it, you might click the tiny tiny "update" button in the lower left hand corner (control-click on a Mac).<br />
<h1>Warnings</h1>
Two warnings I can think of... I'm sure there are more. :-)<br />
<ul><li>Currently this is using a very crude form of area-under-a-curve integration to calculate the probability. This is bad, and not accurate! I will upgrade to a real math library now that I sort-of know what I'm doing with Silverlight.</li>
<li>There is a random number generator and trials involved in this calculation (see below). As a result, you can expect repeated answers to not be exact. The trials are only thrown if you alter the # of expected background events or the expected background's width.</li>
<li>If you put in a very large wdith (say 1e5) it will appear the program has hung. This isn't what has happened, however, it will take a very long time to do the calculation, and it is being done on the main thread and that causes a hang - so just wait, or kill it and try again. :-)</li>
<li>Very small guassian widths on the expected background are not well delt with - so the answer will either come out almost right or it will come out zero... depending on how the randome number generator works. When I use a real math library this will get fixed.</li></ul>
<h1>The Calculation</h1>
The calculation is actually dirt simple, and contains a number of things that make the number that comes out slightly untrustworthy.<br />
<ol><li>A gaussian with mean and width of the specified expected background value and width is created. It is normalized to one (it could be truncated at zero - no negative probability is allowed here).</li>
<li>A crude calculation is performed to determine the xmin and xmax of the plot.</li>
<li>The length of the axis is sampled uniformly 1000 times, and the guassian function gives an exact weight for each sample.</li>
<li>The Poisson distribution for the expected background is created and weighted by the gaussian weight.</li>
<li>The ~2000 Poisson distributions are then added up (and re-normalized in order to deal with the truncated plot).</li></ol>
<ul><li>The actual number of trials is about 20 times the number of bins. The code does its best to make sure there are atleast 50 bins under the main part of the Gaussian, but for performance reasons limits itself to a total of 2000 bins for the full axis.</li></ul>
<br />This is how the two curves are generated. Calculating the probability is done with simple interpolation. The Poisson distribution is really not continuous, so I use a sample interpolation (assuming P(1) is the same value from 1.0 -> 2.0).<br /><br /></div><div class="ClearBoth"></div>gwattsTue, 29 Dec 2009 22:00:28 GMTUpdated Wiki: Documentation 20091229100028P