Table of Contents

Class RandomDataGenerator

Namespace
ScottPlot
Assembly
ScottPlot.dll
public class RandomDataGenerator
Inheritance
RandomDataGenerator
Inherited Members
Extension Methods

Constructors

RandomDataGenerator(int?)

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

public RandomDataGenerator(int? seed = null)

Parameters

seed int?

Properties

Generate

public static RandomDataGenerator Generate { get; }

Property Value

RandomDataGenerator

Methods

AddNoise(double[], double)

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

public double[] AddNoise(double[] input, double magnitude)

Parameters

input double[]
magnitude double

Returns

double[]

AddNoiseInPlace(double[], double)

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

public void AddNoiseInPlace(double[] values, double magnitude)

Parameters

values double[]
magnitude double

RandomByte()

Return a random byte (0-255)

public byte RandomByte()

Returns

byte

RandomByte(byte, byte)

Return a random byte between the given values (inclusive)

public byte RandomByte(byte min, byte max)

Parameters

min byte
max byte

Returns

byte

RandomInteger()

Return a random integer up to the maximum integer size

public int RandomInteger()

Returns

int

RandomInteger(int)

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

public int RandomInteger(int max)

Parameters

max int

Returns

int

RandomInteger(int, int)

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

public int RandomInteger(int min, int max)

Parameters

min int
max int

Returns

int

RandomNonZeroNumber(double)

Return a random number guaranteed not to be zero

public double RandomNonZeroNumber(double max = 1)

Parameters

max double

Returns

double

RandomNormalNumber(double, double)

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

public double RandomNormalNumber(double mean = 0, double stdDev = 1)

Parameters

mean double
stdDev double

Returns

double

RandomNormalSample(int, double, double)

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

public double[] RandomNormalSample(int count, double mean = 0, double stdDev = 1)

Parameters

count int
mean double
stdDev double

Returns

double[]

RandomNumber()

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

public double RandomNumber()

Returns

double

RandomNumber(double)

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

public double RandomNumber(double max)

Parameters

max double

Returns

double

RandomNumber(double, double)

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

public double RandomNumber(double min, double max)

Parameters

min double
max double

Returns

double

RandomOHLCs(int)

Return a collection OHLCs representing random price action

public List<OHLC> RandomOHLCs(int count)

Parameters

count int

Returns

List<OHLC>

RandomOHLCs(int, DateTime)

Return a collection OHLCs representing random price action

public List<OHLC> RandomOHLCs(int count, DateTime start)

Parameters

count int
start DateTime

Returns

List<OHLC>

RandomSample(int, double, double)

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

public double[] RandomSample(int count, double mult = 1, double offset = 0)

Parameters

count int
mult double
offset double

Returns

double[]

RandomSin(int)

Sine wave with random frequency, amplitude, and phase

public double[] RandomSin(int count)

Parameters

count int

Returns

double[]

RandomWalk(int, double, double, double)

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.

public double[] RandomWalk(int count, double mult = 1, double offset = 0, double slope = 0)

Parameters

count int
mult double
offset double
slope double

Returns

double[]

Seed(int)

public void Seed(int seed)

Parameters

seed int