smpln

package
v0.0.0-...-6cdf10e Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Choose

func Choose(nsmpl, nchoose int) [][]bool

func Permutations

func Permutations(p, w int) [][]float64

Permutations returns a sampling plan [0,1] p: dimension; w: number of discrete samples

Types

type HaltonDigitalSequence

type HaltonDigitalSequence struct {
	U [][]float64
	// contains filtered or unexported fields
}

HaltonDigitalSequence is the structure to hold the state of one instance of the Halton digital sequence. New instances can be allocated using the HaltonDigitalSequence.New() function.

func NewHalton

func NewHalton(n, p int) *HaltonDigitalSequence

NewHalton allocates a new instance of the LHC

func (*HaltonDigitalSequence) SampleSize

func (hds *HaltonDigitalSequence) SampleSize() int

SampleSize simply returns the number of samples

type KnuthShuffle

type KnuthShuffle struct {
	Z [][]int
	// contains filtered or unexported fields
}

KnuthShuffle is the structure to hold the state of one instance of the LHC. New instances can be allocated using the knuthShuffle.New() function.

func NewKS

func NewKS(n, p int) *KnuthShuffle

NewKS allocates a new instance of the Knuth Shuffle from n samples of p integers.

func (*KnuthShuffle) Make

func (ks *KnuthShuffle) Make(rng *rand.Rand)

Make builds the sampling plan nxp matrix.

type LatinHyperCube

type LatinHyperCube struct {
	U [][]float64
	// contains filtered or unexported fields
}

LatinHyperCube is the structure to hold the state of one instance of the LHC. New instances can be allocated using the latinHyperCube.New() function.

func NewLHC

func NewLHC(rng *rand.Rand, n, p int, midpoint bool) *LatinHyperCube

NewLHC allocates a new instance of the LHC from n samples of p dimensions.

func (*LatinHyperCube) SampleSize

func (lhc *LatinHyperCube) SampleSize() int

SampleSize simply returns the number of samples

func (*LatinHyperCube) UT

func (lhc *LatinHyperCube) UT() [][]float64

Jump to

Keyboard shortcuts

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