MyNixOS website logo
Description

Zero-Modified Complex 'Tri-Parametric' Pearson Distribution for Overdispersed Count Data.

Implements zero-modified versions of the Complex 'Tri-Parametric' Pearson distribution for overdispersed count data. The package addresses limitations of existing implementations when the parameter b approaches zero. It provides distribution functions, maximum likelihood estimation, and diagnostic tools for modeling count data with excess zeros. The methodology is based on 'Rodriguez-Avi' and coauthors (2003) <doi:10.1007/s00362-002-0134-7>.

zmctp: Zero-Modified Complex Triparametric Parametric Distribution

R-CMD-check License: GPL v3

Overview

The zmctp package extends the Complex Triparametric Pearson (CTP) distribution with zero-modified versions for handling overdispersed count data. It addresses limitations in existing implementations when the parameter b approaches zero.

Key Features

  • 🎯 Robust CTP fitting - Handles cases where b → 0
  • Zero-Modified CTP - Unique feature for zero-inflated/deflated data
  • 📊 Complete S3 methods - print, summary, and plot functions
  • 📈 Diagnostic tools - Goodness-of-fit statistics and visualizations
  • 📚 Comprehensive documentation - Vignette with examples

Installation

# Install from GitHub (when available)
# devtools::install_github("yourusername/zmctp")

# Or install from source
devtools::install_local("path/to/zmctp")

Quick Start

library(zmctp)

# Generate data
x <- rctp(200, a = 1, b = 0.5, gama = 5)

# Fit CTP model
fit <- ctp.fit(x)
print(fit)
plot(fit)

# Fit Zero-Modified CTP
x_zi <- rzictp(200, a = 1, b = 0.5, gama = 5, omega = 0.3)
fit_zi <- zictp.fit(x_zi)
plot(fit_zi)

Why zmctp?

Existing implementations (e.g., the cpd package) struggle when b ≈ 0, often estimating b = 0 which reduces model flexibility. The zmctp package solves this through:

  1. Reparameterization - Ensures variance constraint is always satisfied
  2. Zero-Modified variant - Explicitly models zero-inflation/deflation
  3. Better optimization - Robust default starting values

Documentation

  • Vignette: Run vignette("introduction", package = "zmctp")
  • Help: ?ctp.fit, ?zictp.fit, ?dctp

Example: Comparison with cpd

library(cpd)
library(zmctp)

# Data where cpd estimates b ≈ 0
x <- rzictp(200, a = 1, b = 0.001, gama = 8, omega = 0.2)

# cpd may fail
fit_cpd <- cpd::fitCTP(x)
# b estimate ≈ 0

# zmctp handles it better
fit_zmctp <- zictp.fit(x)
# Recovers both b and omega

Citation

If you use this package, please cite:

@Manual{zmctp,
  title = {zmctp: Zero-Modified Complex Triparametric Pearson Distribution},
  author = {Rasheedat Oladoja},
  year = {2025},
  note = {R package version 0.1.0},
}

And the original CTP paper:

@article{rodriguez2003,
  title={A new class of discrete distributions with complex parameters},
  author={Rodríguez-Avi, J and Conde-Sánchez, A and Sáez-Castillo, AJ},
  journal={Statistical Papers},
  volume={44},
  pages={67--88},
  year={2003},
  doi={10.1007/s00362-002-0134-7}
}

License

GPL-3

Author

Rasheedat Oladoja - [email protected].

Metadata

Version

0.1.0

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows