Posnorm {VGAM}R Documentation

The Positive-Normal Distribution

Description

Density, distribution function, quantile function and random generation for the univariate positive-normal distribution.

Usage

dposnorm(x, mean=0, sd=1)
pposnorm(q, mean=0, sd=1)
qposnorm(p, mean=0, sd=1)
rposnorm(n, mean=0, sd=1)

Arguments

x, q vector of quantiles.
p vector of probabilities.
n number of observations. Must be a positive integer of length 1.
mean, sd see rnorm.

Details

See posnormal1, the VGAM family function for estimating the parameters, for the formula of the probability density function and other details.

Value

dposnorm gives the density, pposnorm gives the distribution function, qposnorm gives the quantile function, and rposnorm generates random deviates.

Note

rposnorm() may run very slowly if the mean is very negative.

Author(s)

T. W. Yee

See Also

posnormal1.

Examples

## Not run: 
m =  0.8
x = seq(-1, 4, len=501)
plot(x, dposnorm(x, m=m), type="l", ylim=0:1, las=1,
     ylab=paste("posnorm(m=",m,", sd=1)"), col="blue",
     main="Blue is density, red is cumulative distribution function",
     sub="Purple lines are the 10,20,...,90 percentiles")
lines(x, pposnorm(x, m=m), col="red")
abline(h=0)
probs = seq(0.1, 0.9, by=0.1)
Q = qposnorm(probs, m=m)
lines(Q, dposnorm(Q, m=m), col="purple", lty=3, type="h")
lines(Q, pposnorm(Q, m=m), col="purple", lty=3, type="h")
abline(h=probs, col="purple", lty=3)
pposnorm(Q, m=m) - probs # Should be all 0
## End(Not run)

[Package VGAM version 0.7-7 Index]