scaled

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package scaled provides a probability distribution scaler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scaled

type Scaled struct {
	Distribution distuv.Rander

	Min float64
	Max float64
	// contains filtered or unexported fields
}

Scaled transforms a distribution by scaling the output between minimum and maximum values.

func New

func New(dist distuv.Rander, min, max float64) (s Scaled)

New constructs a new scaled distribution with a minimum and maximum range.

func (Scaled) Rand

func (s Scaled) Rand() float64

Rand returns a random draw from the embedded distribution rescaled to the min and max range.

Jump to

Keyboard shortcuts

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