rowCovarp

Syntax

rowCovarp(X, Y)

Please see rowFunctions for the parameters and calculation rules.

Details

Calculates the population covariance between X and Y by row and returns a vector with the same number of rows of X.

Returns

A vector with a length equal to the number of rows in the input parameter.

Examples

m1=matrix(2 8 9 12, 9 14 11 8,-3 NULL NULL 9)
m2=matrix(11.2 3 5 9, 7 -10 8 5,17 12 18 9)
rowCovarp(m1, m2)
// output: [-19.82,-19.5,1.5,2.22]

a= 110 112.3 44 98
b= 57.9 39 75 90
c= 55 64 37 78
x=array(DOUBLE[],0, 10).append!([a, b, c])
y=array(DOUBLE[],0, 10).append!([b, a, c])

rowCovarp(x, y)
// output: [-245.96,-245.96,221.25]

Related Function: covarp