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

function-methods

Plot a contour view of a function.


Description

Plot one section view per dimension of a function thus providing a better understanding of the model behaviour.

Plot a 3-D view of a function. Provide a better understanding of the model behaviour.

Usage

## S3 method for class ''function''
contourview(
  model,
  dim = ifelse(is.null(center), 2, length(center)),
  center = NULL,
  axis = NULL,
  npoints = 20,
  nlevels = 10,
  col = "blue",
  filled = FALSE,
  mfrow = NULL,
  Xname = NULL,
  yname = NULL,
  Xscale = 1,
  yscale = 1,
  xlim = c(0, 1),
  ylim = NULL,
  title = NULL,
  add = FALSE,
  ...
)

## S3 method for class ''function''
sectionview(
  model,
  dim = ifelse(is.null(center), 1, length(center)),
  center = NULL,
  axis = NULL,
  npoints = 100,
  col_surf = "blue",
  mfrow = NULL,
  Xname = NULL,
  yname = NULL,
  Xscale = 1,
  yscale = 1,
  xlim = c(0, 1),
  ylim = NULL,
  title = NULL,
  add = FALSE,
  ...
)

## S3 method for class ''function''
sectionview3d(
  model,
  dim = ifelse(is.null(center), 2, length(center)),
  center = NULL,
  axis = NULL,
  npoints = 20,
  col = "blue",
  Xname = NULL,
  yname = NULL,
  Xscale = 1,
  yscale = 1,
  xlim = c(0, 1),
  ylim = NULL,
  title = NULL,
  add = FALSE,
  ...
)

## S4 method for signature ''function''
sectionview(
  model,
  dim,
  center = NULL,
  axis = NULL,
  npoints = 100,
  col = "blue",
  mfrow = NULL,
  Xname = NULL,
  yname = NULL,
  Xscale = 1,
  yscale = 1,
  xlim = c(0, 1),
  ylim = NULL,
  title = NULL,
  ...
)

## S4 method for signature ''function''
sectionview3d(
  model,
  dim,
  center = NULL,
  axis = NULL,
  npoints = 20,
  col = "blue",
  Xname = NULL,
  yname = NULL,
  Xscale = 1,
  yscale = 1,
  xlim = c(0, 1),
  ylim = NULL,
  title = NULL,
  ...
)

## S4 method for signature ''function''
contourview(
  model,
  dim,
  center = NULL,
  axis = NULL,
  npoints = 20,
  col = "blue",
  nlevels = 10,
  Xname = NULL,
  yname = NULL,
  Xscale = 1,
  yscale = 1,
  xlim = c(0, 1),
  ylim = NULL,
  title = NULL,
  ...
)

Arguments

model

an object of class "function".

dim

the dimension of fun arguments.

center

optional coordinates (as a list or data frame) of the center of the section view if the model's dimension is > 2.

axis

optional matrix of 2-axis combinations to plot, one by row. The value NULL leads to all possible combinations i.e. choose(D, 2).

npoints

an optional number of points to discretize plot of response surface and uncertainties.

nlevels

number of contour levels to display.

col

color for the surface.

filled

use filled.contour

mfrow

an optional list to force par(mfrow = ...) call. The default value NULL is automatically set for compact view.

Xname

an optional list of string to overload names for X.

yname

an optional string to overload name for y.

Xscale

an optional factor to scale X.

yscale

an optional factor to scale y.

xlim

a list to give x range for all plots.

ylim

an optional list to force y range for all plots.

title

an optional overload of main title.

add

to print graphics on an existing window.

...

further arguments passed to the first call of plot3d.

col_surf

color for the section.

function

function, taken as model

Details

Experimental points are plotted with fading colors. Points that fall in the specified section (if any) have the color specified col_points while points far away from the center have shaded versions of the same color. The amount of fading is determined using the Euclidean distance between the plotted point and center. The variables chosen with their number are to be found in the X slot of the model. Thus they are 'spatial dimensions' but not 'trend variables'.

A multiple rows/columns plot is produced.

Author(s)

Yann Richet, IRSN

Yann Richet, IRSN

Yann Richet, IRSN

See Also

The function sectionview3d produces a 3D version.

Examples

## A 2D example - Branin-Hoo function.
contourview(branin,dim = 2)
## A 2D example - Branin-Hoo function.
sectionview(branin,center=c(.5,.5))
## A 2D example - Branin-Hoo function.
sectionview3d(branin,dim = 2)

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.