covar: Lower triangle of covariance matrix

Description Usage Arguments Details Value See Also

View source: R/statistic-covariance.R

Description

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.

Usage

1
covar(x, intercept)

Arguments

x

Input data frame that covariance matrix will be calculated with.

intercept

Logical, indicates if intercept column should be appended to x.

Details

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.

Value

The lower triangle of the covariance matrix of x, flattened to a 1-dimensional array.

See Also

dpCovariance$release

mechanismLaplace$evaluate


IQSS/PSI-Library documentation built on Feb. 15, 2020, 9:03 p.m.