expect_distfit {EstimDiagnostics} | R Documentation |
Test a parametric distribution
Description
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.
Usage
expect_distfit(sample, p_value = 0.001, nulldist, ...)
Arguments
sample |
to test |
p_value |
threshold p-value of the test |
nulldist |
null distribution |
... |
parameters to pass to the null distribution |
Value
Invisibly returns a p-value of the test.
Examples
# 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)
[Package EstimDiagnostics version 0.0.3 Index]