Merge pull request #401 from quantified-uncertainty/grammar
minor docs update
This commit is contained in:
commit
ff9f8f5ef2
|
@ -10,3 +10,4 @@ packages/squiggle-lang/lib
|
|||
packages/squiggle-lang/.nyc_output/
|
||||
packages/squiggle-lang/coverage/
|
||||
packages/squiggle-lang/.cache/
|
||||
packages/website/build/
|
||||
|
|
|
@ -305,6 +305,16 @@ The `sample(distribution)` samples a given distribution.
|
|||
|
||||
<SquiggleEditor initialSquiggleString="sample(normal(0, 10))" />
|
||||
|
||||
## Converting between distribution formats
|
||||
|
||||
Recall the [three formats of distributions](https://develop--squiggle-documentation.netlify.app/docs/Discussions/Three-Types-Of-Distributions). We can force any distribution into `SampleSet` format
|
||||
|
||||
<SquiggleEditor initialSquiggleString="toSampleSet(normal(5, 10))" />
|
||||
|
||||
Or `PointSet` format
|
||||
|
||||
<SquiggleEditor initialSquiggleString="toPointSet(normal(5, 10))" />
|
||||
|
||||
## Normalization
|
||||
|
||||
Some distribution operations (like horizontal shift) return an unnormalized distriibution.
|
||||
|
|
|
@ -26,7 +26,7 @@ Think of javascript's list unpacking notation to read our variable-argument func
|
|||
<expr> ::= <term> + <expr> | <term> - <expr> | <expr> .+ <expr> | <expr> .- <expr> | <term>
|
||||
<term> ::= <power> * <term> | <power> / <term> | <power> .* <term> | <power ./ <term> | <power>
|
||||
<power> ::= <factor> ^ <power> | <factor> .^ <power> | <factor>
|
||||
<factor> ::= <number> | <bool> | <symbol> | ( <expr> ) | <array> | <record> | <record>.<symbol> | <symbol> => <expr> | <symbol>(<symbol>) | <symbol>(<symbol>, <symbol>) | ...
|
||||
<factor> ::= <number> | <bool> | <symbol> | ( <expr> ) | <array> | <record> | <record>.<symbol> | <symbol> => <expr> | (<symbol>, <symbol>) => <expr> | ... | <symbol>(<symbol>) | <symbol>(<symbol>, <symbol>) | ...
|
||||
```
|
||||
|
||||
## Data structures
|
||||
|
|
Loading…
Reference in New Issue
Block a user