squiggle/packages/website/docs/Api/DistSampleSet.mdx
2022-06-05 20:02:17 -07:00

67 lines
1.1 KiB
Plaintext

---
sidebar_position: 4
title: Sample Set Distribution
---
### make
```javascript
make: (distribution) => sampleSet
make: (() => number) => sampleSet
make: (list<number>) => sampleSet
```
### kde
```javascript
kde: (sampleSet) => pointSetDist
```
### toEmpiricalPdf
```javascript
toEmpiricalPdf: (sampleSet) => pointSetDist
```
### map
```javascript
map: (sampleSet, (number => number)) => sampleSet
```
### map2
```javascript
map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSet
```
### map3
```javascript
map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet
```
### correlation
```javascript
correlation: (sampleSet, sampleSet) => number
```
### toInternalSampleArray
```javascript
toInternalSampleArray: (sampleSet) => list<number>
```
Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toInternalSampleArray() maintains order and length.
**Examples**
```javascript
toInternalSampleArray(toSampleSet(normal(5,2)))
```