squiggle/packages/website/docs/Api/DistSampleSet.md

45 lines
975 B
Markdown
Raw Normal View History

2022-06-06 04:47:29 +00:00
---
2022-06-11 00:35:48 +00:00
sidebar_position: 5
2022-06-06 04:47:29 +00:00
title: Sample Set Distribution
---
### make
2022-06-11 15:57:02 +00:00
2022-06-06 04:47:29 +00:00
```
SampleSet.make: (distribution) => sampleSet
SampleSet.make: (() => number) => sampleSet
SampleSet.make: (list<number>) => sampleSet
```
### map
2022-06-11 15:57:02 +00:00
2022-06-06 04:47:29 +00:00
```
SampleSet.map: (sampleSet, (number => number)) => sampleSet
```
### map2
2022-06-11 15:57:02 +00:00
2022-06-06 04:47:29 +00:00
```
SampleSet.map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSet
```
### map3
2022-06-11 15:57:02 +00:00
2022-06-06 04:47:29 +00:00
```
SampleSet.map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet
```
2022-06-11 00:35:48 +00:00
### toList
2022-06-11 15:57:02 +00:00
2022-06-06 04:47:29 +00:00
```
2022-06-11 00:35:48 +00:00
SampleSet.toList: (sampleSet) => list<number>
2022-06-06 04:47:29 +00:00
```
2022-06-11 15:57:02 +00:00
Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toList() maintains order and length. Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toList() maintains order and length.
2022-06-06 04:47:29 +00:00
**Examples**
2022-06-11 15:57:02 +00:00
2022-06-06 04:47:29 +00:00
```
2022-06-11 00:35:48 +00:00
toList(toSampleSet(normal(5,2)))
2022-06-11 15:57:02 +00:00
```