|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectus.ihmc.utilities.math.functionApproximation.LinearRegression
public class LinearRegression
Title:LinearRegression
Description: A helper class to solve linear regression problems. The client provides a set of input vectors x_{1...p} and a set of corresponding output values y_{1...p}, this calculates the weights to multiply the input vector x by to approximate y. The number of data points provided, p, must be greater than n, the number of dimensions in x. This algorithm makes all the assumptions needed when using the least squares (Gauss-Markov) method. Like all good things, this was found on wikipedia. Note that to have an offset the client should augment the input vectors with a constant term.
Copyright: Copyright (c) 2007
Company: IHMC
| Field Summary | |
|---|---|
static boolean |
VERBOSE
|
| Constructor Summary | |
|---|---|
LinearRegression(java.util.ArrayList<double[]> inputs,
java.util.ArrayList<java.lang.Double> outputs)
Creates a linear regression problem with the given data set. |
|
LinearRegression(double[][] inputs,
double[] outputs)
Creates a linear regression problem with the given data set. |
|
LinearRegression(com.mathworks.jama.Matrix inputData,
com.mathworks.jama.Matrix outputData)
Creates a linear regression problem with the given data set. |
|
| Method Summary | |
|---|---|
com.mathworks.jama.Matrix |
getCoefficientVectorAsMatrix()
|
double |
getSquaredError()
|
static void |
main(java.lang.String[] args)
|
void |
packCoefficientVector(double[] coefficientVector)
|
boolean |
solve()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean VERBOSE
| Constructor Detail |
|---|
public LinearRegression(com.mathworks.jama.Matrix inputData,
com.mathworks.jama.Matrix outputData)
inputData - Matrix nxp matrix of input vectorsoutputData - Matrix 1xp vector of output values
public LinearRegression(java.util.ArrayList<double[]> inputs,
java.util.ArrayList<java.lang.Double> outputs)
inputs - ArrayListoutputs - ArrayList
public LinearRegression(double[][] inputs,
double[] outputs)
inputs - double[][] the input matrix with dimensions [p][n].outputs - double[] the array of output values| Method Detail |
|---|
public boolean solve()
public double getSquaredError()
public com.mathworks.jama.Matrix getCoefficientVectorAsMatrix()
public void packCoefficientVector(double[] coefficientVector)
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||