.. _quickstart: 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. .. contents:: On this page :local: :depth: 2 ---- 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: .. code-block:: text 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: .. code-block:: python 0.3 * (0.7 ** x) if x >= 0 else 0 This is the PMF of a Geometric distribution with success probability :math:`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 :math:`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 ---------- * :doc:`/user-guide/discrete-rv` — full guide to discrete random variables * :doc:`/user-guide/continuous-rv` — computing moments of continuous distributions * :doc:`/examples/discrete-distributions` — more worked examples * :doc:`input-syntax` — everything you can type in the function field