Learn R Programming

lineqGPR (version 0.1.1)

errorMeasureRegressMC: Error Measures for GP Models using Monte Carlo Samples.

Description

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

Usage

errorMeasureRegressMC(
  y,
  ytest,
  ysamples,
  type = "all",
  control = list(probs = c(0.05, 0.95))
)

Arguments

y

a vector with the output observations used for training.

ytest

a vector with the output observations used for testing.

ysamples

a matrix with posterior sample paths. Samples are indexed by columns.

type

a character string corresponding to the type of the measure.

control

an optional list with parameters to be passed (cia: "probs").

Value

The values of the error measures.

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

errorMeasureRegress

Examples

Run this code
# NOT RUN {
# 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)
matplot(x, ynoise, type = "l", col = "gray70")
lines(x, y, lty = 2, col = "red")
legend("topright", c("target", "samples"), lty = c(2,1), col = c("red", "gray70"))
t(errorMeasureRegressMC(y, y, ynoise))

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

# }

Run the code above in your browser using DataLab