You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: doc/specs/stdlib_stats_distribution_exponential.md
+26-21
Original file line number
Diff line number
Diff line change
@@ -14,34 +14,37 @@ Experimental
14
14
15
15
### Description
16
16
17
-
An exponential distribution is the distribution of time between events in a Poisson point process. The inverse scale parameter `lambda` specifies the average time between events, also called the rate of events.
17
+
An exponential distribution is the distribution of time between events in a Poisson point process. The inverse scale parameter `lambda` specifies the average time between events ($\lambda$), also called the rate of events.
18
18
19
-
Without argument the function returns a random sample from the standard exponential distribution `E(1)` with `lambda = 1`.
19
+
Without argument, the function returns a random sample from the standard exponential distribution $E(\lambda=1)$.
20
20
21
-
With a single argument, the function returns a random sample from the exponential distribution `E(lambda)`.
21
+
With a single argument, the function returns a random sample from the exponential distribution $E(\lambda=\text{lambda})$.
22
22
For complex arguments, the real and imaginary parts are sampled independently of each other.
23
23
24
-
With two arguments the function returns a rank one array of exponentially distributed random variates.
24
+
With two arguments, the function returns a rank-1 array of exponentially distributed random variates.
25
25
26
-
Note: the algorithm used for generating exponetial random variates is fundamentally limited to double precision. Ref.: Marsaglia, G. & Tsang, W.W. (2000) `The ziggurat method for generating random variables', J. Statist. Software, v5(8).
26
+
@note
27
+
The algorithm used for generating exponential random variates is fundamentally limited to double precision.[^1]
For a complex variable (x + y i) with independent real x and imaginary y parts, the joint probability density function
65
-
is the product of the corresponding marginal pdf of real and imaginary pdf (for more details, see
66
-
"Probability and Random Processes with Applications to Signal Processing and Communications", 2nd ed., Scott L. Miller and Donald Childers, 2012, p.197):
67
+
For a complex variable $z=(x + y i)$ with independent real $x$ and imaginary $y$ parts, the joint probability density function is the product of the corresponding real and imaginary marginal pdfs:[^2]
`x`: has `intent(in)` and is a scalar of type `real` or `complex`.
81
82
82
83
`lambda`: has `intent(in)` and is a scalar of type `real` or `complex`.
84
+
If `lambda` is `real`, its value must be positive. If `lambda` is `complex`, both the real and imaginary components must be positive.
83
85
84
86
All arguments must have the same type.
85
87
86
88
### Return value
87
89
88
-
The result is a scalar or an array, with a shape conformable to arguments, and has the same type of input arguments.
90
+
The result is a scalar or an array, with a shape conformable to the arguments, and the same type as the input arguments. If `lambda` is non-positive, the result is `NaN`.
89
91
90
92
### Example
91
93
@@ -103,13 +105,11 @@ Experimental
103
105
104
106
Cumulative distribution function (cdf) of the single real variable exponential distribution:
For a complex variable (x + y i) with independent real x and imaginary y parts, the joint cumulative distribution
109
-
function is the product of corresponding marginal cdf of real and imaginary cdf (for more details, see
110
-
"Probability and Random Processes with Applications to Signal Processing and Communications", 2nd ed., Scott L. Miller and Donald Childers, 2012, p.197):
110
+
For a complex variable $z=(x + y i)$ with independent real $x$ and imaginary $y$ parts, the joint cumulative distribution function is the product of corresponding real and imaginary marginal cdfs:[^2]
`x`: has `intent(in)` and is a scalar of type `real` or `complex`.
125
125
126
126
`lambda`: has `intent(in)` and is a scalar of type `real` or `complex`.
127
+
If `lambda` is `real`, its value must be positive. If `lambda` is `complex`, both the real and imaginary components must be positive.
127
128
128
129
All arguments must have the same type.
129
130
130
131
### Return value
131
132
132
-
The result is a scalar or an array, with a shape conformable to arguments, and has the same type of input arguments.
133
+
The result is a scalar or an array, with a shape conformable to the arguments, and the same type as the input arguments. If `lambda` is non-positive, the result is `NaN`.
[^1] Marsaglia, George, and Wai Wan Tsang. "The ziggurat method for generating random variables." _Journal of statistical software_ 5 (2000): 1-7.
142
+
143
+
[^2] Miller, Scott, and Donald Childers. _Probability and random processes: With applications to signal processing and communications_. Academic Press, 2012 (p. 197).
0 commit comments