ks_test_t function

One-sample Kolmogorov-Smirnov test for student-t distribution

One-sample Kolmogorov-Smirnov test for student-t distribution

Performs a two-sided KS test for H0:XtνH_0: X \sim t_{\nu} with cc, scale ss, and degrees of freedom ν\nu. If parameters are not specified, the MLE given the data will be used (see fitdistr).

For estimated parameters of the t-distribution the p-values are incorrect and should be adjusted. See ks.test and the references therein (Durbin (1973)). As a more practical approach consider bootstrapping and estimating the p-value empirically.

ks_test_t(x, param = NULL)

Arguments

  • x: a numeric vector of data values.

  • param: 3-dimensional named vector ('location', 'scale', 'df')

    which parametrizes the student t distribution. Default: param = NULL, in which case it will be estimated from x.

Returns

A list of class "htest" containing: - statistic: the value of the Kolomogorv-Smirnov statistic.

  • p.value: the p-value for the test.

  • alternative: a character string describing the alternative hypothesis.

  • method: the character string "One-sample Kolmogorov-Smirnov test student-t" plus rounded parameter values.

  • data.name: a character string giving the name(s) of the data.

Examples

set.seed(1021) beta.true <- c(location = 0, scale = 1, df = 4) xx <- rt(n = 1000, df = beta.true['df']) ks_test_t(xx) ks_test_t(xx, beta.true)

See Also

fitdistr, ks.test

  • Maintainer: Georg M. Goerg
  • License: GPL (>= 2)
  • Last published: 2023-11-30