DSP::Analysis::OLSMultipleLinearRegression
Inherits Reference < Object
Constructors
Create an empty OLSMultipleLinearRegression instance, using the given singularity @threshold for the QR decomposition. Params: @threshold – the singularity @threshold
Instance methods
Loads model x and y sample data, overriding any previous sample. Computes and caches QR decomposition of the X matrix. Params: y – the [n,1] array representing the y sample x – the [n,k] array representing the x sample Throws: MathIllegalArgumentException – if the x and y array data are not compatible for the regression
Note that there is no need to add an initial unitary column (column of 1's) when specifying a model including an intercept term. This implementation computes and caches the QR decomposition of the X matrix once it is successfully loaded.
Loads new y sample data, overriding any previous data. Params: y – the array representing the y sample Throws: ArgumentError – if y is null ArgumentError – if y is empty
Validates sample data. Checks that Neither x nor y is null or empty; The size (i.e. number of rows) of x equals the size of y x has at least one more row than it has columns (i.e. there is sufficient data to estimate regression coefficients for each of the columns in x plus an intercept. Params: x – the [n,k] array representing the x data y – the [n,1] array representing the y data Throws: ArgumentError – if x or y is null DimensionMismatchException – if x and y do not have the same size ArgumentError – if x or y are zero-size MathIllegalArgumentException – if the number of rows of x is not larger than the number of columns + 1