List of usage examples for org.apache.commons.math3.stat.regression GLSMultipleLinearRegression GLSMultipleLinearRegression
GLSMultipleLinearRegression
From source file:msi.gama.util.GamaRegression.java
public GamaRegression(final IScope scope, final GamaFloatMatrix data, final String method) throws Exception { AbstractMultipleLinearRegression regressionMethod = null; if (method.equals("GLS")) regressionMethod = new GLSMultipleLinearRegression(); else//from w w w . j a v a2 s . co m regressionMethod = new OLSMultipleLinearRegression(); final int nbFeatures = data.numCols - 1; final int nbInstances = data.numRows; final double[] instances = new double[data.numCols * data.numRows]; for (int i = 0; i < data.length(scope); i++) { instances[i] = data.getMatrix()[i]; } regressionMethod.newSampleData(instances, nbInstances, nbFeatures); param = regressionMethod.estimateRegressionParameters(); }