public class Regress
extends java.lang.Object
Class Regress
estimates a regression coefficient.
Instances of class Regress
are not thread-safe, but
concurrent updates are permitted, and invocation of the beta()
method in the absence of concurrent updates returns an accurate result.
Constructor | Description |
---|---|
Regress() |
Constructs a new
Regress instance. |
Modifier and Type | Method | Description |
---|---|---|
void |
add(double x,
double y) |
Records the specified values of the dependent and independent variables.
|
double |
beta() |
Returns the regression coefficient for the recorded values of the
independent and dependent variables.
|
long |
cnt() |
Returns the number of recorded values of the independent variable.
|
static void |
main(java.lang.String[] args) |
public void add(double x, double y)
x
- the value of the independent variabley
- the value of the dependent variablepublic long cnt()
public double beta()
public static void main(java.lang.String[] args)