| NMathFunctionsCorrelatedRandomInputs(Int32, Double, RandomNumberGenerator, RandomNumberGenerator) Method |
Creates two sequences of correlated random numbers using the specified random number
generators. The created sequence's Spearman rank correlation will be approximately equal
to the specified number.
Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntax public static DoubleMatrix CorrelatedRandomInputs(
int numSamples,
double desiredCorrelation,
RandomNumberGenerator xInputs,
RandomNumberGenerator yInputs
)
Public Shared Function CorrelatedRandomInputs (
numSamples As Integer,
desiredCorrelation As Double,
xInputs As RandomNumberGenerator,
yInputs As RandomNumberGenerator
) As DoubleMatrix
public:
static DoubleMatrix^ CorrelatedRandomInputs(
int numSamples,
double desiredCorrelation,
RandomNumberGenerator^ xInputs,
RandomNumberGenerator^ yInputs
)
static member CorrelatedRandomInputs :
numSamples : int *
desiredCorrelation : float *
xInputs : RandomNumberGenerator *
yInputs : RandomNumberGenerator -> DoubleMatrix
Parameters
- numSamples Int32
- The number of correlated random numbers to createn
- desiredCorrelation Double
- The desired Spearman rank correlation for the
the two sequnces. Must be between -1 and 1, inclusive.
- xInputs RandomNumberGenerator
- Random number generator for one of the sequences.
- yInputs RandomNumberGenerator
- Random number generator for the other sequence.
Return Value
DoubleMatrixMatrix whose columns are the two sequences of correlated random numbers.
Exceptions See Also