Learn R Programming

moonboot (version 1.0.1)

distPower: Ditribution with a Power Law

Description

Density, distribution function, quantile function and random generation for a continuous distribution with the density (pow+1)*(x-min)^pow/(max-min)^(pow+1) for x in the range [min,max] and pow > -1.

Usage

dpower(x, pow, min = 0, max = 1)

ppower(x, pow, min = 0, max = 1)

qpower(p, pow, min = 0, max = 1)

rpower(n, pow, min = 0, max = 1)

Value

dpower gives the density, ppower gives the cumulative distribution function (CDF), qpower gives the quantile function (i.e., the inverse of the CDF), and rpower generates random numbers.

The length of the result is determined by n for rpower, and is the length of x or p for the other functions.

Arguments

x

vector of values where to evaluate the denisty or CDF.

pow

degree of the power law.

min

minimum value of the support of the distribution.

max

maximum value of the support of the distribution.

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.