dnormp: Density function of an exponential power distribution

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

View source: R/dnormp.R

Description

Density function for the exponential power distribution with location parameter mu, scale parameter sigmap and shape parameter p.

Usage

1
dnormp(x, mu=0, sigmap=1, p=2, log=FALSE)

Arguments

x

Vector of quantiles.

mu

Vector of location parameters.

sigmap

Vector of scale parameters.

p

Shape parameter.

log

Logical; if TRUE, the density is given as log(density).

Details

If mu, sigmap or p are not specified they assume the default values 0, 1 and 2, respectively. The exponential power distribution has density function

f(x) = 1/(2 p^(1/p) Gamma(1+1/p) sigmap) exp{-|x - mu|^p/(p sigmap^p)}

where mu is the location parameter, sigmap the scale parameter and p the shape parameter. When p=2 the exponential power distribution becomes the Normal Distribution, when p=1 the exponential power distribution becomes the Laplace Distribution, when p->infinity the exponential power distribution becomes the Uniform Distribution.

Value

dnormp gives the density function of an exponential power distribution.

Author(s)

Angelo M. Mineo

See Also

Normal for the Normal distribution, Uniform for the Uniform distribution, and Special for the Gamma function.

Examples

1
2
3
4
5
6
7
8
## Compute the density for a vector x with mu=0, sigmap=1 and p=1.5
## At the end we have the graph of the exponential power distribution 
## density function with p=1.5
x <- c(-1, 1)
f <- dnormp(x, p=1.5)
print(f)
plot(function(x) dnormp(x, p=1.5) , -4, 4,
          main = "Exponential power distribution density function (p=1.5)", ylab="f(x)")

Example output

[1] 0.2170106 0.2170106

normalp documentation built on Feb. 14, 2020, 5:08 p.m.