Class LinearRegression
java.lang.Object
com.compomics.util.math.statistics.linear_regression.LinearRegression
public class LinearRegression extends Object
Enum of the different implementations for a regression.
- Author:
- Marc Vaudel
-
Constructor Summary
Constructors Constructor Description LinearRegression()
Empty default constructor -
Method Summary
Modifier and Type Method Description static RegressionStatistics
getRobustLinearRegression(ArrayList<Double> x, ArrayList<Double> y)
Returns a robust linear regression based on the median.static RegressionStatistics
getSimpleLinearRegression(ArrayList<Double> x, ArrayList<Double> y)
Returns a simple linear regression.static RegressionStatistics
getSimpleLinearRegressionOutlierRemoval(ArrayList<Double> x, ArrayList<Double> y, Double p)
Returns a simple linear regression performed after outlier removal.
-
Constructor Details
-
LinearRegression
public LinearRegression()Empty default constructor
-
-
Method Details
-
getSimpleLinearRegression
public static RegressionStatistics getSimpleLinearRegression(ArrayList<Double> x, ArrayList<Double> y)Returns a simple linear regression.- Parameters:
x
- the x seriesy
- the y series- Returns:
- a simple linear regression
-
getRobustLinearRegression
public static RegressionStatistics getRobustLinearRegression(ArrayList<Double> x, ArrayList<Double> y)Returns a robust linear regression based on the median.- Parameters:
x
- the x seriesy
- the y series- Returns:
- a simple linear regression
-
getSimpleLinearRegressionOutlierRemoval
public static RegressionStatistics getSimpleLinearRegressionOutlierRemoval(ArrayList<Double> x, ArrayList<Double> y, Double p)Returns a simple linear regression performed after outlier removal. If less than 100 points are available before or after filtering, a robust regression is used.- Parameters:
x
- the x seriesy
- the y seriesp
- the probability for outlier exclusion, e.g. 0.95 for 95% confidence- Returns:
- a simple linear regression
-