experiments

package
v0.0.0-...-a7a9078 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	ID     int
	Levels []Level
	Stats  Statistics
}

Block stores information on blocks for experiments that use blocking.

type Experimenter

type Experimenter interface {
	Evaluate(impute bool) error
}

Experimenter is an interface that defines calculations to evaluate an experiment.

type Factor

type Factor struct {
	ID          int64
	Name        string
	Levels      []Level
	Description string
}

Factor stores information about factors of an experiment .

func NewFactor

func NewFactor(n string, d string, l []Level) Factor

NewFactor creates a new experiment Factor with specified levels

type Level

type Level struct {
	ID          int
	Name        string
	Description string
	Stats       Statistics
}

Level contains information related to levels of a factor.

func NewLevel

func NewLevel(l string, d string) Level

NewLevel creates a Level object for a Factor

type Leveler

type Leveler interface {
	// contains filtered or unexported methods
}

Leveler defines behavior related to factor and block levels.

type RCBDExperiment

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

RCBDExperiment stores all the information about an experiment.

func NewRCBDExperiment

func NewRCBDExperiment(id int64, f Factor, b Block) RCBDExperiment

NewRCBDExperiment generates a new experiment and generates the slice of subjects that can be randomly assigned as the experiment commences.

func (*RCBDExperiment) BulkUpdate

func (re *RCBDExperiment) BulkUpdate(obs []Subject) error

BulkUpdate will update multiple subjects at once.

func (*RCBDExperiment) Evaluate

func (re *RCBDExperiment) Evaluate(impute bool) error

Evaluate calculates the statistics for the experiment and stores them in the stats field. If impute is set to true, evaluate will impute missing values, if it is set to false, the evaluation will not be completed.

func (*RCBDExperiment) RandomID

func (re *RCBDExperiment) RandomID() int64

RandomID returns a random ID from those still available and sets the ID to filled.

func (*RCBDExperiment) UpdateObs

func (re *RCBDExperiment) UpdateObs(obs Subject) error

UpdateObs will update the value for a subject in the experiment.

type SourceOfVariation

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

SourceOfVariation stores summary information for a source of variation

type Statistics

type Statistics struct {
	Sum        float64
	SumSquared float64
	N          int64
	Mean       float64
}

Statistics stores summary statistics information

type Subject

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

Subject stores information on a subject in an experiment.

Jump to

Keyboard shortcuts

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