Variance of a function which has diverging <x^2>

In summary: continuum), but the concept of variance can still be useful for other problems where the mean does not exist.
  • #1
Natchanon
31
3
Homework Statement
I'm given a probability density function p(x) = (1/pi)(1/(x^2+1)) and asked to find its variance.
Relevant Equations
<x> = integral from -inf to inf of x / pi(x^2+1) dx
<x^2> = integral from -inf to inf of (x^2) / pi(x^2+1) dx
variance = <x^2> - <x>^2
I found that <x> of p(x) = 1/π(x2 + 1) is 0. But its <x^2> diverges. I don't know if there are other ways of interpreting it besides saying that the variance is infinity. I usually don't see variance being infinity, so I'm not sure if my answer is correct. So, can variance be infinity? And does its being infinity in this problem make sense?

Thanks
 
Last edited:
Physics news on Phys.org
  • #2
Natchanon said:
Homework Statement: I'm given a probability density function p(x) = (1/pi)(1/(x^2+1)) and asked to find its variance.
Homework Equations: <x> = integral from -inf to inf of x / pi(x^2+1) dx
<x^2> = integral from -inf to inf of (x^2) / pi(x^2+1) dx
variance = <x^2> - <x>^2

I found that <x> of p(x) = 1/π(x2 + 1) is 0. But its <x^2> diverges. I don't know if there are other ways of interpreting it besides saying that the variance is infinity. I usually don't see variance being infinity, so I'm not sure if my answer is correct. So, can variance be infinity? And does its being infinity in this problem make sense?

Thanks
Edit: The distribution seems part of the Cauchy family : https://en.wikipedia.org/wiki/Cauchy_distribution with parameters ## x_0=0 , \gamma =1 ## for which neither mean nor variance converges.
 
Last edited:
  • Like
Likes scottdave
  • #3
Natchanon said:
I found that <x> of p(x) = 1/π(x2 + 1) is 0. But its <x^2> diverges...

How did you find ##E\big[X\big] = 0##?
 
  • #4
First show that ##E[X]=0##. Given that, we have:

\begin{align*}\textrm{Var}(X) = E[X^2]&=\int_{-\infty}^\infty x^2p(x)\,dx
= \frac1\pi \int_{-\infty}^\infty \frac{x^2}{x^2+1}\,dx\\&
= \frac1\pi \int_{-\infty}^\infty \left(1 - \frac{1}{x^2+1}\right)dx
= \frac1\pi \left(\int_{-\infty}^\infty dx - \int_{-\infty}^\infty\frac{dx}{x^2+1}\right)
\end{align*}
Since the second integral converges and the first does not, we conclude the integral does not converge, so the variance does not exist.

Intuitively, that means that the distribution is too spread out for its squared deviation from zero to have a mean.

EDIT: I suppose whether we feel justified in saying ##E[X]=0## depends on whether we require the improper integral
$$\int_{-\infty}^\infty \frac{x\,dx}{1+x^2}$$
to be interpreted as
$$\lim_{a\to\infty}\lim_{b\to\infty} \int_{-a}^b \frac{x\,dx}{1+x^2}$$
or whether we allow it to be
$$\lim_{a\to\infty}\int_{-a}^a \frac{x\,dx}{1+x^2}$$
in which case the integral can be said to converge and the mean is zero.

I think that the former is the usual interpretation, in which case we are forced to say there is no mean. But the latter seems more reasonable to me.

EDIT 2: Man this system plays some nasty tricks when a response is posted while one is editing a previous response! As soon as the new post (not my post) appears, it irreversibly converts in-line latex to maths characters. It did that to me about three times and iu was totally confused until I worked out what was happening. One more reason to prepare posts off-line and then cut and paste them in (after changing $ to ##), I suppose.
 
Last edited:
  • Like
Likes scottdave
  • #5
StoneTemplePython said:
How did you find ##E\big[X\big] = 0##?
So, the integral of x/(x^(2)+1).
Let u = x^(2) + 1 => du = 2x dx => du/2 = x dx, and substitute
changing limits : for x = inf => u = inf ; for x = -inf => u = inf.
We have same upper and lower limits, therefore the integral = 0.
 
  • #6
andrewkirk said:
First show that ##E[X]=0##. Given that...

Natchanon said:
So, the integral of x/(x^(2)+1).
Let u = x^(2) + 1 => du = 2x dx => du/2 = x dx, and substitute
changing limits : for x = inf => u = inf ; for x = -inf => u = inf.
We have same upper and lower limits, therefore the integral = 0.

ummmm...

the issue is that for ##x \in (1, \infty)## we have the point-wise bound

## \frac{1}{2x} \leq \frac{1}{x +\frac{1}{x}} = \frac{x}{x} \cdot \frac{1}{x +\frac{1}{x}} = \frac{x}{x^2 +1}##

which tells us that
##\infty = \frac{1}{2\pi}\int_1^\infty \frac{1}{x}dx \leq \frac{1}{\pi}\int_1^\infty \frac{x}{x^2 + 1}dx = \int_1^\infty \frac{x}{\pi(x^2 + 1)}dx \leq \int_0^\infty \frac{x}{\pi(x^2 + 1)}dx ##

if these inequalities don't make sense, then consider a gut-check from wolfram:
https://www.wolframalpha.com/input/?i=integral+from+1+to+infinity+of+x/(x^2++1)

so
##\int_{-\infty}^\infty \frac{x}{\pi(x^2 + 1)}dx = -\infty + \infty \neq 0##
I underlined the flaw in your response, where you said "We have same upper and lower limits, therefore the integral = 0." In analysis you are not allowed to say ##\infty - \infty = 0##. People go berserk when you do that. If you want to argue that something is zero by symmetry, you first need to deal with convergence issues.

put in different form: in probability we say the first moment ##E\Big[X\Big]## exists iff
##E\Big[\big \vert X\big \vert \Big] \lt \infty##
but
##E\Big[\big \vert X\big \vert \Big] = 2\int_0^\infty \frac{x}{\pi(x^2 + 1)}dx = \infty##

so the first moment doesn't exist which implies variances is not a well defined concept

in this case saying the variance is infinite is technically wrong since the mean does not exist (not even on the extended real line).
 
  • #7
andrewkirk said:
First show that ##E[X]=0##. Given that, we have:
\begin{align*}\textrm{Var}(X) = E[X^2]&=\int_{-\infty}^\infty x^2p(x)\,dx
= \frac1\pi \int_{-\infty}^\infty \frac{x^2}{x^2+1}\,dx\\&
= \frac1\pi \int_{-\infty}^\infty \left(1 - \frac{1}{x^2+1}\right)dx
= \frac1\pi \left(\int_{-\infty}^\infty dx - \int_{-\infty}^\infty\frac{dx}{x^2+1}\right)
\end{align*}

Since the second integral converges and the first does not, we conclude the integral does not converge, so the variance does not exist.

Intuitively, that means that the distribution is too spread out for its squared deviation from zero to have a mean.
\frac1\pi ∫
andrewkirk said:
First show that ##E[X]=0##. Given that, we have:

\begin{align*}\textrm{Var}(X) = E[X^2]&=\int_{-\infty}^\infty x^2p(x)\,dx
= \frac1\pi \int_{-\infty}^\infty \frac{x^2}{x^2+1}\,dx\\&
= \frac1\pi \int_{-\infty}^\infty \left(1 - \frac{1}{x^2+1}\right)dx
= \frac1\pi \left(\int_{-\infty}^\infty dx - \int_{-\infty}^\infty\frac{dx}{x^2+1}\right)
\end{align*}
Since the second integral converges and the first does not, we conclude the integral does not converge, so the variance does not exist.

Intuitively, that means that the distribution is too spread out for its squared deviation from zero to have a mean.

EDIT: I suppose whether we feel justified in saying ##E[X]=0## depends on whether we require the improper integral
$$\int_{-\infty}^\infty \frac{x\,dx}{1+x^2}$$
to be interpreted as
$$\lim_{a\to\infty}\lim_{b\to\infty} \int_{-a}^b \frac{x\,dx}{1+x^2}$$
or whether we allow it to be
$$\lim_{a\to\infty}\int_{-a}^a \frac{x\,dx}{1+x^2}$$
in which case the integral can be said to converge and the mean is zero.

I think that the former is the usual interpretation, in which case we are forced to say there is no mean. But the latter seems more reasonable to me.
So if the mean is 0, but <x^2> diverges, what can we say about the variance? Also, the problem directly states that this is a "Lorentz distribution", does this help me decide whether to say that the mean is 0 or that there is no mean?
 
  • #8
Natchanon said:
Homework Statement: I'm given a probability density function p(x) = (1/pi)(1/(x^2+1)) and asked to find its variance.
Homework Equations: <x> = integral from -inf to inf of x / pi(x^2+1) dx
<x^2> = integral from -inf to inf of (x^2) / pi(x^2+1) dx
variance = <x^2> - <x>^2

I found that <x> of p(x) = 1/π(x2 + 1) is 0. But its <x^2> diverges. I don't know if there are other ways of interpreting it besides saying that the variance is infinity. I usually don't see variance being infinity, so I'm not sure if my answer is correct. So, can variance be infinity? And does its being infinity in this problem make sense?

Thanks
Please use hashmarks before and after Latex for the system to render , to make it more readable. e.g., instead of x^2/pi(x^2+1) use \frac {x^2}{\pi(x^2+1} surrounded by them, so it will render as :
##\frac {x^2}{\pi(x^2+1)} ##
These are ##'s
Before and after math Latex
 
  • #9
Natchanon said:
whether to say that the mean is 0 or that there is no mean?
For the response to a question in class, I'd suggest saying there is no mean, as that's in accordance with the strict definition of improper integral ( at least the one I'm familiar with).
There is a sort of 'pragmatic mean' of zero, obtained by slightly loosening the definition of the improper integral, and that will be useful for some purposes to which one puts means, but perhaps not for others (eg Central Limit Theorem, various Laws of Large Numbers).

But the question is about the variance not the mean, and the variance doesn't exist, no matter how flexible one wants to be in the interpretation of technical terms. The distribution is simply too dispersed. Since it is not strictly meaningful to say 'the variance is infinity' even where the mean exists, but we all know what is meant, I don't think it is any less meaningful to say here that 'the variance is infinity', even though the mean does not strictly exist. But in answer to a class question, I'd say 'the variance does not exist', not 'the variance is infinity'.
 
  • #10
Natchanon said:
\frac1\pi ∫

So if the mean is 0, but <x^2> diverges, what can we say about the variance? Also, the problem directly states that this is a "Lorentz distribution", does this help me decide whether to say that the mean is 0 or that there is no mean?
EDIT: No, the mean is not 0. Notice we have to deal with issues of convergence of the integral, as Python said. Notice the FTC assumes a bounded interval [a,b] and you cannot then just sub-in ## \pm \infty##.
 
Last edited:
  • #11
andrewkirk said:
For the response to a question in class, I'd suggest saying there is no mean, as that's in accordance with the strict definition of improper integral ( at least the one I'm familiar with).
There is a sort of 'pragmatic mean' of zero, obtained by slightly loosening the definition of the improper integral, and that will be useful for some purposes to which one puts means, but perhaps not for others (eg Central Limit Theorem, various Laws of Large Numbers).

But the question is about the variance not the mean, and the variance doesn't exist, no matter how flexible one wants to be in the interpretation of technical terms. The distribution is simply too dispersed. Since it is not strictly meaningful to say 'the variance is infinity' even where the mean exists, but we all know what is meant, I don't think it is any less meaningful to say here that 'the variance is infinity', even though the mean does not strictly exist. But in answer to a class question, I'd say 'the variance does not exist', not 'the variance is infinity'.
The problem is actually split into 3 parts: a) it asks if this distribution is normalized, which it is, b) find the mean and c) find the variance. I calculated the mean both by hands and by using integral calculator, 0 is the result. I suppose the calculator loosens the definition of the improper integral as you said, and I unknowingly did too. So if part b) is zero, but c) doesn't have a numerical answer, can we say that both the mean and the variance are undefined? It doesn't make sense to have a mean without a variance.
 
  • #12
Natchanon said:
It doesn't make sense to have a mean without a variance.

also not true in general

consider a random variable ##X## with discrete probability distribution, whose probability mass is given by
##p(n) = c \cdot \frac{1}{n^2(n-1)}##

for all natural numbers ##n \geq 2##
where ##c## is a normalizing constant given by
##c= \big(2 -\frac{\pi^2}{6}\big)^{-1}##

in this case
##E\big[X \big] = \sum_{n=2}^\infty c \cdot \frac{n}{n^2(n-1)} = c \cdot \sum_{n=2}^\infty \frac{1}{n(n-1)} = c ##

but
##E\big[X^2\big] = \sum_{n=2}^\infty c \cdot \frac{n^2}{n^2(n-1)} = c \cdot \sum_{n=2}^\infty \frac{1}{(n-1)} = \infty ##

so you have a perfectly fine mean and variance doesn't exist
(or in this case people may use the extended real line and say the variance is infinite)
 
  • #13
StoneTemplePython said:
also not true in general

consider a random variable ##X## with discrete probability distribution, whose probability mass is given by
##p(n) = c \cdot \frac{1}{n^2(n-1)}##

for all natural numbers ##n \geq 2##
where ##c## is a normalizing constant given by
##c= \big(2 -\frac{\pi^2}{6}\big)^{-1}##

in this case
##E\big[X \big] = \sum_{n=2}^\infty c \cdot \frac{n}{n^2(n-1)} = c \cdot \sum_{n=2}^\infty \frac{1}{n(n-1)} = c ##

but
##E\big[X^2\big] = \sum_{n=2}^\infty c \cdot \frac{n^2}{n^2(n-1)} = c \cdot \sum_{n=2}^\infty \frac{1}{(n-1)} = \infty ##

so you have a perfectly fine mean and variance doesn't exist
(or in this case people may use the extended real line and say the variance is infinite)
So if we find the variance of a distribution to be infinity, it is equally valid to say that the variance is either infinity or doesn't exist? Are there cases where we should interpret it as being infinity, and not say that it doesn't exist, and vice versa?
 
  • #14
Natchanon said:
Are there cases where we should interpret it as being infinity, and not say that it doesn't exist, and vice versa?

The short answer is yes but you need to be fairly sophisticated to not do it wrongly and when people actually do it is in part a matter of taste. It is extremely common when using real non-negative random variables to consider including ##\infty## as a formal symbol (e.g. when talking about time until ___ in some kind of random walk).

Natchanon said:
So if we find the variance of a distribution to be infinity, it is equally valid to say that the variance is either infinity or doesn't exist?

It's smart for now to just say that if the expected value of something is ##\infty## then it doesn't exist on the real line. And leave it at that. You will never get into trouble with that.

In the back of your mind you should know that sometimes people extend the real line to include ##\infty## as a formal symbol. But if you ever find yourself doing something like ##\infty - \infty## then alarm bells should go off and you got to get the eraser out. Again, the safer approach is to stick with the regular real line and just say something that is not finite doesn't exist on the real line and then you're done.
 
  • Like
Likes jim mcnamara
  • #15
A good point to think about is why not use 0, the principal value of the mean, as our choice of pop mean.
 

What is the definition of variance?

Variance is a measure of how spread out a set of data is. It measures how far each data point is from the mean of the data set.

How is variance calculated?

Variance is calculated by taking the sum of the squared differences between each data point and the mean, and then dividing by the total number of data points. This value is also known as the mean squared deviation.

What is the significance of a function having a diverging ?

A function that has a diverging is one that has an infinite variance. This means that the data points are extremely spread out and there is no clear central tendency.

How does a large variance affect the interpretation of data?

A large variance indicates that the data is highly spread out and there is a lot of variability. This can make it difficult to draw conclusions or make predictions based on the data.

Can the variance of a function with a diverging be reduced?

No, the variance of a function with a diverging cannot be reduced. This is because the data points are extremely spread out and there is no clear central tendency to the data set.

Similar threads

  • Calculus and Beyond Homework Help
Replies
8
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
783
Replies
7
Views
828
  • Calculus and Beyond Homework Help
Replies
9
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
898
  • Calculus and Beyond Homework Help
Replies
10
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
Back
Top