errorMeasureRegress: Error Measures for GP Models.

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/lineqGPutils.R

Description

Compute error measures for GP models: mean absulte error ("mae"), mean squared error ("mse"), standardised mse ("smse"), mean standardised log loss ("msll"), Q2 ("q2"), predictive variance adequation ("pva"), confidence interval accuracy ("cia").

Usage

1
2
3
4
5
6
7
8
errorMeasureRegress(
  y,
  ytest,
  mu,
  varsigma,
  type = "all",
  control = list(nsigma = 1.96)
)

Arguments

y

a vector with the output observations used for training.

ytest

a vector with the output observations used for testing.

mu

a vector with the posterior mean.

varsigma

a vector with the posterior variances.

type

a character string corresponding to the type of the measure.

control

an optional list with parameters to be passed (e.g. cia: "nsigma").

Value

The values of the error measures.

Author(s)

A. F. Lopez-Lopera.

References

Rasmussen, C. E. and Williams, C. K. I. (2005), "Gaussian Processes for Machine Learning (Adaptive Computation and Machine Learning)". The MIT Press. [link]

Bachoc, F. (2013), "Cross validation and maximum likelihood estimations of hyper-parameters of Gaussian processes with model misspecification". Computational Statistics & Data Analysis, 66:55-69. [link]

See Also

errorMeasureRegressMC

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
32
33
34
# generating the toy example
n <- 100
w <- 4*pi
x <- seq(0, 1, length = n)
y <- sin(w*x)

# results with high-level noises generating the toy example
nbsamples <- 100
set.seed(1)
ynoise <- y + matrix(rnorm(n*nbsamples, 0, 10), ncol = nbsamples)
mu <- apply(ynoise, 1, mean)
sigma <- apply(ynoise, 1, sd)
matplot(x, ynoise, type = "l", col = "gray70")
lines(x, y, lty = 2, col = "red")
lines(x, mu, col = "blue")
lines(x, mu+1.98*sigma, lty = 2)
lines(x, mu-1.98*sigma, lty = 2)
legend("topright", c("target", "mean", "confidence", "samples"),
       lty = c(2,1,2,1), col = c("red", "blue", "black", "gray70"))
t(errorMeasureRegress(y, y, mu, sigma^2))

# results with low-level noises generating the toy example
set.seed(1)
ynoise <- y + matrix(rnorm(n*nbsamples, 0, 0.05), ncol = nbsamples)
mu <- apply(ynoise, 1, mean)
sigma <- apply(ynoise, 1, sd)
matplot(x, ynoise, type = "l", col = "gray70")
lines(x, y, lty = 2, col = "red")
lines(x, mu, col = "blue")
lines(x, mu+1.98*sigma, lty = 2)
lines(x, mu-1.98*sigma, lty = 2)
legend("topright", c("target", "mean", "confidence", "samples"),
       lty = c(2,1,2,1), col = c("red", "blue", "black", "gray70"))
t(errorMeasureRegress(y, y, mu, sigma^2))

lineqGPR documentation built on Jan. 11, 2020, 9:23 a.m.