Changed the name of select functions

This commit is contained in:
Ozzie Gooen 2022-06-05 21:47:29 -07:00
parent 6567f1b8ef
commit 441ac3c251
9 changed files with 249 additions and 246 deletions

View File

@ -281,12 +281,12 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce
| ("$_typeModifier_opaque_$", [EvRecord(typeRecord)]) => typeModifier_opaque_update(typeRecord)
| ("$_typeOr_$", [EvArray(arr)]) => typeOr(EvArray(arr))
| ("$_typeFunction_$", [EvArray(arr)]) => typeFunction(arr)
| ("add", [EvArray(aValueArray), EvArray(bValueArray)]) => doAddArray(aValueArray, bValueArray)
| ("add", [EvString(aValueString), EvString(bValueString)]) =>
| ("concat", [EvArray(aValueArray), EvArray(bValueArray)]) => doAddArray(aValueArray, bValueArray)
| ("concat", [EvString(aValueString), EvString(bValueString)]) =>
doAddString(aValueString, bValueString)
| ("inspect", [value, EvString(label)]) => inspectLabel(value, label)
| ("inspect", [value]) => inspect(value)
| ("keep", [EvArray(aValueArray), EvLambda(aLambdaValue)]) =>
| ("filter", [EvArray(aValueArray), EvLambda(aLambdaValue)]) =>
doKeepArray(aValueArray, aLambdaValue)
| ("map", [EvArray(aValueArray), EvLambda(aLambdaValue)]) => doMapArray(aValueArray, aLambdaValue)
| ("mapSamples", [EvDistribution(SampleSet(dist)), EvLambda(aLambdaValue)]) =>

View File

@ -0,0 +1,67 @@
---
sidebar_position: 4
title: Sample Set Distribution
---
### make
```
SampleSet.make: (distribution) => sampleSet
SampleSet.make: (() => number) => sampleSet
SampleSet.make: (list<number>) => sampleSet
```
### kde
```
SampleSet.kde: (sampleSet) => pointSetDist
```
### toEmpiricalPdf
```
SampleSet.toEmpiricalPdf: (sampleSet) => pointSetDist
```
### map
```
SampleSet.map: (sampleSet, (number => number)) => sampleSet
```
### map2
```
SampleSet.map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSet
```
### map3
```
SampleSet.map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet
```
### correlation
```
SampleSet.correlation: (sampleSet, sampleSet) => number
```
### toInternalSampleArray
```
SampleSet.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.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**
```
toInternalSampleArray(toSampleSet(normal(5,2)))
```

View File

@ -1,67 +0,0 @@
---
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)))
```

View File

@ -0,0 +1,179 @@
---
sidebar_position: 6
title: List
---
## make
```
List.make: (number, 'a) => list<'a>
List.make: (number, number => a) => list<'a>
List.make: (pointSetDist) => list<number>
```
### toString
```
List.toString: (list<'a>) => string
```
### length
```
List.length: (list<'a>) => number
```
### get
```
List.get: (list<'a>, number) => 'a
```
### find
```
List.find: (list<'a>, 'a => bool) => 'a
```
### filter
```
List.filter: (list<'a>, 'a => bool) => 'a
```
### set
```
List.set: (list<'a>, number, 'a) => 'a
```
### shuffle
```
List.shuffle: (list<'a>) => list<'a>
```
### reverse
```
List.reverse: (list<'a>) => list<'a>
```
### range
```
List.range: (low:number, high:number, increment?:number=1.0) => list<number>
```
### zip
```
List.zip: (list<'a>, list<'b>) => list<list<'a|b>>
```
### unzip
```
List.unzip: (list<list<'a|b>>) => list<list<'a>, list<'b>>
```
### concat
```
List.concat: (list<'a>, list<'b>) => list<'a|b>
```
### concatMany
```
List.concatMany: (list<list<'a>>) => list<'a>
```
### slice
```
List.slice:
```
### map
```
List.map: (list<'a>, a => b) => list<'b>
```
### reduce
```
List.reduce:
```
### reduceRight
```
List.reduceRight:
```
### includes
```
List.includes: (list<'a>, 'a => bool) => boolean
```
### every
```
List.every: (list<'a>, 'a => bool) => boolean
```
### truncate
```
List.truncate: (list<'a>, number) => list<'a>
```
### uniq
```
List.uniq: (list<'a>) => list<'a>
```
### first
```
List.first: (list<'a>) => 'a
```
### last
```
List.last: (list<'a>) => 'a
```
### sort
```
List.sort: (list<'a>) => list<'a>
```

View File

@ -1,176 +0,0 @@
---
sidebar_position: 6
title: List
---
### make
```javascript
make: (number, 'a) => list<'a> (number, number => a) => list<'a> (pointSetDist) => list<number>
```
### toString
```typescript
toString: (list<'a>) => string
```
### length
```typescript
length: (list<'a>) => number
```
### get
```typescript
get: (list<'a>, number) => 'a
```
### find
```typescript
find: (list<'a>, 'a => bool) => 'a
```
### filter
```typescript
filter: (list<'a>, 'a => bool) => 'a
```
### set
```typescript
set: (list<'a>, number, 'a) => 'a
```
### shuffle
```typescript
shuffle: (list<'a>) => list<'a>
```
### reverse
```typescript
reverse: (list<'a>) => list<'a>
```
### range
```typescript
range: (low:number, high:number, increment?:number=1.0) => list<number>
```
### zip
```typescript
zip: (list<'a>, list<'b>) => list<list<'a|b>>
```
### unzip
```typescript
unzip: (list<list<'a|b>>) => list<list<'a>, list<'b>>
```
### concat
```typescript
concat: (list<'a>, list<'b>) => list<'a|b>
```
### concatMany
```typescript
concatMany: (list<list<'a>>) => list<'a>
```
### slice
```typescript
slice:
```
### map
```typescript
map: (list<'a>, a => b) => list<'b>
```
### reduce
```typescript
reduce:
```
### reduceRight
```typescript
reduceRight:
```
### includes
```typescript
includes: (list<'a>, 'a => bool) => boolean
```
### every
```typescript
every: (list<'a>, 'a => bool) => boolean
```
### truncate
```typescript
truncate: (list<'a>, number) => list<'a>
```
### uniq
```typescript
uniq: (list<'a>) => list<'a>
```
### first
```typescript
first: (list<'a>) => 'a
```
### last
```typescript
last: (list<'a>) => 'a
```
### sort
```typescript
sort: (list<'a>) => list<'a>
```