org.jquantlib.math.statistics
Class IncrementalStatistics
- java.lang.Object
-
- org.jquantlib.math.statistics.GeneralStatistics
-
- org.jquantlib.math.statistics.GenericGaussianStatistics
-
- org.jquantlib.math.statistics.GaussianStatistics
-
- org.jquantlib.math.statistics.GenericRiskStatistics
-
- org.jquantlib.math.statistics.IncrementalStatistics
-
public class IncrementalStatistics extends GenericRiskStatistics
Statistics tool based on incremental accumulationIt can accumulate a set of data and return statistics (e.g: mean, variance, skewness, kurtosis, error estimation, etc.)
-
-
Constructor Summary
Constructors Constructor and Description IncrementalStatistics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(double value)adds a datum to the set, possibly with a weightvoidadd(double value, double weight)voidaddSequence(Array datum)adds a sequence of data to the set, with default weightvoidaddSequence(Array datum, Array weights)adds a sequence of data to the set, each with its weightvoidaddSequence(double[] datum)adds a sequence of data to the set, with default weightvoidaddSequence(double[] datum, double[] weights)adds a sequence of data to the set, each with its weightdoubledownsideDeviation()returns the downside deviation, defined as the square root of the downside variance.doubledownsideVariance()returns the downside variance, defined as , where = 0 if x > 0 and =1 if x <0doubleerrorEstimate()returns the error estimate , defined as the square root of the ratio of the variance to the number of samples.doublekurtosis()returns the excess kurtosis, defined as \frac{N^2(N+1)}{(N-1)(N-2)(N-3)} \frac{\left\langle \left(x-\langle x \rangle \right)^4 \right\rangle}{\sigma^4} - \frac{3(N-1)^2}{(N-2)(N-3)}.doublemax()returns the maximum sample valuedoublemean()returns the mean, defined as \langle x \rangle = \frac{\sum w_i x_i}{\sum w_i}.doublemin()returns the minimum sample valuevoidreset()resets the data to a null setintsamples()number of samples collecteddoubleskewness()returns the skewness, defined as \frac{N^2}{(N-1)(N-2)} \frac{\left\langle \left( x-\langle x \rangle \right)^3 \right\rangle}{\sigma^3}.doublestandardDeviation()returns the standard deviation , defined as the square root of the variance.doublevariance()returns the variance, defined as \frac{N}{N-1} \left\langle \left( x-\langle x \rangle \right)^2 \right\rangle.doubleweightSum()sum of data weights-
Methods inherited from class org.jquantlib.math.statistics.GenericRiskStatistics
averageShortfall, expectedShortfall, potentialUpside, regret, semiDeviation, semiVariance, shortfall, valueAtRisk
-
Methods inherited from class org.jquantlib.math.statistics.GenericGaussianStatistics
gaussianAverageShortfall, gaussianDownsideDeviation, gaussianDownsideVariance, gaussianExpectedShortfall, gaussianPercentile, gaussianPotentialUpside, gaussianRegret, gaussianShortfall, gaussianTopPercentile, gaussianValueAtRisk
-
Methods inherited from class org.jquantlib.math.statistics.GeneralStatistics
data, expectationValue, percentile, sort, topPercentile
-
-
-
-
Method Detail
-
samples
public int samples()
number of samples collected- Overrides:
samplesin classGeneralStatistics
-
weightSum
public double weightSum()
sum of data weights- Overrides:
weightSumin classGeneralStatistics
-
mean
public double mean()
returns the mean, defined as- Overrides:
meanin classGeneralStatistics
-
variance
public double variance()
returns the variance, defined as- Overrides:
variancein classGeneralStatistics
-
standardDeviation
public double standardDeviation()
returns the standard deviation , defined as the square root of the variance.- Overrides:
standardDeviationin classGeneralStatistics
-
errorEstimate
public double errorEstimate()
returns the error estimate , defined as the square root of the ratio of the variance to the number of samples.- Overrides:
errorEstimatein classGeneralStatistics
-
downsideDeviation
public double downsideDeviation()
returns the downside deviation, defined as the square root of the downside variance.- Overrides:
downsideDeviationin classGenericRiskStatistics
-
downsideVariance
public double downsideVariance()
returns the downside variance, defined as , where = 0 if x > 0 and =1 if x <0- Overrides:
downsideVariancein classGenericRiskStatistics
-
skewness
public double skewness()
returns the skewness, defined as The above evaluates to 0 for a Gaussian distribution.- Overrides:
skewnessin classGeneralStatistics
-
kurtosis
public double kurtosis()
returns the excess kurtosis, defined as The above evaluates to 0 for a Gaussian distribution.- Overrides:
kurtosisin classGeneralStatistics
-
min
public double min()
returns the minimum sample value- Overrides:
minin classGeneralStatistics
-
max
public double max()
returns the maximum sample value- Overrides:
maxin classGeneralStatistics
-
addSequence
public void addSequence(double[] datum)
adds a sequence of data to the set, with default weight- Overrides:
addSequencein classGeneralStatistics
-
addSequence
public void addSequence(double[] datum, double[] weights)adds a sequence of data to the set, each with its weightweights must be positive or null
- Overrides:
addSequencein classGeneralStatistics
-
addSequence
public void addSequence(Array datum)
adds a sequence of data to the set, with default weight- Overrides:
addSequencein classGeneralStatistics
-
addSequence
public void addSequence(Array datum, Array weights)
adds a sequence of data to the set, each with its weightweights must be positive or null
- Overrides:
addSequencein classGeneralStatistics
-
add
public void add(double value)
adds a datum to the set, possibly with a weightweight must be positive or null
- Overrides:
addin classGeneralStatistics
-
add
public void add(double value, double weight)- Overrides:
addin classGeneralStatistics
-
reset
public void reset()
resets the data to a null set- Overrides:
resetin classGeneralStatistics
-
-
DataMelt 3.0 © DataMelt by jWork.ORG