NMath Reference Guide

## Input |

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

Inheritance Hierarchy

SystemObject

CenterSpace.NMath.CoreInputVariableCorrelator

CenterSpace.NMath.CoreReducedVarianceInputCorrelator

CenterSpace.NMath.CoreInputVariableCorrelator

CenterSpace.NMath.CoreReducedVarianceInputCorrelator

Syntax

The InputVariableCorrelator type exposes the following members.

Constructors

Name | Description | |
---|---|---|

InputVariableCorrelator | Constructs a InputVariableCorrelator instance. For internal use (e.g. the Clone() method). | |

InputVariableCorrelator(InputVariableCorrelator) | Copy constructor. | |

InputVariableCorrelator(Int32, DoubleMatrix) | Constructs an InputVariableCorrelator instance for the given number of sample inputs and desired correlation matrix. | |

InputVariableCorrelator(Int32, DoubleSymmetricMatrix) | Constructs an InputVariableCorrelator instance for the given number of sample inputs and desired correlation matrix. |

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. |

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. |

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. |

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