laplace_test {goft} | R Documentation |
Tests for the Laplace or double exponential distribution
Description
Transformation and ratio tests for the Laplace distribution by Gonzalez-Estrada and Villasenor (2016).
Usage
laplace_test(x, method = "transf", N = 10^5)
Arguments
x |
a numeric data vector containing a random sample of real numbers. |
method |
the type of test to be performed. Two available options are |
N |
number of Monte Carlo samples used to approximate the p-value of the test when the |
Details
When "transf"
option is chosen, a transformation to approximately exponential random variables is performed and the exponentiality hypothesis is assessed using Anderson-Darling test.
When "ratio"
option is chosen, a test based on the ratio of two estimators of the scale parameter is performed. For samples of size n < 500, the p-value of this test is approximated by Monte Carlo simulation. Otherwise, it is approximated by the standard normal cumulative distribution function.
Value
A list with class "htest"
containing the following components.
statistic |
the calculated value of the test statistic. |
p.value |
approximated p-value of the test. |
method |
a character string giving the name of the method used for testing the null hypothesis. |
data.name |
a character string giving the name of the data set. |
Author(s)
Elizabeth Gonzalez-Estrada egonzalez@colpos.mx, Jose A. Villasenor
References
Gonzalez-Estrada, E. and Villasenor, J.A. (2016). A ratio goodness-of-fit test for the Laplace distribution. Statistics and Probability Letters, 119, 30-35. https://doi.org/10.1016/j.spl.2016.07.003
Examples
# Example 1: testing the Laplace distribution hypothesis using "transf" option
x <- rnorm(50) # simulating a random sample from a normal distribution
laplace_test(x)
# Example 2: testing the Laplace distribution hypothesis using "ratio" option
x <- rt(60,4) # simulating a random sample from Student's t distribution with 4 d.f.
laplace_test(x, method = "ratio")