meanlog
,
sdlog
, and p.zero
.
The zero-modified lognormal (delta) distribution is the mixture of a
lognormal distribution with a positive probability mass at 0.dzmlnorm(x, meanlog = 0, sdlog = 1, p.zero = 0.5)
pzmlnorm(q, meanlog = 0, sdlog = 1, p.zero = 0.5)
qzmlnorm(p, meanlog = 0, sdlog = 1, p.zero = 0.5)
rzmlnorm(n, meanlog = 0, sdlog = 1, p.zero = 0.5)
length(n)
is larger than 1, then length(n)
random values are returned.meanlog=0
.sdlog=1
.rzmlnorm
this must be a single, non-missing number.dzmlnorm
gives the density, pzmlnorm
gives the distribution function,
qzmlnorm
gives the quantile function, and rzmlnorm
generates random
deviates.meanlog=
$\mu$ and sdlog=
$\sigma$. The density function of a
zero-modified lognormal (delta) random variable $Y$ with parameters
meanlog=
$\mu$, sdlog=
$\sigma$, and p.zero=
$p$,
denoted $h(y; \mu, \sigma, p)$, is given by:
p.zero=
$p$=0
, the zero-modified lognormal
distribution simplifies to the lognormal distribution.ezmlnorm
, Probability Distributions and Random Numbers.# Density of the zero-modified lognormal (delta) distribution with
# parameters meanlog=0, sdlog=1, and p.zero=0.5, evaluated at
# 0, 0.5, 1, 1.5, and 2:
dzmlnorm(seq(0, 2, by = 0.5))
#[1] 0.50000000 0.31374804 0.19947114 0.12248683
#[5] 0.07843701
#----------
# The cdf of the zero-modified lognormal (delta) distribution with
# parameters meanlog=1, sdlog=2, and p.zero=0.1, evaluated at 4:
pzmlnorm(4, 1, 2, .1)
#[1] 0.6189203
#----------
# The median of the zero-modified lognormal (delta) distribution with
# parameters meanlog=2, sdlog=3, and p.zero=0.1:
qzmlnorm(0.5, 2, 3, 0.1)
#[1] 4.859177
#----------
# Random sample of 3 observations from the zero-modified lognormal
# (delta) distribution with parameters meanlog=1, sdlog=2, and p.zero=0.4.
# (Note: The call to set.seed simply allows you to reproduce this example.)
set.seed(20)
rzmlnorm(3, 1, 2, 0.4)
#[1] 0.000000 0.000000 3.146641
Run the code above in your browser using DataLab