# Variance of a random variable $X$ as a function of the survival function $S(x)$

Suppose $$X$$ is a nonnegative and continuous random variable with a survival function $$S(x)$$. Show that

$$\mathsf{Var}(X)=2\int_0^\infty tS(t) \, dt-\left( \int_0^\infty S(t) \, dt\right)^2$$

Using the fact that

$$f(x) =−\frac{dS(x)}{dx}$$

we have that

\begin{align*} \mathsf{Var}(X) &=\mathsf{E}(X^2)-\mathsf{E}(X)^2\\\\ &=\int_0^\infty t^2 f(t)\,dt-\left(\int_0^ \infty tf(t) \, dt \right)^2 \\\\ &=-\int_0^\infty t^2 \, dS(t)-\left(\int_0^\infty t \, dS(t) \right)^2 \\\\ &=-\left(t^2 S(t)\bigg\rvert_0^\infty-\int_0^\infty 2tS(t) \, dt \right) - \left(tS(t)\bigg\rvert_0^\infty-\int_0^\infty S(t) \, dt \right)^2 \end{align*}

I could get the desired result by showing

$$t^2 S(t) \bigg\rvert_0^\infty = tS(t) \bigg\rvert_0^\infty = 0$$

but how do we know if $$t$$ and $$t^2$$ go to $$\infty$$ slower than $$S(t)$$?

• It may be worth considering the finiteness of the variance in the case of a distibution where $S(t)$ goes to 0 slowly enough that the integrals you look at don't have a finite value (you may want to write improper integrals out as a limit). You may need to make some assumptions about $S$ sufficient to guarantee it has a variance (otherwise the whole exercise is kind of moot), and then see whether under those assumptions the integral converges.. Sep 9, 2019 at 2:48

Your attempt to prove this using integration-by-parts is the wrong approach, and that is what is leading you to require unnecessary conditions. The simpler approach is to express the moments using double-integration, and then use interchange of integrals to get the survival function. For any non-negative continuous random variable $$X$$ you can use the interchange of integrals to write the $$k$$th raw moment as:
\begin{aligned} \mathbb{E}(X^k) = \int \limits_0^\infty t^k f(t) \ dt &= \int \limits_0^\infty \Bigg[ r^k f(t) \Bigg]_{r=0}^{r=t} \ dt \\[6pt] &= \int \limits_0^\infty \int \limits_0^t k r^{k-1} f(t) \ dr \ dt \\[6pt] &= k \int \limits_0^\infty r^{k-1} \int \limits_r^\infty f(t) \ dt \ dr \\[6pt] &= k \int \limits_0^\infty r^{k-1} S(r) \ dr. \\[6pt] \end{aligned}
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 13, "wp-katex-eq": 0, "align": 0, "equation": 1, "x-ck12": 0, "texerror": 0, "url": "https://stats.stackexchange.com/questions/425427/variance-of-a-random-variable-x-as-a-function-of-the-survival-function-sx", "fetch_time": 1702059865000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2023-50/segments/1700679100769.54/warc/CC-MAIN-20231208180539-20231208210539-00314.warc.gz", "warc_record_offset": 583209184, "warc_record_length": 41856, "token_count": 760, "char_count": 2166, "score": 3.609375, "int_score": 4, "crawl": "CC-MAIN-2023-50", "snapshot_type": "latest", "language": "en", "language_score": 0.7409404516220093, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00011-of-00064.parquet"}