# One-Dimensional Continuous Random Variables

 English Português Français ‎Español Italiano Nederlands

Definition: A continuous random variable takes values on the real line from either a finite or infinite interval.

Density function

If a function ${\displaystyle f(x)}$ has the following properties: ${\displaystyle P(a ${\displaystyle f(x)\geq 0}$ ${\displaystyle \int \limits _{-\infty }^{+\infty }f(x)\,dx=1}$ The function ${\displaystyle f(x)}$ is the density of the continuous random variable ${\displaystyle X}$.

Distribution function

The distribution function can be obtained from the density:

{\displaystyle {\begin{aligned}F(x)&=&P(-\infty

The distribution function ${\displaystyle F(x)}$ is equal to the area under the density ${\displaystyle f(u)}$ for ${\displaystyle -\infty .

The density function, if it exists, can be computed as the first derivative of the distribution function: ${\displaystyle {\frac {\partial F(x)}{\partial x}}=F^{'}(x)=f(x){\text{.}}}$ The waiting time (in minutes) of supermarket customers were collected, which resulted in the following frequency distribution:

Waiting time Relative frequency Cumulative relative frequency
8.0 - 8.5 0.002 0.002
8.5 - 9.0 0.004 0.006
9.0 - 9.5 0.009 0.015
9.5 - 10.0 0.013 0.028
10.0 - 10.5 0.020 0.048
10.5 - 11.0 0.043 0.091
11.0 - 11.5 0.094 0.185
11.5 - 12.0 0.135 0.320
12.0 - 12.5 0.169 0.489
12.5 - 13.0 0.158 0.647
13.0 - 13.5 0.139 0.786
13.5 - 14.0 0.078 0.864
14.0 - 14.5 0.065 0.929
14.5 - 15.0 0.030 0.959
15.0 - 15.5 0.010 0.969
15.5 - 16.0 0.014 0.983
16.0 - 16.5 0.006 0.989
16.5 - 17.0 0.004 0.993
16.0 - 17.5 0.003 0.996
17.5 - 18.0 0.004 1.000

The relative frequencies are used to construct the histogram and the frequency polygon. Fig. 1: Histogram of the waiting time

Fig. 2: Polygon of waiting time

The continuous random variable ${\displaystyle X=\{\,{\text{waiting time}}\,\}}$ defines the groups (bins) with constant bin width ${\displaystyle 0.5}$ min. The probabilities are approximated by relative frequencies (statistical definition of the probability).Note: In Fig. 1, the probabilities are given as the height of the boxes (and not the areas of the boxes). This implies that the sum of the areas of all of the boxes is equal to 0.5 (and not to 1). Similarly, the polygon on Fig. 2 cannot be a density because it does not satisfy the condition ${\displaystyle \int _{-\infty }^{+\infty }f(x)\,dx=1\,.}$ In order to obtain the density of ${\displaystyle X}$, we need to compute the relative frequency density, which is obtained as the ratio of the relative frequencies and the widths of the corresponding groups.

Waiting time Relative frequency density
8.0 - 8.5 0.004
8.5 - 9.0 0.008
9.0 - 9.5 0.018
9.5 - 10.0 0.026
10.0 - 10.5 0.040
10.5 - 11.0 0.086
11.0 - 11.5 0.188
11.5 - 12.0 0.270
12.0 - 12.5 0.338
12.5 - 13.0 0.316
13.0 - 13.5 0.278
13.5 - 14.0 0.156
14.0 - 14.5 0.130
14.5 - 15.0 0.060
15.0 - 15.5 0.020
15.5 - 16.0 0.028
16.0 - 16.5 0.012
16.5 - 17.0 0.008
16.0 - 17.5 0.006
17.5 - 18.0 0.008

Using this relative frequency density we obtain another histogram and smoothed density function. Fig. 3: Histogram of the waiting time using relative frequency density

Fig. 4: Density of ${\displaystyle X}$

In Fig. 3 the probabilities of the groups are given by the area. This implies that the sum of these areas is equal to one. The density in Fig. 4 is (an approximate) density function of the (continuous) random variable ${\displaystyle X=\{\,{\text{waiting time of the customer}}\,\}}$. The corresponding distribution function ${\displaystyle F(x)}$ is given in Fig. 5. Fig. 5: Distribution function of ${\displaystyle X}$

Let us consider the function ${\displaystyle f(x)=\left\{{\begin{array}{ll}0.25x-0.5\ &{\text{for}}\ 2 Is this function a density? We need to verify whether ${\displaystyle \int _{-\infty }^{\infty }f(x)\,dx=1\,{\text{:}}}$ {\displaystyle {\begin{aligned}\int _{-\infty }^{\infty }f(x)\,dx&=&\int _{2}^{4}(0.25x-0.5)\,dx+\int _{4}^{6}(-0.25x+1.25)\,dx\\&=&\left[0.25{\frac {1}{2}}x^{2}-0.5x\right]_{2}^{4}+\left[-0.25{\frac {1}{2}}x^{2}+1.5x\right]_{4}^{6}=1\end{aligned}}} This means that ${\displaystyle f(x)}$ is a density. In particular, it is the density of the triangular distribution (named after the shape of the density in the following figure).

The density function of a continuous random variable has the following properties:

• it cannot be negative
• the area under the curve is equal to one
• probability that the random variable ${\displaystyle X}$ lies between ${\displaystyle a}$ and ${\displaystyle b}$ is equal to the area between the density and the ${\displaystyle x}$-axis on the interval ${\displaystyle [a,b]}$

The density function ${\displaystyle f(x)}$  computes the probability that a random variable lies in the interval ${\displaystyle [x,x+dx]}$.The probability that a continuous random variable will be equal to a specific real number is always equal to zero, since the area under a specific point is equal to zero: ${\displaystyle \int _{x}^{x}f(t)\,dt=F(x)-F(x)=0\,.}$ This implies as a corollary: the probability that continuous random variable ${\displaystyle X}$ falls into an interval does not depend on the closedness or openness of the interval. ${\displaystyle P(a\leq X\leq b)=P(a

The diagram illustrates that a histogram can be smoothed by increasing the number of observations. in the limit (i.e., as N${\displaystyle \rightarrow \infty )}$ the histogram can be approximated by a continuous function.The area between the points ${\displaystyle a}$ and ${\displaystyle b}$ corresponds to the probability that a random variable ${\displaystyle X}$ will fall in the interval ${\displaystyle [a,b]}$. This probability can be computed using integrals. A distribution function, ${\displaystyle F(x),}$ is the probability that the random variable ${\displaystyle X}$ is less than or equal to ${\displaystyle x}$. Its properties follow:

• ${\displaystyle F(x)}$ is nondecreasing, i.e., ${\displaystyle x_{1} implies that ${\displaystyle F(x_{1})\leq F(x_{2})}$
• ${\displaystyle F(x)}$ is continuous
• ${\displaystyle 0\leq F(x)\leq 1}$
• ${\displaystyle \lim _{x\rightarrow -\infty }F(x)=0}$
• ${\displaystyle \lim _{x\rightarrow +\infty }F(x)=1}$

A distribution function cannot be decreasing because this would imply negative probabilities. In general, the distribution function is defined for real numbers. Limits on the sample space are necessary for the complete description of the distribution function.