## gov.sandia.cognition.statistics.method Class MarkovInequality

```java.lang.Object gov.sandia.cognition.util.AbstractCloneableSerializable gov.sandia.cognition.statistics.method.MarkovInequality
```
All Implemented Interfaces:
ConfidenceIntervalEvaluator<Collection<Double>>, CloneableSerializable, Serializable, Cloneable

```@PublicationReference(author="Wikipedia",
title="Markov\'s Inequality",
type=WebPage,
year=2009,
url="http://en.wikipedia.org/wiki/Markov%27s_inequality")
public class MarkovInequalityextends AbstractCloneableSerializableimplements ConfidenceIntervalEvaluator<Collection<Double>>```

Implementation of the Markov Inequality hypothesis test. This is a distribution-free test that says "what is the probability that ANY random variable can take a magnitude greater than 'a', given samples drawn from the random variable" Pr{abs(X)>=a} <= mean(abs(data))/a. For example, assume we have data: (3 -1 2) and would like to know what range of values are possible with 95% confidence -> MarkovInequality.computeConfidenceInterval( (3 -1 2), 0.95 ) The sample mean of the absolute values is (3+1+2)/3 = 2. 1-0.95 <= 2/a -> a=40. Thus Pr{ -40 <= X <= 40 } >= 0.95

Since:
2.0
Author:
Kevin R. Dixon
Serialized Form

Field Summary
`static MarkovInequality` `INSTANCE`
This class has no members, so here's a static instance.

Constructor Summary
`MarkovInequality()`
Creates a new instance of MarkovInequality

Method Summary
` ConfidenceInterval` ```computeConfidenceInterval(Collection<Double> data, double confidence)```
Computes the Markov Inequality Bound for the given data at the given confidence level.
` ConfidenceInterval` ```computeConfidenceInterval(double mean, double variance, int numSamples, double confidence)```
Computes the confidence interval given the mean and variance of the samples, number of samples, and corresponding confidence interval
`static ConfidenceInterval` ```computeConfidenceInterval(double sampleMean, int numSamples, double confidence)```
Computes the Markov Inequality Bound for the given data at the given confidence level.

Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
`clone`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### INSTANCE

`public static final MarkovInequality INSTANCE`
This class has no members, so here's a static instance.

Constructor Detail

### MarkovInequality

`public MarkovInequality()`
Creates a new instance of MarkovInequality

Method Detail

### computeConfidenceInterval

```public ConfidenceInterval computeConfidenceInterval(Collection<Double> data,
double confidence)```
Computes the Markov Inequality Bound for the given data at the given confidence level. Answers the question: what range of values can I expect at least "confidence" percent of the time? 1-confidence = Pr{abs(a)>=a} <= mean(abs(data))/a -> Pr{ -a <= X <= a } >= confidence

Specified by:
`computeConfidenceInterval` in interface `ConfidenceIntervalEvaluator<Collection<Double>>`
Parameters:
`data` - Values drawn from the underlying distribution
`confidence` - Confidence value to find the range of values for
Returns:
ConfidenceInterval describing the worst-case range that ANY random variable can take at the given confidence value

### computeConfidenceInterval

```public static ConfidenceInterval computeConfidenceInterval(double sampleMean,
int numSamples,
double confidence)```
Computes the Markov Inequality Bound for the given data at the given confidence level. Answers the question: what range of values can I expect at least "confidence" percent of the time? 1-confidence = Pr{abs(a)>=a} <= mean(abs(data))/a -> Pr{ -a <= X <= a } >= confidence

Parameters:
`sampleMean` - Sample mean of the underlying data
`numSamples` - Number of samples used in computing the mean
`confidence` - Confidence value to find the range of values for
Returns:
ConfidenceInterval describing the worst-case range that ANY random variable can take at the given confidence value

### computeConfidenceInterval

```public ConfidenceInterval computeConfidenceInterval(double mean,
double variance,
int numSamples,
double confidence)```
Description copied from interface: `ConfidenceIntervalEvaluator`
Computes the confidence interval given the mean and variance of the samples, number of samples, and corresponding confidence interval

Specified by:
`computeConfidenceInterval` in interface `ConfidenceIntervalEvaluator<Collection<Double>>`
Parameters:
`mean` - Mean of the distribution.
`variance` - Variance of the distribution.
`numSamples` - Number of samples in the underlying data
`confidence` - Confidence value to assume for the ConfidenceInterval
Returns:
ConfidenceInterval capturing the range of the mean of the data at the desired level of confidence