View source: R/dpqr-0NvasicekM.R
| ZANVASIM | R Documentation |
Defines a zero-adjusted normal-kernel Vasicek distribution for responses
in [0,1). The parameter \nu is the probability of a structural
zero. Conditional on a positive response, the distribution is
NVASIM with mean \mu and shape parameter \sigma.
d0NVASIM(x, mu = 0.5, sigma = 0.5, nu = 0.1, log = FALSE)
p0NVASIM(q, mu = 0.5, sigma = 0.5, nu = 0.1, lower.tail = TRUE, log.p = FALSE)
q0NVASIM(p, mu = 0.5, sigma = 0.5, nu = 0.1, lower.tail = TRUE, log.p = FALSE)
r0NVASIM(n, mu = 0.5, sigma = 0.5, nu = 0.1)
dZANVASIM(x, mu = 0.5, sigma = 0.5, nu = 0.1, log = FALSE)
pZANVASIM(q, mu = 0.5, sigma = 0.5, nu = 0.1, lower.tail = TRUE, log.p = FALSE)
qZANVASIM(p, mu = 0.5, sigma = 0.5, nu = 0.1, lower.tail = TRUE, log.p = FALSE)
rZANVASIM(n, mu = 0.5, sigma = 0.5, nu = 0.1)
ZANVASIM(mu.link = "logit", sigma.link = "logit", nu.link = "logit")
x |
Vector of values in |
mu |
Mean of the positive Vasicek component, in |
sigma |
Shape parameter of the positive Vasicek component, in
|
nu |
Probability of a structural zero, in |
log |
Logical; if |
q |
Vector of values in |
lower.tail |
Logical; if |
log.p |
Logical; if |
p |
Vector of probabilities. |
n |
Number of observations. If |
mu.link |
Link function for |
sigma.link |
Link function for |
nu.link |
Link function for |
Let Y_+\sim\mathrm{NVASIM}(\mu,\sigma) and let
0<\nu<1. The zero-adjusted distribution is defined by
P(Y=0)=\nu
and
f_Y(y)=(1-\nu)f_{Y_+}(y\mid\mu,\sigma),\quad 0<y<1.
Its cumulative distribution function is
F_Y(y)=\nu+(1-\nu)F_{Y_+}(y\mid\mu,\sigma),\quad 0<y<1.
Consequently,
E(Y)=(1-\nu)\mu
and
\mathrm{Var}(Y)=(1-\nu)\mathrm{Var}(Y_+)+
\nu(1-\nu)\mu^2.
Thus, \mu is the mean conditional on Y>0; it is not the
marginal mean when \nu>0. The marginal mean is
(1-\nu)\mu.
ZANVASIM() returns a gamlss.family object. The functions
d0NVASIM(), p0NVASIM(), q0NVASIM(), and
r0NVASIM() return density or probability mass values, cumulative
probabilities, quantiles, and random observations, respectively.
dZANVASIM(), pZANVASIM(), qZANVASIM(), and
rZANVASIM() are equivalent names following the GAMLSS family-name
convention.
Mazucheli, J., Alves, B., Korkmaz, M. C., and Leiva, V. (2022). Vasicek quantile and mean regression models for bounded data: New formulation, mathematical derivations, and numerical applications. Mathematics, 10, 1389. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3390/math10091389")}
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,
BEZI
set.seed(123)
y <- r0NVASIM(1000, mu = 0.60, sigma = 0.30, nu = 0.20)
mean(y == 0)
mean(y)
(1 - 0.20) * 0.60
library(gamlss)
fit <- gamlss(
y ~ 1,
sigma.formula = ~ 1,
nu.formula = ~ 1,
family = ZANVASIM(),
control = gamlss.control(trace = FALSE)
)
fitted(fit, what = "mu")[1]
fitted(fit, what = "sigma")[1]
fitted(fit, what = "nu")[1]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.