Squiggle is a minimalist programming language for probabilistic estimation. It's meant for intuitively-driven quantitative estimation instead of data analysis or data-driven statistical techniques.
The basics of Squiggle are fairly straightforward. This can be enough for many models. The more advanced functionality can take some time to learn.
Say you're trying to estimate the number of piano tuners in New York City. You can build a simple model of this, like so.
(Tip: This is interactive! Feel free to modify the code directly.)
Now let's take this a bit further. Let's imagine that you think that NYC will grow over time, and you'd like to estimate the number of piano tuners for every point in time for the next few years.
If you haven't noticed yet, you can hover over the
populationAtTime graph to see the distribution of population at different points in time.
You can currently interact with Squiggle in a few ways:
Squiggle is built using Rescript, and is accessible via a simple Typescript library. You can use this library to either run Squiggle code in full, or to call select specific functions within Squiggle (though this latter functionality is very minimal).
You can use Squiggle Components in Observable notebooks. Sam Nolan put together an exportable Observable Notebook of the key components that you can directly import and use in your Observable notebooks.
Squiggle Vs. Other Tools
What Squiggle Is
- A simple programming language for doing math with probability distributions.
- A tool to encode functions as forecasts that can be embedded in other applications.
What Squiggle Is Not
- A complete replacement for enterprise Risk Analysis tools. (See Crystal Ball, @Risk, Lumina Analytica)
- A probabilistic programming language. Squiggle does not support Bayesian inference.
- A tool for substantial data analysis. (See programming languages like Python or Julia)
- A programming language for anything other than estimation.
- A visually-driven tool. (See Guesstimate and Causal)
- Simple and readable syntax, especially for dealing with probabilistic math.
- Fast for relatively small models. Strong for rapid prototyping.
- Optimized for using some numeric and symbolic approaches, not just Monte Carlo.
- Free and open-source.
- Limited scientific capabilities.
- Much slower than serious probabilistic programming languages on sizeable models.
- Can't do Bayesian backwards inference.
- Essentially no support for libraries or modules (yet).
- Still very new, so a tiny ecosystem.
- Still very new, so there are likely math bugs.
- Generally not as easy to use as Guesstimate or Causal, especially for non programmers.