![]() | SQXCovarianceMatrix Method |
Namespace: sqx
public static int CovarianceMatrix( SqlChars Query, SqlBoolean Population, SqlBoolean SnapShot, out Matrix CovarianceMatrix )
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 @C sqx.Matrix exec sqx.CovarianceMatrix @Query = @Query , @Population = 1, @SnapShot = 0, @CovarianceMatrix = @C OUTPUT exec sqx.MatrixToTable @C /* ID 1 2 3 ----------- ---------------------- ---------------------- ---------------------- 1 0.0709172334310987 0.00142036467919198 0.0182726203916543 2 0.00142036467919198 0.0968632683853888 -0.0326049475878277 3 0.0182726203916543 -0.0326049475878277 0.0703461206094948*/