ToFUL

Getting Started

  • Installation
    • Option 1 — Hosted Web App
    • Option 2 — Local Installation
      • Requirements
      • Step 1 — Clone the repository
      • Step 2 — Install dependencies
      • Step 3 — Run the app
    • Option 3 — Virtual Environment (Recommended)
    • Verifying the Installation
    • Optional Dependencies
    • Next Steps
  • Quick Start Guide
    • Step 1 — Open the Calculator
    • Step 2 — Choose Variable Type
    • Step 3 — Enter the Support
    • Step 4 — Enter the PMF
    • Step 5 — Choose Moment Reference
    • Step 6 — Set Moment Order
    • Step 7 — Compute
    • Understanding the Output
      • Moments Tab
      • Statistics Tab
      • Distribution Tab
      • Table Tab
      • Convergence Tab
    • Next Steps
  • Input Syntax Guide
    • Basic Syntax Rules
    • Auto-Corrections Applied by the Parser
      • Exponentiation
      • Implicit Multiplication
      • Exponential Notation
      • Function Aliases
      • Unicode Operators
      • Absolute Value
      • Subscript Variables
      • Greek Letters
    • Available Functions
    • Piecewise Expressions
    • Range Input Syntax
    • Common Mistakes
      • factorial with float arguments
      • Missing else 0
      • Syntax check before computing

User Guide

  • Discrete Random Variables
    • Defining a Discrete Distribution
    • Finite Support
    • Infinite Support
    • Convergence Acceleration for Infinite Series
    • PMF Validation
    • Common Discrete Distributions
    • Tips for Discrete Distributions
    • See also
  • Continuous Random Variables
    • Defining a Continuous Distribution
    • Quadrature Methods
      • Gauss-Laguerre quadrature — [0, ∞)
      • Gauss-Hermite quadrature — (-∞, ∞)
      • Adaptive Gauss-Kronrod — all other domains
      • mpmath tanh-sinh — high precision
      • SymPy symbolic — exact
    • Validation
    • Common Continuous Distributions
    • Precision Settings for CRVs
    • Tips for Continuous Distributions
    • See also
  • Mathematical Functions Reference
    • Constants
    • Exponential and Logarithmic
    • Trigonometric
    • Rounding and Sign
    • Special Functions
    • Operator Reference
    • Examples
    • See also
  • Precision Settings
    • Calc Precision
    • Display Precision
    • When to Increase Calc Precision
    • When to Increase Display Precision
    • Float64 Limits
    • mpmath Mode
    • See also
  • Interpreting Results
    • Moments Tab
    • Statistics Tab
    • Distribution Tab
    • Table Tab
    • Convergence Tab
    • Auto-Correction Notice
    • See also

Examples

  • Discrete Distribution Examples
    • Bernoulli Distribution
    • Binomial Distribution
    • Geometric Distribution (failures before first success)
    • Geometric Distribution (trials until first success)
    • Poisson Distribution
    • Negative Binomial Distribution
    • Uniform Discrete Distribution
    • Tips for All Discrete Distributions
    • See also
  • Continuous Distribution Examples
    • Uniform Distribution
    • Exponential Distribution
    • Standard Normal Distribution
    • Normal Distribution (general)
    • Gamma Distribution
    • Beta Distribution
    • Triangular Distribution
    • Cauchy Distribution
    • Laplace Distribution
    • See also
  • Advanced Examples
    • Mixture Distributions
    • Mixture of Normal Distributions
    • Truncated Distributions
    • Zero-Inflated Distributions
    • Piecewise Linear Distribution
    • High-Order Moments
    • Verifying a Custom Distribution
    • See also

Theory & Background

  • Statistical Moments
    • Definition
    • Types of Moments
      • Raw Moments (a = 0)
      • Central Moments (a = μ)
      • Moments about a Custom Point (a = c)
    • Relationships Between Moment Types
    • Existence of Moments
    • Moment Generating Function
    • Standardised Moments
    • See also
  • Raw vs Central Moments
    • Raw Moments (a = 0)
    • Central Moments (a = μ)
    • Moments about a Custom Point (a = c)
    • The Parallel Axis Theorem for Moments
    • Practical Comparison
    • See also
  • Skewness and Kurtosis
    • Skewness
      • Definition
      • Interpretation
      • Examples
    • Kurtosis
      • Definition
      • Interpretation
      • Examples
    • Numerical Considerations
    • See also
  • Convergence Methods
    • The Problem
    • Discrete Series: The Convergence Cascade
      • 1. Term Magnitude Test
      • 2. Wynn ε-Algorithm
      • 3. Aitken Δ² Method
      • 4. Cohen-Villegas-Zagier Algorithm
      • 5. Geometric Ratio Bound
      • 6. Partial Sum Fallback
    • Continuous Integration: Quadrature Selection
      • Gauss-Laguerre Quadrature
      • Gauss-Hermite Quadrature
      • Adaptive Gauss-Kronrod (SciPy quad)
      • mpmath Tanh-Sinh Quadrature
      • SymPy Symbolic Integration
    • Richardson Error Estimation
    • See also

API Reference

  • core.py — Computational Backend
    • Architecture
    • Data Classes
      • SeriesPattern
        • SeriesPattern.kind
        • SeriesPattern.params
        • SeriesPattern.description
      • SeriesAnalysis
        • SeriesAnalysis.value
        • SeriesAnalysis.converged
        • SeriesAnalysis.terms_used
        • SeriesAnalysis.method
        • SeriesAnalysis.info
        • SeriesAnalysis.partial_sums
        • SeriesAnalysis.term_values
      • ValidationResult
        • ValidationResult.is_valid
        • ValidationResult.message
        • ValidationResult.integral_or_sum
        • ValidationResult.analysis
      • MomentResult
        • MomentResult.order
        • MomentResult.reference
        • MomentResult.value
        • MomentResult.method
        • MomentResult.converged
        • MomentResult.terms_or_nodes
        • MomentResult.info
      • StatisticalSummary
        • StatisticalSummary.mean
        • StatisticalSummary.variance
        • StatisticalSummary.std_dev
        • StatisticalSummary.skewness
        • StatisticalSummary.kurtosis
        • StatisticalSummary.excess_kurtosis
    • Public API
      • Validation
        • validate_drv_probabilities()
        • validate_crv_pdf()
      • Moment Computation
        • compute_moments_parallel()
      • Statistical Summary
        • compute_statistical_summary()
      • Range Parsing
        • parse_range_input()
        • parse_continuous_bound()
      • Utilities
        • to_subscript()
        • detect_series_pattern()
        • generate_extended_series()
    • Convergence Algorithm Reference
    • Quadrature Reference
    • Configuration Constants
    • Legacy Compatibility
      • InfiniteSeriesHandler
      • EnhancedProbabilityValidator
      • EnhancedMomentCalculator
      • rth_moment()
    • See also
  • toful_parser.py — Input Normalisation
    • Data Classes
      • NormalisationResult
        • NormalisationResult.original
        • NormalisationResult.result
        • NormalisationResult.changes
        • NormalisationResult.was_changed
    • Public API
      • normalise_for_eval()
      • normalise_for_display()
      • normalise_range_input()
      • build_safe_dict()
      • prepare_expression()
    • Transformation Pipeline — Pass 1 (eval)
    • Transformation Pipeline — Pass 2 (display)
    • Safe Evaluation Namespace
    • Usage Examples
      • Basic normalisation
      • Full pipeline
      • Range input
    • See also

Troubleshooting

  • Common Errors
    • Validation Errors
      • “PMF sums to X ≠ 1.0”
      • “Negative probabilities detected at x = […]”
      • “PDF integrates to X ≠ 1.0”
      • “Negative PDF value at x ≈ […]”
    • Syntax Errors
      • “Syntax error: invalid syntax (position N)”
    • Range Errors
      • “Cannot parse range ‘…’”
      • “Lower bound must be strictly less than upper bound”
    • Computation Errors
      • “Computation error: OverflowError”
      • “Computation error: ZeroDivisionError”
    • Precision-Related Issues
      • “Results appear as 0.0000 for all moments”
      • “Convergence uncertain after N terms”
    • See also
  • Debugging Functions
    • Step 1 — Read the Auto-Correction Notice
    • Step 2 — Check the Validation Badge
    • Step 3 — Test a Single Value Mentally
    • Step 4 — Verify the Guard Condition
    • Step 5 — Check for Python Keyword Conflicts
    • Step 6 — Isolate Multi-Part Expressions
    • Step 7 — Check for Operator Precedence Issues
    • Step 8 — Verify with a Known Distribution
    • Diagnostic Checklist
    • See also
  • Convergence Issues
    • Understanding the “Convergence Uncertain” Flag
    • Fix 1 — Increase Max Series Terms
    • Fix 2 — Increase Calc Precision
    • Fix 3 — Check Whether the Moment Exists
    • Fix 4 — Reformulate the PMF/PDF
    • Fix 5 — Use a Tighter Range
    • Fix 6 — Switch to mpmath Mode
    • Diagnosing Slowly Converging Series
    • Alternating Series
    • Quick Reference — Which Fix to Try First
    • See also

Development

  • Contributing to ToFUL
    • Code of Conduct
    • Ways to Contribute
    • Setting Up a Development Environment
    • Project Structure
    • Code Style
    • Working on core.py
    • Working on toful_parser.py
    • Working on Documentation
    • Submitting a Pull Request
    • Reporting a Numerical Bug
    • Getting Help
    • See also
  • Changelog
    • v2.0.0 — 2025
    • v1.0.0 — 2024
ToFUL
  • Search


© Copyright 2024, Pranava BA.

Built with Sphinx using a theme provided by Read the Docs.