Difference between revisions of "Theory of Stochastic Signals/Cumulative Distribution Function"

From LNTwww
 
(44 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
   
 
   
 
{{Header
 
{{Header
|Untermenü=Kontinuierliche Zufallsgrößen
+
|Untermenü=Continuous Random Variables
|Vorherige Seite=Wahrscheinlichkeitsdichtefunktion (WDF)
+
|Vorherige Seite=Probability Density Function
|Nächste Seite=Erwartungswerte und Momente
+
|Nächste Seite=Expected Values and Moments
 
}}
 
}}
==Zusammenhang zwischen WDF und VTF==
+
==Relationship between PDF and CDF==
 
<br>
 
<br>
Zur Beschreibung von Zufallsgrößen wird neben der&nbsp; [[Stochastische_Signaltheorie/Wahrscheinlichkeitsdichtefunktion_(WDF)|Wahrscheinlichkeitsdichtefunktion]]&nbsp; (WDF) auch die&nbsp; Verteilungsfunktion&nbsp; (VTF)&nbsp; verwendet, die wie folgt definiert ist:  
+
To describe random variables,&nbsp; in addition to the&nbsp; [[Theory_of_Stochastic_Signals/Probability_Density_Function|&raquo;probability density function&raquo;]]&nbsp; $\rm (PDF)$,&nbsp; we use the&nbsp; &raquo;cumulative distribution function&laquo;&nbsp; $\rm (CDF)$&nbsp; which is defined as follows:  
  
 
{{BlaueBox|TEXT=   
 
{{BlaueBox|TEXT=   
$\text{Definition:}$&nbsp; Die&nbsp; '''Verteilungsfunktion'''&nbsp; $F_{x}(r)$&nbsp; entspricht der Wahrscheinlichkeit, dass die Zufallsgröße&nbsp; $x$&nbsp; kleiner oder gleich einem reellen Zahlenwert&nbsp; $r$&nbsp; ist:  
+
$\text{Definition:}$&nbsp; The&nbsp; &raquo;'''cumulative distribution function'''&laquo;&nbsp; $F_{x}(r)$&nbsp; corresponds to the probability that the random variable&nbsp; $x$&nbsp; is less than or equal to a real number&nbsp; $r$:  
:$$F_{x}(r) = {\rm Pr}( x \le r).$$
+
:$$F_{x}(r) = {\rm Pr}( x \le r).$$}}
  
Die englische Bezeichnung für die Verteilungsfunktion (VTF) ist&nbsp; ''Cumulative Distribution Function''&nbsp; (CDF). }}
 
  
 
+
For a value-continuous random variable,&nbsp; the following statements are possible regarding the CDF:  
Bei einer kontinuierlichen Zufallsgröße sind bezüglich der Verteilungsfunktion folgende Aussagen möglich:  
+
*The CDF is computable from the probability density function&nbsp; $f_{x}(x)$&nbsp; by integration.&nbsp; It holds:  
*Die Verteilungsfunktion ist aus der Wahrscheinlichkeitsdichtefunktion&nbsp; $f_{x}(x)$&nbsp; durch Integration berechenbar.&nbsp; Es gilt:  
 
 
:$$F_{x}(r) = \int_{-\infty}^{r}f_x(x)\,{\rm d}x.$$
 
:$$F_{x}(r) = \int_{-\infty}^{r}f_x(x)\,{\rm d}x.$$
*Da die WDF nie negativ ist, steigt&nbsp; $F_{x}(r)$&nbsp; zumindest schwach monoton an, und liegt stets zwischen den folgenden Grenzwerten:  
+
*Since the PDF is never negative,&nbsp; $F_{x}(r)$&nbsp; increases at least weakly monotonically,&nbsp; and the function always lies between the following limits:  
:$$F_{x}(r → \hspace{0.05cm} \hspace{0.05cm} ∞) = 0, \hspace{0.5cm}F_{x}(r → +∞) = 1.$$  
+
:$$F_{x}(r → \hspace{0.05cm} - \hspace{0.05cm} ∞) = 0, \hspace{0.5cm}F_{x}(r → +∞) = 1.$$  
*Umgekehrt lässt sich die Wahrscheinlichkeitsdichtefunktion aus der Verteilungsfunktion durch Differentiation bestimmen:  
+
*Inversely,&nbsp; the probability density function can be determined from the CDF by differentiation:  
 
:$$f_{x}(x)=\frac{{\rm d} F_{x}(r)}{{\rm d} r}\Bigg |_{\hspace{0.1cm}r=x}.$$
 
:$$f_{x}(x)=\frac{{\rm d} F_{x}(r)}{{\rm d} r}\Bigg |_{\hspace{0.1cm}r=x}.$$
:Der Zusatz&nbsp; &bdquo;$r = x$&rdquo;&nbsp; macht deutlich, dass bei unserer Nomenklatur das Argument der Wahrscheinlichkeitsdichtefunktion die Zufallsgröße selbst ist, während das VTF–Argument eine beliebige reelle Variable&nbsp; $r$&nbsp; angibt.
+
:The addition&nbsp; &raquo;$r = x$&laquo;&nbsp; makes it clear that in our nomenclature the PDF argument is the random variable&nbsp; $x$&nbsp; itself, while the CDF argument specifies any real variable&nbsp; $r$&nbsp;.
 +
 
  
{{BlaueBox|TEXT=
+
{{BlaueBox|TEXT=  
$\text{Hinweise zur Nomenklatur:}$&nbsp;
+
$\text{Notes on nomenclature:}$&nbsp; If in the definitions of&nbsp; $\rm PDF$&nbsp; and&nbsp; $\rm CDF$&nbsp; we had distinguished
 +
*between the random variable&nbsp; $X$&nbsp;
 
   
 
   
Hätten wir bei den Definitionen von&nbsp; $\rm WDF$&nbsp; und&nbsp; $\rm VTF$&nbsp; zwischen der Zufallsgröße&nbsp; $X$&nbsp; und den Realisierungen&nbsp; $x ∈ X$&nbsp; unterschieden  &nbsp; ⇒ &nbsp; $f_{X}(x), F_{X}(x)$, so ergäbe sich folgende Nomenklatur:  
+
*and the realizations&nbsp; $x ∈ X$&nbsp; &nbsp; ⇒ &nbsp; $f_{X}(x), F_{X}(x)$,  
 +
 
 +
 
 +
we would have the following nomenclature:  
 
:$$F_{X}(x) = {\rm Pr}(X \le x) = \int_{-\infty}^{x}f_{x}(\xi)\,{\rm d}\xi.$$
 
:$$F_{X}(x) = {\rm Pr}(X \le x) = \int_{-\infty}^{x}f_{x}(\xi)\,{\rm d}\xi.$$
  
Leider haben wir uns zu Beginn unseres&nbsp; $\rm LNTwww$–Projektes (2001) aus durchaus berechtigten Gründen für unsere Nomenklatur entschieden, was nun (2017) nicht mehr zu ändern ist, auch im Hinblick auf die realisierten Lernvideos.  
+
Unfortunately,&nbsp; at the beginning of our&nbsp; $\rm LNTwww$ project&nbsp; $(2001)$&nbsp; we decided to use our nomenclature for quite legitimate reasons,&nbsp; which now&nbsp; $(2017)$&nbsp; cannot be changed,&nbsp; also with regard to the realized learning videos. &nbsp; '''So we stick with&nbsp; $f_{x}(x)$&nbsp; instead of&nbsp; $f_{X}(x)$&nbsp; as well as&nbsp; $F_{x}(r)$&nbsp; instead of&nbsp; $F_{X}(x).$}}
  
Wir bleiben also bei&nbsp; $f_{x}(x)$&nbsp; anstelle von&nbsp; $f_{X}(x)$&nbsp; sowie&nbsp; $F_{x}(r)$&nbsp; anstelle von&nbsp; $F_{X}(x).$}}
+
==CDF for value-continuous random variables==
 
 
==Verteilungsfunktion bei kontinuierlichen Zufallsgrößen==
 
 
<br>
 
<br>
Die im letzten Abschnitt angegebenen Gleichungen gelten nur für wertkontinuierliche Zufallsgrößen und sollen hier durch ein Beispiel verdeutlicht werden.&nbsp; Im nächsten Abschnitt wird gezeigt, dass für&nbsp; [[Stochastische_Signaltheorie/Verteilungsfunktion#Verteilungsfunktion_bei_diskreten_Zufallsgr.C3.B6.C3.9Fen|diskrete Zufallsgrößen]]&nbsp; die Gleichungen etwas modifiziert werden müssen.
+
The equations given in the last section apply only to value-continuous random variables and will be illustrated here by an example.&nbsp; In the next section it will be shown that for&nbsp; [[Theory_of_Stochastic_Signals/Cumulative_Distribution_Function#CDF_for_value-discrete_random_variables|&raquo;value-discrete random variables&laquo;]]&nbsp; the equations must be modified somewhat.
  
 
{{GraueBox|TEXT=   
 
{{GraueBox|TEXT=   
$\text{Beispiel 1:}$&nbsp; Das linke Bild zeigt das Foto &bdquo;Lena&rdquo;,&nbsp; das häufig als Testvorlage für Bildcodierverfahren dient.  
+
$\text{Example 1:}$&nbsp; The left image shows the photo&nbsp; &raquo;Lena&laquo;,&nbsp; which is often used as a test template for image coding procedures.
*Wird dieses Bild in&nbsp; $256 × 256$&nbsp; Bildpunkte&nbsp; (Pixel) unterteilt, und ermittelt man für jedes einzelne Pixel die Helligkeit, so erhält man eine Folge&nbsp; $〈x_ν〉$&nbsp; von Grauwerten, deren Länge&nbsp; $N = 256^2 = 65536$&nbsp; beträgt.
+
[[File:P_ID617__Sto_T_3_2_S1b_neu.png |right|frame| PDF and CDF of a value-continuous image]]
*Der Grauwert&nbsp; $x$&nbsp; ist eine wertkontinuierliche Zufallsgröße, wobei die Zuordnung zu Zahlenwerten willkürlich ist.&nbsp; Zum Beispiel sei „Schwarz” durch den Wert&nbsp; $x = 0$&nbsp; und „Weiß” durch&nbsp; $x = 1$&nbsp; charakterisiert.
+
*Der Zahlenwert&nbsp; $x =0.5$&nbsp; kennzeichnet dann eine mittlere Graufärbung.  
+
*If this image is divided into&nbsp; $256 × 256$&nbsp; pixels,&nbsp; and the brightness is determined for each pixel,&nbsp; a sequence&nbsp; $〈x_ν〉$&nbsp; of gray values is obtained whose length&nbsp; $N = 256^2 = 65\hspace{0.06cm}536$.
 +
 
 +
*The gray value&nbsp; $x$&nbsp; is a value-continuous random variable,&nbsp; where the assignment to numerical values is arbitrary.&nbsp; For example,&nbsp; let&nbsp; &raquo;black&laquo;&nbsp; be characterized by&nbsp; $x = 0$&nbsp; and&nbsp; &raquo;white&laquo;&nbsp; by&nbsp; $x = 1$:&nbsp; The value&nbsp; $x =0.5$&nbsp; then characterizes a medium gray coloration.  
  
[[File:P_ID617__Sto_T_3_2_S1b_neu.png |center|frame| WDF und VTF eines wertkontinuierlichen Bildes]]
 
  
Im mittleren Bild ist die WDF&nbsp; $f_{x}(x)$&nbsp; dargestellt, die in der Literatur auch oft als&nbsp; &bdquo;Grauwertstatistik&rdquo;&nbsp; bezeichnet wird.  
+
The middle diagram shows the PDF&nbsp; $f_{x}(x)$&nbsp; which is also often referred to in the literature as&nbsp; &raquo;gray value statistics&laquo;.  
*Es ist ersichtlich, dass im Originalbild einige Grauwerte bevorzugt sind und die beiden Extremwerte&nbsp; $x =0$&nbsp; („tiefes Schwarz”)&nbsp; bzw.&nbsp; $x =1$&nbsp; („reines Weiß”)&nbsp; nur sehr selten auftreten.  
+
*In the original image some gray values are preferred and the two extreme values&nbsp; $x =0$&nbsp; ("deep black")&nbsp; or&nbsp; $x =1$&nbsp; ("pure white")&nbsp; occur very rarely.
*Die Verteilungsfunktion&nbsp; $F_{x}(r)$&nbsp; dieser kontinuierlichen Zufallsgröße ist stetig und steigt, wie das rechte Bild zeigt, von&nbsp; $0$&nbsp; auf&nbsp; $1$&nbsp; monoton an. Bei&nbsp; $r \approx 0$&nbsp; und&nbsp; $r \approx 1$&nbsp; verläuft die VTF aufgrund fehlender WDF&ndash;Anteile horizontal.
+
 +
*The cumulative distribution function&nbsp; $F_{x}(r)$&nbsp; is continuous in value and increases monotonically from&nbsp; $0$&nbsp; to&nbsp; $1$&nbsp; as the right figure shows.&nbsp;
 +
 +
*For&nbsp; $r \approx 0$&nbsp; and&nbsp; $r \approx 1$&nbsp; the CDF is horizontal due to the lack of PDF components.
  
  
''Anmerkung:'' &nbsp; Genau genommen ist bei einem am Computer darstellbaren Bild – im Gegensatz zu einem „analogen” Foto – der Grauwert stets eine wertdiskrete Zufallsgröße.&nbsp; Bei großer Auflösung der Farbinformation („Farbtiefe”) kann man diese Zufallsgröße allerdings näherungsweise als wertkontinuierlich betrachten. }}
+
$\text{Note:}$  &nbsp; Strictly speaking,&nbsp; for an image that can be displayed on a computer&nbsp; $($in contrast to an analog photograph$)$:
 +
# &nbsp; The gray value is always a discrete in value.&nbsp;  
 +
# &nbsp; However,&nbsp; with large resolution of the color information&nbsp; $($&raquo;color depth&laquo;$)$,&nbsp; this random variable can be approximated to be continuous in value. }}
  
  
Die in diesem Abschnitt behandelte Thematik ist im Lernvideo&nbsp; [[Zusammenhang_zwischen_WDF_und_VTF_(Lernvideo)|Zusammenhang zwischen WDF und VTF]]&nbsp; zusammengefasst.
+
&raquo; &nbsp; The topic of this chapter is illustrated with examples in the&nbsp; (German language)&nbsp; learning video&nbsp; <br> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;[[Zusammenhang_zwischen_WDF_und_VTF_(Lernvideo)|&raquo;Zusammenhang zwischen WDF und VTF&raquo;]]&nbsp; $\Rightarrow$ &raquo;Relationship between PDF and CDF&laquo;.
  
  
==Verteilungsfunktion bei diskreten Zufallsgrößen==
+
==CDF for value-discrete random variables==
 
<br>
 
<br>
Für die Berechnung der Verteilungsfunktion einer wertdiskreten Zufallsgröße $x$ aus deren WDF muss stets von einer allgemeineren Gleichung ausgegangen werden. Hier gilt mit mit der Hilfsvariablen $\varepsilon > 0$:  
+
For the CDF calculation of a value-discrete random variable&nbsp; $x$&nbsp; from its PDF,&nbsp; a more general equation must always be assumed.&nbsp; Here,&nbsp; with the auxiliary variable&nbsp; $\varepsilon > 0$:  
 
:$$F_{x}(r)=\lim_{\varepsilon\hspace{0.05cm}\to \hspace{0.05cm}0}\int_{-\infty}^{r+\varepsilon}f_x(x)\,{\rm d}x.$$
 
:$$F_{x}(r)=\lim_{\varepsilon\hspace{0.05cm}\to \hspace{0.05cm}0}\int_{-\infty}^{r+\varepsilon}f_x(x)\,{\rm d}x.$$
  
*Die Berechnung der Verteilungsfunktion durch Grenzwertbildung ist aufgrund des „≤”&ndash;Zeichens in der [[Stochastische_Signaltheorie/Verteilungsfunktion#Zusammenhang_zwischen_WDF_und_VTF|allgemeinen Definition]] erforderlich.  
+
*Due to the&nbsp; &raquo;less than/equal&raquo;&nbsp; sign in the&nbsp; [[Theory_of_Stochastic_Signals/Cumulative_Distribution_Function#Relationship_between_PDF_and_CDF|&raquo;general definition&laquo;]], a limit value must be formed for the CDF calculation.&nbsp; If we also take into account that,&nbsp; for a value-discrete random variable,&nbsp; the PDF consists of a sum of weighted&nbsp; [[Signal_Representation/Direct_Current_Signal_-_Limit_Case_of_a_Periodic_Signal#Dirac_.28delta.29_function_in_frequency_domain|&raquo;Dirac delta functions&laquo;]],&nbsp; we obtain:  
*Berücksichtigt man zudem, dass bei einer diskreten Zufallsgröße die WDF aus einer Summe gewichteter [[Signaldarstellung/Allgemeine_Beschreibung/Gleichsignal_-_Grenzfall_eines_periodischen_Signals#Diracfunktion_im_Frequenzbereich|Diracfunktionen]] besteht, so erhält man:  
 
 
:$$F_{x}(r)=\lim_{\varepsilon\hspace{0.05cm}\to \hspace{0.05cm} 0}\int_{-\infty}^{r+\varepsilon}\sum\limits_{\mu= 1}^{ M}p_\mu\cdot \delta(x-x_\mu)\,{\rm d}x.$$
 
:$$F_{x}(r)=\lim_{\varepsilon\hspace{0.05cm}\to \hspace{0.05cm} 0}\int_{-\infty}^{r+\varepsilon}\sum\limits_{\mu= 1}^{ M}p_\mu\cdot \delta(x-x_\mu)\,{\rm d}x.$$
*Vertauscht man in dieser Gleichung Integration und Summation, und berücksichtigt man weiterhin, dass die Integration über die Diracfunktion die Sprungfunktion ergibt, so erhält man:  
+
*If we interchange integration and summation in this equation,&nbsp; and consider that an integration over the Dirac delta function yields the step function,&nbsp; we obtain:  
:$$F_{x}(r)=\sum\limits_{\mu= \rm 1}^{\it M}p_\mu\cdot \gamma_0 (r-x_\mu),\hspace{0.4cm}{\rm mit} \hspace{0.4cm}\gamma_0(x)=\lim_{\epsilon\hspace{0.05cm}\to \hspace{0.05cm} 0}\int_{-\infty}^{x+\varepsilon}\delta (u)\,{\rm d} u = \left\{ \begin{array}{*{2}{c}}  0 \hspace{0.4cm}  {\rm falls}\hspace{0.1cm} x< 0,\\ 1  \hspace{0.4cm} {\rm falls}\hspace{0.1cm}x\ge 0. \\ \end{array} \right.$$
+
:$$F_{x}(r)=\sum\limits_{\mu= \rm 1}^{\it M}p_\mu\cdot \gamma_0 (r-x_\mu),\hspace{0.4cm}{\rm with} \hspace{0.4cm}\gamma_0(x)=\lim_{\epsilon\hspace{0.05cm}\to \hspace{0.05cm} 0}\int_{-\infty}^{x+\varepsilon}\delta (u)\,{\rm d} u = \left\{ \begin{array}{*{2}{c}}  0 \hspace{0.4cm}  {\rm if}\hspace{0.1cm} x< 0,\\ 1  \hspace{0.4cm} {\rm if}\hspace{0.1cm}x\ge 0. \\ \end{array} \right.$$
Hierzu ist anzumerken:
+
::The function&nbsp; $γ_0(x)$&nbsp; differs from the&nbsp; [[Signal_Representation/Fourier_Transform_Theorems#Assignment_Theorem|&raquo;unit step function&laquo;]]&nbsp; $γ(x)$&nbsp; often used in systems theory in that at the jump point&nbsp; $x = 0$&nbsp; the right-hand side limit&nbsp; $1$nbsp; is valid&nbsp; $($instead of the mean value&nbsp; $0.5$&nbsp; between left&ndash; and right&ndash;hand side limits$)$.  
* $γ_0(x)$ unterscheidet sich von der in der Systemtheorie üblichen [[Signaldarstellung/Gesetzmäßigkeiten_der_Fouriertransformation#Zuordnungssatz|Sprungfunktion]] $γ(x)$ dadurch, dass an der Sprungstelle $x = 0$ der rechtsseitige Grenzwert &bdquo;Eins&rdquo; gültig ist (anstelle des Mittelwertes &bdquo;1/2&rdquo; zwischen links- und rechtsseitigem Grenzwert).  
+
*With the above CDF definition,&nbsp; the following probability equation holds for value-continuous and value-discrete random variables equally,&nbsp; and of course also for&nbsp; mixed random variables&nbsp; with discrete and continuous parts:
*Mit obiger VTF-Definition gilt dann für die Wahrscheinlichkeit von kontinuierlichen und diskreten Zufallsgrößen gleichermaßen, und natürlich auch für ''gemischte Zufallsgrößen'' mit diskreten und kontinuierlichen Anteilen:
 
 
:$${\rm Pr}(x_{\rm u}<x \le x_{\rm o})=F_x(x_{\rm o})-F_x(x_{\rm u}).$$
 
:$${\rm Pr}(x_{\rm u}<x \le x_{\rm o})=F_x(x_{\rm o})-F_x(x_{\rm u}).$$
*Bei rein kontinuierlichen Zufallsgrößen könnten hier das „Kleiner”–Zeichen und das „Kleiner/Gleich”–Zeichen gegenseitig ersetzt werden.  
+
*For purely value-continuous random variables,&nbsp; the&nbsp; &raquo;less than&laquo;&nbsp; sign and the&nbsp; &raquo;less than/equal to&laquo;&nbsp; sign could be substituted for each other here.  
 
:$${\rm Pr}(x_{\rm u}<x \le x_{\rm o}) ={\rm Pr}(x_{\rm u}\le x \le x_{\rm o}) ={\rm Pr}(x_{\rm u}\le x < x_{\rm o}) ={\rm Pr}(x_{\rm u}<x < x_{\rm o}).$$
 
:$${\rm Pr}(x_{\rm u}<x \le x_{\rm o}) ={\rm Pr}(x_{\rm u}\le x \le x_{\rm o}) ={\rm Pr}(x_{\rm u}\le x < x_{\rm o}) ={\rm Pr}(x_{\rm u}<x < x_{\rm o}).$$
 
  
 
{{GraueBox|TEXT=   
 
{{GraueBox|TEXT=   
$\text{Beispiel 2:}$&nbsp; Wird nun der Grauwert des [[Stochastische_Signaltheorie/Verteilungsfunktion#Verteilungsfunktion_bei_kontinuierlichen_Zufallsgr.C3.B6.C3.9Fen|ursprünglichen Lena–Fotos]] mit acht Stufen quantisiert, so dass jedes einzelne Pixel durch drei Bit dargestellt und digital übertragen werden kann, so ergibt sich die diskrete Zufallsgröße $q$. Durch die Quantisierung geht allerdings ein Teil der Bildinformation verloren, was sich im quantisierten Bild durch deutlich erkennbare „Konturen” auswirkt.
+
$\text{Example 2:}$&nbsp; If the gray value of the&nbsp; [[Theory_of_Stochastic_Signals/Cumulative_Distribution_Function#CDF_for_continuous-valued_random_variables|&raquo;original Lena photo&laquo;]]&nbsp; is quantized by eight levels,&nbsp; so that each pixel can be represented by three bits and transmitted digitally,&nbsp; the discrete random variable&nbsp; $q$&nbsp; is obtained. &nbsp; However, due to the quantization,&nbsp; a part of the image information is lost,&nbsp; which is reflected in the quantized image by clearly recognizable&nbsp; &raquo;contours&laquo;.
  
[[File:P_ID74__Sto_T_3_2_S2b_neu.png |center|frame| WDF und VTF eines wertdiskreten Bildes]]
+
[[File:P_ID74__Sto_T_3_2_S2b_neu.png |right|frame| PDF and CDF of a value-discrete image]]
  
*Die dazugehörige Wahrscheinlichkeitsdichtefunktion $f_{q}(q)$ setzt sich aus $M = 8$ Diracfunktionen zusammen, wobei bei der hier gewählten Quantisierung den möglichen Graustufen die Werte $q_\mu = (\mu 1)/7$ mit $\mu = 1, 2,$ ... , $8$ zugeordnet sind.  
+
*The associated PDF&nbsp; $f_{q}(q)$&nbsp; is composed of&nbsp; $M = 8$&nbsp; Dirac delta functions, where,&nbsp; in the quantization chosen here,&nbsp; the possible gray levels are assigned the values&nbsp; $q_\mu = (\mu - 1)/7$&nbsp; with&nbsp; $\mu = 1, 2,$ ... , $8$.
*Die Gewichte der Diracfunktionen kann man aus der WDF $f_{x}(x)$ des Originalbildes berechnen. Man erhält
+
:$$p_\mu={\rm Pr}(q = q_\mu ) = {\rm Pr}(\frac{2\mu-\rm 3}{14}< {x} \le\frac{2\it \mu- \rm 1}{14}) \rm = \int_{(2\it \mu- \rm 3)/14}^{(2\mu-1)/14}\it f_{\rm x}(x)\,{\rm d}x.$$
+
*The weights of the Dirac delta functions can be calculated from the PDF&nbsp; $f_{x}(x)$&nbsp; of the original image.&nbsp; One obtains
*Für die undefinierten Randbereiche ($x<0$  bzw.$x>10$) ist hier jeweils $f_{\rm x}(x) = 0$ zu setzen.  
+
:$$p_\mu={\rm Pr}(q = q_\mu ) = {\rm Pr}(\frac{2\mu-\rm 3}{14}< {x} \le\frac{2\it \mu- \rm 1}{14}) $$
*Da im Originalbild die Graustufen $x ≈0$ („sehr tiefes Schwarz”) &nbsp;bzw.&nbsp; $x ≈1$ („nahezu reines Weiß”) weitgehend fehlen, ergeben sich die Wahrscheinlichkeiten $p_1 ≈ p_8 ≈ 0$, und in der WDF sind tatsächlich nur sechs Diracfunktionen sichtbar.
+
:$$\Rightarrow \hspace{0.3cm} p_\mu={\rm Pr}(q = q_\mu ) = \int_{(2\it \mu- \rm 3)/14}^{(2\mu-1)/14}\it f_{x}{\rm (}x{\rm )}\,{\rm d}x.$$
*Die beiden fehlenden Diracfunktionen bei $q = 0$ und $q =1$ sind in der mittleren Grafik nur durch Punkte angedeutet.  
+
*For the undefined areas&nbsp; $(x<0$, &nbsp; $x>1)$&nbsp; is to be set&nbsp; $f_{x}(x) = 0$.&nbsp; Since in the original image the gray levels&nbsp; $x ≈0$&nbsp; $($&raquo;very deep black&laquo;$)$&nbsp; or&nbsp; $x ≈1$&nbsp; $($&raquo;almost pure white&laquo;$)$&nbsp; are largely missing,&nbsp; $p_1 ≈ p_8 ≈ 0$ result.
  
 
+
* Thus,&nbsp; only six Dirac delta functions are visible in the PDF.&nbsp; The two missing Diracs at&nbsp; $q = 0$&nbsp; and&nbsp; $q =1$&nbsp; are only indicated by dots.
Die rechts skizzierte Verteilungsfunktion $F_{q}(r)$ weist entsprechend dem oben Gesagten sechs Unstetigkeitsstellen auf, bei denen jeweils der rechtsseitige Grenzwert gültig ist.}}
+
 +
*The step-shaped CDF&nbsp; $F_{q}(r)$&nbsp; sketched on the right thus has six points of discontinuity,&nbsp; where  in each case the right-hand side limit is valid.}}
  
  
Die in diesem Abschnitt behandelte Thematik ist im Lernvideo [[Zusammenhang_zwischen_WDF_und_VTF_(Lernvideo)|Zusammenhang zwischen WDF und VTF]] zusammengefasst.
+
&raquo; &nbsp; The topic of this chapter is illustrated with examples in the&nbsp; (German language)&nbsp; learning video&nbsp; <br> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;[[Zusammenhang_zwischen_WDF_und_VTF_(Lernvideo)|&raquo;Zusammenhang zwischen WDF und VTF&raquo;]]&nbsp; $\Rightarrow$ &raquo;Relationship between PDF and CDF&laquo;.
  
  
==Aufgaben zum Kapitel==
+
==Exercises for the chapter==
 
<br>
 
<br>
[[Aufgaben:3.2 cos²- und Dirac-VTF|Aufgabe 3.2: $\cos^2$&ndash; und Dirac&ndash;VTF]]
+
[[Aufgaben:Exercise_3.2:_CDF_for_Exercise_3.1|Exercise 3.2: CDF for Exercise 3.1]]
  
[[Aufgaben:Aufgabe_3.2Z:_Zusammenhang_zwischen_WDF_und_VTF|Aufgabe 3.2Z: Zusammenhang zwischen WDF und VTF]]
+
[[Aufgaben:Exercise_3.2Z:_Relationship_between_PDF_and_CDF|Exercise 3.2Z: Relationship between PDF and CDF]]
  
  
 
{{Display}}
 
{{Display}}

Latest revision as of 17:47, 19 February 2024

Relationship between PDF and CDF


To describe random variables,  in addition to the  »probability density function»  $\rm (PDF)$,  we use the  »cumulative distribution function«  $\rm (CDF)$  which is defined as follows:

$\text{Definition:}$  The  »cumulative distribution function«  $F_{x}(r)$  corresponds to the probability that the random variable  $x$  is less than or equal to a real number  $r$:

$$F_{x}(r) = {\rm Pr}( x \le r).$$


For a value-continuous random variable,  the following statements are possible regarding the CDF:

  • The CDF is computable from the probability density function  $f_{x}(x)$  by integration.  It holds:
$$F_{x}(r) = \int_{-\infty}^{r}f_x(x)\,{\rm d}x.$$
  • Since the PDF is never negative,  $F_{x}(r)$  increases at least weakly monotonically,  and the function always lies between the following limits:
$$F_{x}(r → \hspace{0.05cm} - \hspace{0.05cm} ∞) = 0, \hspace{0.5cm}F_{x}(r → +∞) = 1.$$
  • Inversely,  the probability density function can be determined from the CDF by differentiation:
$$f_{x}(x)=\frac{{\rm d} F_{x}(r)}{{\rm d} r}\Bigg |_{\hspace{0.1cm}r=x}.$$
The addition  »$r = x$«  makes it clear that in our nomenclature the PDF argument is the random variable  $x$  itself, while the CDF argument specifies any real variable  $r$ .


$\text{Notes on nomenclature:}$  If in the definitions of  $\rm PDF$  and  $\rm CDF$  we had distinguished

  • between the random variable  $X$ 
  • and the realizations  $x ∈ X$    ⇒   $f_{X}(x), F_{X}(x)$,


we would have the following nomenclature:

$$F_{X}(x) = {\rm Pr}(X \le x) = \int_{-\infty}^{x}f_{x}(\xi)\,{\rm d}\xi.$$

Unfortunately,  at the beginning of our  $\rm LNTwww$ project  $(2001)$  we decided to use our nomenclature for quite legitimate reasons,  which now  $(2017)$  cannot be changed,  also with regard to the realized learning videos.   So we stick with  $f_{x}(x)$  instead of  $f_{X}(x)$  as well as  $F_{x}(r)$  instead of  $F_{X}(x).$

CDF for value-continuous random variables


The equations given in the last section apply only to value-continuous random variables and will be illustrated here by an example.  In the next section it will be shown that for  »value-discrete random variables«  the equations must be modified somewhat.

$\text{Example 1:}$  The left image shows the photo  »Lena«,  which is often used as a test template for image coding procedures.

PDF and CDF of a value-continuous image
  • If this image is divided into  $256 × 256$  pixels,  and the brightness is determined for each pixel,  a sequence  $〈x_ν〉$  of gray values is obtained whose length  $N = 256^2 = 65\hspace{0.06cm}536$.
  • The gray value  $x$  is a value-continuous random variable,  where the assignment to numerical values is arbitrary.  For example,  let  »black«  be characterized by  $x = 0$  and  »white«  by  $x = 1$:  The value  $x =0.5$  then characterizes a medium gray coloration.


The middle diagram shows the PDF  $f_{x}(x)$  which is also often referred to in the literature as  »gray value statistics«.

  • In the original image some gray values are preferred and the two extreme values  $x =0$  ("deep black")  or  $x =1$  ("pure white")  occur very rarely.
  • The cumulative distribution function  $F_{x}(r)$  is continuous in value and increases monotonically from  $0$  to  $1$  as the right figure shows. 
  • For  $r \approx 0$  and  $r \approx 1$  the CDF is horizontal due to the lack of PDF components.


$\text{Note:}$   Strictly speaking,  for an image that can be displayed on a computer  $($in contrast to an analog photograph$)$:

  1.   The gray value is always a discrete in value. 
  2.   However,  with large resolution of the color information  $($»color depth«$)$,  this random variable can be approximated to be continuous in value.


»   The topic of this chapter is illustrated with examples in the  (German language)  learning video 
        »Zusammenhang zwischen WDF und VTF»  $\Rightarrow$ »Relationship between PDF and CDF«.


CDF for value-discrete random variables


For the CDF calculation of a value-discrete random variable  $x$  from its PDF,  a more general equation must always be assumed.  Here,  with the auxiliary variable  $\varepsilon > 0$:

$$F_{x}(r)=\lim_{\varepsilon\hspace{0.05cm}\to \hspace{0.05cm}0}\int_{-\infty}^{r+\varepsilon}f_x(x)\,{\rm d}x.$$
  • Due to the  »less than/equal»  sign in the  »general definition«, a limit value must be formed for the CDF calculation.  If we also take into account that,  for a value-discrete random variable,  the PDF consists of a sum of weighted  »Dirac delta functions«,  we obtain:
$$F_{x}(r)=\lim_{\varepsilon\hspace{0.05cm}\to \hspace{0.05cm} 0}\int_{-\infty}^{r+\varepsilon}\sum\limits_{\mu= 1}^{ M}p_\mu\cdot \delta(x-x_\mu)\,{\rm d}x.$$
  • If we interchange integration and summation in this equation,  and consider that an integration over the Dirac delta function yields the step function,  we obtain:
$$F_{x}(r)=\sum\limits_{\mu= \rm 1}^{\it M}p_\mu\cdot \gamma_0 (r-x_\mu),\hspace{0.4cm}{\rm with} \hspace{0.4cm}\gamma_0(x)=\lim_{\epsilon\hspace{0.05cm}\to \hspace{0.05cm} 0}\int_{-\infty}^{x+\varepsilon}\delta (u)\,{\rm d} u = \left\{ \begin{array}{*{2}{c}} 0 \hspace{0.4cm} {\rm if}\hspace{0.1cm} x< 0,\\ 1 \hspace{0.4cm} {\rm if}\hspace{0.1cm}x\ge 0. \\ \end{array} \right.$$
The function  $γ_0(x)$  differs from the  »unit step function«  $γ(x)$  often used in systems theory in that at the jump point  $x = 0$  the right-hand side limit  $1$nbsp; is valid  $($instead of the mean value  $0.5$  between left– and right–hand side limits$)$.
  • With the above CDF definition,  the following probability equation holds for value-continuous and value-discrete random variables equally,  and of course also for  mixed random variables  with discrete and continuous parts:
$${\rm Pr}(x_{\rm u}<x \le x_{\rm o})=F_x(x_{\rm o})-F_x(x_{\rm u}).$$
  • For purely value-continuous random variables,  the  »less than«  sign and the  »less than/equal to«  sign could be substituted for each other here.
$${\rm Pr}(x_{\rm u}<x \le x_{\rm o}) ={\rm Pr}(x_{\rm u}\le x \le x_{\rm o}) ={\rm Pr}(x_{\rm u}\le x < x_{\rm o}) ={\rm Pr}(x_{\rm u}<x < x_{\rm o}).$$

$\text{Example 2:}$  If the gray value of the  »original Lena photo«  is quantized by eight levels,  so that each pixel can be represented by three bits and transmitted digitally,  the discrete random variable  $q$  is obtained.   However, due to the quantization,  a part of the image information is lost,  which is reflected in the quantized image by clearly recognizable  »contours«.

PDF and CDF of a value-discrete image
  • The associated PDF  $f_{q}(q)$  is composed of  $M = 8$  Dirac delta functions, where,  in the quantization chosen here,  the possible gray levels are assigned the values  $q_\mu = (\mu - 1)/7$  with  $\mu = 1, 2,$ ... , $8$.
  • The weights of the Dirac delta functions can be calculated from the PDF  $f_{x}(x)$  of the original image.  One obtains
$$p_\mu={\rm Pr}(q = q_\mu ) = {\rm Pr}(\frac{2\mu-\rm 3}{14}< {x} \le\frac{2\it \mu- \rm 1}{14}) $$
$$\Rightarrow \hspace{0.3cm} p_\mu={\rm Pr}(q = q_\mu ) = \int_{(2\it \mu- \rm 3)/14}^{(2\mu-1)/14}\it f_{x}{\rm (}x{\rm )}\,{\rm d}x.$$
  • For the undefined areas  $(x<0$,   $x>1)$  is to be set  $f_{x}(x) = 0$.  Since in the original image the gray levels  $x ≈0$  $($»very deep black«$)$  or  $x ≈1$  $($»almost pure white«$)$  are largely missing,  $p_1 ≈ p_8 ≈ 0$ result.
  • Thus,  only six Dirac delta functions are visible in the PDF.  The two missing Diracs at  $q = 0$  and  $q =1$  are only indicated by dots.
  • The step-shaped CDF  $F_{q}(r)$  sketched on the right thus has six points of discontinuity,  where in each case the right-hand side limit is valid.


»   The topic of this chapter is illustrated with examples in the  (German language)  learning video 
        »Zusammenhang zwischen WDF und VTF»  $\Rightarrow$ »Relationship between PDF and CDF«.


Exercises for the chapter


Exercise 3.2: CDF for Exercise 3.1

Exercise 3.2Z: Relationship between PDF and CDF