Learn R Programming

highD2pop (version 1.0)

rdblepareto: The double pareto distribution

Description

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

Usage

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

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

Examples

Run this code

## 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))

Run the code above in your browser using DataLab