Partition data according to the MAP tree

Share:

Description

Partition data according to the maximum a' posteriori (MAP) tree contained in a "tgp"-class object.

Usage

1
partition(X, out)

Arguments

X

data.frame, matrix, or vector of inputs X with the same dimension of out$X, i.e., ncol(X) == ncol(out$X)

out

"tgp"-class object which is the output of one the model functions with tree support (e.g. btgpllm, btgp, btlm)

Value

Output is a list of data.frames populated with the inputs X contained in each region of the partition of the MAP tree in the "tgp"-class object out

Author(s)

Robert B. Gramacy, rbgramacy@chicagobooth.edu, and Matt Taddy, taddy@chicagobooth.edu

References

http://bobby.gramacy.com/r_packages/tgp

See Also

tgp.design, tgp.trees

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#
# 2-d Exponential data
# (This example is based on random data.  
# It might be fun to run it a few times)
#

# get the data
exp2d.data <- exp2d.rand()
X <- exp2d.data$X; Z <- exp2d.data$Z
Xcand <- exp2d.data$XX

# fit treed GP LLM model to data w/o prediction
# basically just to get MAP tree (and plot it)
out <- btgpllm(X=X, Z=Z, pred.n=FALSE, BTE=c(2000,3000,2)) 
tgp.trees(out)

# find a treed sequential D-Optimal design 
# with 10 more points
Xcand.parts <- partition(Xcand, out)