residuals: Kolmogorov-Smirnov Test Plots

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

Description

Illustrate a one-sample Kolmogorov-Smirnov test by plotting the empirical distribution deviation.

Usage

1

Arguments

x

a numeric vector of data values.

y

a cumulative distribution function such as 'pnorm'.

diff

logical, indicating if the normalised difference should be plotted. If FALSE, the absolute distribution functions are plotted.

...

additional arguments for ks.test, ignored in the plotting. In particular, only two-sided tests are illustrated.

Details

In addition to the (normalised) empirical distribution deviation, lines for the K-S test statistic are drawn, as well as +/- two standard deviations around the expectation under the null hypothesis.

Value

A list with class "htest", as generated by ks.test

Author(s)

Finn Lindgren finn.lindgren@gmail.com

See Also

ks.test

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Check for N(0,1) data
data = rowSums(matrix(runif(100*12)*2-1,100,12))/2
inla.ks.plot(data, pnorm)

## Not run: 
## Check the goodness-of-fit of cross-validated predictions
result = inla(..., control.predictor=list(cpo=TRUE))
inla.ks.plot(result$pit, punif)

## End(Not run)

andrewzm/INLA documentation built on May 10, 2019, 11:12 a.m.