![]() | SQXCorrelationMatrix Method |
Namespace: sqx
public static int CorrelationMatrix( SqlChars Query, SqlBoolean Population, SqlBoolean SnapShot, out Matrix CorrelationMatrix )
declare @Query nvarchar(max) = N' select a.Value [1],b.Value [2],c.Value [3] from sqx.VectorTable(sqx.RandomVector(10,1)) a inner join sqx.VectorTable(sqx.RandomVector(10,2)) b ON a.ID = b.ID inner join sqx.VectorTable(sqx.RandomVector(10,3)) c ON a.ID = c.ID ' declare @R sqx.Matrix exec sqx.CorrelationMatrix @Query = @Query , @Population = 1, @SnapShot = 0, @CorrelationMatrix = @R OUTPUT exec sqx.MatrixToTable @R /* ID 1 2 3 ----------- ---------------------- ---------------------- ---------------------- 1 1 0.0171373794175597 0.258705024392653 2 0.0171373794175597 1 -0.394987971874921 3 0.258705024392653 -0.394987971874921 1*/