cumbeta
Syntax
cumbeta(Y, X, [intercept=true])
Please see Cumulative Window Functions for the parameter description and windowing logic.
Details
Cumulatively calculate the coefficient estimate of the regression of Y on X.
Parameters
X (Y) is a scalar/vector/matrix/table/tuple (with scalars or equal-length vectors)/dictionary.
intercept (optional) is a BOOL scalar, default true. It specifies whether the linear regression includes an intercept term. If set to false, the intercept is fixed at 0, resulting in a regression through the origin.
Returns
A vector of the same length as X.
Examples
x=1 3 5 7 11 16 23
y=1 6 9 8 15 23 34;
cumbeta(y,x);
// output: [,2.5,2,1.2,1.256757,1.365322,1.440948]
cumbeta(y,x,true);
// output: [,2.5,2,1.2,1.256757,1.365322,1.440948]
cumbeta(y,x,false);
// output: [1,1.9,1.828571,1.428571,1.390244,1.416486,1.449495]
