Package 'CCd'

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

Help Index


The Cauchy-Cacoullos (Discrete Cauchy) Distribution.

Description

Functions to estimate the parameters Cauchy-Cacoullos (discrete Cauchy) distribution using maximum likelihood. Probability mass, distribution and quantile function are also included.

Details

Package: CCd
Type: Package
Version: 1.1
Date: 2024-12-07
License: GPL-2

Maintainers

Michail Tsagris [email protected].

Author(s)

Michail Tsagris [email protected].

References

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

Description

Maximum likelihood estimation of the CC distribution.

Usage

cc.mle(y)
cc.mle0(y, tol = 1e-7)

Arguments

y

A vector with integer values.

tol

The tolerance value to terminate the maximization algorithm.

Details

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.

Value

A list including:

param

For the cc.mle() a vector of the λ\lambda and μ\mu parameters.

lambda

For the cc.mle0() the λ\lambda parameter.

loglik

The value of the maximized log-likelihood.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris [email protected].

References

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.

See Also

loc0.test, dcc, cc.reg

Examples

y <- round( rcauchy(100, 3, 10) )
cc.mle(y)

y <- round( rcauchy(100, 0, 10) )
cc.mle0(y)

Regression modelling with the CC distribution

Description

Regression modelling with the CC distribution.

Usage

cc.reg(y, x, tol = 1e-6)

Arguments

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.

Details

Regression modelling assuming that the counts follow the CC distribution is implemented.

Value

A list including:

lambda

The λ\lambda parameter.

be

The regression coefficients.

loglik

The value of the maximized log-likelihood.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris [email protected].

References

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.

See Also

cc.mle

Examples

y <- round( rcauchy(150, 3, 10) )
x <- iris[, 1:2]
cc.reg(y, x)

Density, distribution function and quantile function of the CC distribution

Description

Density, distribution function and quantile function of the CC distribution.

Usage

dcc(y, mu = 0, lambda, logged = FALSE)
pcc(y, mu = 0, lambda)
qcc(p, mu, lambda)

Arguments

y

A vector with integer values.

p

A vector with probabilities.

mu

The value of the location parameter μ\mu.

lambda

The value of the scale parameter λ\lambda.

logged

Should the logarithm of the density be returned (TRUE) or not (FALSE)?

Details

The density of the CC distribution is computed. The probability mass function of the CC distribution (Papadatos, 2022) is given by P(X=k)=tanh(λπ)πλλ2+κ2.P(X=k)=\dfrac{\tanh{(\lambda \pi)}}{\pi}\dfrac{\lambda}{\lambda^2+\kappa^2}.

The cumulative distribution function of the CC distribution is computed. We explore the property of the CC distribution that P(X=κ)=P(X=κ)P(X=-\kappa)=P(X=\kappa), where κ>0\kappa>0, 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.

Value

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.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris [email protected].

References

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.

See Also

dcc, cc.mle

Examples

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

Description

Log-likelihood ratio test for zero location parameter.

Usage

loc0.test(y, tol = 1e-7)

Arguments

y

A vector with integer values.

tol

The tolerance value to terminate the maximization algorithm.

Details

We perform a log-likelihood ratio test to test whether the location parameter can be assumed zero or not.

Value

A vector with the test statistic and its associated p-value.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris [email protected].

References

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.

See Also

cc.mle, dcc

Examples

y <- round( rcauchy(100, 3, 10) )
loc0.test(y)

y <- round( rcauchy(100, 0, 10) )
loc0.test(y)