Description Usage Arguments Value Examples
View source: R/expect_distfit.R
Expectation checking whether a given sample comes from a certain parametric distribution. The underlying procedure is Anderson-Darling test of goodness-of-fit ad.test
.
The expectation throws an error when the test's p-value is smaller than the threshold p-value.
1 | expect_distfit(sample, p_value = 0.001, nulldist, ...)
|
sample |
to test |
p_value |
threshold p-value of the test |
nulldist |
null distribution |
... |
parameters to pass to the null distribution |
Invisibly returns a p-value of the test.
1 2 3 4 5 6 7 8 9 10 11 | # Gaussianity test
## Not run:
x<-rnorm(n=1e4,5,6)
expect_distfit(sample=x, nulldist="pnorm", mean=5, sd=6.3)
expect_distfit(sample=x, nulldist="pnorm", mean=5, sd=6)
## End(Not run)
# Uniformity test
x<-runif(n=1e4,-1,6)
expect_distfit(sample=x, nulldist="punif", min=-1, max=6)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.