View source: R/dpqr-01NvasicekM.R
| ZOANVASIM | R Documentation |
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"
)
x |
Vector of values in |
mu |
Mean of the continuous Vasicek component, in |
sigma |
Shape parameter of the continuous Vasicek component, in
|
nu |
Probability at zero, |
tau |
Conditional probability at one among nonzero observations,
|
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 |
tau.link |
Link function for |
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.
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.
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)
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.