mean
,
sd
, and p.zero
.
The zero-modified normal distribution is the mixture of a normal distribution
with a positive probability mass at 0.dzmnorm(x, mean = 0, sd = 1, p.zero = 0.5)
pzmnorm(q, mean = 0, sd = 1, p.zero = 0.5)
qzmnorm(p, mean = 0, sd = 1, p.zero = 0.5)
rzmnorm(n, mean = 0, sd = 1, p.zero = 0.5)
length(n)
is larger than 1, then length(n)
random values are returned.mean=0
.sd=1
.rzmnorm
this must be a single, non-missing number.dzmnorm
gives the density, pzmnorm
gives the distribution function,
qzmnorm
gives the quantile function, and rzmnorm
generates random
deviates.mean=
$\mu$ and sd=
$\sigma$. The density function of a
zero-modified normal random variable $Y$ with parameters mean=
$\mu$,
sd=
$\sigma$, and p.zero=
$p$, denoted $h(y; \mu, \sigma, p)$,
is given by:
p.zero=
$p$=0
, the zero-modified normal
distribution simplifies to the normal distribution.ezmnorm
, Probability Distributions and Random Numbers.# Density of the zero-modified normal distribution with parameters
# mean=2, sd=1, and p.zero=0.5, evaluated at 0, 0.5, 1, 1.5, and 2:
dzmnorm(seq(0, 2, by = 0.5), mean = 2)
#[1] 0.5000000 0.0647588 0.1209854 0.1760327 0.1994711
#----------
# The cdf of the zero-modified normal distribution with parameters
# mean=3, sd=2, and p.zero=0.1, evaluated at 4:
pzmnorm(4, 3, 2, .1)
#[1] 0.7223162
#----------
# The median of the zero-modified normal distribution with parameters
# mean=3, sd=1, and p.zero=0.1:
qzmnorm(0.5, 3, 1, 0.1)
#[1] 2.86029
#----------
# Random sample of 3 observations from the zero-modified normal distribution
# with parameters mean=3, sd=1, and p.zero=0.4.
# (Note: The call to set.seed simply allows you to reproduce this example.)
set.seed(20)
rzmnorm(3, 3, 1, 0.4)
#[1] 0.000000 0.000000 3.073168
Run the code above in your browser using DataLab