squiggle/packages/squiggle-lang/src/rescript/Distributions/GenericDist.resi

85 lines
2.1 KiB
Plaintext
Raw Normal View History

type t = DistributionTypes.genericDist
type error = DistributionTypes.error
2022-03-28 12:39:07 +00:00
type toPointSetFn = t => result<PointSetTypes.pointSetDist, error>
2022-04-09 22:10:06 +00:00
type toSampleSetFn = t => result<SampleSetDist.t, error>
2022-03-28 12:39:07 +00:00
type scaleMultiplyFn = (t, float) => result<t, error>
type pointwiseAddFn = (t, t) => result<t, error>
let sampleN: (t, int) => array<float>
2022-04-09 22:10:06 +00:00
let toSampleSetDist: (t, int) => Belt.Result.t<QuriSquiggleLang.SampleSetDist.t, error>
2022-03-28 12:39:07 +00:00
let fromFloat: float => t
let toString: t => string
let normalize: t => t
let isNormalized: t => bool
let toFloatOperation: (
t,
~toPointSetFn: toPointSetFn,
2022-04-29 01:31:15 +00:00
~distToFloatOperation: DistributionTypes.DistributionOperation.toFloat,
) => result<float, error>
2022-03-28 12:39:07 +00:00
module Score: {
let klDivergence: (t, t, ~toPointSetFn: toPointSetFn) => result<float, error>
let logScoreWithPointResolution: (
option<t>,
t,
float,
~toPointSetFn: toPointSetFn,
) => result<float, error>
}
2022-04-29 00:24:13 +00:00
2022-04-11 06:16:29 +00:00
@genType
let toPointSet: (
t,
~xyPointLength: int,
~sampleCount: int,
2022-04-23 18:09:06 +00:00
~xSelection: DistributionTypes.DistributionOperation.pointsetXSelection=?,
unit,
) => result<PointSetTypes.pointSetDist, error>
2022-04-09 02:55:06 +00:00
let toSparkline: (t, ~sampleCount: int, ~bucketCount: int=?, unit) => result<string, error>
2022-03-28 12:39:07 +00:00
let truncate: (
t,
~toPointSetFn: toPointSetFn,
~leftCutoff: option<float>=?,
~rightCutoff: option<float>=?,
unit,
) => result<t, error>
2022-03-28 12:39:07 +00:00
let algebraicCombination: (
~strategy: DistributionTypes.asAlgebraicCombinationStrategy,
2022-03-29 19:47:32 +00:00
t,
~toPointSetFn: toPointSetFn,
~toSampleSetFn: toSampleSetFn,
2022-04-23 18:09:06 +00:00
~arithmeticOperation: Operation.algebraicOperation,
~t2: t,
2022-03-28 12:39:07 +00:00
) => result<t, error>
let pointwiseCombination: (
2022-03-29 19:47:32 +00:00
t,
~toPointSetFn: toPointSetFn,
2022-04-23 18:09:06 +00:00
~algebraicCombination: Operation.algebraicOperation,
~t2: t,
2022-03-28 12:39:07 +00:00
) => result<t, error>
let pointwiseCombinationFloat: (
2022-03-29 19:47:32 +00:00
t,
~toPointSetFn: toPointSetFn,
2022-04-23 18:09:06 +00:00
~algebraicCombination: Operation.algebraicOperation,
~f: float,
2022-03-28 12:39:07 +00:00
) => result<t, error>
let mixture: (
array<(t, float)>,
~scaleMultiplyFn: scaleMultiplyFn,
~pointwiseAddFn: pointwiseAddFn,
) => result<t, error>
let isSymbolic: t => bool
let isPointSet: t => bool