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\).
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"
)
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.
Vector of values in \([0,1]\) at which the density or probability mass is evaluated. The distribution has support \([0,1]\).
Mean of the continuous Vasicek component, in \((0,1)\).
Shape parameter of the continuous Vasicek component, in \((0,1)\).
Probability at zero, \(\nu=P(Y=0)\), in \((0,1)\).
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().
Logical; if TRUE, log probabilities or log densities are
returned.
Vector of values in \([0,1]\) at which the cumulative distribution function is evaluated.
Logical; if TRUE, probabilities are
\(P(Y\leq y)\); otherwise, they are \(P(Y>y)\).
Logical; if TRUE, probabilities are supplied or
returned on the log scale.
Vector of probabilities.
Number of observations. If length(n) > 1, its length is
taken to be the number required.
Link function for \(\mu\).
Link function for \(\sigma\).
Link function for \(\nu\).
Link function for \(\tau\).
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.
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.
NVASIM,
ZANVASIM,
OANVASIM,
BEOI
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)
if (FALSE) {
library(gamlss)
fit <- gamlss(
y ~ 1,
sigma.formula = ~ 1,
nu.formula = ~ 1,
tau.formula = ~ 1,
family = ZOANVASIM(),
control = gamlss.control(trace = FALSE)
)
}
Run the code above in your browser using DataLab