expect_gaussian {EstimDiagnostics} | R Documentation |
Test a Gaussian distribution
Description
Expectation checking whether a given sample comes from Gaussian distribution with arbitrary parameters. The underlying procedure is Shapiro- Wilk's test of normality shapiro.test
.
The expectation throws an error when the test's p-value is smaller than the threshold p-value.
Usage
expect_gaussian(sample, p_value = 0.001)
Arguments
sample |
to test |
p_value |
threshold p-value of the test |
Details
shapiro.test allows the number of non-missing values to be between 3 and 5000.
Value
Invisibly returns a p-value of the test.
Examples
x<-rnorm(n=1e3,5,6)
expect_gaussian(sample=x)
#The following test doesn't pass
## Not run:
x<-runif(n=1e2,-1,6)
expect_gaussian(sample=x)
## End(Not run)
[Package EstimDiagnostics version 0.0.3 Index]