unscalingFun: Unscaling function applied to all the dimensions

Description Usage Arguments Details Value Author(s) Examples

View source: R/unscalingFun.R

Description

Unscaling the coordinates of points in dimension d

Usage

1
2
unscalingFun(mat, model = NULL, allknots = NULL, alleta = NULL,
  indices = NULL, standardize = FALSE, lower = NULL, upper = NULL)

Arguments

mat

Matrix with values to be unscaled

model

km object containing knots and eta's. If provided, the arguments allknots and alleta are ignored.

allknots

List of arrays obtained from the field [email protected]@knots of a km object

alleta

List of arrays obtained from the field [email protected]@eta of a km object

indices

Array containing the indices of the dimensions to rescale.

standardize

If the initial values in the columns of mat are not in [0,S], with S the integral of the piecewise linear function equal to eta at points knots, then there is the possibility to rescale the values y by indicating in which interval they are.

lower

If standardize=TRUE, this is an array of lower bounds.

upper

If standardize=TRUE, this is an array of upper bounds.

Details

There are two possible ways to use this function. If the number of columns of mat is not equal to d = [email protected] (i.e. the number of dimensions), we assume that mat is allready a submatrix of some bigger matrix with d columns. In that case, all the columns of mat are rescaled an so length(indices) Must be equal to the number of columns of mat. The second way to use the function is to have a matrix mat with the same number of columns as d. In that case only some (or all) columns of mat will be rescaled, depending on the values of indices. If indices is missing, all the columns are rescaled.

Value

A rescaled matrix with the same size.

Author(s)

Clement Chevalier [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
library(DiceKriging)
myfun <- function(x) return(-1 * branin_robinv(x))
d <- 4

set.seed(8)

n0 <- 40
T <- -10
opt.index <- c(3,4)
inv.index <- c(1,2)
lower <- rep(0,times=d)
upper <- rep(1,times=d)

design <- matrix(runif(d*n0),nrow=n0)
response <- myfun(design)

knots.number <- c(3,0,2,2)
knots <- generate_knots(knots.number = knots.number , d = d)

model <- km(formula = ~1,design = design,response = response,covtype = "matern3_2",scaling = TRUE,knots = knots)
allknots <- model@covariance@knots
alleta <- model@covariance@eta

# generates a sequence of points in dimension 4:
myrands <- matrix( runif(2000),ncol=4  )

result <- unscalingFun(mat = myrands[,1:2], allknots =  allknots,alleta = alleta,indices = c(1,2),standardize = TRUE , lower = lower,upper = upper)

result2 <- unscalingFun(mat = myrands,      allknots =  allknots,alleta = alleta,indices = c(1,2),standardize = TRUE , lower = lower,upper = upper)

# result and result2 are the same

IRSN/RobustInv documentation built on Dec. 8, 2018, 2:17 a.m.