Click or drag to resize

InputVariableCorrelator Class

Instances of the InputVariableCorrelator class are used to induce a desired rank correlation among input variables.
Inheritance Hierarchy

Namespace:  CenterSpace.NMath.Core
Assembly:  NMath (in NMath.dll) Version: 7.3
public class InputVariableCorrelator : ICloneable

The InputVariableCorrelator type exposes the following members.

Protected methodInputVariableCorrelator
Constructs a InputVariableCorrelator instance. For internal use (e.g. the Clone() method).
Protected methodInputVariableCorrelator(InputVariableCorrelator)
Copy constructor.
Public methodInputVariableCorrelator(Int32, DoubleMatrix)
Constructs an InputVariableCorrelator instance for the given number of sample inputs and desired correlation matrix.
Public methodInputVariableCorrelator(Int32, DoubleSymmetricMatrix)
Constructs an InputVariableCorrelator instance for the given number of sample inputs and desired correlation matrix.
Public propertyNumInputVariables
Gets the number of input variables.
Public propertyRstar
Gets the permuted score matrix which has been transformed to have the desired correlation matrix.
Public propertySampleSize
Gets the sample size of the input variables.
Public methodClone
Implementation of the ICloneable interface. Produces a deep copy of self.
Protected methodComputeR
Computes the score matrix R according to the algorithm.
Protected methodComputeRstar
Computes the transformation of the score matrix R which has the desired correlations.
Public methodGetCorrelatedInputs
Constructs a matrix containing the input variables values re-ordered so as to have the desried correlations.
Protected methodGetScores
Gets the scores contained in each column of the score matrix R in the algorithm.
Protected fieldindexPermutations_
numVariables X sampleSize matrix of index permutations. For each i = 0,...numVariables-1 sortedIndices_[i] is an array containing a permutation of the integers j = 0,...,numVariables-1. This effectively specifies how each input variables values must be reorded to achieve the desired correlations.
Protected fieldintRng_
Random number generator. Used for shuffling.
Protected fieldnumInputVariables_
The number of input variables.
Protected fieldRstar_
The score matrix transformed to have the desired correlation matrix.
Protected fieldsampleSize_
The sample size.
Consider two sequences of random numbers {ai} and {bi}, i = 1, 2,...,N which may follow any probablility distributions. For example the {ai} may be a sequence of normally distributed random numbers while {bi} might be a sequence of random numbers following a beta distribution. In general these sequences will be uncorrelated, especially if they come from pseudo random number generators. Suppose that you are running a simulation on an economic model that works with mortgage backed security prices and U.S. Treasury bond prices as inputs. Since these two prices are highly correlated, two sequences of uncorrelated inputs would not be appropriate. The purpose of the InputVariableCorrelator class is to produce sequences of correlated inputs. The correlated inputs retain the same marginal distributions as the original inputs and will have a Spearmans rank correlation matrix approximately equal to one specified by the user. Reference for the algorithm used - Iman, Ronald L. and W. J. Conover, A Distribution-Free Approach to Inducing Rank Correlation Amoung Input Variables, Commun. Statist.-Simula. Computation 11(3), pp. 311-334 (1982)
See Also