bernstein {diffpriv} | R Documentation |
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.
bernstein(f, dims, k = 10)
f |
a function to be approximated. |
dims |
the function |
k |
the lattice resolution of approximation. |
an S3 object of class bernstein
.
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.
predict.bernstein
for subsequent evaluation.
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)