Description Usage Arguments Details Value See Also
View source: R/statistic-covariance.R
This function is called by mechanismLaplace$evaluate
, which is called within the
differentially private covariance release function dpCovariance$release
. It
produces the true covariance matrix of input x
that is then perturbed within
mechanismLaplace$evaluate
.
1 | covar(x, intercept)
|
x |
Input data frame that covariance matrix will be calculated with. |
intercept |
Logical, indicates if intercept column should be appended to x. |
Since the Laplace mechanism as instantiated within mechanismLaplace$evaluate
expects
an output of the true function which can have a 1-dimensional vector of noise added to it,
the covariance function here outputs a flattened version of the lower triangle of the
covariance matrix, rather than a matrix. The lower triangle is sufficient since covariance
matrices are symmetric.
The flattened output corresponds to the covariance matrix by proceeding proceeding top-to-bottom down each column of the lower triangular matrix (including the diagonal).
The traditional covariance matrix is then reconstructed from the noisy version of this output
as a post-processing step in covarianceFormatRelease
.
The lower triangle of the covariance matrix of x, flattened to a 1-dimensional array.
dpCovariance$release
mechanismLaplace$evaluate
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.