0
$\begingroup$

Particulary, I would like to find the expected value of the sum of $n$ variables distributed like ParetoDistribution[1,1.14]. For example, this works for the sum of two vars with Gamma distribution:

dist = GammaDistribution[1, 1];
c[n_] := Integrate[
           InverseFourierTransform[(CharacteristicFunction[dist, t])^n, t, x]*x, 
           {x, -∞, ∞}]
c[2]

I've tried this and it works for almost every distribution but I think that this is not a very efficent way of doing it and still doesn't work for the Pareto.

My ultimate goal is to Plot what I've called c[n] against n, to see how the expected value of the sum of n iid variables changes with n.

I need it to do it in a Monte Carlo way, in the sense that I need to simulate each variable as a random variable but with the same underlying distribution. If I calculate the mean for a Pareto(1,1.14) I get 8.14 but It is very uncommon that I'll get that value from a sample. So the sample mean of 2 variables is likely to be under 2*8.14. I need to capture that randomness.

$\endgroup$
  • 1
    $\begingroup$ I'm not sure what you mean by "I need to capture that randomness". If independent and identically distributed (i.i.d) random variables $X_i$ ($i=1,2,\ldots,n$) all have mean $\mu$, then the mean of the sum is simply $n\mu$. No need for Monte Carlo. $\endgroup$ – JimB Jul 12 at 14:57
  • $\begingroup$ I need sample mean of a simulated sample. $\endgroup$ – Juan Carlos Herranz Ramos Jul 12 at 15:00
  • $\begingroup$ Firs figure of arxiv.org/pdf/1802.05495.pdf $\endgroup$ – Juan Carlos Herranz Ramos Jul 12 at 15:01
  • $\begingroup$ I read the paper a bit. that figure shows a measure of the extent of that fat tail to the sum of random numbers on the vertical axis. It's not just taking the union of n- random variables. OP does not write that expression. If you are interested in the results, please at least write formulas. $\endgroup$ – Xminer Jul 12 at 15:15
  • 2
    $\begingroup$ Please re-write your question and title to deal explicitly with either the expectation of the mean deviation or the $\kappa$ metric and include the reference article in the body of the question. I understand that you're new to this forum but you need to fix the question and title so the folks here don't spend time answering questions that won't help you. $\endgroup$ – JimB Jul 12 at 17:15
0
$\begingroup$

This? my code sampled $n$ pairs, take its MeanDeviation,then get Expected Value. I do not know the detailed procedure, but it would be reference.

ClearAll[dist];
fatTailMeasure := 
 Function[{n, dist}, 
  SeedRandom[
   1234]; (MeanDeviation /@ Partition[#, n] &@
     RandomVariate[dist, 1000000]) // Mean]
Function[{dst},
   fatTailMeasure[#, dst] & /@ Range[1, 10]] /@ {CauchyDistribution[],
    ParetoDistribution[1, 1.14], , StudentTDistribution[3], 
   NormalDistribution[]} // ListLinePlot

Mathematica graphics

$\endgroup$
  • $\begingroup$ Thank you for your answer. I've realized that I haven't made an important point. I need it to do it in a Monte Carlo way, in the sense that I need to simulate each variable as a random variable but with the same underlying distribution. If I calculate the mean for a Pareto(1,1.14) I get 8.14 but It is very uncommon that I'll get that value from a sample. So the sample mean of 2 variables is likely to be under 2*8.14. I need to capture that randomness. $\endgroup$ – Juan Carlos Herranz Ramos Jul 12 at 14:44
  • $\begingroup$ aww,please write it in the question... $\endgroup$ – Xminer Jul 12 at 14:49
  • $\begingroup$ What you mean is something like this?Histogram[ Total /@ Partition[#, 2] &@ RandomVariate[ParetoDistribution[1, 1.14], 1000]] $\endgroup$ – Xminer Jul 12 at 14:50
  • $\begingroup$ arxiv.org/pdf/1802.05495.pdf $\endgroup$ – Juan Carlos Herranz Ramos Jul 12 at 14:54
  • $\begingroup$ I've found this. First figure. $\endgroup$ – Juan Carlos Herranz Ramos Jul 12 at 14:54
2
$\begingroup$

For the Gamma distribution:

dist = GammaDistribution[1, 1];
With[{n = 5},
  vars = Table[Unique[], n];
  dd = TransformedDistribution[Total[vars], Thread[vars \[Distributed] dist]]]
(*    GammaDistribution[5, 1]    *)

For the Pareto distribution it's a bit less obvious:

dist = ParetoDistribution[1, 1.14];
With[{n = 2},
  vars = Table[Unique[], n];
  dd = TransformedDistribution[Total[vars], Thread[vars \[Distributed] dist]]]
(*    complicated output that is not any simpler than what we put in    *)

We can, however, calculate properties of dd:

Mean[dd]
(*    16.2857    *)

PDF[dd]
(*    complicated hypergeometric formula    *)
$\endgroup$
2
$\begingroup$

The expectation is linear, so just use the fact that $$ E\left(\sum_i X_i\right)=\sum_i E\left(X_i\right) $$ I assume you know how to take the expectation of random variables using Mean[dist].

Independence is irrelevant here. If they are iid it simplifies to $$ c(n)=E\left(\sum_{i=1}^n X_i\right)=n\,E(X_1), $$ As $c$ is linear the plot will be... linear.

dist = ParetoDistribution[1, 1.14]
c[n_Integer] := n Mean@dist
DiscretePlot[c[n], {n, 0, 15}]

enter image description here

If you want to do it with Monte-Carlo mean approximation you can do the following:

MCMean[d_, m_] := Mean[RandomVariate[d, m]];
MCMean[dist, 1000000000]

7.42469

which is not very good in spite of the large sample -- but that is the topic of another question: how to estimate means of Pareto distributions via MC methods.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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