Documentation ¶
Index ¶
- func EstimateNoise(data []float32, width int32) float32
- func FastApproxBoundedMAD(data []float32, location float32, lowBound, highBound float32, numSamples int) float32
- func FastApproxBoundedMedian(data []float32, lowBound, highBound float32, samples []float32) float32
- func FastApproxBoundedQn(data []float32, lowBound, highBound float32, samples []float32) float32
- func FastApproxBoundedStdDev(data []float32, location float32, lowBound, highBound float32, numSamples int) float32
- func FastApproxMAD(data []float32, location float32, samples []float32) float32
- func FastApproxMedian(data []float32, samples []float32) float32
- func FastApproxQn(data []float32, samples []float32) float32
- func FastApproxSigmaClippedMedianAndQn(data []float32, sigmaLow, sigmaHigh float32, epsilon float32, numSamples int) (location, scale float32)
- func FastApproxStdDev(data []float32, location float32, numSamples int) float32
- func GetModeStdDevFromHistogram(bins []int32, min, max float32) (mode, stdDev float32, err error)
- func GetModeStdDevFromPerceptualHistogram(bins []int32, min, max float32) (mode float32, err error)
- func GetPeak(bins []int32, min, max float32) (x, y float32)
- func GetPerceptualHistogramPeak(bins []int32, min, max float32) (x, y float32)
- func HalfSampleMode(data []float32) float32
- func HalfSampleModeSorted(data []float32) float32
- func Histogram(data []float32, min, max float32, bins []int32)
- func HistogramScaleLoc(data []float32, min, max float32, numBins uint32) (loc, scale float32)
- func IKSS(data []float32, epsilon float32, e float32) (location, scale float32)
- func LinearRegression(xs, ys []float32) (slope, intercept, xmean, xstddev, ymean, ystddev float32)
- func MeanStdDev(xs []float32) (mean, stdDev float32)
- func PerceptualHistogram(data []float32, min, max float32, bins []int32)
- func SigmaClippedMedianAndMAD(data []float32, sigmaLow, sigmaHigh float32) (median, mad float32)
- type LSEstimatorMode
- type Stats
- func (s *Stats) Clear()
- func (s *Stats) FreeData()
- func (s *Stats) Location() float32
- func (s *Stats) Max() float32
- func (s *Stats) Mean() float32
- func (s *Stats) Min() float32
- func (s *Stats) Noise() float32
- func (s *Stats) Scale() float32
- func (s *Stats) SetData(d []float32)
- func (s *Stats) StdDev() float32
- func (s *Stats) String() string
- func (s *Stats) StringEager() string
- func (s *Stats) UpdateCachedWith(multiplier, offset float32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EstimateNoise ¶
Estimate the level of gaussian noise on a natural image. From J. Immerkær, “Fast Noise Variance Estimation”, Computer Vision and Image Understanding, Vol. 64, No. 2, pp. 300-302, Sep. 1996
func FastApproxBoundedMAD ¶
func FastApproxBoundedMAD(data []float32, location float32, lowBound, highBound float32, numSamples int) float32
Calculates fast approximate median of absolute differences of the (presumably large) data by subsampling the given number of values and taking the MAD of that.
func FastApproxBoundedMedian ¶
func FastApproxBoundedMedian(data []float32, lowBound, highBound float32, samples []float32) float32
Calculates fast approximate median of the (presumably large) data by subsampling the given number of values and taking the median of that. Uses provided samples array as scratchpad
func FastApproxBoundedQn ¶
Calculates fast approximate Qn scale estimate of the (presumably large) data by subsampling the given number of pairs and taking the first quartile of that.
func FastApproxBoundedStdDev ¶
func FastApproxBoundedStdDev(data []float32, location float32, lowBound, highBound float32, numSamples int) float32
Calculates fast approximate median of the (presumably large) data by subsampling the given number of values and taking the median of that.
func FastApproxMAD ¶
Calculates fast approximate median of absolute differences of the (presumably large) data by subsampling the given number of values and taking the MAD of that.
func FastApproxMedian ¶
Calculates fast approximate median of the (presumably large) data by subsampling the given number of values and taking the median of that. Uses provided samples array as scratchpad
func FastApproxQn ¶
Calculates fast approximate Qn scale estimate of the (presumably large) data by subsampling the given number of pairs and taking the first quartile of that. Original paper http://web.ipac.caltech.edu/staff/fmasci/home/astro_refs/BetterThanMAD.pdf Original n*log n implementation technical report https://www.researchgate.net/profile/Christophe_Croux/publication/228595593_Time-Efficient_Algorithms_for_Two_Highly_Robust_Estimators_of_Scale/links/09e4150f52c2fcabb0000000/Time-Efficient-Algorithms-for-Two-Highly-Robust-Estimators-of-Scale.pdf Sampling approach appears to be mine
func FastApproxSigmaClippedMedianAndQn ¶
func FastApproxSigmaClippedMedianAndQn(data []float32, sigmaLow, sigmaHigh float32, epsilon float32, numSamples int) (location, scale float32)
Returns a rapid robust estimation of location and scale. Uses a fast approximate median based on randomized 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 FastApproxStdDev ¶
Calculates fast approximate median of the (presumably large) data by subsampling the given number of values and taking the median of that.
func GetModeStdDevFromHistogram ¶
Calculates the mode and the standard deviation of the given histogram
func GetModeStdDevFromPerceptualHistogram ¶
Calculates the mode and the standard deviation of the given histogram
func GetPerceptualHistogramPeak ¶
Returns the location and the value of the histogram peak
func HalfSampleMode ¶
Returns the half sample mode of the data, an estimator for the mode. Does not modify data. Turned out not to be that robust after all, not using this. From Bickel and Fruehwirth 2006, https://arxiv.org/ftp/math/papers/0505/0505419.pdf
func HalfSampleModeSorted ¶
Returns the half sample mode of the data, an estimator for the mode. Does not modify data. Prerequisite: data is sorted. Turned out not to be that robust after all, not using this. From Bickel and Fruehwirth 2006, https://arxiv.org/ftp/math/papers/0505/0505419.pdf
func HistogramScaleLoc ¶
Calculate scale and location based on histogram
func LinearRegression ¶
Calculate linear regression for xs and ys
func MeanStdDev ¶
func PerceptualHistogram ¶
Calculate histogram of data between min and max into given bins
func SigmaClippedMedianAndMAD ¶
Returns the sigma clipped median of the data. Does not change the data.
Types ¶
type LSEstimatorMode ¶
type LSEstimatorMode int
Enumerated type for location and scale estimator modes
const ( LSEMeanStdDev LSEstimatorMode = iota LSEMedianMAD LSEIKSS LSESCMedianQn LSEHistogram )
var LSEstimator LSEstimatorMode = LSESCMedianQn
Global mode selection for location and scale estimation FIXME: Need to still remove this global
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Statistics on data arrays, calculated on demand