public class StatsHypercube extends Object
Modifier and Type | Field and Description |
---|---|
Collection<String> |
dimLabels
The dimension labels.
|
Collection<Stat> |
stats
The statistical values.
|
Constructor and Description |
---|
StatsHypercube(String... dimLabels)
Build an hypercube.
|
Modifier and Type | Method and Description |
---|---|
StatsHypercube |
abs()
Apply absolute value.
|
StatsHypercube |
apply(BinaryOperator<Double> op,
StatsHypercube hc)
Apply an operation to the values, using values of another hypercube.
|
StatsHypercube |
apply(UnaryOperator<Double> op)
Apply an operation on the values.
|
void |
changeDimValue(String dimLabel,
String dimValueOld,
String dimValueNew)
Change a dimension value.
|
StatsHypercube |
delete(String dimLabel)
Delete a dimension.
|
StatsHypercube |
delete(String dimLabel,
int size)
Delete the stats having a label value with a given number of caracters.
|
StatsHypercube |
delete(String dimLabel,
String dimValue)
Delete all stats having a given value for a dimension
|
StatsHypercube |
diff(double valueToDiff)
Remove a quantity to the values.
|
StatsHypercube |
diff(StatsHypercube hc)
Remove the values of another hypercube.
|
StatsHypercube |
div(double valueToDiv)
Divide all values by a quantity.
|
StatsHypercube |
div(StatsHypercube hc)
Divide by the values of another hypercube.
|
String[] |
getDimLabels() |
HashSet<String> |
getDimValues(String dimLabel)
Return all dimension values for a dimension.
|
double[] |
getQuantiles(int nb)
Compute the quantiles of the statistics.
|
StatsHypercube |
inv()
Invert the values.
|
StatsHypercube |
mult(double factor)
Multiply the values by a factor.
|
StatsHypercube |
mult(StatsHypercube hc)
Multiply by the values of another hypercube.
|
StatsHypercube |
opp()
Change the sign of the values.
|
StatsHypercube |
pow(double exp)
Apply a power to the values.
|
void |
printBasicStats()
Print basic statistics from the hypercube values
|
void |
printInfo()
Print hypercube structure.
|
void |
printInfo(boolean printDimValues)
Print hypercube structure.
|
void |
printQuantiles(int nb)
Print the quantiles.
|
StatsHypercube |
select(Selection.Criteria sel)
Extract an hypercube based on a selection criteria
|
StatsHypercube |
selectDimValueDifferentFrom(String... dimLabelValues)
Extract an hypercube of stats having dimLabel!=dimValue
Ex: gender!=male AND country!=HU, etc.
|
StatsHypercube |
selectDimValueEqualTo(String... dimLabelValues)
Extract an hypercube of stats having dimLabel=dimValue
Ex: gender=male AND country=HU, etc.
|
StatsHypercube |
selectDimValueGreaterOrEqualThan(String dimLabel,
double value)
Extract an hypercube of stats having dimLabel >= value
Ex: year >= 2015
|
StatsHypercube |
selectDimValueGreaterThan(String dimLabel,
double value)
Extract an hypercube of stats having dimLabel > value
Ex: year >= 2015
|
StatsHypercube |
selectDimValueLowerOrEqualThan(String dimLabel,
double value)
Extract an hypercube of stats having dimLabel <= value
Ex: year <= 2015
|
StatsHypercube |
selectDimValueLowerThan(String dimLabel,
double value)
Extract an hypercube of stats having dimLabel < value
Ex: year < 2015
|
StatsHypercube |
selectValueDifferentFrom(double value)
Extract an hypercube of stats different from specified value.
|
StatsHypercube |
selectValueEqualTo(double value)
Extract an hypercube of stats having specified value.
|
StatsHypercube |
selectValueGreaterOrEqualThan(double value)
Extract an hypercube of stats having values greater or equal than a specified value.
|
StatsHypercube |
selectValueGreaterThan(double value)
Extract an hypercube of stats having values greater than a specified value.
|
StatsHypercube |
selectValueLowerOrEqualThan(double value)
Extract an hypercube of stats having values lower or equal than a specified value.
|
StatsHypercube |
selectValueLowerThan(double value)
Extract an hypercube of stats having values lower than a specified value.
|
StatsHypercube |
shrinkDimensions()
Remove dimensions with no or a single value.
|
StatsHypercube |
sqrt()
Apply root square of the values
|
StatsHypercube |
sum(double valueToSum)
Add a qualtity to the values.
|
StatsHypercube |
sum(StatsHypercube hc)
Add the values of another hypercube.
|
HashMap<String,Double> |
toMap()
Transform an hypercube with only one dimension into a hashmap.
|
public Collection<Stat> stats
public Collection<String> dimLabels
public StatsHypercube(String... dimLabels)
dimLabels
- The dimension labels.public String[] getDimLabels()
public HashSet<String> getDimValues(String dimLabel)
dimLabel
- public StatsHypercube select(Selection.Criteria sel)
sel
- The selection criterionpublic StatsHypercube selectDimValueEqualTo(String... dimLabelValues)
dimLabelValues
- List of couples (label,value) Example; "gender","male","country","HU"public StatsHypercube selectDimValueDifferentFrom(String... dimLabelValues)
dimLabelValues
- public StatsHypercube selectDimValueGreaterThan(String dimLabel, double value)
dimLabel
- value
- public StatsHypercube selectDimValueLowerThan(String dimLabel, double value)
dimLabel
- value
- public StatsHypercube selectDimValueGreaterOrEqualThan(String dimLabel, double value)
dimLabel
- value
- public StatsHypercube selectDimValueLowerOrEqualThan(String dimLabel, double value)
dimLabel
- value
- public StatsHypercube selectValueEqualTo(double value)
value
- public StatsHypercube selectValueDifferentFrom(double value)
value
- public StatsHypercube selectValueGreaterThan(double value)
value
- public StatsHypercube selectValueLowerThan(double value)
value
- public StatsHypercube selectValueGreaterOrEqualThan(double value)
value
- public StatsHypercube selectValueLowerOrEqualThan(double value)
value
- public StatsHypercube delete(String dimLabel)
dimLabel
- public StatsHypercube shrinkDimensions()
public StatsHypercube delete(String dimLabel, String dimValue)
dimLabel
- dimValue
- public StatsHypercube delete(String dimLabel, int size)
dimLabel
- size
- public void changeDimValue(String dimLabel, String dimValueOld, String dimValueNew)
dimLabel
- The dimension of the valuedimValueOld
- The old value, to changedimValueNew
- The new value, to usepublic StatsHypercube apply(UnaryOperator<Double> op)
op
- public StatsHypercube abs()
public StatsHypercube mult(double factor)
factor
- public StatsHypercube sum(double valueToSum)
valueToSum
- public StatsHypercube pow(double exp)
exp
- public StatsHypercube inv()
public StatsHypercube sqrt()
public StatsHypercube diff(double valueToDiff)
valueToDiff
- public StatsHypercube div(double valueToDiv)
valueToDiv
- public StatsHypercube opp()
public StatsHypercube apply(BinaryOperator<Double> op, StatsHypercube hc)
op
- hc
- public StatsHypercube sum(StatsHypercube hc)
hc
- public StatsHypercube diff(StatsHypercube hc)
hc
- public StatsHypercube div(StatsHypercube hc)
hc
- public StatsHypercube mult(StatsHypercube hc)
hc
- public void printInfo()
public void printInfo(boolean printDimValues)
printDimValues
- Set to true to also show the dimension values.public void printBasicStats()
public double[] getQuantiles(int nb)
nb
- The number of quantiles.public void printQuantiles(int nb)
nb
- The number of quantiles.Copyright © 2020. All rights reserved.