diff --git a/packages/website/docs/Discussions/Bugs.mdx b/packages/website/docs/Discussions/Bugs.mdx index e70e45b3..154ee2a0 100644 --- a/packages/website/docs/Discussions/Bugs.mdx +++ b/packages/website/docs/Discussions/Bugs.mdx @@ -9,7 +9,7 @@ Much of the Squiggle math is imprecise. This can cause significant errors, so wa Below are a few specific examples to watch for. We'll work on improving these over time and adding much better warnings and error management. -## Operations on very small or large numbers, silently round to 0 and 1 +## Operations on very small or large numbers, silently round to 0 and 1 Squiggle is poor at dealing with very small or large numbers, given fundamental limitations of floating point precision. See [this Github Issue](https://github.com/quantified-uncertainty/squiggle/issues/834). @@ -38,4 +38,4 @@ The means of sample set distributions can vary dramatically, especially as the n defaultCode={`symbolicDist = 5 to 50333333 sampleSetDist = SampleSet.fromDist(symbolicDist) [mean(symbolicDist), mean(sampleSetDist), symbolicDist, sampleSetDist]`} -/> \ No newline at end of file +/> diff --git a/packages/website/docs/Discussions/Future-Features.md b/packages/website/docs/Discussions/Future-Features.md index 3ad0e455..cf6c34d8 100644 --- a/packages/website/docs/Discussions/Future-Features.md +++ b/packages/website/docs/Discussions/Future-Features.md @@ -51,4 +51,4 @@ It might be useful to allow people to annotate functions and variables with long Right now, Monte Carlo simulations are totally random. It would be nicer to be able to enter a seed somehow in order to control the randomness. Or, with the same seed, the function should always return the same values. This would make debugging and similar easier. **Caching/Memoization** -There are many performance improvements that Squiggle could have. We'll get to some of them eventually. \ No newline at end of file +There are many performance improvements that Squiggle could have. We'll get to some of them eventually. diff --git a/packages/website/docs/Guides/DistributionCreation.mdx b/packages/website/docs/Guides/DistributionCreation.mdx index 9feb1d13..b5bfdd11 100644 --- a/packages/website/docs/Guides/DistributionCreation.mdx +++ b/packages/website/docs/Guides/DistributionCreation.mdx @@ -35,7 +35,9 @@ If both values are above zero, a `lognormal` distribution is used. If not, a `no - It's very easy to generate distributions with very long tails. These can be impossible to see without changing view settings. (These settings are available in the Playground, but not this smaller editor component) + It's very easy to generate distributions with very long tails. These can be + impossible to see without changing view settings. (These settings are + available in the Playground, but not this smaller editor component) @@ -69,7 +71,7 @@ If both values are above zero, a `lognormal` distribution is used. If not, a `no `mixture(...distributions: Distribution[], weights?: number[])` `mx(...distributions: Distribution[], weights?: number[])` `mixture(distributions: Distributions[], weights?: number[])` -`mx(distributions: Distributions[], weights?: number[])` +`mx(distributions: Distributions[], weights?: number[])` The `mixture` mixes combines multiple distributions to create a mixture. You can optionally pass in a list of proportional weights. @@ -283,10 +285,7 @@ Creates a [beta distribution](https://en.wikipedia.org/wiki/Beta_distribution) w - + @@ -378,12 +377,14 @@ Creates a sample set distribution using an array of samples. Creates a continuous point set distribution using a list of points. - +])`} +/> ### Arguments @@ -395,13 +396,15 @@ Creates a continuous point set distribution using a list of points. Creates a discrete point set distribution using a list of points. - +])`} +/> ### Arguments -- `points`: An array of at least 1 coordinate. \ No newline at end of file +- `points`: An array of at least 1 coordinate. diff --git a/packages/website/docs/Guides/Language.mdx b/packages/website/docs/Guides/Language.mdx index 71f7e888..311ef6ba 100644 --- a/packages/website/docs/Guides/Language.mdx +++ b/packages/website/docs/Guides/Language.mdx @@ -12,6 +12,7 @@ Squiggle supports some simple types and language features. ## Distributions + There are several ways of easily entering distributions. See the [documentation](/docs/Api/Dist/) on distributions for a complete API. ## Lists + Squiggle lists can accept items of any type, similar to those in Python. [API](/docs/Api/List). ## Dictionaries + Squiggle dictionaries work similarly to Python dictionaries. [API](/docs/Api/Dictionary). +`} +/> ## Pipes Squiggle features [data-first](https://www.javierchavarri.com/data-first-and-data-last-a-comparison/) pipes. Functions in the standard library are organized to make this convenient. - truncateLeft(3) |> SampleSet.fromDist |> SampleSet.map({|r| r + 10})`} /> + + truncateLeft(3) |> SampleSet.fromDist |> SampleSet.map({|r| r + 10})`} +/> ## Standard Library @@ -70,24 +78,30 @@ Squiggle features a simple [standard libary](/docs/Api/Dist). Most functions are namespaced under their respective types to keep functionality distinct. Certain popular functions are usable without their namespaces. For example, - SampleSet.fromList // namespaces required + + SampleSet.fromList // namespaces required b = normal(5,2) // namespace not required c = 5 to 10 // namespace not required -""`} /> +""`} +/> ## Number Prefixes + Numbers support a few scientific notation prefixes. -| prefix | multiplier | -|-----|-------| -| n | 10^-9 | -| m | 10^-3 | -| k | 10^3 | -| M | 10^6 | -| B,G | 10^9 | -| T | 10^12 | -| P | 10^15 | +| prefix | multiplier | +| ------ | ---------- | +| n | 10^-9 | +| m | 10^-3 | +| k | 10^3 | +| M | 10^6 | +| B,G | 10^9 | +| T | 10^12 | +| P | 10^15 | - +distribution`} +/> diff --git a/packages/website/docs/Overview.mdx b/packages/website/docs/Overview.mdx index a620c9a8..9e314211 100644 --- a/packages/website/docs/Overview.mdx +++ b/packages/website/docs/Overview.mdx @@ -10,10 +10,12 @@ Squiggle is a minimalist programming language for probabilistic estimation. It's The basics of Squiggle are fairly straightforward. This can be enough for many models. The more advanced functionality can take some time to learn. ## Simple example + 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. - - ## Using Squiggle + You can currently interact with Squiggle in a few ways: **[Playground](/playground)** @@ -68,7 +72,7 @@ The [Squiggle Playground](/playground) is a nice tool for working with small mod There's a simple [VS Code extension](https://marketplace.visualstudio.com/items?itemName=QURI.vscode-squiggle) for running and visualizing Squiggle code. We find that VS Code is a useful editor for managing larger Squiggle setups. **[Typescript Library](https://www.npmjs.com/package/@quri/squiggle-lang)** -Squiggle is built using [Rescript](https://rescript-lang.org/), 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). +Squiggle is built using [Rescript](https://rescript-lang.org/), 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). **[React Components Library](https://www.npmjs.com/package/@quri/squiggle-components)** All of the components used in the playground and documentation are available in a separate component NPM repo. You can see the full Storybook of components [here](https://squiggle-components.netlify.app). @@ -93,13 +97,15 @@ You can use Squiggle Components in Observable notebooks. Sam Nolan put together - A visually-driven tool. (See [Guesstimate](https://www.getguesstimate.com/) and [Causal](https://causal.app/)) ### Strengths + - 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. +- Optimized for using some numeric and symbolic approaches, not just Monte Carlo. - Embeddable in Javascript. - Free and open-source. -### Weaknesses +### Weaknesses + - Limited scientific capabilities. - Much slower than serious probabilistic programming languages on sizeable models. - Can't do Bayesian backwards inference. @@ -109,4 +115,5 @@ You can use Squiggle Components in Observable notebooks. Sam Nolan put together - Generally not as easy to use as Guesstimate or Causal, especially for non programmers. ## Organization -Squiggle is one of the main projects of [The Quantified Uncertainty Research Institute](https://quantifieduncertainty.org/). QURI is a nonprofit funded primarily by [Effective Altruist](https://www.effectivealtruism.org/) donors. \ No newline at end of file + +Squiggle is one of the main projects of [The Quantified Uncertainty Research Institute](https://quantifieduncertainty.org/). QURI is a nonprofit funded primarily by [Effective Altruist](https://www.effectivealtruism.org/) donors. diff --git a/packages/website/src/pages/index.js b/packages/website/src/pages/index.js index fdfe3b45..b0c26514 100644 --- a/packages/website/src/pages/index.js +++ b/packages/website/src/pages/index.js @@ -10,12 +10,12 @@ function HomepageHeader() { return (
- {'Docusaurus + {"Docusaurus

{siteConfig.title}

Early Access

{siteConfig.tagline}