shared3p_statistics_summary.sc
shared3p_statistics_summary.sc
Module for finding the main percentiles in statistics.
Functions:
MAD
Find the median absolute deviation of a sample.
MAD(constant)
Find the median absolute deviation of a sample.
MAD(filter)
Find the median absolute deviation of a filtered sample.
Detailed Description
D - shared3p protection domain |
Supported types - int32 / int64 / int32 / int64 |
Parameters
data |
- input sample |
mask |
- mask vector indicating which elements of the input sample to include when computing MAD |
returns the median absolute deviation of the filtered input multiplied by 1.4826 |
Leaks the number of true values in the mask |
MAD(filter, constant)
Find the median absolute deviation of a filtered sample.
Detailed Description
D - shared3p protection domain |
Supported types - int32 / int64 / float32 / float64 |
Parameters
data |
- input sample |
mask |
- mask vector indicating which elements of the input sample to include when computing MAD |
constant |
- scale factor |
returns the median absolute deviation of the filtered input multiplied by the scale factor |
Leaks the number of true values in the mask |
covariance
Estimate the Pearson covariance of two samples.
covariance(filter)
Estimate the Pearson covariance of two samples.
Detailed Description
D - shared3p protection domain |
Supported types - int32 / int64 / float32 / float64 |
Parameters
sample1 |
- first sample |
sample2 |
- second sample |
filter |
- filter indicating which elements of the samples are available |
returns the covariance |
None |
Function Overloads
D float32 covariance(D int32[[1]] sample1, D int32[[1]] sample2, D bool[[1]] filter)
D float64 covariance(D int64[[1]] sample1, D int64[[1]] sample2, D bool[[1]] filter)
D float32 covariance(D float32[[1]] sample1, D float32[[1]] sample2, D bool[[1]] filter)
D float64 covariance(D float64[[1]] sample1, D float64[[1]] sample2, D bool[[1]] filter)
fiveNumberSummary
Find the minimum, lower quartile, median, upper quartile and maximum of a sample.
Detailed Description
D - shared3p protection domain |
Supported types - int32 / int64 / float32 / float64 |
A version of this function which hides the sample size was implemented for the paper "Going Beyond Millionaires: Privacy-Preserving Statistical Analysis" but is not included due to private integer division not working. |
Parameters
data |
- input sample |
isAvailable |
- vector indicating which elements of the input sample are available |
returns a vector containing the minimum, lower quartile, median, upper quartile and maximum of the input sample (in that order). If the input size is less than five, a vector of zeroes is returned. |
Leaks the number of true values in isAvailable |
Function Overloads
D float32 fiveNumberSummary(D int32[[1]] data, D bool[[1]] isAvailable)
D float64 fiveNumberSummary(D int64[[1]] data, D bool[[1]] isAvailable)
D float32 fiveNumberSummary(D float32[[1]] data, D bool[[1]] isAvailable)
D float64 fiveNumberSummary(D float64[[1]] data, D bool[[1]] isAvailable)
maximum
Find the largest element of a vector.
Detailed Description
D - shared3p protection domain |
Supported types - int32 / int64 / float32 / float64 |
Parameters
data |
- input vector |
isAvailable |
- vector indicating which elements of the input vector are available |
returns the largest element of the input vector |
Leaks the number of true values in isAvailable |
mean
Find the mean of a vector.
Detailed Description
D - any protection domain |
Supported types - int8 int16 int32 int64 uint8 uint16 uint32 uint64 float32 float64 |
Parameters
data |
- input vector (the function may overflow if the input is too big) |
returns the mean of the input vector |
None |
Function Overloads
D float32 mean(D int8[[1]] data)
D float32 mean(D int16[[1]] data)
D float32 mean(D int32[[1]] data)
D float64 mean(D int64[[1]] data)
D float32 mean(D uint8[[1]] data)
D float32 mean(D uint16[[1]] data)
D float32 mean(D uint32[[1]] data)
D float64 mean(D uint64[[1]] data)
D float32 mean(D float32[[1]] data)
D float64 mean(D float64[[1]] data)
mean(filter)
Find the mean of a filtered vector.
Detailed Description
D - any protection domain |
Supported types - int8 int16 int32 int64 uint8 uint16 uint32 uint64 float32 float64 |
Parameters
data |
- input vector (the function may overflow if the input is too big) |
mask |
- mask indicating which elements of the input vector to include when computing the mean |
returns the mean of the filtered input vector |
None |
Function Overloads
D float32 mean(D int8[[1]] data, D bool[[1]] mask)
D float32 mean(D int16[[1]] data, D bool[[1]] mask)
D float32 mean(D int32[[1]] data, D bool[[1]] mask)
D float64 mean(D int64[[1]] data, D bool[[1]] mask)
D float32 mean(D uint8[[1]] data, D bool[[1]] mask)
D float32 mean(D uint16[[1]] data, D bool[[1]] mask)
D float32 mean(D uint32[[1]] data, D bool[[1]] mask)
D float64 mean(D uint64[[1]] data, D bool[[1]] mask)
D float32 mean(D float32[[1]] data, D bool[[1]] mask)
D float64 mean(D float64[[1]] data, D bool[[1]] mask)
minimum
Find the smallest element of a vector.
Detailed Description
D - shared3p protection domain |
Supported types - int32 / int64 / float32 / float64 |
Parameters
data |
- input vector |
isAvailable |
- vector indicating which elements of the input vector are available |
returns the smallest element of the input vector |
Leaks the number of true values in isAvailable |
quantiles
Calculate sample quantiles.
Detailed Description
D - shared3p protection domain |
Supported types - int32 / int64 / float32 / float64 |
Parameters
data |
- input sample |
isAvailable |
- vector indicating which elements of the input sample are available |
probabilities |
- vector of probabilities between 0 and 1 |
returns sample quantiles corresponding to the specified probabilities |
Leaks the number of true values in isAvailable |
Function Overloads
D float32 quantiles(D int32[[1]] data, D bool[[1]] isAvailable, float64[[1]] probabilities)
D float64 quantiles(D int64[[1]] data, D bool[[1]] isAvailable, float64[[1]] probabilities)
D float32 quantiles(D float32[[1]] data, D bool[[1]] isAvailable, float64[[1]] probabilities)
D float64 quantiles(D float64[[1]] data, D bool[[1]] isAvailable, float64[[1]] probabilities)
standardDev
Find the standard deviation of a sample.
standardDev(filter)
Find the standard deviation of a filtered sample.
Detailed Description
D - any protection domain |
Supported types - int32 / int64 / float32 / float64 |
Parameters
data |
- input sample (the function may overflow if the input is too big) |
mask |
- mask vector indicating which elements of the input sample to include when computing the standard deviation |
returns the standard deviation of the filtered input vector |
None |
variance
Find the variance of a vector.
variance(filter)
Find the variance of a filtered vector.
Detailed Description
D - any protection domain |
Supported types - int32 / int64 / float32 / float64 |
Parameters
data |
- input vector (the function may overflow if the input is too big) |
mask |
- mask indicating which elements of the input vector to include when computing the variance |
returns the variance of the input vector |
None |