Watson {EDFtest}R Documentation

Watson statistic

Description

Compute the Watson goodness-of-fit statistic U^2 for an i.i.d. sample, x, to test for the given distribution with parameters unknown. Estimate parameters by ML using EDFtest MLE function by default.

Usage

Watson.uniform(x, parameter = estimate.uniform(x))

Watson.normal(x, parameter = estimate.normal(x))

Watson.gamma(x, parameter = estimate.gamma(x))

Watson.logistic(x, parameter = estimate.logistic(x))

Watson.laplace(x, parameter = estimate.laplace(x))

Watson.weibull(x, parameter = estimate.weibull(x))

Watson.extremevalue(x)

Watson.exp(x, parameter = estimate.exp(x))

Watson(z)

Arguments

x

A random sample.

parameter

Parameters of the given distribution, MLE by default.

z

A standard uniform random sample.

Value

Watson statistic of the given sample.

See Also

estimate for estimating distribution parameters by ML; CvM for calculating Cramér-von Mises statistic; AD for calculating Anderson-Darling statistic; Watson.pvalue for calculating P-value of Watson statistic.

Examples

x0=runif(n=100,min=-1,max=1)
Watson.uniform(x0)

x1=rnorm(n=100,mean=0,sd=1)
Watson.normal(x1)

x2=rgamma(n=100,shape=1,scale=1)
Watson.gamma(x2)

x3=rlogis(n=100,location=0,scale=1)
Watson.logistic(x3)

x4= rmutil::rlaplace(n=100,m=0,s=1)
Watson.laplace(x4)

x5=rweibull(n=100,shape=1,scale=1)
Watson.weibull(x5)
x5_log=log(x5)
Watson.extremevalue(x5_log)

x6=rexp(n=100,rate=1/2)
Watson.exp(x6)

[Package EDFtest version 0.1.0 Index]