Description Usage Arguments Details Value Author(s) References Examples

View source: R/distIneqMassart.R

This function implements a test of the random number generator and distribution function based on an inequality due to Massart (1990).

1 | ```
distIneqMassart(densFn = "norm", n = 10000, probBound = 0.001, ...)
``` |

`densFn` |
Character. The root name of the distribution to be tested. |

`n` |
Numeric. The size of the sample to be used. |

`probBound` |
Numeric. The value of the bound on the right hand side of
the Massart inequality. See |

`...` |
Additional arguments to allow specification of the parameters of the distribution. |

Massart (1990) gave a version of the Dvoretsky-Kiefer-Wolfowitz inequality with the best possible constant:

*
P(sup_x|F_n(x)-F(x)|> t) <= 2exp(-2nt^2)*

where * F_n* is the empirical distribution function for
a sample of *n* independent and identically distributed random
variables with distribution function *F*. This inequality is true
for all distribution functions, for all *n* and *t*.

This test is used in base R to check the standard distribution
functions. The code may be found in the file `p-r-random.tests.R`

in the `tests`

directory.

`sup` |
Numeric. The supremum of the absolute difference between the empirical distribution and the true distribution function. |

`probBound` |
Numeric. The value of the bound on the right hand side of the Massart inequality. |

`t` |
Numeric. The lower bound which the supremum of the absolute difference between the empirical distribution and the true distribution function must exceed. |

`pVal` |
Numeric. The probability that the absolute difference
between the empirical distribution and the true distribution function
exceeds |

`check` |
Logical. Indicates whether the inequality is satisfied or not. |

David Scott d.scott@auckland.ac.nz, Christine Yang Dong c.dong@auckland.ac.nz

Massart P. (1990) The tight constant in the Dvoretsky-Kiefer-Wolfovitz
inequality. *Ann. Probab.*, **18**, 1269–1283.

1 2 3 4 5 6 | ```
## Normal distribution is the default
distIneqMassart()
## Specify parameter values
distIneqMassart(mean = 1, sd = 2)
## Gamma distribution has no default value for shape
distIneqMassart("gamma", shape = 1)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.