# Variance

### Integrating survival function to calculate the mean

For a continuous random variable that are non-negative in values, the mean is obtained by integrating from to where is the probability density function of . In some cases, this integral is hard (or impossible) to do. In these cases, it may be possible to find the mean and higher moments by integrating the survival functions.

Here’s the usual way to calculate moments.

Moments can be calculated by integrating the survival function.

In fact, the mean and moments of many of the distributions in the Exam C table are calculated using the survival function method, e.g. the Pareto distribution and the exponential distribution.

The integrals in (3) and (4) are derived from (1) and (2) by performing integration by parts. The derivation is not very hard. You will find out that some assumptions are needed to make the integration by parts work. Specifically, the assumption is that the following limit is 0.

The integrals in (3) and (4) works only if this limit converges to zero. Essentially this limit is zero if the expectation exists.

The same idea can be applied to a discrete distribution.

**Examples**

*Example 1*

Suppose that the useful life (in months) of a device is modeled by the CDF for . Calculated the expected useful of a brand new device. Calculate the variance of the lifetime of such a device.

Note that the survival function is . The following shows the calculation.

Note that the integral for uses the method of substitution.

*Example 2*

Suppose that the lifetime of a machine follows a distribution with the following CDF.

Calculate the mean and variance of the lifetime.

The survival function is . The first is to calculate the first 2 moments.

Note that the integral for is manipulated to be in terms of integrals of exponential density functions while the integral for is manipulated to be in terms of integrals of times exponential density functions (each becoming the mean of that exponential distribution).

*Example 3*

The two-parameter Pareto distribution (Type II Lomax) is discussed in here in a companion blog. Its survival function is

Derive the mean of the Pareto distribution using the survival function approach. What assumption is made on the shape parameter ?

In order for the integral to converge, we need to assume .

The next two examples are left as exercises.

**Practice Problems**

*Practice Problem 1*

The survival function for the distribution of a lifetime of a type of electronic devices is .

Calculate the mean and variance of the lifetime of such devices.

*Practice Problem 2*

The probability that the size of a randomly selected auto collision loss is greater than is .

Calculate the mean and variance of the loss size.

**Answers**

*Practice Problem 1*

*Practice Problem 2*

2017 – Dan Ma