RandomSamplingExtensions.CorrelatedSamples Method

Definition

Namespace: Numerics.NET.Statistics.Distributions
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0

Overload List

CorrelatedSamples(IRandomSource, Int32, Distribution[], SymmetricMatrix<Double>) Generates a series of random variables with the specified correlation matrix.
CorrelatedSamples(Random, Int32, Distribution[], SymmetricMatrix<Double>) Generates a series of random variables with the specified correlation matrix.
CorrelatedSamples<TGenerator>(IRandomSource<TGenerator>, Int32, Distribution[], SymmetricMatrix<Double>) Generates a series of random variables with the specified correlation matrix.

CorrelatedSamples(IRandomSource, Int32, Distribution[], SymmetricMatrix<Double>)

Generates a series of random variables with the specified correlation matrix.
C#
public static Vector<double>[] CorrelatedSamples(
	this IRandomSource random,
	int numberOfSamples,
	Distribution[] distributions,
	SymmetricMatrix<double> correlations
)

Parameters

random  IRandomSource
 
numberOfSamples  Int32
The number of samples to generate.
distributions  Distribution[]
An array of Distribution objects specifying the probability distribution of each variable.
correlations  SymmetricMatrix<Double>
A SymmetricMatrix specifying the desired correlation matrix.

Return Value

Vector<Double>[]
An array of real vectors with approximately the specified correlation matrix.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IRandomSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

CorrelatedSamples<TGenerator>(IRandomSource<TGenerator>, Int32, Distribution[], SymmetricMatrix<Double>)

Generates a series of random variables with the specified correlation matrix.
C#
public static Vector<double>[] CorrelatedSamples<TGenerator>(
	this IRandomSource<TGenerator> random,
	int numberOfSamples,
	Distribution[] distributions,
	SymmetricMatrix<double> correlations
)
where TGenerator : struct, new(), IRandomGenerator

Parameters

random  IRandomSource<TGenerator>
 
numberOfSamples  Int32
The number of samples to generate.
distributions  Distribution[]
An array of Distribution objects specifying the probability distribution of each variable.
correlations  SymmetricMatrix<Double>
A SymmetricMatrix specifying the desired correlation matrix.

Type Parameters

TGenerator

Return Value

Vector<Double>[]
An array of real vectors with approximately the specified correlation matrix.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IRandomSource<TGenerator>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

CorrelatedSamples(Random, Int32, Distribution[], SymmetricMatrix<Double>)

Generates a series of random variables with the specified correlation matrix.
C#
public static Vector<double>[] CorrelatedSamples(
	this Random random,
	int numberOfSamples,
	Distribution[] distributions,
	SymmetricMatrix<double> correlations
)

Parameters

random  Random
 
numberOfSamples  Int32
The number of samples to generate.
distributions  Distribution[]
An array of Distribution objects specifying the probability distribution of each variable.
correlations  SymmetricMatrix<Double>
A SymmetricMatrix specifying the desired correlation matrix.

Return Value

Vector<Double>[]
An array of real vectors with approximately the specified correlation matrix.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Random. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also