Given the vectors (breaks[1],...,breaks[n])
and the list of IBMPopSim
compatible
functions funs = (f[0],f[1],...,f[n])
(one value more!), piecewise_xy(breaks, funs)
returns
the function
$$f(x,y) = f_0(x) {1}_{y\le breaks[1]}+\sum_{k=1}^{n-1} f_k(x) {1}_{[breaks_{k}, breaks_{k+1})}(y) + f_n(x){1}_{y \ge breaks[n]}$$
piecewise_xy(breaks, funs)
Piecewise bivariate function built with the given intervals and functions.
A C++ version of this function is available. See vignette('IBMPopSim_cpp')
for more details.