Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mesh_exsets

Search excursion set of nD function, sampled by a mesh


Description

Search excursion set of nD function, sampled by a mesh

Usage

mesh_exsets(
  f,
  f.vectorized = FALSE,
  threshold,
  sign,
  intervals,
  mesh = "seq",
  mesh.sizes = 11,
  maxerror_f = 1e-09,
  tol = .Machine$double.eps^0.25,
  ex_filter.tri = all,
  ...
)

Arguments

f

Function to inverse at 'threshold'

f.vectorized

is f already vectorized ? (default: no)

threshold

target value to inverse

sign

focus at conservative for above (sign=1) or below (sign=-1) the threshold

intervals

bounds to inverse in, each column contains min and max of each dimension

mesh

function or "unif" or "seq" (default) to preform interval partition

mesh.sizes

number of parts for mesh (duplicate for each dimension if using "seq")

maxerror_f

maximal tolerance on f precision

tol

the desired accuracy (convergence tolerance on f arg).

ex_filter.tri

boolean function to validate a geometry::tri as considered in excursion : 'any' or 'all'

...

parameters to forward to mesh_roots(...) call

Examples

mesh_exsets(function(x) x, threshold=.51, sign=1, intervals=rbind(0,1))
mesh_exsets(function(x) x, threshold=.50000001, sign=1, intervals=rbind(0,1))
mesh_exsets(function(x) sum(x), threshold=.51,sign=1, intervals=cbind(rbind(0,1),rbind(0,1)))
mesh_exsets(sin,threshold=0,sign="sup",interval=c(pi/2,5*pi/2))
mesh_exsets(f = function(x) sin(pi*x[1])*sin(pi*x[2]),
            threshold=0,sign=1, intervals = matrix(c(1/2,5/2,1/2,5/2),nrow=2))

e = mesh_exsets(function(x) (0.25+x[1])^2+(0.5+x[2])^2 ,
              threshold =0.25,sign=-1, intervals=matrix(c(-1,1,-1,1),nrow=2))
plot(e$p,xlim=c(-1,1),ylim=c(-1,1));
apply(e$tri,1,function(tri) polygon(e$p[tri,],col=rgb(.4,.4,.4,.4)))

## Not run: 
e = mesh_exsets(function(x) (0.5+x[1])^2+(-0.5+x[2])^2+(0.+x[3])^2,
              threshold = .25,sign=-1, mesh="unif", mesh.sizes = 10,
              intervals=matrix(c(-1,1,-1,1,-1,1),nrow=2))
rgl::plot3d(e$p,xlim=c(-1,1),ylim=c(-1,1),zlim=c(-1,1));
apply(e$tri,1,function(tri)rgl::lines3d(e$p[tri,]))

## End(Not run)

DiceView

Methods for Visualization of Computer Experiments Design and Surrogate

v2.0-1
GPL-3
Authors
Yann Richet, Yves Deville, Clement Chevalier
Initial release
2020-11-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.