Hide table of contents

Squiggle is a "simple programming language for intuitive probabilistic estimation". It serves as its own standalone programming language with its own syntax, but it is implemented in JavaScript.

I like the features of Squiggle and intend to use it frequently, but I also frequently want to use similar functionalities in Python, especially alongside other Python statistical programming packages like Numpy, Pandas, and Matplotlib.

The squigglepy package here implements many Squiggle-like functionalities in Python.

The package also has useful utility functions for Bayesian networks (using rejection sampling), pooling forecasts (via weighted geometric mean of odds and others), laplace (including the time-invariant version), and kelly betting.

The package and documentation are available on GitHub.

The package can be downloaded from Pypi using pip install squigglepy.

This package is unofficial and supported by myself and Rethink Priorities. It is not affiliated with or associated with the Quantified Uncertainty Research Institute, which maintains the Squiggle language (in JavaScript).

This package is also new and not yet in a stable production version, so you may encounter bugs and other errors. Please report those so they can be fixed. It's also possible that future versions of the package may introduce breaking changes.

This package is available under an MIT license.

Comments8


Sorted by Click to highlight new comments since:

So cool! Strong upvote!

I also created a Python implementation of Squiggle with a very similar name! I’m unlikely to maintain it further since I’ve ended up focusing on impact markets. But maybe you can find something interesting in there to copy-paste into your version.

Oh thanks! Sorry I didn't know about this. But with your permission I will look for things that I will copy into the package and I will credit you for those additions. Please let me know if I don't have permission to do that.

You have all the permissions! I’d be delighted if it turns out my couple weeks of coding back then had more than exploratory value. :-D

Generally my hope is that Squiggle will allow us to combine the big-picture long-term thinking of current EA with the focus on quantification and interval-scale-based prioritization of < 2015 EA.

That it will be used by anyone who has to model something. That they’ll contribute their models back to some central repository. That we’ll get to recombine all these models and build exponentially more powerful ones from them with constant development time. That eventually our models will become powerful enough to capture the real world in all its relevant complexity.

I still find this vision inspiring. I just feel a lot of urgency about AGI for now, and impact markets seem more directly relevant to that.

I used your tech to launch a new version of Squigglepy that lets you use ~ and @ as shorthand to sample and lets you add, subtract, etc. distributions directly without having to sample inbetween!

Yeah, a "SquiggleHub" would be nice.

Yes! The Python implementation can just use PyPI, but I imagine something custom is needed to support Squiggle models based on other interpreters.

Thanks so much! Was hoping someone would do this soon!

Curated and popular this week
 ·  · 5m read
 · 
The AI safety community has grown rapidly since the ChatGPT wake-up call, but available funding doesn’t seem to have kept pace. However, there’s a more recent dynamic that’s created even better funding opportunities, which I witnessed as a recommender in the most recent SFF grant round.[1]   Most philanthropic (vs. government or industry) AI safety funding (>50%) comes from one source: Good Ventures. But they’ve recently stopped funding several categories of work (my own categories, not theirs): * Many Republican-leaning think tanks, such as the Foundation for American Innovation. * “Post-alignment” causes such as digital sentience or regulation of explosive growth. * The rationality community, including LessWrong, Lightcone, SPARC, CFAR, MIRI. * High school outreach, such as Non-trivial. In addition, they are currently not funding (or not fully funding): * Many non-US think tanks, who don’t want to appear influenced by an American organisation (there’s now probably more than 20 of these). * They do fund technical safety non-profits like FAR AI, though they’re probably underfunding this area, in part due to difficulty hiring for this area the last few years (though they’ve hired recently). * Political campaigns, since foundations can’t contribute to them. * Organisations they’ve decided are below their funding bar for whatever reason (e.g. most agent foundations work). OP is not infallible so some of these might still be worth funding. * Nuclear security, since it’s on average less cost-effective than direct AI funding, so isn’t one of the official cause areas (though I wouldn’t be surprised if there were some good opportunities there). This means many of the organisations in these categories have only been able to access a a minority of the available philanthropic capital (in recent history, I’d guess ~25%). In the recent SFF grant round, I estimate they faced a funding bar 1.5 to 3 times higher. This creates a lot of opportunities for other donors
 ·  · 1m read
 · 
LewisBollard
 ·  · 5m read
 · 
Note: This post was crossposted from the Open Philanthropy Farm Animal Welfare Research Newsletter by the Forum team, with the author's permission. The author may not see or respond to comments on this post. ---------------------------------------- Progress for factory-farmed animals is far too slow. But it is happening. Practices that once seemed permanent — like battery cages and the killing of male chicks — are now on a slow path to extinction. Animals who were once ignored — like fish and even shrimp — are now finally seeing reforms, by the billions. It’s easy to gloss over such numbers. So, as you read the wins below, I encourage you to consider each of these animals as an individual. A hen no longer confined to a cage, a chick no longer macerated alive, a fish no longer dying a prolonged death. I also encourage you to reflect on the role you and your fellow advocates and funders played in these wins. I’m inspired by what you’ve achieved. I hope you will be too. 1. About Cluckin’ Time. Over 1,000 companies globally have now fulfilled their pledges to go cage-free. McDonald’s implemented its pledge in the US and Canada two years ahead of schedule, sparing seven million hens from cages. Subway implemented its pledge in Europe, the Middle East, Oceania, and Indonesia. Yum Brands, owner of KFC and Pizza Hut, reported that for 25,000 of its restaurants it is now 90% cage-free. These are not cheap changes: one UK retailer, Lidl, recently invested £1 billion just to transition part of its egg supply chain to free-range. 2. The Egg-sodus: Cracking Open Cages. In five of Europe’s seven biggest egg markets — France, Germany, Italy, the Netherlands, and the UK — at least two-thirds of hens are now cage-free. In the US, about 40% of hens are — up from a mere 6% a decade ago. In Brazil, where large-scale cage-free production didn’t exist a decade ago, about 15% of hens are now cage-free. And in Japan, where it still barely exists, the nation’s largest egg buyer, Kewpi