Difference between revisions of "Bernoulli distribution"

Line 2: Line 2:
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
  
= Bernoulli( P ) =
+
== Bernoulli(P) ==
 +
 
 +
Creates a discrete probability distribution with probability «P» of 1 (True) and probability (1 - P) of 0 (False). «P» is a probability value or array of probabilities, between 0 and 1. The result is the equivalent to:
 +
:<code>If Uniform(0, 1) < P Then 1 Else 0</code>
  
Creates a discrete probability distribution with probability P of 1 (True) and probability (1 - P) of 0 (False). P is a probability value or array of probabilities, between 0 and 1. The result is the equivalent to:
 
If [[Uniform]](0, 1) < P Then 1 Else 0
 
 
Or even just:
 
Or even just:
[[Uniform]](0, 1) < P
+
:<code>Uniform(0, 1) < P</code>
If P is greater than 1, the distribution is made up of all 1’s. If P is less than 0, the distribution is made up of all 0’s.
+
 
 +
If «P» is greater than 1, the distribution is made up of all 1’s. If «P» is less than 0, the distribution is made up of all 0’s.
 +
 
 +
To generate an Array of Bernoulli values that are independent over index I, use the optional «Over» parameter:
 +
:<code>Bernoulli(P, Over: I)</code>
  
To generate an Array of Bernoulli values that are independent over index I, use:
 
Bernoulli(P, Over: I)
 
 
You can extend this to an Array with multiple dimensions, as:
 
You can extend this to an Array with multiple dimensions, as:
Bernoulli(P, Over: I, J, K)
+
:<code>Bernoulli(P, Over: I, J, K)</code>
 
 
= Library =
 
  
 +
== Library ==
 
Distributions
 
Distributions
  
= See Also =
+
== See Also ==
 
 
 
* [[Uniform]]
 
* [[Uniform]]
 +
* [[Parametric_discrete_distributions]]
 +
* [[Distribution Densities Library]]

Revision as of 01:07, 27 January 2016


Bernoulli(P)

Creates a discrete probability distribution with probability «P» of 1 (True) and probability (1 - P) of 0 (False). «P» is a probability value or array of probabilities, between 0 and 1. The result is the equivalent to:

If Uniform(0, 1) < P Then 1 Else 0

Or even just:

Uniform(0, 1) < P

If «P» is greater than 1, the distribution is made up of all 1’s. If «P» is less than 0, the distribution is made up of all 0’s.

To generate an Array of Bernoulli values that are independent over index I, use the optional «Over» parameter:

Bernoulli(P, Over: I)

You can extend this to an Array with multiple dimensions, as:

Bernoulli(P, Over: I, J, K)

Library

Distributions

See Also

Comments


You are not allowed to post comments.