Finding the Mean and Variance from PDF A random variable $n$ can be represented by its PDF
$$p(n) = \frac{(\theta - 1) y^{\theta-1} n}{ (n^2 + y^2)^{(\theta+1)/2}}.$$
$\theta$ is a positive integer and $y$ is a positive parameter. If $\theta=4$ how to you find the mean and variance?
My guess was to plug in $4$ of course and then integrate that function from $0$ to infinity. As for the variance I honestly have no clue. I have not taken statistics in a while so I admit I am a bit rusty. Any clues/help is appreciated. Thanks!
 A: In case you get stuck computing the integrals referred to in the above post, here is an automated way to proceed. Given random variable $N$ has pdf $f(n)$:

The density is well-defined provided $\theta>1$. The mean $E_f[N]$ is:

and the variance of $N$ is:

where I am using the Expect and Var functions from the the mathStatica package for Mathematica to automate the nitty-gritties. 
In the case of $\theta = 4$, the above results simplify to $E[N] = y$ and $Var(N) = y^2$.
A: I'll give you a few hints that will allow you to compute the mean and variance from your pdf.
First of all, remember that the expected value of a univariate continuous random variable $E[X]$ is defined as $E[X] = \int_{-\infty}^{\infty}{x f(x) dx}$ as explained here, where the range of the integral corresponds to the sample space or support (say, $(-\infty, \infty)$ for a Gaussian distribution, $(0, \infty)$ for an exponential distribution).
Second, the mean of the random variable is simply it's expected value: $\mu = E[X] = \int_{-\infty}^{\infty}{x f(x) dx}$. It looks like you already covered that.
Third, the definition of the variance of a continuous random variable $Var(X)$ is $Var(X) = E[(X-\mu)^2] = \int_{-\infty}^{\infty}{(x-\mu)^2 f(x) dx}$, as detailed here. Again, you only need to solve for the integral in the support. Alternatively, it is sometimes easier to rely on the equivalent expression $Var(X) = E[(X-\mu)^2] = E[X^2] - (E[X])^2$, where the first term is $E[X^2] = \int_{-\infty}^{\infty}{x^2 f(x) dx}$ (see the definition of the expectation in the second paragraph) and the second term is $(E[X])^2 = \mu^2$.
Finally, you don't need to pick an arbitrary value for the parameter $\theta$ and plug it in the pdf. You can solve for the mean and the variance anyway. See, for example, mean and variance for a binomial (use summation instead of integrals for discrete random variables).
If you can't solve this after reading this, please edit your question showing us where you got stuck.
