Minor docs cleanup

This commit is contained in:
Ozzie Gooen 2022-07-22 15:31:05 -07:00
parent 3250d6009a
commit 349b99b3ef
4 changed files with 13 additions and 31 deletions

View File

@ -339,7 +339,7 @@ A log loss score. Often that often acts as a [scoring rule](https://en.wikipedia
Note that it is fairly slow. Note that it is fairly slow.
``` ```
logScore: ({estimate: distribution, ?prior: distribution, answer: distribution|number}) => number Dist.logScore: ({estimate: distribution, ?prior: distribution, answer: distribution|number}) => number
``` ```
**Examples** **Examples**

View File

@ -23,12 +23,6 @@ Squiggle is still very early. The main first goal is to become stable. This mean
## Distribution Features ## Distribution Features
`Distribution.fromSamples([])`
Converts a list of samples, for example, from Guesstimate, into a distribution shape. Maybe takes a list of optional parameters.
`Distribution.fromCoordinates({xs, ys})`
Convert XY coordinates into a distribution. Figure out a good way to do this for continuous, discrete, and mixed distributions.
[Metalog Distribution](https://en.wikipedia.org/wiki/Metalog_distribution) [Metalog Distribution](https://en.wikipedia.org/wiki/Metalog_distribution)
Add the Metalog distribution, and some convenient methods for generating these distributions. This might be a bit tricky because we might need or build a library to fit data. There's no Metalog javascript library yet, this would be pretty useful. There's already a Metalog library in Python, so that one could be used for inspiration. Add the Metalog distribution, and some convenient methods for generating these distributions. This might be a bit tricky because we might need or build a library to fit data. There's no Metalog javascript library yet, this would be pretty useful. There's already a Metalog library in Python, so that one could be used for inspiration.

View File

@ -343,13 +343,13 @@ Creates a [triangular distribution](https://en.wikipedia.org/wiki/Triangular_dis
<SquiggleEditor defaultCode="triangular(1, 2, 4)" /> <SquiggleEditor defaultCode="triangular(1, 2, 4)" />
## FromSamples ## FromList
`fromSamples(samples:number[])` `SampleSet.fromList(samples:number[])`
Creates a sample set distribution using an array of samples. Creates a sample set distribution using an array of samples.
<SquiggleEditor defaultCode="fromSamples([1,2,3,4,6,5,5,5])" /> <SquiggleEditor defaultCode="SampleSet.fromList([1,2,3,4,6,5,5,5])" />
### Arguments ### Arguments

View File

@ -47,7 +47,7 @@ dist1 * dist2`}
We also provide concatenation of two distributions as a syntax sugar for `*` We also provide concatenation of two distributions as a syntax sugar for `*`
<SquiggleEditor defaultCode="(0.1 to 1) triangular(1,2,3)" /> <SquiggleEditor defaultCode="(0.1 to 1) * triangular(1,2,3)" />
### Division ### Division
@ -88,16 +88,13 @@ log(dist)`}
/> />
<SquiggleEditor <SquiggleEditor
defaultCode={`dist = beta(1,2) defaultCode={`log10(5 to 10)`}
log10(dist)`}
/> />
Base `x` Base `x`
<SquiggleEditor <SquiggleEditor
defaultCode={`x = 2 defaultCode={`log(5 to 10, 2)`}
dist = beta(2,3)
log(dist, x)`}
/> />
#### Validity #### Validity
@ -114,9 +111,7 @@ For every point on the x-axis, operate the corresponding points in the y axis of
TODO: this isn't in the new interpreter/parser yet. TODO: this isn't in the new interpreter/parser yet.
<SquiggleEditor <SquiggleEditor
defaultCode={`dist1 = 1 to 10 defaultCode={`(1 to 10) .+ triangular(1,2,3)`}
dist2 = triangular(1,2,3)
dist1 .+ dist2`}
/> />
### Pointwise subtraction ### Pointwise subtraction
@ -124,33 +119,26 @@ dist1 .+ dist2`}
TODO: this isn't in the new interpreter/parser yet. TODO: this isn't in the new interpreter/parser yet.
<SquiggleEditor <SquiggleEditor
defaultCode={`dist1 = 1 to 10 defaultCode={`(1 to 10) .- triangular(1,2,3)`}
dist2 = triangular(1,2,3)
dist1 .- dist2`}
/> />
### Pointwise multiplication ### Pointwise multiplication
<SquiggleEditor <SquiggleEditor
defaultCode={`dist1 = 1 to 10 defaultCode={`(1 to 10) .* triangular(1,2,3)`}
dist2 = triangular(1,2,3)
dist1 .* dist2`}
/> />
### Pointwise division ### Pointwise division
<SquiggleEditor <SquiggleEditor
defaultCode={`dist1 = uniform(0,20) defaultCode={`(uniform(0,10)) ./ normal(10,4)`}
dist2 = normal(10,8)
dist1 ./ dist2`}
/> />
### Pointwise exponentiation ### Pointwise exponentiation
<SquiggleEditor <SquiggleEditor
defaultCode={`dist1 = 1 to 10 defaultCode={`(1 to 10) .^ triangular(1,2,3)`}
dist2 = triangular(1,2,3)
dist1 .^ dist2`}
/> />
## Standard functions on distributions ## Standard functions on distributions