What is the difference between finite and infinite variance - Cross Validated most recent 30 from stats.stackexchange.com 2019-07-21T15:35:35Z https://stats.stackexchange.com/feeds/question/94402 http://www.creativecommons.org/licenses/by-sa/3.0/rdf https://stats.stackexchange.com/q/94402 31 What is the difference between finite and infinite variance AfterWorkGuinness https://stats.stackexchange.com/users/44105 2014-04-19T22:16:24Z 2018-09-04T17:03:05Z <p>What is the difference between finite and infinite variance ? My stats knowledge is rather basic; Wikipedia / Google wasn't much help here.</p> https://stats.stackexchange.com/questions/94402/-/94410#94410 1 Answer by John Jiang for What is the difference between finite and infinite variance John Jiang https://stats.stackexchange.com/users/40429 2014-04-20T01:21:50Z 2015-06-23T06:10:48Z <p>Most distributions you encounter probably have finite variance. Here is a discrete example $X$ that has infinite variance but finite mean: </p> <p>Let its probability mass function be $p(k) = c/|k|^3$, for $k \in \mathbb{Z} \setminus\{0\}$, $p(0) = 0$, where $c = (2\zeta(3))^{-1} := (2\sum_{k=1}^\infty 1/k^3)^{-1} &lt; \infty$. First of all because $\mathbb{E} \mid X\mid &lt; \infty$ it has finite mean. Also it has infinite variance because $2 \sum_{k=1}^\infty k^2 / |k|^3 = 2\sum_{k=1}^\infty k^{-1} = \infty$. </p> <p>Note: $\zeta(x) :=\sum_{k=1}^\infty k^{-x}$ is the Riemann zeta function. There are many other examples, just not so pleasant to write down.</p> https://stats.stackexchange.com/questions/94402/-/100161#100161 45 Answer by kjetil b halvorsen for What is the difference between finite and infinite variance kjetil b halvorsen https://stats.stackexchange.com/users/11887 2014-05-27T12:04:52Z 2018-09-04T17:03:05Z <p>$\DeclareMathOperator{\E}{E} \DeclareMathOperator{\var}{var}$ What does it mean for a random variable to have "infinite variance"? What does it mean for a random variable to have infinite expectation? The explanation in both cases are rather similar, so let us start with the case of expectation, and then variance after that.</p> <p>Let $X$ be a continuous random variable (RV) (our conclusions will be valid more generally, for the discrete case, replace integral by sum). To simplify exposition, lets assume $X \ge 0$.</p> <p>Its expectation is defined by the integral $$\E X = \int_0^\infty x f(x) \, d x$$ when that integral exists, that is, is finite. Else we say the expectation does not exist. That is an improper integral, and by definition is $$\int_0^\infty x f(x) \, d x = \lim_{a \rightarrow \infty} \int_0^a x f(x) \, d x$$ For that limit to be finite, the contribution from the tail must vanish, that is, we must have $$\lim_{a \rightarrow \infty} \int_a^\infty x f(x) \, d x =0$$ A necessary (but not sufficient) condition for that to be the case is $\lim_{x\rightarrow \infty} x f(x) =0$. What the above displayed condition says, is that, the <strong>contribution to the expectation from the (right) tail must be vanishing</strong>. If so is not the case, the expectation <strong>is dominated by contributions from arbitrarily large realized values</strong>. In practice, that will mean that empirical means will be very unstable, because they <strong>will be dominated by the infrequent very large realized values</strong>. And note that this instability of sample means will not disappear with large samples --- it is a built-in part of the model!</p> <p>In many situations, that seems unrealistic. Lets say an (life) insurance model, so $X$ models some (human) lifetime. We know that, say $X &gt; 1000$ doesn't occur, but in practice we use models without an upper limit. The reason is clear: No <strong>hard</strong> upper limit is known, if a person is (say) 110 years old, there is no reason he cannot live one more year! So a model with a hard upper limit seems artificial. Still, we do not want the extreme upper tail to have much influence.</p> <p>If $X$ has a finite expectation, then we can change the model to have a hard upper limit without undue influence to the model. In situations with a fuzzy upper limit that seems good. If the model have infinite expectation, then, any hard upper limit we introduce to the model will have dramatic consequences! That is the real importance of infinite expectation. </p> <p><strong>With finite expectation, we can be fuzzy about upper limits. With infinite expectation, we cannot</strong>.</p> <p>Now, much the same can be said about infinite variance, mutatis mutandi.</p> <p>To make clearer, let us see at an example. For the example we use the Pareto distribution, implemented in the R package (on CRAN) actuar as pareto1 --- single-parameter Pareto distribution also known as Pareto type 1 distribution. It has probability density function given by $$f(x) = \begin{cases} \frac{\alpha m^\alpha}{x^{\alpha+1}} &amp;, x\ge m \\ 0 &amp;, x&lt;m \end{cases}$$ for some parameters $m&gt;0, \alpha&gt;0$. When $\alpha &gt; 1$ the expectation exists and is given by $\frac{\alpha}{\alpha-1}\cdot m$. When $\alpha \le 1$ the expectation do not exist, or as we say, it is infinite, because the integral defining it diverges to infinity. We can define the <strong>First moment distribution</strong> (see the post <a href="https://stats.stackexchange.com/questions/137931/when-would-we-use-tantiles-and-the-medial-rather-than-quantiles-and-the-median">When would we use tantiles and the medial, rather than quantiles and the median?</a> for some information and references) as $$E(M) = \int_m^M x f(x) \, d x = \frac{\alpha}{\alpha-1} \left( m - \frac{m^\alpha}{M^{\alpha-1}} \right)$$ ( this exists without regard to if the expectation itself exists). (Later edit: I invented the name "first moment distribution, later I learned this is related to what is "officially" names <em>partial moments</em>).</p> <p>When the expectation exists ($\alpha&gt; 1$) we can divide by it to get the relative first moment distribution, given by $$Er(M) = E(m)/E(\infty) = 1-\left(\frac{m}{M}\right)^{\alpha-1}$$ When $\alpha$ is just a little bit larger than one, so the expectation "just barely exists", the integral defining the expectation will converge slowly. Let us look at the example with $m=1, \alpha=1.2$. Let us plot then $Er(M)$ with the help of R:</p> <pre><code>### Function for opening new plot file: open_png &lt;- function(filename) png(filename=filename, type="cairo-png") library(actuar) # from CRAN ### Code for Pareto type I distribution: # First plotting density and "graphical moments" using ideas from http://www.quantdec.com/envstats/notes/class_06/properties.htm and used some times at cross validated m &lt;- 1.0 alpha &lt;- 1.2 # Expectation: E &lt;- m * (alpha/(alpha-1)) # upper limit for plots: upper &lt;- qpareto1(0.99, alpha, m) # open_png("first_moment_dist1.png") Er &lt;- function(M, m, alpha) 1.0 - (m/M)^(alpha-1.0) ### Inverse relative first moment distribution function, giving # what we may call "expectation quantiles": Er_inv &lt;- function(eq, m, alpha) m*exp(log(1.0-eq)/(1-alpha)) plot(function(M) Er(M, m, alpha), from=1.0, to=upper) plot(function(M) ppareto1(M, alpha, m), from=1.0, to=upper, add=TRUE, col="red") dev.off() </code></pre> <p>which produces this plot:</p> <p><a href="https://i.stack.imgur.com/AVw3o.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AVw3o.png" alt="enter image description here"></a></p> <p>For example, from this plot you can read that about 50% of the contribution to the expectation come from observations above around 40. Given that the expectation $\mu$ of this distribution is 6, that is astounding! (this distribution do not have existing variance. For that we need $\alpha &gt; 2$). </p> <p>The function Er_inv defined above is the inverse relative first moment distribution, an analogue to the quantile function. We have:</p> <pre><code>&gt; ### What this plot shows very clearly is that most of the contribution to the expectation come from the very extreme right tail! # Example eq &lt;- Er_inv(0.5, m, alpha) ppareto1(eq, alpha, m) eq &gt; &gt; &gt;  0.984375 &gt;  32 &gt; </code></pre> <p>This shows that 50% of the contributions to the expectation comes from the upper 1.5% tail of the distribution! So, especially in small samples where there is a high probability that the extreme tail is not represented, the arithmetic mean, while still being an unbiased estimator of the expectation $\mu$, must have a very skew distribution. We will investigate this by simulation: First we use a sample size $n=5$.</p> <pre><code>set.seed(1234) n &lt;- 5 N &lt;- 10000000 # Number of simulation replicas means &lt;- replicate(N, mean(rpareto1(n, alpha, m) )) &gt; mean(means)  5.846645 &gt; median(means)  2.658925 &gt; min(means)  1.014836 &gt; max(means)  633004.5 length(means[means &lt;=100])  9970136 </code></pre> <p>To get a readable plot we only show the histogram for the part of the sample with values below 100, which is a very large part of the sample.</p> <pre><code>open_png("mean_sim_hist1.png") hist(means[means&lt;=100], breaks=100, probability=TRUE) dev.off() </code></pre> <p><a href="https://i.stack.imgur.com/lSjUk.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lSjUk.png" alt="enter image description here"></a></p> <p>The distribution of the arithmetical means is very skew, </p> <pre><code>&gt; sum(means &lt;= 6)/N  0.8596413 &gt; </code></pre> <p>almost 86% of the empirical means are less or equal than the theoretical mean, the expectation. <strong>That is what we should expect, since most of the contribution to the mean comes from the extreme upper tail, which is unrepresented in most samples</strong>.</p> <p>We need to go back to reassess our earlier conclusion. While the existence of the mean makes it possible to be fuzzy about upper limits, we see that <strong>when "the mean just barely exists", meaning that the integral is slowly convergent, we cannot really be that fuzzy about upper limits</strong>. <strong>Slowly convergent integrals has the consequence that it might be better to use methods that do not assume that the expectation exists</strong>. When the integral is very slowly converging, it is in practice as if it didn't converge at all. The practical benefits that follow from an convergent integral is a chimera in the slowly convergent case! That is one way to understand N N Taleb's conclusion in <a href="http://fooledbyrandomness.com/complexityAugust-06.pdf" rel="noreferrer">http://fooledbyrandomness.com/complexityAugust-06.pdf</a></p> https://stats.stackexchange.com/questions/94402/-/171781#171781 2 Answer by Aksakal for What is the difference between finite and infinite variance Aksakal https://stats.stackexchange.com/users/36041 2015-09-09T19:25:22Z 2015-09-09T19:25:22Z <p>Variance is the measure of dispersion of the distribution of values of a random variable. It's not the only such measure, e.g. mean absolute deviation is one of alternatives.</p> <p>The infinite variance means that random values don't tend to concentrate around the mean <em>too tightly</em>. It could mean that there's <em>large enough</em> probability that the next random number will be <em>very</em> far away from the mean.</p> <p>The distributions like Normal (Gaussian) can produce random numbers very far away from the mean, but the probability of such events decrease <em>very rapidly</em> with magnitude of the deviation.</p> <p>In that regard when you look at the plot of Cauchy distribution or a Gaussian (normal) distribution, they don't look very different visually. However, if you try to compute the variance of the Cauchy distribution it'll be infinite, while Gaussian's is finite. So, normal distribution is more tight around its mean compared to Cauchy's.</p> <p>Btw, if you talk to mathematicians, they'll insist that Cauchy distribution doesn't have a well defined mean, that it's infinite. This sounds ridiculous to physicists who'd point out to the fact that Cauchy's symmetrical, hence, it's bound to have a mean. In this case they'd argue the problem is with your definition of mean, not with the Cauchy's distribution.</p> https://stats.stackexchange.com/questions/94402/-/365385#365385 2 Answer by Martijn Weterings for What is the difference between finite and infinite variance Martijn Weterings https://stats.stackexchange.com/users/164061 2018-09-04T16:32:59Z 2018-09-04T16:51:17Z <p>An alternative way to look at is by the quantile function. </p> <p>$$Q(F(x)) = x$$</p> <p>Then we can compute a moment or expectation </p> <p>$$E(T(x)) = \int_{-\infty}^\infty T(x) f(x) dx\\$$</p> <p>alternatively as (replacing $f(x)dx = dF$):</p> <p>$$E(T(x)) = \int_{0}^1 T(Q(F)) dF \\$$</p> <p>Say we wish to compute the first moment then $T(x) = x$. In the image below this corresponds to the area between F and the <em>vertical</em> line at $x=0$ (where the area on the left side may count as negative when $T(x)&lt;0$). The second moment would correspond to the volume that the same area sweeps when it is rotated along the line at $x=0$ (with a factor $\pi$ difference).</p> <p><a href="https://i.stack.imgur.com/9P0OL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9P0OL.png" alt="Cauchy versus Normal"></a></p> <p>The curves in the image show how much each quantile contributes in the computation. </p> <p>For the normal curve there are only very few quantiles with a large contribution. But for the Cauchy curve there are many more quantiles with a large contribution. If the curve $T(Q(F))$ goes sufficiently fast enough to infinity when F approaches zero or one, then the area can be infinite.</p> <p>This infinity may not be so strange since the integrand itself distance (mean) or squared distance (variance) can become infinite. It is only a question how much <em>weight</em>, how much percent of F, those infinite tails have.</p> <p>In the summation/integration of distance from zero (mean) or squared distance from the mean (variance) a single point that is very far away will have more influence on the average distance (or squared distance) than a lot of points nearby.</p> <p>Thus when we move towards infinity the density may decrease, but the influence on the sum of some (increasing) quantity, e.g. distance or squared distance does not necessarily change.</p> <p>If for each amount of mass at some distance $x$ there is half or more mass at a distance $\sqrt{2}x$ then you will get that the sum of total mass $\sum \frac{1}{2^n}$ will converge because the contribution of mass decreases, but the variance becomes infinite since that contribution does not decrease $\sum ((\sqrt{2}x)^n)^2 \frac{1}{2^n} \to \infty$</p>