Description Usage Arguments Value See Also Examples
Using the rsm
package, this function builds a linear response surface model.
1 |
x |
design matrix (sample locations), rows for each sample, columns for each variable. |
y |
vector of observations at |
control |
(list), with the options for the model building procedure:
|
returns an object of class spotRSM
.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.