Learn R Programming

goft (version 1.3.6)

cauchy_test: Tests for the Cauchy distribution

Description

Two tests for the Cauchy distribution hypothesis.

Usage

cauchy_test(x, N = 10^3, method = "transf")

Arguments

x

a numeric data vector containing a random sample of real numbers.

N

number of Monte Carlo samples used to approximate the p-value of the tests. Default is N = 10^3.

method

character string giving the name of the method to be used for testing the Cauchy distribution hypothesis. Two available options are "transf" and "ratio".

Value

A list with class "htest" containing the following components.

statistic

the calculated value of the test statistic.

p.value

the approximated p-value of the test.

method

the character string "Test for the Cauchy distribution based on the ratio of two scale estimators".

data.name

a character string giving the name of the data set.

Details

Option "ratio" performs a test for the Cauchy distribution based on the ratio of the maximum likelihood estimator for the scale parameter and the mean absolute deviation (Gonzalez-Estrada and Villasenor, 2018).

Option "transf" performs a test based on a data transformation to approximately exponentially distributed data (Villasenor and Gonzalez-Estrada, 2020).

References

Gonzalez-Estrada, E. and Villasenor, J.A. (2018). An R package for testing goodness of fit: goft. Journal of Statistical Computation and Simulation, 88 4, 726-751. https://doi.org/10.1080/00949655.2017.1404604

Villasenor, J.A. and Gonzalez-Estrada, E. (2020). Goodness of fit tests for Cauchy distributions using data transformations. In I. Ghosh, N. Balakrishnan and H.K.T. Ng. Contributions of Barry C. Arnold to Statistical Science - Theory and Applications. Springer.

Examples

Run this code
# NOT RUN {
x <- rnorm(20)    # simulating a data set from a normal distribution
cauchy_test(x)    # testing the Cauchy distribution hypothesis 
# }

Run the code above in your browser using DataLab