stats

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: GPL-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

type Stats struct {
	Width    int       // Width of a line in the underlying data array (for noise)
	Data     []float32 // The underlying data array
	ADU      int32     // ADU value of the data
	Min      float32   // Minimum
	Max      float32   // Maximum
	Mean     float32   // Mean (average)
	StdDev   float32   // Standard Deviation (norm 2, sigma)
	Variance float32   // Variance (sigma^2)
	Location float32   // Selected location indicator (standard: randomized sigma-clipped median using randomized Qn)
	Scale    float32   // Selected scale indicator (standard: randomized Qn)
	Noise    float32   // Noise Estimation
}

Statistics on data arrays, calculated on demand.

func NewStats

func NewStats(data []float32, adu int32, xs int) *Stats

func (*Stats) FastApproxBoundedMedian added in v0.14.0

func (s *Stats) FastApproxBoundedMedian(sample []float32, lowerBound, higherBound float32) float32

FastApproxBoundedMedian

Calculates fast approximate median of the (presumably large) data by sub-sampling the given number of values and taking the median of that.

Note: this is not a statistically correct median, but it is fast and should be good enough for most purposes. The sub-sampling is done by randomly selecting sub-values from the data array using a random number generator pinned to the maximum of the data array.

func (*Stats) FastApproxBoundedQn added in v0.14.0

func (s *Stats) FastApproxBoundedQn(sample []float32, lowerBound, higherBound float32) float32

Calculates fast approximate Qn scale estimate of the (presumably large) data by sub-sampling the given number of pairs and taking the first quartile of that.

N.B This is not a statistically correct median, but it is fast and should be good enough for most purposes. The sub-sampling is done by randomly selecting sub-values from the data array using a random number generator pinned to the maximum of the data array.

func (*Stats) FastApproxMedian added in v0.14.0

func (s *Stats) FastApproxMedian(sample []float32) float32

Calculates fast approximate median of the (presumably large) data by sub-sampling the given number of values and taking the median of that.

N.B. This is not a statistically correct median, but it is fast and should be good enough for most purposes. The sub-sampling is done by randomly selecting sub-values from the data array using a random number generator pinned to the maximum of the data array.

func (*Stats) FastApproxQn added in v0.14.0

func (s *Stats) FastApproxQn(sample []float32) float32

Calculates fast approximate Qn scale estimate of the (presumably large) data by sub-sampling the given number of pairs.

N.B. This is not a statistically correct median, but it is fast and should be good enough for most purposes. The sub-sampling is done by randomly selecting sub-values from the data array using a random number generator pinned to the maximum of the data array.

@see http://web.ipac.caltech.edu/staff/fmasci/home/astro_refs/BetterThanMAD.pdf

func (*Stats) FastApproxSigmaClippedMedianAndQn added in v0.14.0

func (s *Stats) FastApproxSigmaClippedMedianAndQn() (float32, float32)

Calculates the fast approximate sigma-clipped median and Qn scale estimate of the data, returning a rapid estimation of location and scale. Uses a fast approximate median based on randomized sub-sampling, iteratively sigma clipped with a fast approximate Qn based on random sampling. Exits once the absolute change in location and scale is below epsilon.

func (*Stats) FastMedian added in v0.14.0

func (s *Stats) FastMedian() float32

FastMedian calculates the median of the data sample

Jump to

Keyboard shortcuts

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