bernweibull: The Bernoulli-Weibull distribution

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Density, distribution function, quantile function and random generation for the Bernoulli-Weibull distribution with parameters prob, shape, and scale.

Usage

1
2
3
4
dbernweibull(x, prob, scale, shape)
pbernweibull(q, prob, scale, shape)
qbernweibull(p, prob, scale, shape)
rbernweibull(n, prob, scale, shape)

Arguments

x,q

vector of quantiles.

p

vector of probabilities.

prob

probability of non-zero event.

n

number of random samples.

scale,shape

shape and scale parameters of the weibull distribution.

Details

Mixture of Bernoulli and Weibull distribution. The mixture is analogue to the one described for the berngamma distribution.

Value

dbernweibull gives the density (pdf), pbernweibull gives the distribution function (cdf), qbernweibull gives the quantile function (inverse cdf), and rbernweibull generates random deviates.

Note

The implementation is largely based on the bweibull 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

Weibull, berngamma

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
data(obsprecip)

(ts <- startbernweibull(obsprecip[,1]))
hist(obsprecip[,1],freq=FALSE) 
lines(seq(0,max(obsprecip[,1])),
      dbernweibull(seq(0,max(obsprecip[,1])),
                   prob=ts$prob,
                   shape=ts$shape,
                   scale=ts$scale),
      col="red")

pp <- seq(0.01,0.99,by=0.01)
qq <-quantile(obsprecip[,1],probs=pp) 

plot(qq,pp)
lines(qbernweibull(pp,
                   prob=ts$prob,
                   scale=ts$scale,
                   shape=ts$shape),
      pp,col="red")

plot(qq,pp)
lines(qq,
      pbernweibull(qq,
                   prob=ts$prob,
                   scale=ts$scale,
                   shape=ts$shape),
      col="red")

hist(rbernweibull(1000,prob=ts$prob,
                      shape=ts$shape,
                      scale=ts$scale),freq=TRUE)

qmap documentation built on May 1, 2019, 7:31 p.m.