Difference between revisions of "Theory of Stochastic Signals/Exponentially Distributed Random Variables"
(56 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
{{Header | {{Header | ||
− | |Untermenü= | + | |Untermenü=Continuous Random Variables |
− | |Vorherige Seite= | + | |Vorherige Seite= Gaussian Distributed Random Variables |
− | |Nächste Seite= | + | |Nächste Seite=Further Distributions |
}} | }} | ||
− | == | + | ==One-sided exponential distribution== |
− | {{Definition} | + | <br> |
− | + | {{BlaueBox|TEXT= | |
− | fx(x)=λ⋅e−λ⋅x. | + | $\text{Definition:}$ |
− | + | A continuous random variable x is called (one-sided) »'''exponentially distributed'''« if it can take only non–negative values and the probability density function has the following shape for $x>0$: | |
+ | :fx(x)=λ⋅e−λ⋅x. }} | ||
− | + | [[File: P_ID72__Sto_T_3_6_S1_neu.png |right|frame| PDF and CDF of an exponentially distributed random variable]] | |
− | |||
− | |||
+ | The left sketch shows the "probability density function" (PDF) of such an exponentially distributed random variable x. To be emphasized: | ||
+ | #The larger the distribution parameter λ, the steeper the decay. | ||
+ | #By definition fx(0)=λ/2, i.e. the mean of left-hand limit (0) and right-hand limit (λ). | ||
− | + | *For the "cumulative distribution function" (CDF), we obtain for r>0 by integration over the PDF (right graph): | |
+ | :$$F_{x}(r)=1-\rm e^{\it -\lambda\hspace{0.05cm}\cdot \hspace{0.03cm} r}.$$ | ||
− | + | *The "moments" of the one-sided exponential distribution are generally equal to | |
− | $$ | + | :$$m_k = k!/λ^k.$$ |
+ | *From this and from Steiner's theorem, we get for the "mean" and the "standard deviation": | ||
+ | :$$m_1={1}/{\lambda},$$ | ||
+ | :$$\sigma=\sqrt{m_2-m_1^2}=\sqrt{\frac{2}{\lambda^2}-\frac{1}{\lambda^2}}={1}/{\lambda}.$$ | ||
− | + | {{GraueBox|TEXT= | |
− | $ | + | $\text{Example 1:}$ The exponential distribution has great importance for reliability studies, and the term "lifetime distribution" is also commonly used in this context. |
− | $ | + | #In these applications, the random variable is often the time $t$ that elapses before a component fails. |
+ | #Furthermore, it should be noted that the exponential distribution is closely related to the [[Theory_of_Stochastic_Signals/Poisson_Distribution|$\text{Poisson distribution}$]]. }} | ||
− | + | ==Transformation of random variables== | |
− | + | <br> | |
− | + | To generate such an exponentially distributed random variable on a digital computer, you can use e.g. a »'''nonlinear transformation'''«. The underlying principle is first stated here in general terms. | |
− | == | + | {{BlaueBox|TEXT= |
− | + | Procedure: If a continuous-valued random variable u possesses the PDF fu(u), then the probability density function of the random variable transformed at the nonlinear characteristic $x = g(u)$ holds: | |
+ | :$$f_{x}(x)=\frac{f_u(u)}{\mid g\hspace{0.05cm}'(u)\mid}\Bigg \vert_{\hspace{0.1cm} u=h(x)}.$$ | ||
− | + | Here, $g\hspace{0.05cm}'(u)$ denotes the derivative of the characteristic curve g(u) and $h(x)$ gives the inverse function to $g(u)$ . }} | |
− | |||
− | |||
− | + | *However, the above equation is only valid under the condition that the derivative $g\hspace{0.03cm}'(u) \ne 0$. | |
+ | *For a characteristic with horizontal sections $(g\hspace{0.05cm}'(u) = 0)$: Additional Dirac delta functions appear in the PDF if the input variable has components in these ranges. | ||
+ | *The weights of these Dirac delta functions are equal to the probabilities that the input variable lies in these ranges. | ||
− | {{ | + | |
− | [[File:P_ID76__Sto_T_3_6_S2_neu.png | | + | {{GraueBox|TEXT= |
− | + | [[File:P_ID76__Sto_T_3_6_S2_neu.png |frame| To transform random variables | right]] | |
− | * | + | $\text{Example 2:}$ |
− | * | + | Given a random variable u triangularly distributed between $-2$ and $+2$ on a nonlinearity with characteristic $x = g(u)$, |
+ | *which, in the range $\vert u \vert ≤ 1$ triples the input values, and | ||
+ | *mapping all values $\vert u \vert > 1$ to $x = \pm 3$ depending on the sign, | ||
− | { | + | then the PDF $f_{x}(x)$ sketched on the right is obtained. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Please note: | |
− | + | # Due to the amplification by a factor of $3$ ⇒ $f_{x}(x) is wider and lower thanf_{u}(u)$ by this factor. | |
− | $$x | + | # The two horizontal limits of the characteristic at u=±1 lead to two Dirac delta functions at $x = ±3, each with weight 1/8$. |
+ | # The weight $1/8 corresponds to the green areas in the PDF f_{u}(u).$}} | ||
− | + | ==Generation of an exponentially distributed random variable== | |
+ | <br> | ||
+ | {{BlaueBox|TEXT= | ||
+ | $\text{Procedure:}$ | ||
+ | Now we assume that the random variable $u$ to be transformed is uniformly distributed between $0 (inclusive) and 1$ (exclusive). | ||
− | + | *Moreover, we consider the monotonically increasing characteristic curve | |
− | + | :x=g1(u)=1λ⋅ln (11−u). | |
− | + | *It can be shown that by this characteristic x=g1(u) a one-sided exponentially distributed random variable x with the following PDF arises <br>(derivation see [[Theory_of_Stochastic_Signals/Exponentially_Distributed_Random_Variables#Derivation_of_the_corresponding_transformation_characteristic|"next section"]]): | |
− | $$ | + | :$$f_{x}(x)=\lambda\cdot\rm e^{\it -\lambda \hspace{0.05cm}\cdot \hspace{0.03cm} x}\hspace{0.2cm}{\rm for}\hspace{0.2cm} {\it x}>0.$$ |
+ | *Note: | ||
+ | #For x=0 the PDF value is half (λ/2). | ||
+ | # Negative x values do not occur because for 0≤u<1 the argument of the (natural) logarithm function does not become smaller than 1.}} | ||
+ | |||
− | + | By the way, the same PDF is obtained with the monotonically decreasing characteristic curve | |
− | + | :$$x=g_2(u)=\frac{1}{\lambda}\cdot \rm ln \ (\frac{1}{\it u})=-\frac{1}{\lambda}\cdot \rm ln(\it u \rm ).$$ | |
− | + | Please note: | |
− | + | *When using a computer implementation corresponding to the first transformation characteristic $x=g_1(u) ⇒ the value u = 1$ must be excluded. | |
+ | *On the other hand, if one uses the second transformation characteristic x=g2(u) ⇒ the value u=0 must be excluded. | ||
− | |||
− | |||
+ | The following (German language) learning video shall clarify the transformations derived here: <br> [[Erzeugung_einer_Exponentialverteilung_(Lernvideo)|"Erzeugung einer Exponentialverteilung"]] ⇒ "Generation of an exponential distribution". | ||
+ | ==Derivation of the corresponding transformation characteristic== | ||
+ | <br> | ||
+ | {{BlaueBox|TEXT= | ||
+ | Task: | ||
+ | # Now the transformation characteristic x=g1(u)=g(u) already used in the last section is derived. | ||
+ | # This forms from the uniformly distributed random variable u with PDF fu(u) a one-sided exponentially distributed random variable x with PDF fx(x): | ||
+ | |||
+ | ::$$f_{u}(u)= \left\{ 1if0<u<1,0.5ifu=0,u=1,0else, \right. \hspace{0.5cm}\Rightarrow \hspace{0.5cm} | ||
+ | f_{x}(x)= \left\{ λ⋅e−λ⋅xifx>0,λ/2ifx=0,0elsex<0. \right.$$}} | ||
+ | {{BlaueBox|TEXT= | ||
+ | Solution: | ||
+ | |||
+ | '''(1)''' Starting from the general transformation equation | ||
+ | ::fx(x)=fu(u)∣g′(u)∣|u=h(x) | ||
+ | :is obtained by converting and substituting the given PDF fx(x): | ||
+ | ::∣g′(u)∣=fu(u)fx(x)|x=g(u)=1/λ⋅eλ⋅g(u). | ||
+ | :Here x=g′(u) gives the derivative of the characteristic curve, which we assume to be monotonically increasing. | ||
+ | |||
+ | '''(2)''' With this assumption we get |g′(u)|=g′(u)=dx/du and the differential equation du=λ ⋅e−λ⋅xdx with solution u=K−e−λ⋅x. | ||
+ | |||
+ | '''(3)''' From the condition that the input variable u=0 should lead to the output value x=0, we obtain for the constant K=1 and thus u=1−e−λ⋅x. | ||
+ | |||
+ | '''(4)''' Solving this equation for x yields the equation given in front: | ||
+ | ::x=g1(u)=1λ⋅ln(11−u). | ||
+ | |||
+ | *In a computer implementation, however, ensure that the critical value 1 is excluded for the uniformly distributed input variable u. | ||
+ | *This, however, has (almost) no effect on the final result. }} | ||
+ | |||
+ | |||
+ | ==Two-sided exponential distribution - Laplace distribution== | ||
+ | <br> | ||
+ | Closely related to the exponential distribution is the [https://en.wikipedia.org/wiki/Laplace_distribution Laplace distribution] with the probability density function | ||
+ | :fx(x)=λ2⋅e−λ⋅|x|. | ||
+ | |||
+ | The Laplace distribution is a "two-sided exponential distribution" that approximates sufficiently well the amplitude distribution of speech and music signals. | ||
+ | * The k–th order moments mk of the Laplace distribution agree with those of the exponential distribution for even k. | ||
+ | * For odd k, the (symmetric) Laplace distribution always yields mk=0. | ||
+ | *For generation of the Laplace distribution, one uses a between ±1 uniformly distributed random variable v (where v=0 must be excluded) and the transformation characteristic curve | ||
+ | :x=sign(v)λ⋅ln(v). | ||
+ | |||
+ | Further notes: | ||
+ | *From the [[Aufgaben:Exercise_3.8:_Amplification_and_Limitation|"Exercise 3.8"]] one can see further properties of the Laplace distribution. | ||
+ | *With the HTML 5/JavaScript applet [[Applets:PDF,_CDF_and_Moments_of_Special_Distributions|"PDF, CDF and Moments of Special Distributions"]] you can display the characteristics of the exponential and the Laplace distribution. | ||
+ | *In the (German language) learning video [[Wahrscheinlichkeit_und_WDF_(Lernvideo)|"Wahrscheinlichkeit und WDF"]] ⇒ "Probability and PDF", it is shown which meaning the Laplace distribution has for the description of speech and music signals. | ||
+ | *We also refer you to the (German language) HTML 5/JavaScript applet [[Applets:Zweidimensionale_Laplace-Zufallsgrößen_(Applet)|"Zweidimensionale Laplace-Zufallsgrößen"]] ⇒ "Two-dimensional Laplace random variables". | ||
+ | |||
+ | |||
+ | ==Exercises for the chapter== | ||
+ | <br> | ||
+ | [[Aufgaben:Exercise_3.8:_Amplification_and_Limitation|Exercise 3.8: Amplification and Limitation]] | ||
+ | |||
+ | [[Aufgaben:Exercise_3.8Z:_Circle_(Ring)_Area|Exercise 3.8Z: Circle (Ring) Area]] | ||
+ | |||
+ | [[Aufgaben:Exercise_3.9:_Characteristic_Curve_for_Cosine_PDF|Exercise 3.9: Characteristic Curve for Cosine PDF]] | ||
+ | |||
+ | [[Aufgaben:Exercise_3.9Z:_Sine_Transformation|Exercise 3.9Z: Sine Transformation]] | ||
{{Display}} | {{Display}} |
Latest revision as of 22:22, 20 December 2022
Contents
One-sided exponential distribution
Definition: A continuous random variable x is called (one-sided) »exponentially distributed« if it can take only non–negative values and the probability density function has the following shape for x>0:
- fx(x)=λ⋅e−λ⋅x.
The left sketch shows the "probability density function" (PDF) of such an exponentially distributed random variable x. To be emphasized:
- The larger the distribution parameter λ, the steeper the decay.
- By definition fx(0)=λ/2, i.e. the mean of left-hand limit (0) and right-hand limit (λ).
- For the "cumulative distribution function" (CDF), we obtain for r>0 by integration over the PDF (right graph):
- Fx(r)=1−e−λ⋅r.
- The "moments" of the one-sided exponential distribution are generally equal to
- mk=k!/λk.
- From this and from Steiner's theorem, we get for the "mean" and the "standard deviation":
- m1=1/λ,
- σ=√m2−m21=√2λ2−1λ2=1/λ.
Example 1: The exponential distribution has great importance for reliability studies, and the term "lifetime distribution" is also commonly used in this context.
- In these applications, the random variable is often the time t that elapses before a component fails.
- Furthermore, it should be noted that the exponential distribution is closely related to the Poisson distribution.
Transformation of random variables
To generate such an exponentially distributed random variable on a digital computer, you can use e.g. a »nonlinear transformation«. The underlying principle is first stated here in general terms.
Procedure: If a continuous-valued random variable u possesses the PDF fu(u), then the probability density function of the random variable transformed at the nonlinear characteristic x=g(u) holds:
- fx(x)=fu(u)∣g′(u)∣|u=h(x).
Here, g′(u) denotes the derivative of the characteristic curve g(u) and h(x) gives the inverse function to g(u) .
- However, the above equation is only valid under the condition that the derivative g′(u)≠0.
- For a characteristic with horizontal sections (g′(u)=0): Additional Dirac delta functions appear in the PDF if the input variable has components in these ranges.
- The weights of these Dirac delta functions are equal to the probabilities that the input variable lies in these ranges.
Example 2: Given a random variable u triangularly distributed between −2 and +2 on a nonlinearity with characteristic x=g(u),
- which, in the range |u|≤1 triples the input values, and
- mapping all values |u|>1 to x=±3 depending on the sign,
then the PDF fx(x) sketched on the right is obtained.
Please note:
- Due to the amplification by a factor of 3 ⇒ fx(x) is wider and lower than fu(u) by this factor.
- The two horizontal limits of the characteristic at u=±1 lead to two Dirac delta functions at x=±3, each with weight 1/8.
- The weight 1/8 corresponds to the green areas in the PDF fu(u).
Generation of an exponentially distributed random variable
Procedure: Now we assume that the random variable u to be transformed is uniformly distributed between 0 (inclusive) and 1 (exclusive).
- Moreover, we consider the monotonically increasing characteristic curve
- x=g1(u)=1λ⋅ln (11−u).
- It can be shown that by this characteristic x=g1(u) a one-sided exponentially distributed random variable x with the following PDF arises
(derivation see "next section"):
- fx(x)=λ⋅e−λ⋅xforx>0.
- Note:
- For x=0 the PDF value is half (λ/2).
- Negative x values do not occur because for 0≤u<1 the argument of the (natural) logarithm function does not become smaller than 1.
By the way, the same PDF is obtained with the monotonically decreasing characteristic curve
- x=g2(u)=1λ⋅ln (1u)=−1λ⋅ln(u).
Please note:
- When using a computer implementation corresponding to the first transformation characteristic x=g1(u) ⇒ the value u=1 must be excluded.
- On the other hand, if one uses the second transformation characteristic x=g2(u) ⇒ the value u=0 must be excluded.
The following (German language) learning video shall clarify the transformations derived here:
"Erzeugung einer Exponentialverteilung" ⇒ "Generation of an exponential distribution".
Derivation of the corresponding transformation characteristic
Task:
- Now the transformation characteristic x=g1(u)=g(u) already used in the last section is derived.
- This forms from the uniformly distributed random variable u with PDF fu(u) a one-sided exponentially distributed random variable x with PDF fx(x):
- fu(u)={1if0<u<1,0.5ifu=0,u=1,0else,⇒fx(x)={λ⋅e−λ⋅xifx>0,λ/2ifx=0,0elsex<0.
- fu(u)={1if0<u<1,0.5ifu=0,u=1,0else,⇒fx(x)={λ⋅e−λ⋅xifx>0,λ/2ifx=0,0elsex<0.
Solution:
(1) Starting from the general transformation equation
- fx(x)=fu(u)∣g′(u)∣|u=h(x)
- fx(x)=fu(u)∣g′(u)∣|u=h(x)
- is obtained by converting and substituting the given PDF fx(x):
- ∣g′(u)∣=fu(u)fx(x)|x=g(u)=1/λ⋅eλ⋅g(u).
- ∣g′(u)∣=fu(u)fx(x)|x=g(u)=1/λ⋅eλ⋅g(u).
- Here x=g′(u) gives the derivative of the characteristic curve, which we assume to be monotonically increasing.
(2) With this assumption we get |g′(u)|=g′(u)=dx/du and the differential equation du=λ ⋅e−λ⋅xdx with solution u=K−e−λ⋅x.
(3) From the condition that the input variable u=0 should lead to the output value x=0, we obtain for the constant K=1 and thus u=1−e−λ⋅x.
(4) Solving this equation for x yields the equation given in front:
- x=g1(u)=1λ⋅ln(11−u).
- x=g1(u)=1λ⋅ln(11−u).
- In a computer implementation, however, ensure that the critical value 1 is excluded for the uniformly distributed input variable u.
- This, however, has (almost) no effect on the final result.
Two-sided exponential distribution - Laplace distribution
Closely related to the exponential distribution is the Laplace distribution with the probability density function
- fx(x)=λ2⋅e−λ⋅|x|.
The Laplace distribution is a "two-sided exponential distribution" that approximates sufficiently well the amplitude distribution of speech and music signals.
- The k–th order moments mk of the Laplace distribution agree with those of the exponential distribution for even k.
- For odd k, the (symmetric) Laplace distribution always yields mk=0.
- For generation of the Laplace distribution, one uses a between ±1 uniformly distributed random variable v (where v=0 must be excluded) and the transformation characteristic curve
- x=sign(v)λ⋅ln(v).
Further notes:
- From the "Exercise 3.8" one can see further properties of the Laplace distribution.
- With the HTML 5/JavaScript applet "PDF, CDF and Moments of Special Distributions" you can display the characteristics of the exponential and the Laplace distribution.
- In the (German language) learning video "Wahrscheinlichkeit und WDF" ⇒ "Probability and PDF", it is shown which meaning the Laplace distribution has for the description of speech and music signals.
- We also refer you to the (German language) HTML 5/JavaScript applet "Zweidimensionale Laplace-Zufallsgrößen" ⇒ "Two-dimensional Laplace random variables".
Exercises for the chapter
Exercise 3.8: Amplification and Limitation
Exercise 3.8Z: Circle (Ring) Area
Exercise 3.9: Characteristic Curve for Cosine PDF
Exercise 3.9Z: Sine Transformation