R: Generally-Altered, -Inflated and -Truncated Logarithmic...

Gaitlog {VGAM} | R Documentation

## Generally–Altered, –Inflated and –Truncated Logarithmic Distribution

### Description

Density, distribution function, quantile function and random generation for the generally–altered, –inflated and –truncated logarithmic distribution. Both parametric and nonparametric variants are supported; these are based on finite mixtures of the parent with itself and the multinomial logit model (MLM) respectively. Altogether it can be abbreviated as GAAIIT–Log(shape.p)–Log(shape.a)–MLM–Log(shape.i)–MLM, and it is also known as the GAIT-Log PNP combo.

### Usage

    dgaitlog(x, shape.p, alter.mix = NULL, alter.mlm = NULL,
             inflate.mix = NULL, inflate.mlm = NULL, truncate = NULL,
             max.support = Inf, pobs.mix.a = 0, pobs.mlm.a = 0,
             pstr.mix.i = 0, pstr.mlm.i = 0, shape.a = shape.p,
             shape.i = shape.p, byrow.arg = FALSE, deflation = FALSE,
             log.arg = FALSE)
    pgaitlog(q, shape.p, alter.mix = NULL, alter.mlm = NULL,
             inflate.mix = NULL, inflate.mlm = NULL, truncate = NULL,
             max.support = Inf, pobs.mix.a = 0, pobs.mlm.a = 0,
             pstr.mix.i = 0, pstr.mlm.i = 0, shape.a = shape.p,
             shape.i = shape.p, byrow.arg = FALSE)
    qgaitlog(p, shape.p, alter.mix = NULL, alter.mlm = NULL,
             inflate.mix = NULL, inflate.mlm = NULL, truncate = NULL,
             max.support = Inf, pobs.mix.a = 0, pobs.mlm.a = 0,
             pstr.mix.i = 0, pstr.mlm.i = 0, shape.a = shape.p,
             shape.i = shape.p, byrow.arg = FALSE)
    rgaitlog(n, shape.p, alter.mix = NULL, alter.mlm = NULL,
             inflate.mix = NULL, inflate.mlm = NULL, truncate = NULL,
             max.support = Inf, pobs.mix.a = 0, pobs.mlm.a = 0,
             pstr.mix.i = 0, pstr.mlm.i = 0, shape.a = shape.p,
             shape.i = shape.p, byrow.arg = FALSE)

### Arguments

`x, q, p, n, log.arg` | Same meaning as in `dlog`.
`shape.p, shape.a, shape.i` | Same meaning as `shape` for `dlog`, i.e., for an ordinary logarithmic distribution. See `Gaitpois` for generic information.
`truncate, max.support` | See `Gaitpois` for generic information.
`alter.mix, inflate.mix` | See `Gaitpois` for generic information.
`alter.mlm, inflate.mlm` | See `Gaitpois` for generic information.
`pobs.mlm.a, pstr.mlm.i, byrow.arg` | See `Gaitpois` for generic information.
`pobs.mix.a, pstr.mix.i` | See `Gaitpois` for generic information.
`deflation` | See `Gaitpois` for generic information.

### Details

These functions allow any combination of 3 operator types: truncation, alteration and inflation. See `Gaitpois` for generic information. These functions do what `Oalog`, `Oilog`, `Otlog` collectively did plus much more.

In the notation of Yee and Ma (2020) these functions allow for the special cases: (i) GAIT–Log(`shape.p`)–Log(`shape.a`, `alter.mix`, `pobs.mix.a`)–Log(`shape.i`, `inflate.mix`, `pstr.mix.i`); (ii) GAIT–Log(`shape.p`)–MLM(`alter.mlm`, `pobs.mlm.a`)–MLM(`inflate.mlm`, `pstr.mlm.i`). Model (i) is totally parametric while model (ii) is the most nonparametric possible.

### Value

`dgaitlog` gives the density, `pgaitlog` gives the distribution function, `qgaitlog` gives the quantile function, and `rgaitlog` generates random deviates. The default values of the arguments correspond to ordinary `dlog`, `plog`, `qlog`, `rlog` respectively.

### Note

See `Gaitpois` for general information also relevant to this parent distribution.

### Author(s)

T. W. Yee.

### See Also

`Gaitpois`, `multinomial`, `gaitlog.mix`, `Oalog`, `Oilog`, `Otlog`.

### Examples

    ivec <- c(2, 10); avec <- ivec + 4; shape <- 0.95; xgrid <- 0:29
    tvec <- 15; max.support <- 25; pobs.a <- 0.10; pstr.i <- 0.15
    (ddd <- dgaitlog(xgrid, shape, truncate = tvec,
       max.support = max.support, pobs.mix.a = pobs.a,
       alter.mix = avec, pstr.mix.i = pstr.i, inflate.mix = ivec))
    ## Not run: plot(xgrid, ddd, type = "n", ylab = "Probability", xlab = "x",
                  main = "GAIT PMF---Logarithmic Parent")
    mylwd <- 0.5
    abline(v = avec, col = 'green', lwd = mylwd)
    abline(v = ivec, col = 'red', lwd = mylwd)
    abline(v = tvec, col = 'tan', lwd = mylwd)
    abline(v = max.support, col = 'magenta', lwd = mylwd)
    abline(h = c(pobs.a, pstr.i, 0:1), col = 'gray', lty = "dashed")
    lines(xgrid, dlog(xgrid, shape), col = 'gray', lty = "dashed")  # f_{\pi}
    lines(xgrid, ddd, type = "h", col = "blue", lwd = 3)  # GAIT PMF
    points(xgrid[ddd == 0], ddd[ddd == 0], pch = 16)
    ## End(Not run)

[Package VGAM version 1.1-3 Index]