blob: 35dd255054643de8a21a5557330280e910b9b016 [file] [log] [blame]
kortschak805531d2017-11-01 10:30:53 +10301// Copyright ©2016 The Gonum Authors. All rights reserved.
btracey477fe7e2016-01-24 12:43:19 -07002// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package distmv
6
7// Quantiler returns the multi-dimensional inverse cumulative distribution function.
8// len(x) must equal len(p), and if x is non-nil, len(x) must also equal len(p).
9// If x is nil, a new slice will be allocated and returned, otherwise the quantile
10// will be stored in-place into x. All of the values of p must be between 0 and 1,
11// or Quantile will panic.
12type Quantiler interface {
13 Quantile(x, p []float64) []float64
14}
15
16// LogProber computes the log of the probability of the point x.
17type LogProber interface {
18 LogProb(x []float64) float64
19}
20
21// Rander generates a random number according to the distributon.
22// If the input is non-nil, len(x) must equal len(p) and the dimension of the distribution,
23// otherwise Quantile will panic.
24// If the input is nil, a new slice will be allocated and returned.
25type Rander interface {
26 Rand(x []float64) []float64
27}
28
29// RandLogProber is both a Rander and a LogProber.
30type RandLogProber interface {
31 Rander
32 LogProber
33}