private_nn_resample: Resample points to preserve privacy

View source: R/private_nn_resample.R

private_nn_resampleR Documentation

Resample points to preserve privacy

Description

This function takes a set of x,y coordinates and resamples them according to a nearest-neighbour kernel, so that points in sparser parts of the distribution have a larger bandwidth, and their kernels overlap with high probability on the kernels of at least K other points

Usage

private_nn_resample(x, id = NULL, K = 5, size = nrow(x))

Arguments

x

a two-column matrix of coordinates

id

a vector of integers representing group membership (default NULL)

K

the number of nearest neighbours each kernel must overlap with default 5.

size

the number of points to sample. Default nrow(x)

Value

a two-column matrix of resampled points


matweldon/privateKDE documentation built on May 25, 2022, 6:15 a.m.