Title: | The Cauchy-Cacoullos (Discrete Cauchy) Distribution |
---|---|
Description: | Maximum likelihood estimation of the Cauchy-Cacoullos (discrete Cauchy) distribution. Probability mass, distribution and quantile function are also included. The reference paper is: Papadatos N. (2022). "The Characteristic Function of the Discrete Cauchy Distribution in Memory of T. Cacoullos". Journal of Statistical Theory Practice, 16(3): 47. <doi:10.1007/s42519-022-00268-6>. |
Authors: | Michail Tsagris [aut, cre] |
Maintainer: | Michail Tsagris <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.1 |
Built: | 2024-12-08 06:35:47 UTC |
Source: | CRAN |
Functions to estimate the parameters Cauchy-Cacoullos (discrete Cauchy) distribution using maximum likelihood. Probability mass, distribution and quantile function are also included.
Package: | CCd |
Type: | Package |
Version: | 1.1 |
Date: | 2024-12-07 |
License: | GPL-2 |
Michail Tsagris [email protected].
Michail Tsagris [email protected].
Papadatos N. (2022). The characteristic function of the discrete Cauchy distribution In Memory of T. Cacoullos. Journal of Statistical Theory and Practice, 16(3): 47.
Maximum likelihood estimation of the CC distribution.
cc.mle(y) cc.mle0(y, tol = 1e-7)
cc.mle(y) cc.mle0(y, tol = 1e-7)
y |
A vector with integer values. |
tol |
The tolerance value to terminate the maximization algorithm. |
The function cc.mle0() uses the optimize
function to perform MLE when the location parameter is zero, just as proposed by Papadatos (2022). The function cc.mle() uses the optim
function when the location is not assumed zero.
A list including:
param |
For the cc.mle() a vector of the |
lambda |
For the cc.mle0() the |
loglik |
The value of the maximized log-likelihood. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Papadatos N. (2022). The characteristic function of the discrete Cauchy distribution In Memory of T. Cacoullos. Journal of Statistical Theory and Practice, 16(3): 47.
y <- round( rcauchy(100, 3, 10) ) cc.mle(y) y <- round( rcauchy(100, 0, 10) ) cc.mle0(y)
y <- round( rcauchy(100, 3, 10) ) cc.mle(y) y <- round( rcauchy(100, 0, 10) ) cc.mle0(y)
Regression modelling with the CC distribution.
cc.reg(y, x, tol = 1e-6)
cc.reg(y, x, tol = 1e-6)
y |
The response variable, a vector with integer values. |
x |
A vector or matrix with with the predictor variables. |
tol |
The tolerance value to terminate the maximization algorithm. |
Regression modelling assuming that the counts follow the CC distribution is implemented.
A list including:
lambda |
The |
be |
The regression coefficients. |
loglik |
The value of the maximized log-likelihood. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Papadatos N. (2022). The characteristic function of the discrete Cauchy distribution In Memory of T. Cacoullos. Journal of Statistical Theory and Practice, 16(3): 47.
y <- round( rcauchy(150, 3, 10) ) x <- iris[, 1:2] cc.reg(y, x)
y <- round( rcauchy(150, 3, 10) ) x <- iris[, 1:2] cc.reg(y, x)
Density, distribution function and quantile function of the CC distribution.
dcc(y, mu = 0, lambda, logged = FALSE) pcc(y, mu = 0, lambda) qcc(p, mu, lambda)
dcc(y, mu = 0, lambda, logged = FALSE) pcc(y, mu = 0, lambda) qcc(p, mu, lambda)
y |
A vector with integer values. |
p |
A vector with probabilities. |
mu |
The value of the location parameter |
lambda |
The value of the scale parameter |
logged |
Should the logarithm of the density be returned (TRUE) or not (FALSE)? |
The density of the CC distribution is computed. The probability mass function of the CC distribution (Papadatos, 2022) is given by
The cumulative distribution function of the CC distribution is computed. We explore the property of the CC distribution that , where
, to compute the cumulative distribution.
As for the quantile function we use the optimize
function to find the integer whose cumulative probability matches the given probability. So, basically, the qcc() works with left tailed probabilities.
dcc returns a vector with the (logged) density values, the (logged) probabilities for each value of y., pcc returns a vector with the cumulative probabilities, while qcc returns a vector with integer numbers.
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Papadatos N. (2022). The characteristic function of the discrete Cauchy distribution In Memory of T. Cacoullos. Journal of Statistical Theory and Practice, 16(3): 47.
x <- round( rcauchy(100, 3, 10) ) mod <- cc.mle(x) y <- dcc(x, mod$param[1], mod$param[3]) pcc(x[1:5], mod$param[1], mod$param[3])
x <- round( rcauchy(100, 3, 10) ) mod <- cc.mle(x) y <- dcc(x, mod$param[1], mod$param[3]) pcc(x[1:5], mod$param[1], mod$param[3])
Log-likelihood ratio test for zero location parameter.
loc0.test(y, tol = 1e-7)
loc0.test(y, tol = 1e-7)
y |
A vector with integer values. |
tol |
The tolerance value to terminate the maximization algorithm. |
We perform a log-likelihood ratio test to test whether the location parameter can be assumed zero or not.
A vector with the test statistic and its associated p-value.
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Papadatos N. (2022). The characteristic function of the discrete Cauchy distribution In Memory of T. Cacoullos. Journal of Statistical Theory and Practice, 16(3): 47.
y <- round( rcauchy(100, 3, 10) ) loc0.test(y) y <- round( rcauchy(100, 0, 10) ) loc0.test(y)
y <- round( rcauchy(100, 3, 10) ) loc0.test(y) y <- round( rcauchy(100, 0, 10) ) loc0.test(y)