2
$\begingroup$

So for example, if I had to find $E(\sum_1^n\log(X_i))$ would this be equal to $\sum_1^nE(\log(X_i))$ and then do I proceed from there?

By the way, $X_1, X_2, ...,X_n $ is a random sample from the distribution with probability density function $ f(x)=\theta x^{\theta-1}$, $0<x<1, \theta>0$, just in case anyone wanted to know!

$\endgroup$

3 Answers 3

2
$\begingroup$

That's right. The reason is that expectation is linear:

$$E[a_1X_1 + ... + a_nX_n] = a_1E[X_1] + ... + a_nE[X_n]$$

This holds for any random variables $X_1, ..., X_n$ (They don't have to be independent or identically distributed) and any finite constants $a_1, ..., a_n$, if all the expectations exist

However, if we consider an infinite sum of random variables and constants, linearity might not hold.


Next:

$$E[\log(X_i)] = \int_{\mathbb R} \log(x_i)f_{X_i}(x_i)dx_i $$

$$ = \int_{\mathbb R} \log(x_i) \theta x_i^{\theta-1}dx_i $$

$$ = \int_{0}^{1} \log(x_i) \theta x_i^{\theta-1}dx_i $$

Do you know how to evaluate

$$\int \log(x_i) x_i^{\theta-1}dx_i$$

?

$\endgroup$
3
  • 1
    $\begingroup$ Yes, I've used integration by parts to obtain $-\frac{1}{\theta^2}$ and my final answer is therefore $-\frac{n}{\theta}$ right? $\endgroup$
    – Kim
    Commented Dec 5, 2015 at 15:18
  • $\begingroup$ @Kim yeah $\endgroup$
    – BCLC
    Commented Dec 5, 2015 at 15:22
  • 1
    $\begingroup$ Almost right. Expectation is linear if the expectations exist. However, in the unusual case where terms are not independent and can have infinite expectation it might not work. For instance, let $X_1$ be the e to the power of a Cauchy random variable, and $X_2 = 1/X_1$. Then the expectations of the logs are infinite so $\sum E(\log(X_i)) = \infty-\infty$ which is indeterminant, but $\log(X_1)+\log(X_2) = 0$ so that $E(\sum \log(X_i)) = 0$. I know, this is picky. :) $\endgroup$
    – AlaskaRon
    Commented Dec 6, 2015 at 1:57
0
$\begingroup$

I found a case where it works and a case where it doesn't.

X <- matrix(rep((1:9/9),3), 3,3)
X
          [,1]      [,2]      [,3]
[1,] 0.1111111 0.4444444 0.7777778
[2,] 0.2222222 0.5555556 0.8888889
[3,] 0.3333333 0.6666667 1.0000000

mean(colSums(log(X)))
[1] -2.324398

sum(colMeans(log(X)))
[1] -2.324398

Here is my attempt to show mathematically. I am going to assume n is the length of each sample X in this case.

\begin{align} E\bigg(\sum^n_1 \log(X_i)\bigg) &= \frac{\sum^n_1 \log(X_1) + \sum^n_1 \log(X_2) + ... \sum^n_1 \log(X_n)}{n} \\[10pt] \sum^n_1 E\big(\log(X_i)\big) &= \sum^n_1 \frac{\sum^n_1 \log(X_1)}{n} + \frac{\sum^n_1 \log(X_2)}{n} + ... \frac{\sum^n_1 \log(X_n)}{n} \\[10pt] &= \frac{\sum^n_1 \log(X_1) + \sum^n_1 \log(X_2) + ... \sum^n_1 \log(X_n)}{n} \end{align}

If the size of $X$ is different they would not be equal.

> X <- matrix(rep((1:12/12),4), 4,3)
> X
           [,1]      [,2]      [,3]
[1,] 0.08333333 0.4166667 0.7500000
[2,] 0.16666667 0.5000000 0.8333333
[3,] 0.25000000 0.5833333 0.9166667
[4,] 0.33333333 0.6666667 1.0000000
> sum(colMeans(log(X)))
[1] -2.457916
> mean(colSums(log(X)))
[1] -3.277222

\begin{align} \sum^n_1 E(\log(X_i)) &= \sum^n_1 \frac{\sum^n_1 \log(X_1)}{k} + \frac{\sum^n_1 \log(X_2)}{k} + ... \frac{\sum^n_1 \log(X_n)}{k} \\[10pt] &= \frac{\sum^n_1 \log(X_1) + \sum^n_1 \log(X_2) + ... \sum^n_1 \log(X_n)}{k} \end{align} where $k$ is the length of each $X$ and $k \ne n$.

$\endgroup$
1
  • $\begingroup$ Welcome to the site, @MattL.. I took the liberty of editing your post to make it a little more readable. Please ensure it still says what you want it to. $\endgroup$ Commented Dec 5, 2015 at 15:44
0
$\begingroup$

Assuming you have samples $X_1^{(j)},...,X_N^{(j)}$ of each variable $X^{(j)}$, and there are $p$ variables:

$$ E\left[ \sum_{j=1}^p \log(X^{(j)})\right] \approx (1/N) \sum_{i=1}^N \left \{ \sum_{j=1}^p \log(X_i^{(j)}) \right \} $$

$\endgroup$
2
  • $\begingroup$ And this works regardless of the distribution the Xs come from! $\endgroup$ Commented Dec 5, 2015 at 16:05
  • $\begingroup$ I thought you had data and wanted to estimate the mean. This works hehe $\endgroup$ Commented Dec 5, 2015 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.