Skip to content

DagsHub/probabilistic-spreadsheet

Repository files navigation

Probabilistic Excel

A web-based spreadsheet where cells can contain probability distributions instead of just plain numbers. Formulas operating on distributions produce resulting distributions via Monte Carlo simulation.

Inspired by Erik Bernhardsson's blog post on why software projects take longer than expected.

Features

Distribution Types

  • NORMAL(mean, stdev) - Normal (Gaussian) distribution
  • LOGNORMAL(mu, sigma) - Log-normal distribution (parameters are for the underlying normal)
  • UNIFORM(min, max) - Uniform distribution

Statistical Functions

  • MEAN(cell) - Expected value of a distribution
  • MEDIAN(cell) - 50th percentile
  • STDEV(cell) - Standard deviation
  • PERCENTILE(cell, p) - p-th percentile (p in 0-100)
  • PROB(cell, ">", value) - Probability that distribution exceeds value (supports >, <, >=, <=)
  • SUM(range) - Sum of a range (convolves distributions)

Arithmetic Operations

All standard operations work on distributions:

  • Addition: =A1 + B1
  • Subtraction: =A1 - B1
  • Multiplication: =A1 * B1
  • Division: =A1 / B1
  • Exponentiation: =A1 ^ 2

Key Behaviors

  • Independent sampling: Each cell reference in a formula is treated as an independent draw from that distribution. So =A1 + A1 produces a different result than =2 * A1.
  • Monte Carlo simulation: Operations on distributions use Monte Carlo sampling with adaptive sample sizes.
  • Inline visualization: Distributions are displayed as small PDF sparklines in cells.
  • Click to expand: Click on any distribution cell to see detailed statistics and a histogram.
  • Auto-save: Your spreadsheet is automatically saved to localStorage.

Development

# Install dependencies
npm install

# Run development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

Deployment

This project is configured for GitHub Pages deployment. Push to the main branch to trigger automatic deployment.

To deploy manually:

  1. Go to repository Settings > Pages
  2. Set Source to "GitHub Actions"
  3. Push to main branch

Tech Stack

  • React 18 + TypeScript
  • Vite
  • Material UI (MUI) + MUI X Charts
  • jStat for statistical functions

License

MIT

About

Make spreadsheets with probability distributions as cell values

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages