hep.aida.ref.dataset
Class DataStatistics
- java.lang.Object
-
- hep.aida.ref.dataset.DataStatistics
-
public class DataStatistics extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor and Description DataStatistics(int dimension)Creates a new instance of DataSetStatistics.DataStatistics(java.lang.String[] descriptions)Creates a new instance of DataSetStatistics.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddEntries(double[] mean, double[] rms, double sumw, double sumw2, int entries)Add a set of weighted entries to this DataSetStatistics.voidaddEntries(double[] mean, double[] rms, int entries)Add a set of entries to this DataSetStatistics.voidaddEntry(double[] x)Add a new entry to this DataSetStatistics with unit weight.voidaddEntry(double[] x, double w)Add a weighted entry to this DataSetStatistics.java.lang.Stringdescription(int coord)Get the description corresponding to a coordinate.intdimension()Get the dimension of the DataStatistics.intentries()Get the number of entries in this data setdoubleequivalentEntries()Get the equivalent entries for this data set.doublemean(int coord)Get the mean for a given coordinate.voidremoveEntries(double[] mean, double[] rms, double sumw, double sumw2, int entries)Remove the information corresponding to a set of weighted entries.voidremoveEntries(double[] mean, double[] rms, int entries)Remove the information corresponding to a set of weighted entries.voidremoveEntry(double[] x)Remove an entry from this DataSetStatistics with unit weight.voidremoveEntry(double[] x, double w)Remove a weighted entry from this DataSetStatistics.voidreset()Reset all the statistics quantities to zero.doublerms(int coord)Get the rms for a given coordinate.voidscale(double scaleFactor)Scale the statistics by a give scaleFactor Rescaling is equivalent to multiplying all the weights by the scale factor.voidsetDescription(int coord, java.lang.String description)Set the description for a given coordinatevoidsetDescription(java.lang.String[] descriptions)Set the description for all the coordinates.doublesumOfWeights()Get the sum of weights for this data set.
-
-
-
Constructor Detail
-
DataStatistics
public DataStatistics(java.lang.String[] descriptions)
Creates a new instance of DataSetStatistics.- Parameters:
descriptions- Is an array specifying the description for each of the coordinates of this data set.
-
DataStatistics
public DataStatistics(int dimension)
Creates a new instance of DataSetStatistics.- Parameters:
dimension- The dimension, i.e. the number of coordinates of this data set.
-
-
Method Detail
-
dimension
public int dimension()
Get the dimension of the DataStatistics.- Returns:
- The dimension of the DataStatistics.
-
addEntry
public void addEntry(double[] x, double w)Add a weighted entry to this DataSetStatistics. The statistical information is updated.- Parameters:
x- The coordinates of the added entry.w- The corresponding weight.
-
addEntry
public void addEntry(double[] x)
Add a new entry to this DataSetStatistics with unit weight.- Parameters:
x- The coordinates of the added entry.
-
removeEntry
public void removeEntry(double[] x, double w)Remove a weighted entry from this DataSetStatistics. The statistical information is updated.- Parameters:
x- The coordinates of the removed entry.w- The corresponding weight.
-
removeEntry
public void removeEntry(double[] x)
Remove an entry from this DataSetStatistics with unit weight.- Parameters:
x- The coordinates of the entry to remove.
-
addEntries
public void addEntries(double[] mean, double[] rms, double sumw, double sumw2, int entries)Add a set of weighted entries to this DataSetStatistics. The statistical information is updated.- Parameters:
mean- The mean of the entries to be added.rms- The rms of the entries to be added.sumw- The sum of weights of the entries to be added.sumw2- The sum of weights squared of the entries to be added.entries- The number of the entries to be added.
-
addEntries
public void addEntries(double[] mean, double[] rms, int entries)Add a set of entries to this DataSetStatistics. The statistical information is updated.- Parameters:
mean- The mean of the entries to be added.rms- The rms of the entries to be added.entries- The number of the entries to be added.
-
removeEntries
public void removeEntries(double[] mean, double[] rms, double sumw, double sumw2, int entries)Remove the information corresponding to a set of weighted entries.- Parameters:
mean- The mean of the entries to be removed.rms- The rms of the entries to be removed.sumw- The sum of weights of the entries to be removed.sumw2- The sum of weights squared of the entries to be removed.entries- The number of the entries to be added.
-
removeEntries
public void removeEntries(double[] mean, double[] rms, int entries)Remove the information corresponding to a set of weighted entries.- Parameters:
mean- The mean of the entries to be removed.rms- The rms of the entries to be removed.entries- The number of the entries to be added.
-
mean
public double mean(int coord)
Get the mean for a given coordinate.- Parameters:
coord- The index of the coordinate.- Returns:
- The mean of the coordinate coord.
-
rms
public double rms(int coord)
Get the rms for a given coordinate.- Parameters:
coord- The index of the coordinage;- Returns:
- The rms of the coordinate coord.
-
sumOfWeights
public double sumOfWeights()
Get the sum of weights for this data set.- Returns:
- The sum of weights.
-
equivalentEntries
public double equivalentEntries()
Get the equivalent entries for this data set.- Returns:
- The equivalent entries for this data set.
-
entries
public int entries()
Get the number of entries in this data set- Returns:
- The number of entries.
-
scale
public void scale(double scaleFactor)
Scale the statistics by a give scaleFactor Rescaling is equivalent to multiplying all the weights by the scale factor.- Parameters:
scaleFactor- The scaleFactor.
-
reset
public void reset()
Reset all the statistics quantities to zero.
-
setDescription
public void setDescription(java.lang.String[] descriptions)
Set the description for all the coordinates.- Parameters:
descriptions- The array containing the description for each coordinate.
-
setDescription
public void setDescription(int coord, java.lang.String description)Set the description for a given coordinate- Parameters:
coord- The index of the coordinate.description- The description for the coordinate
-
description
public java.lang.String description(int coord)
Get the description corresponding to a coordinate.- Parameters:
coord- The coordinate.- Returns:
- The description corresponding to that coordinate.
-
-
DMelt 3.0 © DataMelt by jWork.ORG