Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gaussian2d ¶
type Gaussian2d struct {
Mx, My float64 // mean
Sx, Sy float64 // standard deviation
Cov float64 // covariance
Ht float64 // value at the mean
// contains filtered or unexported fields
}
Gaussian2d is a 2-dimensional normal distribution.
func NewGaussian2d ¶
func NewGaussian2d(mx, my, sx, sy, ht, cov float64) *Gaussian2d
NewGaussian2d returns a new 2-dimensional Gaussian2d with the given mean, standard deviation, covariance
A bunch of values used during PDF computation are pre-computed for efficiency, so if any of the exported fields are changed then Precompute() must be called to re-compute these fields.
func (*Gaussian2d) PDF ¶
func (g *Gaussian2d) PDF(x, y float64) float64
PDF returns the probability density.
func (*Gaussian2d) Precompute ¶
func (g *Gaussian2d) Precompute()
precompute pre-computes a bunch of information that is used during PDF computation. It must be called if any of the exported fields of the gaussion are changed after NewGaussian2d is called.
Click to show internal directories.
Click to hide internal directories.