CGGPvalstats {CGGP}R Documentation

Calculate stats for CGGP prediction on validation data

Description

Calculate stats for CGGP prediction on validation data

Usage

CGGPvalstats(CGGP, Xval, Yval, bydim = TRUE, ...)

Arguments

CGGP

CGGP object

Xval

X validation matrix

Yval

Y validation data

bydim

If multiple outputs, should it be done separately by dimension?

...

Passed to valstats, such as which stats to calculate.

Value

data frame

Examples


SG <- CGGPcreate(d=3, batchsize=100)
f1 <- function(x){x[1]+x[2]^2}
y <- apply(SG$design, 1, f1)
SG <- CGGPfit(SG, y)
Xval <- matrix(runif(3*100), ncol=3)
Yval <- apply(Xval, 1, f1)
CGGPvalstats(CGGP=SG, Xval=Xval, Yval=Yval)

# Multiple outputs
SG <- CGGPcreate(d=3, batchsize=100)
f1 <- function(x){x[1]+x[2]^2}
f2 <- function(x){x[1]^1.3+.4*sin(6*x[2])+10}
y1 <- apply(SG$design, 1, f1)#+rnorm(1,0,.01)
y2 <- apply(SG$design, 1, f2)#+rnorm(1,0,.01)
y <- cbind(y1, y2)
SG <- CGGPfit(SG, Y=y)
Xval <- matrix(runif(3*100), ncol=3)
Yval <- cbind(apply(Xval, 1, f1),
              apply(Xval, 1, f2))
CGGPvalstats(SG, Xval, Yval)
CGGPvalstats(SG, Xval, Yval, bydim=FALSE)


[Package CGGP version 1.0.3 Index]