1
$\begingroup$

Can someone explain by a simple example what is EventData doing?

e = {1.0, 2.1, 3.2, 4.5, 5.7};
ci = {0, 0, 0, 1, 0};

A = EventData[e, ci]

Mean[A]

gives 3.54. How is it calculated? can someone please explain by this or another simple example.

$\endgroup$

2 Answers 2

2
$\begingroup$

Event Data >> Properties and Relations:

Descriptive statistics are based on the underlying SurvivalDistribution

So, as an alternative to EmpiricalDistribution you can also use SurvivalDistribution to get descriptive statistics of A:

sd = SurvivalDistribution[A]; 

{Mean@A, Mean@sd, Expectation[x, Distributed[x, sd]], 
 Dot @@ sd /@ {"Weights", "Domain"}, Dot @@ A["EmpiricalPDF"]}

{3.54, 3.54, 3.54, 3.54, 3.54}

$\endgroup$
1
$\begingroup$

Briefly put, one is constructing the EmpiricalDistribution[] from the given EventData[], and then Mean[] is computed as usual for a discrete distribution.

Using the example in the OP:

e = {1.0, 2.1, 3.2, 4.5, 5.7};
ci = {0, 0, 0, 1, 0};
ed = EventData[e, ci];

dist = EmpiricalDistribution[ed];

probs = Table[Probability[k == ki, k \[Distributed] dist], {ki, e}]
   {0.2, 0.2, 0.2, 0, 0.4}

{probs.e, Mean[dist], Mean[ed]}
   {3.54, 3.54, 3.54}
$\endgroup$

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.