ks_test_t {LambertW}R Documentation

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

Description

Performs a two-sided KS test for H_0: X \sim t_{\nu} with c, scale s, 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.

Usage

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.

Value

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.

See Also

fitdistr, ks.test

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)


[Package LambertW version 0.6.9-1 Index]