ZOANVASIM: Zero-and-one-adjusted N-Vasicek distribution

View source: R/dpqr-01NvasicekM.R

ZOANVASIMR Documentation

Zero-and-one-adjusted N-Vasicek distribution

Description

Defines a normal-kernel Vasicek distribution augmented by point masses at zero and one. Conditional on an observation in (0,1), the continuous component is NVASIM with mean \mu and shape parameter \sigma.

Usage

d01NVASIM(x, mu = 0.5, sigma = 0.5, nu = 0.1, tau = 0.1, log = FALSE)

p01NVASIM(
  q,
  mu = 0.5,
  sigma = 0.5,
  nu = 0.1,
  tau = 0.1,
  lower.tail = TRUE,
  log.p = FALSE
)

q01NVASIM(
  p,
  mu = 0.5,
  sigma = 0.5,
  nu = 0.1,
  tau = 0.1,
  lower.tail = TRUE,
  log.p = FALSE
)

r01NVASIM(n, mu = 0.5, sigma = 0.5, nu = 0.1, tau = 0.1)

dZOANVASIM(x, mu = 0.5, sigma = 0.5, nu = 0.1, tau = 0.1, log = FALSE)

pZOANVASIM(
  q,
  mu = 0.5,
  sigma = 0.5,
  nu = 0.1,
  tau = 0.1,
  lower.tail = TRUE,
  log.p = FALSE
)

qZOANVASIM(
  p,
  mu = 0.5,
  sigma = 0.5,
  nu = 0.1,
  tau = 0.1,
  lower.tail = TRUE,
  log.p = FALSE
)

rZOANVASIM(n, mu = 0.5, sigma = 0.5, nu = 0.1, tau = 0.1)

ZOANVASIM(
  mu.link = "logit",
  sigma.link = "logit",
  nu.link = "logit",
  tau.link = "logit"
)

Arguments

x

Vector of values in [0,1] at which the density or probability mass is evaluated. The distribution has support [0,1].

mu

Mean of the continuous Vasicek component, in (0,1).

sigma

Shape parameter of the continuous Vasicek component, in (0,1).

nu

Probability at zero, \nu=P(Y=0), in (0,1).

tau

Conditional probability at one among nonzero observations, \tau=P(Y=1\mid Y>0), in (0,1). This parameter is unrelated to the fixed quantile level used by NVASIQ() and LVASIQ().

log

Logical; if TRUE, log probabilities or log densities are returned.

q

Vector of values in [0,1] at which the cumulative distribution function is evaluated.

lower.tail

Logical; if TRUE, probabilities are P(Y\leq y); otherwise, they are P(Y>y).

log.p

Logical; if TRUE, probabilities are supplied or returned on the log scale.

p

Vector of probabilities.

n

Number of observations. If length(n) > 1, its length is taken to be the number required.

mu.link

Link function for \mu.

sigma.link

Link function for \sigma.

nu.link

Link function for \nu.

tau.link

Link function for \tau.

Details

Let Y_c\sim\mathrm{NVASIM}(\mu,\sigma). Write p_0, p_1, and p_c for the probabilities of zero, one, and the continuous component. The sequential BEOI-type parameterization is

\nu=P(Y=0),\qquad \tau=P(Y=1\mid Y>0).

Hence,

p_0=\nu,\qquad p_1=(1-\nu)\tau,\qquad p_c=(1-\nu)(1-\tau).

The distribution is

P(Y=0)=p_0,\qquad P(Y=1)=p_1

and

f_Y(y)=p_c f_{Y_c}(y\mid\mu,\sigma),\quad 0<y<1.

Its marginal mean and variance are

E(Y)=(1-\nu)\left[\tau+(1-\tau)\mu\right]

and

\mathrm{Var}(Y)= (1-\nu)\left[(1-\tau)\left\{\mathrm{Var}(Y_c)+\mu^2\right\} +\tau\right] -\left\{(1-\nu)\left[\tau+(1-\tau)\mu\right]\right\}^2.

Logit links for \nu and \tau guarantee valid probabilities. If \nu=0, the model reduces to the BEOI-type one-adjusted model; if \tau=0, it reduces to the zero-adjusted model.

Value

ZOANVASIM() returns a four-parameter gamlss.family object. The functions d01NVASIM(), p01NVASIM(), q01NVASIM(), and r01NVASIM() return probability mass or density values, cumulative probabilities, quantiles, and random observations, respectively. dZOANVASIM(), pZOANVASIM(), qZOANVASIM(), and rZOANVASIM() are equivalent names following the GAMLSS family-name convention.

References

Ospina, R. and Ferrari, S. L. P. (2010). Inflated beta distributions. Statistical Papers, 51, 111–126.

Rigby, R. A. and Stasinopoulos, D. M. (2005). Generalized additive models for location, scale and shape. Applied Statistics, 54(3), 507–554.

See Also

NVASIM, ZANVASIM, OANVASIM, BEOI

Examples

set.seed(123)
y <- r01NVASIM(
  1000, mu = 0.60, sigma = 0.30, nu = 0.20, tau = 0.25
)
c(zero = mean(y == 0), one = mean(y == 1))
mean(y)
(1 - 0.20) * (0.25 + (1 - 0.25) * 0.60)

## Not run: 
library(gamlss)
fit <- gamlss(
  y ~ 1,
  sigma.formula = ~ 1,
  nu.formula = ~ 1,
  tau.formula = ~ 1,
  family = ZOANVASIM(),
  control = gamlss.control(trace = FALSE)
)

## End(Not run)

vasicekreg documentation built on Aug. 20, 2026, 9:08 a.m.