Package it.unimi.dsi.webgraph.algo
Class ApproximateNeighbourhoodFunctions
- java.lang.Object
-
- it.unimi.dsi.webgraph.algo.ApproximateNeighbourhoodFunctions
-
public class ApproximateNeighbourhoodFunctions extends java.lang.Object
Static methods and objects that manipulate approximate neighbourhood functions.A number of statistics that can be used with
Jackknife
, such asCDF
,AVERAGE_DISTANCE
,HARMONIC_DIAMETER
andSPID
are available.
-
-
Field Summary
Fields Modifier and Type Field Description static it.unimi.dsi.stat.Jackknife.Statistic
AVERAGE_DISTANCE
A statistic that computes the average distance.static it.unimi.dsi.stat.Jackknife.Statistic
CDF
A statistic that divides all values of a sample (an approximate neighbourhood function) by the last value.static it.unimi.dsi.stat.Jackknife.Statistic
EFFECTIVE_DIAMETER
A statistic that computes the effective diameter.static it.unimi.dsi.stat.Jackknife.Statistic
HARMONIC_DIAMETER
A statistic that computes the harmonic diameter.static it.unimi.dsi.stat.Jackknife.Statistic
PMF
A statistic that computes differences between consecutive elements of a sample (an approximate neighbourhood function) and divide them by the last value.static it.unimi.dsi.stat.Jackknife.Statistic
SPID
A statistic that computes the spid.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double[]
combine(java.lang.Iterable<double[]> anf)
Combines several approximate neighbourhood functions for the same graph by averaging their values.static it.unimi.dsi.fastutil.objects.ObjectList<double[]>
evenOut(java.lang.Iterable<double[]> anf)
Evens out several approximate neighbourhood functions for the same graph by extending them to the same length (by copying the last value).
-
-
-
Field Detail
-
SPID
public static it.unimi.dsi.stat.Jackknife.Statistic SPID
A statistic that computes the spid.
-
AVERAGE_DISTANCE
public static it.unimi.dsi.stat.Jackknife.Statistic AVERAGE_DISTANCE
A statistic that computes the average distance.
-
HARMONIC_DIAMETER
public static it.unimi.dsi.stat.Jackknife.Statistic HARMONIC_DIAMETER
A statistic that computes the harmonic diameter.
-
EFFECTIVE_DIAMETER
public static it.unimi.dsi.stat.Jackknife.Statistic EFFECTIVE_DIAMETER
A statistic that computes the effective diameter.
-
CDF
public static it.unimi.dsi.stat.Jackknife.Statistic CDF
A statistic that divides all values of a sample (an approximate neighbourhood function) by the last value. Useful for moving from neighbourhood functions to cumulative distribution functions.
-
PMF
public static it.unimi.dsi.stat.Jackknife.Statistic PMF
A statistic that computes differences between consecutive elements of a sample (an approximate neighbourhood function) and divide them by the last value. Useful for moving from neighbourhood functions or cumulative distribution functions to probability mass functions.
-
-
Method Detail
-
combine
public static double[] combine(java.lang.Iterable<double[]> anf)
Combines several approximate neighbourhood functions for the same graph by averaging their values.Note that the resulting approximate neighbourhood function has its standard deviation reduced by the square root of the number of samples (the standard error). However, if the cumulative distribution function has to be computed instead, calling this method and dividing all values by the last value is not the best approach, as it leads to a biased estimate. Rather, the samples should be combined using the jackknife and the
CDF
statistic.If you want to obtain estimates on the standard error of each data point, please consider using the jackknife with the identity statistic instead of this method.
- Parameters:
anf
- an iterable object returning arrays of doubles representing approximate neighbourhood functions.- Returns:
- a combined approximate neighbourhood functions.
-
evenOut
public static it.unimi.dsi.fastutil.objects.ObjectList<double[]> evenOut(java.lang.Iterable<double[]> anf)
Evens out several approximate neighbourhood functions for the same graph by extending them to the same length (by copying the last value). This is usually a preparatory step for the jackknife.- Parameters:
anf
- an iterable object returning arrays of doubles representing approximate neighbourhood functions.- Returns:
- a list containing the same approximate neighbourhood functions, extended to the same length.
-
-