inla.ks.plot {INLA} | R Documentation

## Kolmogorov-Smirnov Test Plots

### Description

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

### Usage

    inla.ks.plot(x, y, diff=TRUE, ...)

### 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

    ## 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)

[Package INLA version 18.07.12 Index]