dist

package
v0.0.0-...-96ee72c Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: BSD-2-Clause Imports: 4 Imported by: 8

Documentation

Overview

Package dist provides spherical distribution types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Normal

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

Normal is an isotropic univariate spherical normal distribution discretized over a pixelation.

It is based on equation (2) from Hauberg (2018) 2018 IEEE FUSION: 704 <doi:10.23919/ICIF.2018.8455242>:

SN(x|u,v) ∝ exp(-λ * gcd(x,u)^2/2)

where x and u are points on a sphere, u is the mean, λ is the concentration parameter (in 1/radians^2), and gcd is the great circle distance.

func NewNormal

func NewNormal(lambda float64, pix *earth.Pixelation) Normal

NewNormal returns a discretized spherical normal, using lambda as the concentration parameter (in 1/radian^2 units) and using pix as the underlying pixelation.

func (Normal) CDF

func (n Normal) CDF(dist float64) float64

CDF returns the probability cumulative density function for a pixel at a distance dist (in radians).

func (Normal) Lambda

func (n Normal) Lambda() float64

Lambda returns the concentration parameter (in 1/radians^2) of a normal distribution.

func (Normal) LogProb

func (n Normal) LogProb(dist float64) float64

LogProb returns the natural logarithm of the probability density function at a distance dist (in radians).

func (Normal) LogProbRingDist

func (n Normal) LogProbRingDist(rDist int) float64

LogProbRingDist returns the natural logarithm of the probability density function at a given ring distance i.e. the ring of a pixel, if one of the pixels is rotated to the north pole.

func (Normal) Pix

func (n Normal) Pix() *earth.Pixelation

Pix returns the underlying pixelation of a normal distribution.

func (Normal) Prob

func (n Normal) Prob(dist float64) float64

Prob returns the value of the probability density function for a pixel at a distance dist (in radians).

func (Normal) ProbRingDist

func (n Normal) ProbRingDist(rDist int) float64

ProbRingDist returns the the value of the probability density function at a given ring distance i.e. the ring of a pixel, if one of the pixels is rotated to the north pole.

func (Normal) QuantileChord2

func (n Normal) QuantileChord2(cd float64) float64

QuantileChord2 returns the square of the Euclidean chord distance for the maximum distance that is inside the indicated cumulative density.

This is useful because sometimes we want to know if a given pixel is inside or outside a critical CDF value and then using the great circle distance.

func (Normal) Rand

func (n Normal) Rand(u earth.Pixel) earth.Pixel

Rand returns a random pixel from the underlying pixelation draw from an spherical normal which mean is the pixel u.

func (Normal) Ring

func (n Normal) Ring(dist float64) float64

Ring returns the value of the probability density function for a ring at a distance dist (in radians).

func (Normal) ScaledProb

func (n Normal) ScaledProb(dist float64) float64

ScaledProb returns the value of the probability density function for a pixel at a distance dist (in radians) scaled by the maximum probability (i.e. by 0 distance).

func (Normal) ScaledProbRingDist

func (n Normal) ScaledProbRingDist(rDist int) float64

ScaledRingDist returns the value of the probability density function scaled by the maximum probability (i.e. by 0 distance). at a given ring distance i.e. the ring of a pixel, if one of the pixels is rotated to the north pole.

func (Normal) Variance

func (n Normal) Variance() float64

Variance returns the Variance (in radians^2).

Jump to

Keyboard shortcuts

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