gbt.ksval: Kolmogorov-Smirnov validation of model

Description Usage Arguments Details Value Examples

View source: R/gbt.ksval.R

Description

gbt.ksval transforms observations to U(0,1) if the model is correct and performs a Kolmogorov-Smirnov test for uniformity.

Usage

1
gbt.ksval(object, y, x)

Arguments

object

Object or pointer to object of class ENSEMBLE

y

Observations to be tested

x

design matrix for training. Must be of type matrix.

Details

Model validation of model passed as object using observations y. Assuming the loss is a negative log-likelihood and thus a probabilistic model, the transformation

u = F_Y(y;x,θ) \sim U(0,1),

is usually valid. One parameter, μ=g^{-1}(f(x)), is given by the model. Remaining parameters are estimated globally over feature space, assuming they are constant. This then allow the above transformation to be exploited, so that the Kolmogorov-Smirnov test for uniformity can be performed.

If the response is a count model (poisson or negbinom), the transformation

u_i = F_Y(y_i-1;x,θ) + Uf_Y(y_i,x,θ), ~ U \sim U(0,1)

is used to obtain a continuous transformation to the unit interval, which, if the model is correct, will give standard uniform random variables.

Value

Kolmogorov-Smirnov test of model

Examples

1
2
3
4
5
6
7
## Gaussian regression:
x_tr <- as.matrix(runif(500, 0, 4))
y_tr <- rnorm(500, x_tr, 1)
x_te <- as.matrix(runif(500, 0, 4))
y_te <- rnorm(500, x_te, 1)
mod <- gbt.train(y_tr, x_tr)
gbt.ksval(mod, y_te, x_te)

agtboost documentation built on Nov. 24, 2021, 1:16 a.m.

Related to gbt.ksval in agtboost...