 | InputVariableCorrelator Class |
Instances of the InputVariableCorrelator class are used to induce
a desired rank correlation among input variables.
Inheritance Hierarchy Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntaxpublic class InputVariableCorrelator : ICloneable
Public Class InputVariableCorrelator
Implements ICloneable
public ref class InputVariableCorrelator : ICloneable
type InputVariableCorrelator =
class
interface ICloneable
end
The InputVariableCorrelator type exposes the following members.
Constructors
Properties | Name | Description |
---|
 | NumInputVariables |
Gets the number of input variables.
|
 | Rstar |
Gets the permuted score matrix which has been transformed to have the
desired correlation matrix.
|
 | SampleSize |
Gets the sample size of the input variables.
|
Top
Methods | Name | Description |
---|
 | Clone |
Implementation of the ICloneable interface. Produces a deep copy of self.
|
 | ComputeR |
Computes the score matrix R according to the algorithm.
|
 | ComputeRstar |
Computes the transformation of the score matrix R which has the desired correlations.
|
 | GetCorrelatedInputs |
Constructs a matrix containing the input variables values re-ordered so as
to have the desried correlations.
|
 | GetScores |
Gets the scores contained in each column of the score matrix R in the algorithm.
|
Top
Fields | Name | Description |
---|
 | indexPermutations_ |
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.
|
 | intRng_ |
Random number generator. Used for shuffling.
|
 | numInputVariables_ |
The number of input variables.
|
 | Rstar_ |
The score matrix transformed to have the desired correlation matrix.
|
 | sampleSize_ |
The sample size.
|
Top
Remarks
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