I have this dataframe where I created the 3rd column using the first two columns. Both ${Y}$ and ${X}$ are independent random variables.
$\bar{Y}$ | $\bar{X}$ | $\bar{Z} = 100\frac{\bar{X}-\bar{Y}}{\bar{Y}}$ |
---|---|---|
13435 | 13502 | 0.4987 |
21847 | 22354 | 2.3207 |
15584 | 18014 | 15.5929 |
17121 | 16738 | -2.2370 |
18758 | 19664 | 4.8299 |
18994 | 22234 | 17.0580 |
22864 | 23555 | 3.0222 |
30365 | 31452 | 3.5798 |
29850 | 34808 | 16.6097 |
38674 | 38791 | 0.3025 |
47803 | 39717 | -16.9153 |
88777 | 91756 | 3.3556 |
When I manually calculate the expectation of $\bar{Z}$ using the data in the 3rd column (in the above table) and pass it statistics.mean() function in Python, I get $E[Z] = 0.04.$
On the other hand, I know that I can calculate $E[Z]$ also as follows:
$E[Z] = E[100\frac{X-Y}{Y}] = 100E[\frac{X}{Y}-1] =100E[\frac{X}{Y}]-100 =100E[X]E[\frac{1}{Y}] -100 $ (as according to this link https://en.wikipedia.org/wiki/Ratio_distribution I can write $E[\frac{X}{Y}] =E[X]E[\frac{1}{Y}]$ )
but then I get $E[Z] = 33.75$ (since the mean of $\bar{X}$ and $\frac{1}{\bar{Y}}$ are $E[\bar{X}] =31048.75 $ and $E[\frac{1}{\bar{Y}}] = 0.000043$, respectively.)
Apparently I get two very different mean values for $\bar{Z}$. When I do the same process for standart deviation, I again get very different values. So which approach should I use? Manually calculating using the 3rd row (by using Python's statistics library mean() and stdev() functions) or using the derivation formula?
In this study http://www.statistics.du.se/essays/D09_Zhang%20Ling%20&%20Han%20Kun.pdf, as far as I understood, they straightaway calculated mean and standard deviation by using the data in Percentage and Absolute columns.
I am really looking forward to some informative answers!
Thank you!