0
$\begingroup$

I'm trying to evaluate the following sums that nest into eachother:

$$ m_k=\frac{k}{k-1} \left(e^{\gamma}+ \sum_{i=1}^{k-2} {k-1\choose i} \frac{m_i}{i} \right) \\ m_1=e^\gamma $$ and $$ \kappa_n = m_n - \sum_{i=1}^{n-1} {n-1 \choose i}m_i\kappa_{n-i} \\ \kappa_1 = m_1 $$

With the following code:

moment[1] = E^(EulerGamma);
moment[k_] := 
 k/(k - 1) (E^(EulerGamma) + 
    Sum[Binomial[(k - 1), i]*moment[i]/i, {i, 1, k - 2}])

and

cum[1] = moment[1];
cum[n_] := 
 moment[n] - 
  Sum[moment[i]*cum[n - i]*Binomial[n - 1, i], {i, 1, n - 1}]

But it's calculating wrong on $\kappa_4$. Am I missing something?

The results I'm trying to replicate come from a paper that offer the first 4 values of $\kappa$ to be:

$$ 1.781072 \quad 0.3899259 \quad 0.2814155 \quad 0.2399205 $$ And my results are: $$ 1.78107 \quad 0.389926 \quad 0.281416 \quad -3.32222$$

$\endgroup$
10
  • 3
    $\begingroup$ Please edit your question and explain what exactly is wrong: What answer do you expect and why? Also, there is some chaos with letters, $k_{n-i}$ should perhaps be $\kappa_{n-i}$ and $k_4$ should perhaps be $\kappa_4$... $\endgroup$
    – user293787
    Nov 6, 2022 at 21:51
  • $\begingroup$ Just made the edits. Sorry for the lack of clarity. $\endgroup$ Nov 7, 2022 at 5:52
  • 2
    $\begingroup$ Have you considered that the paper could be wrong? Can you provide a link (ideally open access)? $\endgroup$
    – user293787
    Nov 7, 2022 at 5:54
  • 1
    $\begingroup$ Maybe it works out fine but is moment[2] equal to $2 e^{\gamma }$ ? I ask because the Sum goes from $i=1$ to $i=k-2$ which is $i=1$ to $i=0$. $\endgroup$
    – JimB
    Nov 7, 2022 at 6:12
  • 1
    $\begingroup$ How to choose proper value of "n"??? $\endgroup$ Nov 7, 2022 at 7:11

0

Your Answer

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

Browse other questions tagged or ask your own question.