Update DistGeneric.mdx

This commit is contained in:
Ozzie Gooen 2022-07-21 15:44:46 -07:00 committed by GitHub
parent 5c78ad1fc4
commit 0ef01da963
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -290,38 +290,6 @@ quantile: (distribution, number) => number
quantile(normal(5, 2), 0.5);
```
### toPointSet
**TODO: Will soon be called "PointSet.make"**
Converts a distribution to the pointSet format.
```
toPointSet: (distribution) => pointSetDistribution
```
**Examples**
```javascript
toPointSet(normal(5, 2));
```
### toSampleSet
**TODO: Will soon be called "SampleSet.make"**
Converts a distribution to the sampleSet format, with n samples.
```
toSampleSet: (distribution, number) => sampleSetDistribution
```
**Examples**
```javascript
toSampleSet(normal(5, 2), 1000);
```
### truncateLeft
Truncates the left side of a distribution. Returns either a pointSet distribution or a symbolic distribution.
@ -412,20 +380,6 @@ sparkline: (distribution, n = 20) => string
toSparkline(truncateLeft(normal(5, 2), 3), 20); // produces ▁▇█████▇▅▄▃▂▂▁▁▁▁▁▁▁
```
### inspect
Prints the value of the distribution to the Javascript console, then returns the distribution. Useful for debugging.
```
inspect: (distribution) => distribution
```
**Examples**
```javascript
inspect(normal(5, 2)); // logs "normal(5, 2)" to the javascript console and returns the distribution.
```
## Normalization
There are some situations where computation will return unnormalized distributions. This means that their cumulative sums are not equal to 1.0. Unnormalized distributions are not valid for many relevant functions; for example, klDivergence and scoring.