Learn R Programming

GPpenalty (version 1.0.1)

dpe: dpe

Description

Calculates a decorrelated prediction error (DPE) value. Lower DPE values indicate better fits.

Usage

dpe(y, mu, R)

Value

a numeric value

Arguments

y

response variable vector

mu

predicted mean vector

R

predicted covariance matrix with the scale parameter removed

Examples

Run this code

### test function ###
f_x <- function(x) {
return(sin(2*pi*x) + x^2)
}

### training data ###
n <- 8
x <- runif(n, 0, 1)
y <- f_x(x)

### testing data ###
n.test <- 100
x.test <- runif(n.test, 0, 1)
y.test <- f_x(x.test)

### get parameter estimates ###
out <- mle_gp(y, x)

### prediction ###
pred <- predict_gp(out, x.test)

### get DPE value ###
DPE_value <- dpe(y.test, pred$mup, pred$R)

Run the code above in your browser using DataLab