Learn R Programming

suropt (version 0.1.1)

build_surmodel: Build an surmodel object

Description

Build an surmodel object

Usage

build_surmodel(fn, n_in, d_in, doe_type = "rlhs", sur_type = "mkm",
  pre_process = NULL, post_process = NULL)

Arguments

fn

high fidelity function (fun must return a list of vectors with the format list(y = c(y1, y2, y3), g = c(g1, g2))). Alternatively, it can e a data.frame with names such as X.1, X.2, Y.1, G.1, G.2, G3

n_in, d_in

integer number of observations and dimension of the input variables

doe_type

string that defines the doe generation scheme (list valid schemes)

sur_type

string that defines the surogate type (list valid types)

pre_process

string vector defining the pre processing functions

post_process

string vector defining the post processing

Value

surogate model

Examples

Run this code
# NOT RUN {
fn <- function(x) list(y = x^2)
model <- build_surmodel(fn, 20, 1)

fn <- function(x) list(y = DiceKriging::branin(x))
model <- build_surmodel(fn, 20, 2)

fn <- function(x) list(y = DiceKriging::branin(x), g = 0.2 - prod(x))
model <- build_surmodel(fn, 20, 2)

fn <- shaffer2
model <- build_surmodel(fn, 20, 1)

fn <- binh
model <- build_surmodel(fn, 20, 2)

data <- data.frame(X.1 = runif(5), X.2 = runif(5), Y.1 = runif(5))
model <- build_surmodel(data)

data <- data.frame(X.1 = runif(5), X.2 = runif(5), Y.1 = runif(5), G.1 = rnorm(5))
model <- build_surmodel(data)
# }

Run the code above in your browser using DataLab