Skip to contents

Goodness-of-fit test statistic for a fitted distribution

Usage

gof_test(x, d, test = c("ks", "ad", "chi_squared"))

Arguments

x

numeric vector of observations. Sorted internally, as the C# methods require.

d

a corehydro_dist object.

test

one of "ks" (Kolmogorov-Smirnov D), "ad" (Anderson-Darling A squared), or "chi_squared".

Value

a single numeric test statistic.

Examples

x <- c(2.1, 3.4, 1.8, 4.9, 3.3, 2.7, 5.1, 3.9)
gof_test(x, distribution("Normal", c(3.4, 1.1)))
#> [1] 0.163659