rdblepareto: The double pareto distribution

Description Usage Arguments Value Author(s) Examples

View source: R/highD2popfunctions.R

Description

Random number generation from the double Pareto distribution with parameters shape and scale.

Usage

1
rdblepareto(n, shape, scale)

Arguments

n

number of observations to generate.

shape

shape parameter, must be strictly greater than zero.

scale

scale parameter, must be strictly greater than zero.

Value

a vector of length n of realizations from the double Pareto distribution with shape parameter shape and scale parameter scale.

Author(s)

Karl Gregory [email protected], http://www.stat.tamu.edu/~kbgregory.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## The function is currently defined as
function (n, shape, scale) 
{
    u <- runif(n, 0, 1)
    x <- scale * (1 - u)^(-1/shape) - scale
    y <- sample(c(-1, 1), n, replace = TRUE) * x
    return(y)
  }


x <- rdblepareto(500,1.5,1)

plot(density(x))

highD2pop documentation built on May 29, 2017, 6:09 p.m.