distuvx

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MIT Imports: 3 Imported by: 0

README

distuvx

Provides univariate random distribution types not found in gonum/stat/distuv

GoDoc Go Report Card License Badge

Overview

distuvx provides univariate random distribution types that are not currently found in gonum/stat/distuv.

Contributing

Contributions are welcome! To contribute please:

  1. Fork the repository
  2. Create a feature branch
  3. Code
  4. Submit a pull request
Testing

Prior to submitting a pull request, please run:

$ make check

To update and view the test coverage report:

$ make cover

License

distuvx is released under the MIT license. Please see the LICENSE file for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Beta4

type Beta4 struct {
	// contains filtered or unexported fields
}

Beta4 implements the four-parameter Beta distribution, which is like the two-parameter Beta distribution with ranges between the min and max instead of between 0 and 1.

func NewBeta4

func NewBeta4(alpha, beta, min, max float64, src rand.Source) Beta4

NewBeta4 constructs a new four-parameter Beta distribution.

func (Beta4) CDF

func (b Beta4) CDF(y float64) float64

CDF computes the value of the cumulative distribution function at y.

func (Beta4) Mean

func (b Beta4) Mean() float64

Mean returns the mean of the Beta4 probability distribution.

func (Beta4) Mode

func (b Beta4) Mode() float64

Mode returns the mode of the Beta4 distribution.

Mode returns NaN if either alpha or beta parameters are less than or equal to 1 as a special case.

func (Beta4) NumParameters

func (b Beta4) NumParameters() int

NumParameters returns the number of parameters in the Beta4 distribution.

func (Beta4) Prob

func (b Beta4) Prob(y float64) float64

Prob computes the value of the probability density function at y.

func (Beta4) Rand

func (b Beta4) Rand() float64

Rand implements the Rander interface for the PERT distribution.

func (Beta4) StdDev

func (b Beta4) StdDev() float64

StdDev returns the standard deviation of the Beta4 probability distribution.

func (Beta4) Variance

func (b Beta4) Variance() float64

Variance returns the variance of the Beta4 probability distribution.

type PERT

type PERT struct {
	// contains filtered or unexported fields
}

PERT represents a PERT distribution, which is a four parameter Beta distribution described by the parameters min, max, and mode, as well as the requirement that the mean = (max + 4 * mod + min) / 6. (https://en.wikipedia.org/wiki/PERT_distribution)

func NewPERT

func NewPERT(min, max, mode float64, src rand.Source) PERT

NewPERT constructs a new PERT distribution using the given min, max, and mode. Constraints are min < max and min ≤ mode ≤ max.

func (PERT) CDF

func (p PERT) CDF(y float64) float64

CDF computes the value of the cumulative distribution function at y.

func (PERT) Mean

func (p PERT) Mean() float64

Mean returns the mean of the PERT probability distribution.

func (PERT) Mode

func (p PERT) Mode() float64

Mode returns the mode of the PERT probability distribution.

func (PERT) NumParameters

func (p PERT) NumParameters() int

NumParameters returns the number of parameters in the PERT distribution.

func (PERT) Prob

func (p PERT) Prob(y float64) float64

Prob computes the value of the probability density function at y.

func (PERT) Rand

func (p PERT) Rand() float64

Rand implements the Rander interface for the PERT distribution.

Jump to

Keyboard shortcuts

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