bootstrap: github.com/Preetam/bootstrap Index | Files

package bootstrap

import "github.com/Preetam/bootstrap"

Index

Package Files

bootstrap.go

type Aggregator Uses

type Aggregator interface {
    Aggregate(values []float64) float64
}

Aggregator aggregates a slice of floats.

type AverageAggregator Uses

type AverageAggregator struct{}

AverageAggregator generates an average.

func NewAverageAggregator Uses

func NewAverageAggregator() AverageAggregator

NewAverageAggregator returns a new AverageAggregator.

func (AverageAggregator) Aggregate Uses

func (a AverageAggregator) Aggregate(values []float64) float64

Aggregate returns the average of values.

type BasicResampler Uses

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

BasicResampler is a basic bootstrap resampler.

func NewBasicResampler Uses

func NewBasicResampler(aggregator Aggregator, iterations int) *BasicResampler

NewBasicResampler returns a BasicResampler that aggregates values using aggregator.

func (*BasicResampler) Quantile Uses

func (r *BasicResampler) Quantile(q float64) float64

Quantile returns the q quantile of resampled aggregate values. Resample must be called before this method or NaN is returned.

func (*BasicResampler) Resample Uses

func (r *BasicResampler) Resample(values []float64)

Resample resamples from values for the given number of iterations and saves the aggregate values.

func (*BasicResampler) Reset Uses

func (r *BasicResampler) Reset()

Reset resets any sampled state.

type PresampledResampler Uses

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

PresampledResampler is a bootstrap resampler that precomputes sample indexes on creation.

func NewPresampledResampler Uses

func NewPresampledResampler(aggregator Aggregator, iterations int, numValues int) *PresampledResampler

NewPresampledResampler returns a PresampledResampler that aggregates values using aggregator.

func (*PresampledResampler) Quantile Uses

func (r *PresampledResampler) Quantile(q float64) float64

Quantile returns the q quantile of resampled aggregate values. Resample must be called before this method or NaN is returned.

func (*PresampledResampler) Resample Uses

func (r *PresampledResampler) Resample(values []float64)

Resample resamples from values for the given number of iterations and saves the aggregate values.

func (*PresampledResampler) Reset Uses

func (r *PresampledResampler) Reset()

Reset resets any sampled state.

type QuantileAggregator Uses

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

QuantileAggregator generates a quantile.

func NewQuantileAggregator Uses

func NewQuantileAggregator(quantile float64) QuantileAggregator

NewQuantileAggregator returns a new QuantileAggregator with the given quantile.

func (QuantileAggregator) Aggregate Uses

func (a QuantileAggregator) Aggregate(values []float64) float64

Aggregate returns the a.quantile quantile of values.

type Resampler Uses

type Resampler interface {
    Resample(values []float64)
    Quantile(float64) float64
    Reset()
}

Resampler resamples floats with an Aggregator.

type SumAggregator Uses

type SumAggregator struct{}

SumAggregator generates a sum.

func NewSumAggregator Uses

func NewSumAggregator() SumAggregator

NewSumAggregator returns a new SumAggregator.

func (SumAggregator) Aggregate Uses

func (a SumAggregator) Aggregate(values []float64) float64

Aggregate returns the sum of values.

Package bootstrap imports 3 packages (graph). Updated 2017-11-12. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).