public class RunningStatistics2D
extends java.lang.Object
implements galileo.serialization.ByteSerializable
RunningStatistics
class, this class supports
two dimensions (x and y), along with some extra features (simple linear
regression, r^2, calculating correlation).Modifier and Type | Class and Description |
---|---|
class |
RunningStatistics2D.PearsonResult
Encapsulates the results of a Pearson product-moment correlation
coefficient calculation, including the two-tailed p-value.
|
Constructor and Description |
---|
RunningStatistics2D() |
RunningStatistics2D(galileo.serialization.SerializationInputStream in) |
Modifier and Type | Method and Description |
---|---|
double |
intercept() |
void |
merge(RunningStatistics2D that) |
long |
n()
Retrieves the number of samples submitted to the RunningStatistics2D
instance so far.
|
double |
predict(double x)
Given a value of x, estimate the outcome of y using simple linear
regression.
|
void |
put(double[]... samples)
Adds several new (x, y) sample pairs to the 2D running statistics.
|
void |
put(double x,
double y)
Adds a new sample to the 2D running statistics.
|
double |
r()
Calculate the Pearson product-moment correlation coefficient.
|
double |
r2()
Calculate the coefficient of determination (r squared).
|
RunningStatistics2D.PearsonResult |
rp()
Calculate the Pearson product-moment correlation coefficient, including
the two-tailed p-value.
|
void |
serialize(galileo.serialization.SerializationOutputStream out) |
double |
slope() |
double |
SSxx() |
double |
SSxy() |
double |
SSyy() |
RunningStatistics |
xStat() |
RunningStatistics |
yStat() |
public RunningStatistics2D()
@ByteSerializable.Deserialize public RunningStatistics2D(galileo.serialization.SerializationInputStream in) throws java.io.IOException
java.io.IOException
public void merge(RunningStatistics2D that)
public void put(double[]... samples)
samples
- Array of two-element arrays (representing x and y)public void put(double x, double y)
public double SSxy()
public double SSxx()
public double SSyy()
public double r()
public RunningStatistics2D.PearsonResult rp()
public double r2()
public double slope()
public double intercept()
public double predict(double x)
public RunningStatistics xStat()
public RunningStatistics yStat()
public long n()
public void serialize(galileo.serialization.SerializationOutputStream out) throws java.io.IOException
serialize
in interface galileo.serialization.ByteSerializable
java.io.IOException