## Class Statistics

• java.lang.Object
• org.robwork.sdurw_math.Statistics

• public class Statistics
extends java.lang.Object
Class for collecting data and calculating simple statistics.
• ### Constructor Summary

Constructors
Constructor Description
Statistics()
Statistics​(long cPtr, boolean cMemoryOwn)
• ### Method Summary

All Methods
Modifier and Type Method Description
void add​(double t)
double angularMean()
Returns the angular mean of the values added

The angular mean is computed as \tan^{-1}\frac{\Sigma_{d\in data}\sin(d)}{\Sigma_{d\in data}\cos(d)}
pair_d_d angularMeanAndVariance()
returns the angular mean and the variance of the data.

See documentation of Statistics::angularMean() and Statistics::angularVariance()
for how the mean and variane are computed.
double angularVariance()
Returns the angular variance of the values added
The variance is computed as \frac{1}{n-1} \Sigma_{d\in data}\left[\cos^{-1}(\sin(d)\sin(\mu)-\cos(d)\cos(\mu))\right]^2 where \mu is
the angular mean of the data.
void clear()
Clear the recorded statistics data
SWIGTYPE_p_std__listT_double_t data()
Provides reference to the internal data container
void delete()
static long getCPtr​(Statistics obj)
double maxValue()
Returns the maximum value of data added.

If no data is added 0 is returned.
double mean()
Returns the mean of the values added

The mean is computed as \frac{1}{n} \Sigma_{d\in data}d
pair_d_d meanAndVariance()
returns the mean and the variance of the data.

See documentation of Statistics::mean() and Statistics::variance()
for how the mean and variane are computed.
double median()
Returns the median of the values added

Given an equal number of element, the mean is calculated as the average of the two center
elements.
pair_d_d minAndMaxValue()
Returns pair containing the minimum and maximum value of the data added.

If no data is added 0 is returned for both values.
double minValue()
Returns the minimum value of data added.

If no data is added 0 is returned.
java.lang.String toString()
double variance()
Returns the variance of the values added
The variance is computed as \frac{1}{n-1} \Sigma_{d\in data}(m-\mu)^2
where \mu is the mean of the data.
• ### Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
• ### Constructor Detail

• #### Statistics

public Statistics​(long cPtr,
boolean cMemoryOwn)
• #### Statistics

public Statistics()
• ### Method Detail

• #### getCPtr

public static long getCPtr​(Statistics obj)
• #### delete

public void delete()
• #### mean

public double mean()
Returns the mean of the values added

The mean is computed as \frac{1}{n} \Sigma_{d\in data}d
• #### angularMean

public double angularMean()
Returns the angular mean of the values added

The angular mean is computed as \tan^{-1}\frac{\Sigma_{d\in data}\sin(d)}{\Sigma_{d\in data}\cos(d)}
• #### median

public double median()
Returns the median of the values added

Given an equal number of element, the mean is calculated as the average of the two center
elements.
• #### variance

public double variance()
Returns the variance of the values added
The variance is computed as \frac{1}{n-1} \Sigma_{d\in data}(m-\mu)^2
where \mu is the mean of the data.
• #### angularVariance

public double angularVariance()
Returns the angular variance of the values added
The variance is computed as \frac{1}{n-1} \Sigma_{d\in data}\left[\cos^{-1}(\sin(d)\sin(\mu)-\cos(d)\cos(\mu))\right]^2 where \mu is
the angular mean of the data.
• #### meanAndVariance

public pair_d_d meanAndVariance()
returns the mean and the variance of the data.

See documentation of Statistics::mean() and Statistics::variance()
for how the mean and variane are computed.
• #### angularMeanAndVariance

public pair_d_d angularMeanAndVariance()
returns the angular mean and the variance of the data.

See documentation of Statistics::angularMean() and Statistics::angularVariance()
for how the mean and variane are computed.
• #### minValue

public double minValue()
Returns the minimum value of data added.

If no data is added 0 is returned.
• #### maxValue

public double maxValue()
Returns the maximum value of data added.

If no data is added 0 is returned.
• #### minAndMaxValue

public pair_d_d minAndMaxValue()
Returns pair containing the minimum and maximum value of the data added.

If no data is added 0 is returned for both values.

public void add​(double t)
public void clear()
public SWIGTYPE_p_std__listT_double_t data()
public java.lang.String toString()
toString in class java.lang.Object