rowBeta

Syntax

rowBeta(Y, X)

Please see rowFunctions for the parameters and calculation rules.

Details

Calculate the coefficient estimate of the ordinary-least-squares regression of Y on X by row and return a vector with the same number of rows of X.

Examples

m1=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])
m2=matrix(49.6 NULL 29.52, 50.32 51.29 26.23, NULL 74.97 23.75)
rowBeta(m1, m2)
// output
[-4.1667,-0.1182, -1.3374]

m3=matrix(8 NULL 10, 8 NULL 4, 14 NULL NULL)
rowBeta(m3, m2)
// output
[0, , 1.8237]

Related function: beta