Last data update: 2014.03.03

R: Plot a contour view of a model, including design points
contourview.listR Documentation

Plot a contour view of a model, including design points

Description

Plot a contour view of a model, thus providing a better understanding of its behaviour.

Usage

  contourview.list(model, center = NULL, axis = NULL,
    npoints = 20, nlevels = 10, col_points = "red",
    col_surf = "blue", filled = FALSE, bg_blend = 1,
    mfrow = NULL, Xname = NULL, yname = NULL, Xscale = 1,
    yscale = 1, xlim = NULL, ylim = NULL, title = NULL,
    add = FALSE, ...)

Arguments

model

a list that can be used in the modelPredict function of the DiceEval package.

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.

col_points

color of points.

col_surf

color for the surface.

filled

use filled.contour

nlevels

number of contour levels to display.

mfrow

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

bg_blend

an optional factor of alpha (color channel) blending used to plot design points outside from this section.

xlim

an optional list to force x range for all plots. The default value NULL is automatically set to include all design points.

ylim

an optional list to force y range for all plots. The default value NULL is automatically set to include all design points.

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.

title

an optional overload of main title.

add

to print graphics on an existing window.

...

optional arguments passed to the first call of plot3d.

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 data$X element of the model. Thus they are original data variables but not trend variables that may have been created using the model's formula.

Author(s)

Yann Richet, IRSN

See Also

sectionview.list for a 2D plot, and the modelPredict function in the DiceEval package. The sectionview3d.km produces a similar plot for km objects.

Examples

## A 2D example - Branin-Hoo function
## a 16-points factorial design, and the corresponding response
d <- 2; n <- 16
design.fact <- expand.grid(seq(0, 1, length = 4), seq(0, 1, length = 4))
design.fact <- data.frame(design.fact); names(design.fact) <-c("x1", "x2")
y <- branin(design.fact)

## linear model
m1 <- modelFit(design.fact, y$x1, type = "Linear", formula = "Y~.")

## the same as sectionview3d.list
contourview(m1)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DiceView)
Loading required package: DiceKriging
Loading required package: DiceEval
Loading required package: rgl
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DiceView/contourview.list.Rd_%03d_medium.png", width=480, height=480)
> ### Name: contourview.list
> ### Title: Plot a contour view of a model, including design points
> ### Aliases: contourview.list
> ### Keywords: models
> 
> ### ** Examples
> 
> ## A 2D example - Branin-Hoo function
> ## a 16-points factorial design, and the corresponding response
> d <- 2; n <- 16
> design.fact <- expand.grid(seq(0, 1, length = 4), seq(0, 1, length = 4))
> design.fact <- data.frame(design.fact); names(design.fact) <-c("x1", "x2")
> y <- branin(design.fact)
> 
> ## linear model
> m1 <- modelFit(design.fact, y$x1, type = "Linear", formula = "Y~.")
> 
> ## the same as sectionview3d.list
> contourview(m1)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>