Calculating Standard Deviation for a Probability Density Function?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
17 replies · 2K views
Schwarzschild90
Messages
111
Reaction score
1

Homework Statement


Continuous probability.PNG


Homework Equations


See below

The Attempt at a Solution



\begin{align}
\begin{split}
p(x) = C \ x \ exp(-x/ \lambda)
\end{split}
\end{align}

If $p(x)$ is a probability density function on the interval $ 0 \textless x \textless + \infty $ , then it follows that the normalization constant can be isolated by setting the area under the curve equal to one

\begin{align}
\begin{split}
\int_0^\infty p(x) \ dx = 1 \to \\ C \int_0^\infty x \ exp(-x/ \lambda) \ dx = 1 \to \\ C \lambda^2 = 1 \to \\ C = \frac{1}{\lambda^2}
\end{split}
\end{align}

\subsection*{(b)}
The mean $\mu$ (or expection $E(X)$) of X is

\begin{align}
\begin{split}
mean = E(X) = \int_a^b x \ f(x) \ dx = \frac{1}{\lambda^2} \int_0^\infty x^2 \ exp(-x/ \lambda) \ dx = 2 \lambda^3
\end{split}
\end{align}

\subsection*{(c)}
Now, determine the standard deviation $\sigma$ of X

\begin{align}
\begin{split}
\sigma =
\end{split}
\end{align}
 
Physics news on Phys.org
In 3), did you forget the factor C?
Are you stuck on the standard deviation, or did your post just get truncated?
What formulae do you know related to variance and s.d.?
 
  • Like
Likes   Reactions: Schwarzschild90
I imagined that someone could see if what I had already done was correct

I know the following formula for variance: (E(X^2) - mu^2)
 
Schwarzschild90 said:

Homework Statement


View attachment 95542

Homework Equations


See below

The Attempt at a Solution



\begin{align}
\begin{split}
p(x) = C \ x \ exp(-x/ \lambda)
\end{split}
\end{align}

If $p(x)$ is a probability density function on the interval $ 0 \textless x \textless + \infty $ , then it follows that the normalization constant can be isolated by setting the area under the curve equal to one

\begin{align}
\begin{split}
\int_0^\infty p(x) \ dx = 1 \to \\ C \int_0^\infty x \ exp(-x/ \lambda) \ dx = 1 \to \\ C \lambda^2 = 1 \to \\ C = \frac{1}{\lambda^2}
\end{split}
\end{align}

\subsection*{(b)}
The mean $\mu$ (or expection $E(X)$) of X is

\begin{align}
\begin{split}
mean = E(X) = \int_a^b x \ f(x) \ dx = \frac{1}{\lambda^2} \int_0^\infty x^2 \ exp(-x/ \lambda) \ dx = 2 \lambda^3
\end{split}
\end{align}

\subsection*{(c)}
Now, determine the standard deviation $\sigma$ of X

\begin{align}
\begin{split}
\sigma =
\end{split}
\end{align}

Your computation of ##EX## is incorrect.

Hint: check dimensions. If ##X## happened to be a time, ##\lambda## would have dimensions of time also, and so your ##\lambda^3## would have dimensions of ##\text{time}^3## (but should be just 'time').
 
  • Like
Likes   Reactions: Schwarzschild90
I forgot to divide by λ2.

Now, does 2/λ seem reasonable in your eyes?
 
Schwarzschild90 said:
I forgot to divide by λ2.

Now, does 2/λ seem reasonable in your eyes?

Both reasonable and correct, not only in my eyes but absolutely.
 
  • Like
Likes   Reactions: Schwarzschild90
Schwarzschild90 said:
I forgot to divide by λ2.

Now, does 2/λ seem reasonable in your eyes?
Now you seem to have divided by λ4.
If you replace x with λu in the integral you can see you should get a factor λ and an integral independent of λ.
Schwarzschild90 said:
I
I know the following formula for variance: (E(X^2) - mu^2)
So turn that into an integral. You already have μ.
 
  • Like
Likes   Reactions: Schwarzschild90
Ray Vickson said:
Both reasonable and correct, not only in my eyes but absolutely.

Sorry: I am so used to looking at such distributions in the form ##c t e^{-\lambda t}## (that is, with ##\lambda t## instead of ##t/\lambda##) that my brain failed to process the difference in your case. So, NO: you are still not correct.
 
  • Like
Likes   Reactions: Schwarzschild90
Like this? I don't understand why we replace x with lambda u

\begin{align}
\begin{split}
mean = E(X) = \int_a^b x \ f(x) \ dx = \frac{1}{\lambda^2} \int_0^\infty (\lambda u)^2 \ exp(-(\lambda u)/ \lambda) \ dx =
\end{split}
\end{align}
 
Schwarzschild90 said:
Like this? I don't understand why we replace x with lambda u

\begin{align}
\begin{split}
mean = E(X) = \int_a^b x \ f(x) \ dx = \frac{1}{\lambda^2} \int_0^\infty (\lambda u)^2 \ exp(-(\lambda u)/ \lambda) \ dx =
\end{split}
\end{align}
I was just using that to show that the final expression must be linear in lambda.
##\frac{1}{\lambda^2} \int_0^\infty (\lambda u)^2 \ exp(-(\lambda u)/ \lambda) \ d(\lambda u)=\lambda\int_0^\infty u^2e^{-u}.du##. Your first version ended up with a factor λ3 because you forgot the factor C=λ-2, but then somehow you got λ-1, as though you made the correction twice over.
 
  • Like
Likes   Reactions: Schwarzschild90
So, 2\lambda would be correct?
 
Schwarzschild90 said:
So, 2\lambda would be correct?
Yes.
 
  • Like
Likes   Reactions: Schwarzschild90
Will use this formula to calculate the standard deviation
\begin{align}
\begin{split}
\sigma = std(X) =\sqrt{ \int_a^b (x-\mu)^2 \ f(x) \ dx }
\end{split}
\end{align}
 
Schwarzschild90 said:
Will use this formula to calculate the standard deviation
\begin{align}
\begin{split}
\sigma = std(X) =\sqrt{ \int_a^b (x-\mu)^2 \ f(x) \ dx }
\end{split}
\end{align}
Ok, but you might find the form var(X)=E(X2)-E(X)2 more convenient than E((X-E(X))2).
 
I assume sqrt(E(X2)-E(X)2)?
 
Schwarzschild90 said:
I assume sqrt(E(X2)-E(X)2)?
For standard deviation, yes. I was quoting formulae for variance (σ2).
 
  • Like
Likes   Reactions: Schwarzschild90
\begin{align}
\begin{split}
E(X^2) = \frac{1}{\lambda^2} \int_0^\infty x^3 \ exp(-x/ \lambda) \ dx = 6 \lambda^2 \\
\mu^2 = 4\lambda^2 \\
\sigma = std(X) = \sqrt{var(X)} = \sqrt{E(X^2) - \mu^2} = \sqrt{6\lambda^2 - 4\lambda^2}= \sqrt{2\lambda^2} = \sqrt{2}\lambda \\
\end{split}
\end{align}

It seems almost impossible to commit a mistake using the above equation :P, but I've been wrong before
 
Last edited:
Schwarzschild90 said:
\begin{align}
\begin{split}
E(X^2) = \frac{1}{\lambda^2} \int_0^\infty x^3 \ exp(-x/ \lambda) \ dx = 6 \lambda^2 \\
\mu^2 = 4\lambda^2 \\
\sigma = std(X) = \sqrt{var(X)} = \sqrt{E(X^2) - \mu^2} = \sqrt{6\lambda^2 - 4\lambda^2}= \sqrt{2\lambda^2} = \sqrt{2}\lambda \\
\end{split}
\end{align}

It seems almost impossible to commit a mistake using the above equation :P, but I've been wrong before
Looks right.