Quick Start Guide

This guide walks you through calculating your first moments in ToFUL. We will compute the first four moments of a Geometric distribution — a classic example that exercises both infinite discrete support and the full moment pipeline.


Step 1 — Open the Calculator

Visit toful1.streamlit.app (or run streamlit run app.py locally) and click Open Calculator.


Step 2 — Choose Variable Type

In the sidebar, the Variable Type selector defaults to Discrete (DRV). Leave it there — the Geometric distribution is discrete.


Step 3 — Enter the Support

In the Range field type:

0,1,2,3,...

The trailing ... signals an infinite series. ToFUL detects the arithmetic pattern (step = 1) and extends the support automatically up to the configured maximum terms (default 200).


Step 4 — Enter the PMF

In the Probability Function field type:

0.3 * (0.7 ** x) if x >= 0 else 0

This is the PMF of a Geometric distribution with success probability \(p = 0.3\). The if x >= 0 else 0 guard ensures the function returns 0 outside the support.

Tip

You can also type 0.3 * 0.7^x if x >= 0 else 0 using a caret for exponentiation — ToFUL’s parser will auto-correct it to **.


Step 5 — Choose Moment Reference

Leave Moment Reference set to Origin (a = 0) to compute raw moments.


Step 6 — Set Moment Order

Set Max order (r) to 4 to compute μ₁ through μ₄.


Step 7 — Compute

Click Compute Moments. ToFUL will:

  1. Validate that the PMF sums to 1 over the support.

  2. Compute each moment using the convergence-acceleration cascade.

  3. Display results across five tabs.


Understanding the Output

Moments Tab

Four metric cards appear, one per moment order. Each card shows:

  • The moment symbol (μ₁, μ₂, μ₃, μ₄)

  • The computed value

  • The numerical method used (e.g. term-magnitude, wynn-epsilon)

For a Geometric distribution with \(p = 0.3\):

Order

Value

Interpretation

μ₁

2.3333…

Mean = (1-p)/p = 7/3

μ₂

13.2222…

Second raw moment E[X²]

μ₃

111.2222…

Third raw moment E[X³]

μ₄

1247.2963…

Fourth raw moment E[X⁴]

Statistics Tab

Switch the Moment Reference to Mean (a = μ) and recompute to see derived statistics: variance, standard deviation, skewness, and kurtosis.

Distribution Tab

Shows a stem plot of the PMF annotated with the mean, alongside a bar chart comparing the magnitude of each moment.

Table Tab

A downloadable CSV table with all moment values, methods, and convergence status.

Convergence Tab

Per-moment diagnostic entries showing which convergence method fired and the associated info string.


Next Steps