Previous Next


Matrix Property (RDKCorrelation Object)

Description

Retrieves or sets the numeric values of the correlation matrix. Matrix elements must be between –1 and +1, and the diagonal elements of the matrix must always be 1. Correlation matrices are always symmetric, so if you set the value of Matrix(1,2), the corresponding element Matrix(2,1) will automatically be changed for you.

Syntax

object.Matrix(rowIndex as Integer, colIndex as Integer)

Arguments

rowIndex (Required Integer) – the row of the matrix element you wish to set or get.

colIndex (Required Integer) – the column of the matrix element you wish to set or get.

Return Value

(Double) The value of the matrix element specified by rowIndex and colIndex.

Example

'Set up the elements of a 3x3 correlation matrix:
With RDKApp.Correlations("myMatrix")
    .Matrix(1,2) = 0.5
    .Matrix(1,3) = 0.4
    .Matrix(2,3) = -0.1
End With

@RISK correlates inputs using rank-order correlation. For more background on this technique, see the @RISK for Excel User's Manual.