distributions

package
v1.0.43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultParetoScale = 1
	DefaultParetoShape = 0.1
)
View Source
const (
	NormalSigma = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Constant added in v1.0.39

type Constant struct {
	Number
}

Constant represents a Constant distribution

func NewConstant added in v1.0.39

func NewConstant() *Constant

NewConstant creates a new Constant distribution.

func (*Constant) Next added in v1.0.39

func (u *Constant) Next() float64

Next computes the value of the probability density function at x.

type Generator

type Generator interface {
	Next() float64
	Last() float64
}

type Normal added in v1.0.37

type Normal struct {
	Impl distuv.Normal

	Number
	// contains filtered or unexported fields
}

Normal represents a normal (Gaussian) distribution (https://en.wikipedia.org/wiki/Normal_distribution).

func NewNormal added in v1.0.37

func NewNormal(lb int64, ub int64) *Normal

NewNormal creates a new Normal distribution.

func (*Normal) Next added in v1.0.37

func (u *Normal) Next() float64

Next computes the value of the probability density function at x.

type Number added in v1.0.37

type Number struct {
	LastValue float64
}

Number is a common generator.

func (*Number) Last added in v1.0.37

func (n *Number) Last() float64

Last implements the Generator Last interface.

func (*Number) SetLastValue added in v1.0.37

func (n *Number) SetLastValue(value float64)

SetLastValue sets the last value generated.

type Pareto added in v1.0.37

type Pareto struct {
	Impl distuv.Pareto

	Number
	// contains filtered or unexported fields
}

Pareto implements the Pareto (Type I) distribution

func NewPareto added in v1.0.37

func NewPareto(scale float64, shape float64) *Pareto

NewPareto creates a new Pareto distribution.

func (*Pareto) Next added in v1.0.37

func (u *Pareto) Next() float64

Next computes the value of the probability density function at x.

type ProbabilitySlice added in v1.0.37

type ProbabilitySlice []float64

ProbabilitySlice provides the value of the probability density function at x.

func GenerateProbabilitySliceFromSpec added in v1.0.37

func GenerateProbabilitySliceFromSpec(samples int64, spec *v1alpha1.DistributionSpec) ProbabilitySlice

func (ProbabilitySlice) ApplyToFloat64 added in v1.0.37

func (dist ProbabilitySlice) ApplyToFloat64(total float64) []float64

func (ProbabilitySlice) ApplyToInt64 added in v1.0.37

func (dist ProbabilitySlice) ApplyToInt64(total int64) []int64

func (ProbabilitySlice) ApplyToResources added in v1.0.37

func (dist ProbabilitySlice) ApplyToResources(total corev1.ResourceList) v1alpha1.ResourceDistribution

func (ProbabilitySlice) ApplyToTimeline added in v1.0.37

func (dist ProbabilitySlice) ApplyToTimeline(startingTime metav1.Time, total metav1.Duration) v1alpha1.Timeline

type Uniform added in v1.0.37

type Uniform struct {
	Impl distuv.Uniform

	Number
	// contains filtered or unexported fields
}

Uniform represents a continuous uniform distribution (https://en.wikipedia.org/wiki/Uniform_distribution_%28continuous%29).

func NewUniform added in v1.0.37

func NewUniform(lb int64, ub int64) *Uniform

NewUniform creates a new Uniform distribution.

func (*Uniform) Next added in v1.0.37

func (u *Uniform) Next() float64

Next computes the value of the probability density function at x.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL