Adding probabilities together

Recommended Posts

Sunaj 1

Sunaj 1

Just trying to wrap my head around some (very) basic math here by converting it into AU3 syntax, on this page (http://www.paulgraham.com/naivebayes.html) there is a good example of how to add two, or more, probabilities together. Here's the short version:

If a and b are the probabilities associated with two independent pieces of evidence [that someone is a basketball player], then combined they indicate a probability of:

Share this post

Link to post

Share on other sites

BrewManNH 1,037

BrewManNH 1,037

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Share this post

Link to post

Share on other sites

Sunaj 1

Sunaj 1

Ah so simple, thank you. After writing code to accumulate/calculate conditional probabilities (in PHP) I was stuck on how to combine them, this solves it nicely (and makes a good case for learning a bit of basic math notation), here's the fixed code in case someone should stumble on this subject down the road:

Share this post

Link to post

Share on other sites

BrewManNH 1,037

BrewManNH 1,037

It's been a LOOONNNGGG time since I've sat in a math class, good to know I haven't forgotten everything yet.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Similar Content

RunningStats calculates running (moving) statistics: Standard Deviation, Variance, and Mean . The single function _RunningStats(), queries, clears, restores, or adds to the running statistics.
Example.au3 adds 7 samples of data to running statistics and displays the results using _ArrayDisplay().
Example-Persistent-Storage.au3 adds the first 6 samples to the running statistics and stores the results in an INI file. The data is read from the INI file and restored to the running statistics. The 7th sample is added and the results displayed, matching the results from Example.au3.
Credits: John D. Cook for his article "Accurately computing running variance" at http://www.johndcook.com/blog/standard_deviation/
RunningStats.zip

I started writing this UDF a while ago, so I decided to share it here.
This is an UDF full of advanced mathematical functions. It allows to work with primes, create number sequences, interpolate, calculate values of functions like Riemann zeta.
Full list of functions:

Hi,
I've attached an example picture of a shape which i would like to calculate it's area. Let's say a user has marked this kind of shaped area on the screen and you need to run some calculations on it, like getting the area of it.
- How would you go about this problem?
Thanks in advance