Mean and variance of a cosine function

iocal

Junior Member
Joined
Jun 30, 2013
Messages
68
Hi guys, as the title suggests I am a lizzle puzzled here.
The exercise asks me to prove that the variance of a cosine function is 1/2 and that also requires calculating the expected value.
I think I am getting the limits of integration wrong. What I am trying is [0,2π]. Any help is greatly appreciated, thanks!
 
\(\displaystyle \displaystyle \mu =\dfrac{1}{2\pi} \int_0^{2\pi} \cos{\theta}\ d\theta \)

\(\displaystyle \displaystyle \mathrm{V}[\theta] = \dfrac{1}{2\pi} \int_0^{2\pi} \cos^2{\theta}\ d\theta - \mu^2\)....that is, mean of square minus mean squared

You should be able to justify your result for \(\displaystyle \mu\) by looking at a graph of the cosine.

I am not familiar with your method. I simply tried to do it like that ∫xcosx dx .Integrate by parts to get 0 which seems quite reasonable looking at the graph.

Then for the variance ∫x^2cosx dx , the mean being zero. But the problem is that I got the variance to be equal to 4π evaluating the integral over [0,2π]. Any thoughts?
 
Last edited:
I am not familiar with your method. I simply tried to do it like that ∫xcosx dx .Integrate by parts to get 0 which seems quite reasonable looking at the graph.

Then for the variance ∫x^2cosx dx , the mean being zero. But the problem is that I got the variance to be equal to 4π evaluating the integral over [0,2π]. Any thoughts?
My previous post was completely off the wall! Sorry about that - please ignore that post.

OK. The cosine distribution is limited from -pi/2 to +pi/2, because negative frequencies are meaningless. The normalization factor is
\(\displaystyle \displaystyle \int_{-\pi/2}^{\pi/2} \cos{x}\ dx = \sin{x}\mid_{-\pi/2}^{\pi/2}\ = 2 \)

First moment of x = \(\displaystyle \displaystyle \dfrac{1}{2}\int_{-\pi/2}^{\pi/2}x\ \cos{x}\ dx = 0\)...because it is an odd function

Second moment = \(\displaystyle \displaystyle \dfrac{1}{2}\int_{-\pi/2}^{\pi/2}x^2\ \cos{x}\ dx = \int_0^{\pi/2}x^2\ \cos{x}\ dx\)

With the different limits, I seem to come up with \(\displaystyle [(\pi/2)^2 - 2]\).

Makes me wonder how they define the cosine distribution. Could it be
\(\displaystyle f(x) = \frac{\pi}{4}\ \cos\left( \frac{\pi}{2}x \right)\),...for \(\displaystyle -1 \leq x \leq 1\) ?
 
My previous post was completely off the wall! Sorry about that - please ignore that post.

OK. The cosine distribution is limited from -pi/2 to +pi/2, because negative frequencies are meaningless. The normalization factor is
\(\displaystyle \displaystyle \int_{-\pi/2}^{\pi/2} \cos{x}\ dx = \sin{x}\mid_{-\pi/2}^{\pi/2}\ = 2 \)

First moment of x = \(\displaystyle \displaystyle \dfrac{1}{2}\int_{-\pi/2}^{\pi/2}x\ \cos{x}\ dx = 0\)...because it is an odd function

Second moment = \(\displaystyle \displaystyle \dfrac{1}{2}\int_{-\pi/2}^{\pi/2}x^2\ \cos{x}\ dx = \int_0^{\pi/2}x^2\ \cos{x}\ dx\)

With the different limits, I seem to come up with \(\displaystyle [(\pi/2)^2 - 2]\).

Makes me wonder how they define the cosine distribution. Could it be
\(\displaystyle f(x) = \frac{\pi}{4}\ \cos\left( \frac{\pi}{2}x \right)\),...for \(\displaystyle -1 \leq x \leq 1\) ?

Doesn't explain much but if it helps the context is the periodogram of a function. In any case thanks a lot.
 
But why do you use the scaling factor 1/2 in the integral? I have not seen that before.
 
But why do you use the scaling factor 1/2 in the integral? I have not seen that before.
The distribution function f(x) has to integrate to unity. Since the integral of cosx is 2, the normalization factor is 1/2.
 
The distribution function f(x) has to integrate to unity. Since the integral of cosx is 2, the normalization factor is 1/2.

Got you. By the way if you have a good advanced calculus book to suggest please pm me.
 
Top