buildPCA: buildPCA

Description Usage Arguments Value Author(s) Examples

View source: R/buildPCA.R

Description

buildPCA builds principal components of given dataset. It is used inside plotPCA function to build necessary object to perform principal components analysis.

Usage

1
buildPCA(x, control = list())

Arguments

x

dataset of parameters to be transformed

control

control list

Value

returns a list with the following elements:
sdev the standard deviations of the principal components (i.e., the square roots of the eigenvalues of the covariance/correlation matrix, though the calculation is actually done with the singular values of the data matrix).
rotation the matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors).
x transformed matrix.
center,scale the centering and scaling used, or FALSE.

Author(s)

Alpar Gür alpar.guer@smail.th-koeln.de

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
#define objective function

objFun <- function(x) 2*(x[1] - 1)^2 + 5*(x[2] - 3)^2 + (10*x[3] - x[4]/3)   

spotConfig <- 
list(types = c('numeric', 'numeric', 'numeric', 'numeric'), 
funEvals = 15, #budget
noise = TRUE,
seedFun = 1,
replicated = 2,
seedSPOT = 1,
design = designLHD,
model = buildRandomForest, #surrogate model
optimizer = optimLHD, #LHD to optimize model
optimizerControl = list(funEvals=100)) #100 model evals in each step

lower <- c(-20, -20, -20, -20) 
upper <- c(20, 20, 20, 20)

res <- spot(x=NULL, 
   fun=objFun, 
   lower=lower, 
   upper=upper, 
   control=spotConfig) 

resPCA <- buildPCA(res$x) 

SPOT documentation built on Jan. 3, 2022, 5:11 p.m.