buildRSM: Build Response Surface Model

Description Usage Arguments Value See Also Examples

View source: R/buildRSM.R

Description

Using the rsm package, this function builds a linear response surface model.

Usage

1
buildRSM(x, y, control = list())

Arguments

x

design matrix (sample locations), rows for each sample, columns for each variable.

y

vector of observations at x

control

(list), with the options for the model building procedure:

mainEffectsOnly

Logical, defaults to FALSE. Set to TRUE if a model with main effects only is desired (no interactions, second order effects).

canonical

Logical, defaults to FALSE. If this is TRUE, use the canonical path to descent from saddle points. Else, simply use steepest descent

Value

returns an object of class spotRSM.

See Also

predict.spotRSM

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Create a test function: branin
braninFunction <- function (x) {	
	(x[2]  - 5.1/(4 * pi^2) * (x[1] ^2) + 5/pi * x[1]  - 6)^2 + 
10 * (1 - 1/(8 * pi)) * cos(x[1] ) + 10
}
## Create design points
x <- cbind(runif(20)*15-5,runif(20)*15)
## Compute observations at design points
y <- as.matrix(apply(x,1,braninFunction))
## Create model with default settings
fit <- buildRSM(x,y)
## Predict new point
predict(fit,cbind(1,2))
## True value at location
braninFunction(c(1,2))
## plots
plot(fit)
## path of steepest descent
descentSpotRSM(fit)

SPOT documentation built on Oct. 23, 2021, 1:06 a.m.