bernstein: Fit a Bernstein polynomial approximation.

Description Usage Arguments Value References See Also Examples

View source: R/bernstein_polynomials.R

Description

Fits the basis of Bernstein polynomial functions to given real-valued function f of [0,1]^d where d=dims, against a regular lattice of k+1 points in each dimension for given k. Note the approximation is not the iterated variant.

Usage

1
bernstein(f, dims, k = 10)

Arguments

f

a function to be approximated.

dims

the function f's domain dimension.

k

the lattice resolution of approximation.

Value

an S3 object of class bernstein.

References

Francesco Ald<c3><a0> 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.

See Also

predict.bernstein for subsequent evaluation.

Examples

1
2
3
4
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)

diffpriv documentation built on May 2, 2019, 2:38 a.m.