Class DefaultStatistics
- All Implemented Interfaces:
dk.alexandra.fresco.framework.builder.ComputationDirectory,Statistics
public class DefaultStatistics extends Object implements Statistics
-
Method Summary
Modifier and Type Method Description dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>chiSquare(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> observed, double[] expected)Compute the test statistics for a Χ2-test.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>chiSquare(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> observed, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> expected)Compute the test statistics for a Χ2-test.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>correlation(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data1, dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> mean1, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data2, dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> mean2)Compute Pearson's correlation coefficient on the two samples.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>correlation(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data1, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data2)Compute Pearson's correlation coefficient on the two samples.dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>>coxRegressionContinuous(List<SurvivalInfoContinuous> data, int iterations, double alpha, double[] beta)Estimate the parameters of a Cox model on the given data.dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>>coxRegressionDiscrete(List<SurvivalInfoDiscrete> data, int iterations, double alpha, double[] beta)Estimate the parameters of a Cox model on the given data.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>ffest(List<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> observed)Compute the F-test statistics for the null hypothesis that the given datasets have the same mean.dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.util.Pair<BigInteger,Integer>>>frequencyTable(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data)Compute a frequency table for the data.dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>>histogramContinuous(double[] buckets, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data)Compute the histogram for the given sample.dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>>histogramContinuous(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> buckets, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data)Compute the histogram for the given sample.dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>>histogramDiscrete(int[] buckets, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data)Compute the histogram for the given sample.dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>>histogramDiscrete(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> buckets, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data)Compute the histogram for the given sample.dk.alexandra.fresco.framework.DRes<MultiDimensionalArray<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>>>kAnonymize(dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> sensitiveAttributes, List<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> buckets, int k)Compute a k-anonymized version of the given datset.dk.alexandra.fresco.framework.DRes<MultiDimensionalArray<List<BigInteger>>>kAnonymizeAndOpen(dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> sensitiveAttributes, List<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> buckets, int k)Compute a k-anonymized version of the given dataset and open it to all parties.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>kruskallWallisTest(List<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> observed)Compute the Kruskall-Wallis test statistics for the null hypothesis that the given samples are drawn from same the distribution.dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.util.Pair<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>,Integer>>>leakyFrequencyTable(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data)Compute a frequency table for the data.dk.alexandra.fresco.framework.DRes<LinearRegression.LinearRegressionResult>linearRegression(List<ArrayList<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> x, ArrayList<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> y)Compute estimates for the parameters b of a linear model such that b0 x0 + ...dk.alexandra.fresco.framework.DRes<ArrayList<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>>mahalanobisDistance(List<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> X)Compute the Mahalanobis Distance of all samples in a data set.dk.alexandra.fresco.framework.DRes<MultiDimensionalArray<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>>multiDimensionalHistogramDiscrete(List<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> buckets, dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data)Compute the histogram for the given multi-dimensional sample.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>sampleMean(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data)Compute the sample mean of the given data.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>sampleMedian(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data)Compute the sample median of the sample set.dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>>samplePercentiles(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data, double[] percentiles)Compute the sample percentiles of a sample set.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>sampleStandardDeviation(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data)Compute the standard deviation of the data.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>sampleStandardDeviation(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data, dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> mean)Compute the sample standard deviation of the data given that the sample mean has already been calculated.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>sampleVariance(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data)Compute the sample variance of the given data.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>sampleVariance(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data, dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> mean)Compute the sample variance of the given data, assuming the sample mean has already been calculated.dk.alexandra.fresco.framework.DRes<SimpleLinearRegression.SimpleLinearRegressionResult>simpleLinearRegression(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> x, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> y)Compute simple linear regression on two samples.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>ttest(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data, dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> mu)Compute the test statistics for a Student's t-test for the hypothesis that the mean of the sample is equal tomu.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>ttest(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data1, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data2)Compute the test statistics for a two-sample Student's t-test for the hypothesis that the mean of the two samples are equal.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>>twoDimensionalHistogramContinuous(dk.alexandra.fresco.framework.util.Pair<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>,List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> buckets, List<dk.alexandra.fresco.framework.util.Pair<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>,dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> data)Compute the histogram for the given two-dimensional sample.dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>>twoDimensionalHistogramDiscrete(dk.alexandra.fresco.framework.util.Pair<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>,List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> buckets, List<dk.alexandra.fresco.framework.util.Pair<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>,dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> data)Compute the histogram for the given two-dimensional sample.
-
Method Details
-
sampleMean
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> sampleMean(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data)Description copied from interface:StatisticsCompute the sample mean of the given data.- Specified by:
sampleMeanin interfaceStatistics- Parameters:
data- A dataset.- Returns:
- The sample mean.
-
sampleMedian
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> sampleMedian(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data)Description copied from interface:StatisticsCompute the sample median of the sample set.- Specified by:
sampleMedianin interfaceStatistics- Parameters:
data- Samples.- Returns:
- The median.
-
samplePercentiles
public dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> samplePercentiles(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data, double[] percentiles)Description copied from interface:StatisticsCompute the sample percentiles of a sample set.- Specified by:
samplePercentilesin interfaceStatistics- Parameters:
data- Samples.- Returns:
- The median.
-
sampleVariance
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> sampleVariance(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data, dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> mean)Description copied from interface:StatisticsCompute the sample variance of the given data, assuming the sample mean has already been calculated.- Specified by:
sampleVariancein interfaceStatistics- Parameters:
data- A dataset.mean- The sample mean for the given dataset.- Returns:
- The sample variance.
-
sampleVariance
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> sampleVariance(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data)Description copied from interface:StatisticsCompute the sample variance of the given data.- Specified by:
sampleVariancein interfaceStatistics- Parameters:
data- A dataset.- Returns:
- The sample variance.
-
sampleStandardDeviation
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> sampleStandardDeviation(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data)Description copied from interface:StatisticsCompute the standard deviation of the data.- Specified by:
sampleStandardDeviationin interfaceStatistics- Parameters:
data- A dataset.- Returns:
- The sample standard deviation.
-
sampleStandardDeviation
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> sampleStandardDeviation(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data, dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> mean)Description copied from interface:StatisticsCompute the sample standard deviation of the data given that the sample mean has already been calculated.- Specified by:
sampleStandardDeviationin interfaceStatistics- Parameters:
data- A dataset.mean- The sample mean for the given dataset.- Returns:
- The sample standard deviation.
-
ttest
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> ttest(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data, dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> mu)Description copied from interface:StatisticsCompute the test statistics for a Student's t-test for the hypothesis that the mean of the sample is equal tomu.- Specified by:
ttestin interfaceStatistics- Parameters:
data- A dataset.mu- The parameter for the t-test.- Returns:
- The test statistics.
-
ttest
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> ttest(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data1, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data2)Description copied from interface:StatisticsCompute the test statistics for a two-sample Student's t-test for the hypothesis that the mean of the two samples are equal. It is assumed that the two samples have the same variance.- Specified by:
ttestin interfaceStatistics- Parameters:
data1- A dataset.data2- A dataset.- Returns:
- The test statistics for the hypothesis that the two datasets have the same mean.
-
chiSquare
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> chiSquare(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> observed, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> expected)Description copied from interface:StatisticsCompute the test statistics for a Χ2-test.- Specified by:
chiSquarein interfaceStatistics- Parameters:
observed- The observed data.expected- The expected number of observations in each bucket.- Returns:
- The test statistics that the observed data fits the distribution of the expected.
-
chiSquare
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> chiSquare(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> observed, double[] expected)Description copied from interface:StatisticsCompute the test statistics for a Χ2-test.- Specified by:
chiSquarein interfaceStatistics- Parameters:
observed- The observed data.expected- The expected number of observations in each bucket.- Returns:
- The test statistics that the observed data fits the distribution of the expected.
-
linearRegression
public dk.alexandra.fresco.framework.DRes<LinearRegression.LinearRegressionResult> linearRegression(List<ArrayList<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> x, ArrayList<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> y)Description copied from interface:StatisticsCompute estimates for the parameters b of a linear model such that b0 x0 + ... + bk xk = y.- Specified by:
linearRegressionin interfaceStatistics- Parameters:
x- The dataset.y- The dependant values- Returns:
- An estimation for the parameters of a linear model for the given data.
-
simpleLinearRegression
public dk.alexandra.fresco.framework.DRes<SimpleLinearRegression.SimpleLinearRegressionResult> simpleLinearRegression(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> x, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> y)Description copied from interface:StatisticsCompute simple linear regression on two samples.- Specified by:
simpleLinearRegressionin interfaceStatistics- Parameters:
x- The dataset.y- The dependant values.- Returns:
- An estimation for the parameters of a linear model.
-
correlation
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> correlation(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data1, dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> mean1, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data2, dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> mean2)Description copied from interface:StatisticsCompute Pearson's correlation coefficient on the two samples. Here it's assumed that the sample means has already been calculated.- Specified by:
correlationin interfaceStatistics- Returns:
-
correlation
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> correlation(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data1, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data2)Description copied from interface:StatisticsCompute Pearson's correlation coefficient on the two samples.- Specified by:
correlationin interfaceStatistics- Returns:
-
ffest
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> ffest(List<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> observed)Description copied from interface:StatisticsCompute the F-test statistics for the null hypothesis that the given datasets have the same mean.- Specified by:
ffestin interfaceStatistics- Parameters:
observed- A list of datasets.- Returns:
- The test statistics.
-
kruskallWallisTest
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed> kruskallWallisTest(List<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> observed)Description copied from interface:StatisticsCompute the Kruskall-Wallis test statistics for the null hypothesis that the given samples are drawn from same the distribution.- Specified by:
kruskallWallisTestin interfaceStatistics- Returns:
-
leakyFrequencyTable
public dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.util.Pair<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>,Integer>>> leakyFrequencyTable(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data)Description copied from interface:StatisticsCompute a frequency table for the data. Note that the frequencies will be leaked but the corresponding values will not.- Specified by:
leakyFrequencyTablein interfaceStatistics- Parameters:
data- A dataset- Returns:
- A frequency table.
-
frequencyTable
public dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.util.Pair<BigInteger,Integer>>> frequencyTable(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data)Description copied from interface:StatisticsCompute a frequency table for the data.- Specified by:
frequencyTablein interfaceStatistics- Parameters:
data- A dataset- Returns:
- A frequency table.
-
coxRegressionDiscrete
public dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> coxRegressionDiscrete(List<SurvivalInfoDiscrete> data, int iterations, double alpha, double[] beta)Description copied from interface:StatisticsEstimate the parameters of a Cox model on the given data. Here it's assumed that each covariate only takes values in a (small) finite set, e.g. when they indicate group membership. If many different values are possible, useStatistics.coxRegressionContinuous(java.util.List<dk.alexandra.fresco.stat.survival.SurvivalInfoContinuous>, int, double, double[])instead.- Specified by:
coxRegressionDiscretein interfaceStatistics- Parameters:
data- The data set.iterations- The number of iterations.alpha- The learning rate.beta- The initial coefficient guess.- Returns:
-
coxRegressionContinuous
public dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> coxRegressionContinuous(List<SurvivalInfoContinuous> data, int iterations, double alpha, double[] beta)Description copied from interface:StatisticsEstimate the parameters of a Cox model on the given data.- Specified by:
coxRegressionContinuousin interfaceStatistics- Parameters:
data- The data set.iterations- The number of iterations.alpha- The learning rate.beta- The initial coefficient guess.- Returns:
-
histogramDiscrete
public dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> histogramDiscrete(int[] buckets, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data)Description copied from interface:StatisticsCompute the histogram for the given sample.- Specified by:
histogramDiscretein interfaceStatistics- Parameters:
buckets- Upper bound for the buckets to use in the histogram.data- The sample data.- Returns:
-
histogramDiscrete
public dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> histogramDiscrete(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> buckets, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data)Description copied from interface:StatisticsCompute the histogram for the given sample.- Specified by:
histogramDiscretein interfaceStatistics- Parameters:
buckets- Upper bound for the buckets to use in the histogram.data- The sample data.- Returns:
-
histogramContinuous
public dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> histogramContinuous(List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> buckets, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data)Description copied from interface:StatisticsCompute the histogram for the given sample.- Specified by:
histogramContinuousin interfaceStatistics- Parameters:
buckets- Upper bound for the buckets to use in the histogram.data- The sample data.- Returns:
-
histogramContinuous
public dk.alexandra.fresco.framework.DRes<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> histogramContinuous(double[] buckets, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>> data)Description copied from interface:StatisticsCompute the histogram for the given sample.- Specified by:
histogramContinuousin interfaceStatistics- Parameters:
buckets- Upper bound for the buckets to use in the histogram.data- The sample data.- Returns:
-
twoDimensionalHistogramDiscrete
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> twoDimensionalHistogramDiscrete(dk.alexandra.fresco.framework.util.Pair<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>,List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> buckets, List<dk.alexandra.fresco.framework.util.Pair<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>,dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> data)Description copied from interface:StatisticsCompute the histogram for the given two-dimensional sample.- Specified by:
twoDimensionalHistogramDiscretein interfaceStatistics- Parameters:
buckets- Upper bounds for the buckets to use in the histogram.data- The sample data.- Returns:
-
twoDimensionalHistogramContinuous
public dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> twoDimensionalHistogramContinuous(dk.alexandra.fresco.framework.util.Pair<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>,List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> buckets, List<dk.alexandra.fresco.framework.util.Pair<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>,dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> data)Description copied from interface:StatisticsCompute the histogram for the given two-dimensional sample.- Specified by:
twoDimensionalHistogramContinuousin interfaceStatistics- Parameters:
buckets- Upper bounds for the buckets to use in the histogram.data- The sample data.- Returns:
-
multiDimensionalHistogramDiscrete
public dk.alexandra.fresco.framework.DRes<MultiDimensionalArray<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> multiDimensionalHistogramDiscrete(List<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> buckets, dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data)Description copied from interface:StatisticsCompute the histogram for the given multi-dimensional sample.- Specified by:
multiDimensionalHistogramDiscretein interfaceStatistics- Parameters:
buckets- Upper bounds for the buckets to use in the histogram.data- The sample data.- Returns:
-
kAnonymize
public dk.alexandra.fresco.framework.DRes<MultiDimensionalArray<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>>> kAnonymize(dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> sensitiveAttributes, List<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> buckets, int k)Description copied from interface:StatisticsCompute a k-anonymized version of the given datset.Each row in the data set are the quasi-identifiers of an individual with a corresponding entry in the list of values of the sensitive attribute. The buckets indicates the desired generalization of the quasi-identifiers as in a histogram. K is the smallest allowed number of individuals in each bucket.
The output is a histogram on the given buckets with the value in the histogram being a list of size data.getHeight() with a non-zero entry x at index i indicating that the data point at row i is in this bucket and that the corresponding sensitive attribute was x.
- Specified by:
kAnonymizein interfaceStatistics- Parameters:
data- The quasi identifiers for each individual.sensitiveAttributes- The corresponding sensitive attributes. Must be non-zerobuckets- The buckets defining the desired generalization.k- The smallest allowed number of individuals in each bucket.- Returns:
- A k-anonymous data set with all buckets with fewer than k elements suppressed.
-
kAnonymizeAndOpen
public dk.alexandra.fresco.framework.DRes<MultiDimensionalArray<List<BigInteger>>> kAnonymizeAndOpen(dk.alexandra.fresco.lib.common.collections.Matrix<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> data, List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>> sensitiveAttributes, List<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.framework.value.SInt>>> buckets, int k)Description copied from interface:StatisticsCompute a k-anonymized version of the given dataset and open it to all parties.Each row in the data set are the quasi-identifiers of an individual with a corresponding entry in the list of values of the sensitive attribute. The buckets indicates the desired generalization of the quasi-identifiers as in a histogram. K is the smallest allowed number of individuals in each bucket.
The output is a histogram on the given buckets with the value corresponding to a bucket is a list of the sensitive attributes from the original dataset which ended up in this bucket.
- Specified by:
kAnonymizeAndOpenin interfaceStatistics- Parameters:
data- The quasi identifiers for each individual.sensitiveAttributes- The corresponding sensitive attributes. Must be non-zero.buckets- The buckets defining the desired generalization.k- The smallest allowed number of individuals in each bucket.- Returns:
- A k-anonymous data set with all buckets with fewer than k elements suppressed.
-
mahalanobisDistance
public dk.alexandra.fresco.framework.DRes<ArrayList<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> mahalanobisDistance(List<List<dk.alexandra.fresco.framework.DRes<dk.alexandra.fresco.lib.fixed.SFixed>>> X)Description copied from interface:StatisticsCompute the Mahalanobis Distance of all samples in a data set. This may be used to detect outliers in the data set which may be filtered out obliviously (seeFilteredStatisticsbefore using the data set for analysis.- Specified by:
mahalanobisDistancein interfaceStatistics- Parameters:
X- The data set
-