ctp.fit: Maximum Likelihood Estimation for the CTP Distribution

View source: R/ctp_fit.R

ctp.fitR Documentation

Maximum Likelihood Estimation for the CTP Distribution

Description

Fits the Complex Triparametric Pearson (CTP) distribution to count data using maximum likelihood estimation.

Usage

ctp.fit(
  x,
  a_start = NULL,
  b_start = NULL,
  gama_start = NULL,
  method = "L-BFGS-B",
  penalty = 1e+10
)

Arguments

x

Numeric vector of nonnegative counts.

a_start

Optional starting value for parameter a.

b_start

Optional starting value for parameter b.

gama_start

Optional starting value for parameter gamma.

method

Optimization method (default: "L-BFGS-B").

penalty

numeric penalty added for numerical stability when b → 0

Value

An object of class "ctpfit" containing:

estimates

Named vector of MLEs

se

Standard errors

vcov

Variance-covariance matrix

logLik

Log-likelihood

AIC

Akaike Information Criterion

BIC

Bayesian Information Criterion

pearson_chisq

Pearson's chi-squared statistic

wald_chisq

Wald's chi-squared statistic

fitted_freq

Data frame of observed vs expected frequencies

data

Original data

converged

Convergence status

Examples

set.seed(123)

x <- rctp(30, a = 1, b = 0.5, gama = 5)
fit <- ctp.fit(x)
print(fit)
plot(fit)


zmctp documentation built on Sept. 20, 2026, 5:07 p.m.