The function PTRTE() defines the Poisson-transmuted record type exponential distribution,
a two-parameter discrete distribution, for a gamlss.family object to be used in GAMLSS fitting
using the function gamlss().
PTRTE(mu.link = "log", sigma.link = "logit")Returns a gamlss.family object that can be used to fit the Poisson-transmuted record type exponential
distribution using the gamlss() function.
The Poisson-transmuted record type exponential distribution with parameters \(\mu\) and \(\sigma\) has support \(x = 0,1,2,\dots\) and probability mass function given by
$$f(x | \mu, \sigma) = \frac{\mu}{(1+\mu)^{x+1}} \left(\frac{\sigma \mu (1+x)}{1+\mu} - (\sigma-1) \right)$$
Parameter restrictions: \(\mu > 0\) and \(0 < \sigma < 1\).
Note: we renamed the original parameters \(\theta\) and \(p\) to \(\mu\) and \(\sigma\) respectively
to implement this distribution within the gamlss framework.
Erbayram, T., & Akdogan, Y. (2025). A new discrete model generated from mixed Poisson transmuted record type exponential distribution. Ricerca di Matematica, 74, 1225–1247.
# Example 1
# Generating some random values with known mu and sigma
# logit_inv function
logit_inv <- function(x) exp(x) / (exp(x)+1)
set.seed(12345)
y <- rPTRTE(n=200, mu=0.2, sigma=0.5)
# Fitting the model
library(gamlss)
mod1 <- gamlss(y~1, family=PTRTE)
#> GAMLSS-RS iteration 1: Global Deviance = 1273.926
# Extracting the fitted values for mu and sigma
exp(coef(mod1, what="mu"))
#> (Intercept)
#> 0.1854627
logit_inv(coef(mod1, what="sigma"))
#> (Intercept)
#> 0.5821792
# Example 2
# Generating random values under some model
# A function to simulate a data set with Y ~ PTRTE
gendat <- function(n) {
x1 <- runif(n)
x2 <- runif(n)
mu <- exp(2 + 1 * x1) # 12 approximately
sigma <- logit_inv(2 - 2 * x2) # 0.73 approximately
y <- rPTRTE(n=n, mu=mu, sigma=sigma)
data.frame(y=y, x1=x1, x2=x2)
}
set.seed(12345)
dat <- gendat(n=2000)
# Fitting the model
mod2 <- NULL
mod2 <- gamlss(y~x1, sigma.fo=~x2, family=PTRTE, data=dat,
control=gamlss.control(n.cyc=500, trace=FALSE))
summary(mod2)
#> Warning: summary: vcov has failed, option qr is used instead
#> ******************************************************************
#> Family: c("PTRTE", "Poisson-Transmuted Record Type Exponential")
#>
#> Call: gamlss(formula = y ~ x1, sigma.formula = ~x2, family = PTRTE,
#> data = dat, control = gamlss.control(n.cyc = 500, trace = FALSE))
#>
#> Fitting method: RS()
#>
#> ------------------------------------------------------------------
#> Mu link function: log
#> Mu Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 2.0014 0.1165 17.185 < 2e-16 ***
#> x1 0.8643 0.2223 3.888 0.000104 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> ------------------------------------------------------------------
#> Sigma link function: logit
#> Sigma Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> (Intercept) 0.5516 0.8066 0.684 0.494
#> x2 -1.3565 1.4364 -0.944 0.345
#>
#> ------------------------------------------------------------------
#> No. of observations in the fit: 2000
#> Degrees of Freedom for the fit: 4
#> Residual Deg. of Freedom: 1996
#> at cycle: 46
#>
#> Global Deviance: 1610.545
#> AIC: 1618.545
#> SBC: 1640.948
#> ******************************************************************
# Example 3 (Second data set of the article)
# European corn-borer count data reported by McGuire et al. (1957).
# The observed and fitted frequencies are given in Table 11 of
# Erbayram and Akdogan (2025), where the P-TRTE distribution is
# illustrated using this data set.
values <- 0:5
freq <- c(188, 83, 36, 14, 2, 1)
y <- rep(x=values, times=freq)
mod3 <- gamlss(y~1, sigma.fo=~1, family=PTRTE(),
control=gamlss.control(n.cyc=500, trace=TRUE))
#> GAMLSS-RS iteration 1: Global Deviance = 711.8002
exp(coef(mod3, what="mu"))
#> (Intercept)
#> 2.874795
logit_inv(coef(mod3, what="sigma"))
#> (Intercept)
#> 0.8640032