| bernlnorm {qmap} | R Documentation |
The Bernoulli-Log-Normal distribution
Description
Density, distribution function, quantile function and random
generation for the Bernoulli-Log-Normal distribution with parameters
prob, meanlog, and sdlog.
Usage
dbernlnorm(x, prob, meanlog, sdlog)
pbernlnorm(q, prob, meanlog, sdlog)
qbernlnorm(p, prob, meanlog, sdlog)
rbernlnorm(n, prob, meanlog, sdlog)
Arguments
x, q |
vector of quantiles. |
p |
vector of probabilities. |
prob |
probability of non-zero event. |
n |
number of random samples. |
meanlog, sdlog |
meanlog and sdlog parameters of the Log-Normal distribution. |
Details
Mixture of Bernoulli and Log-Normal distribution. The mixture is analogue
to the one described for the berngamma distribution.
Value
dbernlnorm gives the density (pdf), pbernlnorm gives
the distribution function (cdf), qbernlnorm gives the
quantile function (inverse cdf), and rbernlnorm generates
random deviates.
Note
The implementation is largely based on the blnorm family in
the CaDENCE-package (Cannon, 2012) that was only available as
test version at time of implementation (Mar. 2012). The
CaDENCE-package is available at
http://www.eos.ubc.ca/~acannon/CaDENCE/.
Author(s)
Lukas Gudmundsson
References
Cannon, A. J. Neural networks for probabilistic environmental prediction: Conditional Density Estimation Network Creation and Evaluation (CaDENCE) in R. Computers & Geosciences, 2012, 41, 126 - 135, doi:10.1016/j.cageo.2011.08.023.
See Also
Examples
data(obsprecip)
(ts <- startbernlnorm(obsprecip[,1]))
hist(obsprecip[,1],freq=FALSE)
lines(seq(0,20),dbernlnorm(0:20,
prob=ts$prob,
meanlog=ts$meanlog,
sdlog=ts$sdlog),
col="red")
pp <- seq(0.01,0.99,by=0.01)
qq <-quantile(obsprecip[,1],probs=pp)
plot(qq,pp)
lines(qbernlnorm(pp,
prob=ts$prob,
meanlog=ts$meanlog,
sdlog=ts$sdlog),
pp,col="red")
plot(qq,pp)
lines(qq,
pbernlnorm(qq,
prob=ts$prob,
meanlog=ts$meanlog,
sdlog=ts$sdlog),
col="red")
hist(rbernlnorm(1000,prob=ts$prob,
meanlog=ts$meanlog,
sdlog=ts$sdlog),freq=FALSE)