Multivariate Regression

Linear Regression: Provide a solution for an n-order equation between two variables of the form:

      Y = a0*X^0 + a1*X^1 + ... + anX^n

where a series of values are measured for X & Y and we do a least squares fit to determine the coefficients (a0, a1, ..., an). The R^2 goodness of fit value is also computed.

Multivariate Linear Regression: The Python and Smalltalk versions of the package provide a more general form of equation that allows more than one exogenous variable. The form of the equation is the more generic:

      Y = a0*(EQ0) + a1*(Eq1) + ... + an*(Eqn)

This allows us to define equations of various forms such as:

      Y = a0 + a1*X + a2*X^2 + a3*X*Y + a4*Y + a5*Y^2

Or to even to get away from a straight power series:

      Y = a0 + a1*log(x) + a2*log(y)

Notes: Python was the language that I originally wanted to do the regression in, but I didn't want to have to debug the algorithms and learn the language simultaneously. Anyhow, I cleaned up the code a little from the Java and Smalltalk versions, adding in some assertions for contract purposes. Still not 100% where I'd like it to be, but it'll have to do for now.

Java does not support Lambdas like Python or Code Blocks like Smalltalk. This limited my Java code to a straight power series between X & Y.


Chris Rathman / Chris.Rathman@tx.rr.com