expect_gaussian: Test a Gaussian distribution

Description Usage Arguments Details Value Examples

View source: R/expect_distfit.R

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

1
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

1
2
3
4
5
6
7
8
9
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)

EstimDiagnostics documentation built on April 17, 2021, 1:08 a.m.