Several small documentation improvements

This commit is contained in:
Ozzie Gooen 2022-07-23 11:06:15 -07:00
parent 349b99b3ef
commit ff1f8e8e84
2 changed files with 35 additions and 20 deletions

View File

@ -7,44 +7,47 @@ import { SquiggleEditor } from "../../src/components/SquiggleEditor";
## Expressions
### Distributions
<SquiggleEditor defaultCode={`mixture(1 to 2, 3, [0.3, 0.7])`} />
### Numbers
<SquiggleEditor defaultCode="4.32" />
### Arrays
### Distributions
<SquiggleEditor defaultCode={`a = normal(4,2)
b = 30 to 50
c = lognormal({mean:90, stdev: 7})
d = mixture(a,b,c, [0.3, 0.3, .4])
{a:a, b:b, c:c, d:d}`} />
### Lists
<SquiggleEditor
defaultCode={`[beta(1,10), 4, isNormalized(SampleSet.fromDist(1 to 2))]`}
/>
### Records
<SquiggleEditor
defaultCode={`List.make(5,1)`}
/>
### Dictionaries
<SquiggleEditor
defaultCode={`d = {dist: triangular(0, 1, 2), weight: 0.25}
d.dist`}
/>
## Statements
A statement assigns expressions to names. It looks like `<symbol> = <expression>`
<SquiggleEditor
defaultCode={`value_of_work = 10 to 70
5 + value_of_work / 75`}
/>
### Functions
We can define functions
<SquiggleEditor
defaultCode={`f(t) = normal(t^2, t^1.2+.01)
f`}
/>
### Anonymous Functions
<SquiggleEditor
defaultCode={`ozzie_estimate(t) = lognormal(t^(1.1), 0.5)
nuno_estimate(t, m) = mixture(normal(-5, 1), lognormal(m, t / 1.25))
ozzie_estimate(1) * nuno_estimate(1, 1)`}
defaultCode={`{|t| normal(t^2, t^1.2+.01)}`}
/>
## See more

View File

@ -3,7 +3,19 @@ sidebar_position: 1
title: Introduction
---
Squiggle is an _estimation language_, and a syntax for _calculating and expressing beliefs_ involving uncertainty. It has use cases in forecasting and writing evaluations.
Squiggle is a simple programming language for intuitive probabilistic estimation. It's meant for quantitative forecasting and evaluations.
The basics of Squiggle can be pretty simple and intuitive. The more advanced functionality can take some time to learn.
## What Squiggle Is
- A simple programming language for doing math with probability distributions
- An embeddable language that can be used in Javascript applications
- A tool to embed 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 with backwards inference and sophisticated sampling algorithms. (See [PPLs](https://en.wikipedia.org/wiki/Probabilistic_programming))
- A visual tool aimed at casual users (see Guesstimate, Causal)
## Get started