ScottPlot
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
ScottPlot.RandomDataGenerator Class Reference

Public Member Functions

 RandomDataGenerator (int? seed=null)
 Create a random number generator. The seed is random by default, but could be fixed to the defined value.
 
void Seed (int seed)
 
double RandomNumber ()
 Return a uniformly random number between 0 (inclusive) and 1 (exclusive)
 
double RandomNumber (double max)
 Return a uniformly random number between 0 (inclusive) and max (exclusive)
 
double RandomNumber (double min, double max)
 Return a uniformly random number between min (inclusive) and max (exclusive)
 
double RandomNonZeroNumber (double max=1)
 Return a random number guaranteed not to be zero.
 
int RandomInteger ()
 Return a random integer up to the maximum integer size.
 
byte RandomByte ()
 Return a random byte (0-255)
 
byte RandomByte (byte min, byte max)
 Return a random byte between the given values (inclusive)
 
int RandomInteger (int max)
 Return a random integer between zero (inclusive) and max (exclusive)
 
int RandomInteger (int min, int max)
 Return a random integer between min (inclusive) and max (exclusive)
 
double RandomNormalNumber (double mean=0, double stdDev=1)
 Return a number normally distributed around the given mean according to the stdDev standard deviation.
 
void AddNoiseInPlace (double[] values, double magnitude)
 Mutate the given array by adding noise (± magnitude) and return it.
 
double[] AddNoise (double[] input, double magnitude)
 Return a copy of the given data with random noise added (± magnitude)
 
double[] RandomSample (int count, double mult=1, double offset=0)
 Uniformly distributed random numbers between 0 and 1 (multiplied by mult then added to offset ).
 
double[] RandomNormalSample (int count, double mean=0, double stdDev=1)
 Return a collection of numbers normally distributed around the given mean according to the stdDev standard deviation.
 
double[] RandomSin (int count)
 Sine wave with random frequency, amplitude, and phase.
 
double[] RandomWalk (int count, double mult=1, double offset=0, double slope=0)
 A sequence of numbers that starts at offset and "walks" randomly from one point to the next, scaled by mult with an approximate slope of slope .
 
List< OHLCRandomOHLCs (int count)
 Return a collection OHLCs representing random price action.
 
List< OHLCRandomOHLCs (int count, DateTime start)
 Return a collection OHLCs representing random price action.
 

Properties

static RandomDataGenerator Generate = new(0) [get]
 

Constructor & Destructor Documentation

◆ RandomDataGenerator()

ScottPlot.RandomDataGenerator.RandomDataGenerator ( int?  seed = null)
inline

Create a random number generator. The seed is random by default, but could be fixed to the defined value.

Member Function Documentation

◆ AddNoise()

double[] ScottPlot.RandomDataGenerator.AddNoise ( double[]  input,
double  magnitude 
)
inline

Return a copy of the given data with random noise added (± magnitude)

◆ AddNoiseInPlace()

void ScottPlot.RandomDataGenerator.AddNoiseInPlace ( double[]  values,
double  magnitude 
)
inline

Mutate the given array by adding noise (± magnitude) and return it.

◆ RandomByte() [1/2]

byte ScottPlot.RandomDataGenerator.RandomByte ( )
inline

Return a random byte (0-255)

◆ RandomByte() [2/2]

byte ScottPlot.RandomDataGenerator.RandomByte ( byte  min,
byte  max 
)
inline

Return a random byte between the given values (inclusive)

◆ RandomInteger() [1/3]

int ScottPlot.RandomDataGenerator.RandomInteger ( )
inline

Return a random integer up to the maximum integer size.

◆ RandomInteger() [2/3]

int ScottPlot.RandomDataGenerator.RandomInteger ( int  max)
inline

Return a random integer between zero (inclusive) and max (exclusive)

◆ RandomInteger() [3/3]

int ScottPlot.RandomDataGenerator.RandomInteger ( int  min,
int  max 
)
inline

Return a random integer between min (inclusive) and max (exclusive)

◆ RandomNonZeroNumber()

double ScottPlot.RandomDataGenerator.RandomNonZeroNumber ( double  max = 1)
inline

Return a random number guaranteed not to be zero.

◆ RandomNormalNumber()

double ScottPlot.RandomDataGenerator.RandomNormalNumber ( double  mean = 0,
double  stdDev = 1 
)
inline

Return a number normally distributed around the given mean according to the stdDev standard deviation.

◆ RandomNormalSample()

double[] ScottPlot.RandomDataGenerator.RandomNormalSample ( int  count,
double  mean = 0,
double  stdDev = 1 
)
inline

Return a collection of numbers normally distributed around the given mean according to the stdDev standard deviation.

◆ RandomNumber() [1/3]

double ScottPlot.RandomDataGenerator.RandomNumber ( )
inline

Return a uniformly random number between 0 (inclusive) and 1 (exclusive)

◆ RandomNumber() [2/3]

double ScottPlot.RandomDataGenerator.RandomNumber ( double  max)
inline

Return a uniformly random number between 0 (inclusive) and max (exclusive)

◆ RandomNumber() [3/3]

double ScottPlot.RandomDataGenerator.RandomNumber ( double  min,
double  max 
)
inline

Return a uniformly random number between min (inclusive) and max (exclusive)

◆ RandomOHLCs() [1/2]

List< OHLC > ScottPlot.RandomDataGenerator.RandomOHLCs ( int  count)
inline

Return a collection OHLCs representing random price action.

◆ RandomOHLCs() [2/2]

List< OHLC > ScottPlot.RandomDataGenerator.RandomOHLCs ( int  count,
DateTime  start 
)
inline

Return a collection OHLCs representing random price action.

◆ RandomSample()

double[] ScottPlot.RandomDataGenerator.RandomSample ( int  count,
double  mult = 1,
double  offset = 0 
)
inline

Uniformly distributed random numbers between 0 and 1 (multiplied by mult then added to offset ).

◆ RandomSin()

double[] ScottPlot.RandomDataGenerator.RandomSin ( int  count)
inline

Sine wave with random frequency, amplitude, and phase.

◆ RandomWalk()

double[] ScottPlot.RandomDataGenerator.RandomWalk ( int  count,
double  mult = 1,
double  offset = 0,
double  slope = 0 
)
inline

A sequence of numbers that starts at offset and "walks" randomly from one point to the next, scaled by mult with an approximate slope of slope .

◆ Seed()

void ScottPlot.RandomDataGenerator.Seed ( int  seed)
inline

Property Documentation

◆ Generate

RandomDataGenerator ScottPlot.RandomDataGenerator.Generate = new(0)
staticget

The documentation for this class was generated from the following file: