predict.bernstein function

Evaluate Bernstein approximations on data.

Evaluate Bernstein approximations on data.

Evaluates a given S3 object of type bernstein on given data D.

## S3 method for class 'bernstein' predict(object, D, ...)

Arguments

  • object: an S3 object of type bernstein.
  • D: either a numeric vector or matrix, all values in [0,1]. If numeric then length should be object$dims unless the latter is 1 in which case the length can be arbitrary. If a matrix then the number of columns should match object$dims.
  • ...: additional arguments.

Returns

a numeric vector of scalar real evaluations.

Examples

f <- function(x) x * sin(x*10) b <- bernstein(f, dims = 1) xs <- seq(from=0, to=1, length=50) mean((f(xs) - predict(b,xs))^2)

References

Francesco Aldà and Benjamin I. P. Rubinstein. "The Bernstein Mechanism: Function Release under Differential Privacy", in Proceedings of the 31st AAAI Conference on Artificial Intelligence (AAAI'2017), pp. 1705-1711, Feb 2017.