UnivariateRegressionResult
Fitted univariate least-squares regression y = slope * x + intercept. Carries the marginal x / y variances and the raw weighted cross-deviation sxy so the result round-trips losslessly under merge regardless of penalty.
Constructors
UnivariateRegressionResult
Properties
correlation
Pearson correlation of the x and y streams, sxy / sqrt(sxx * syy).
Computed from the raw cross-deviation rather than from 1 - sse/sst, because sse is evaluated at the penalised slope: under Penalty.L1 with a lambda above the soft-thresholding cut the slope is exactly zero, making sse == sst and yielding a correlation of zero for perfectly correlated data. This is a property of the two streams and so is independent of penalty.
covariance
Weighted covariance sxy / totalWeights.
intercept
penalty
slope
sse
sst
Sum of squared deviations from the running mean: Sum (x - mean)^2 * weight.
Implementors must override this or variance; the two are defined in terms of each other, so overriding neither recurses until the stack runs out. Every Result in the library overrides sst, which is the cheaper of the two to carry.
sxy
totalWeights
Cumulative weight of observations folded into this result.
x
Marginal statistics of the x stream.
y
Marginal statistics of the y stream.
Number of features in weights.
Mean squared error: sse / totalWeights. Zero on an empty stream.
Unbiased sample standard deviation: sqrt([sampleVariance]).
Unbiased sample variance: [sst] / ([totalWeights] - 1). Zero when totalWeights <= 1.