Topic: Utilities

Topic Description:

Basic R utilities used in many packages and functions, such as date and string manipulations, statistical distributions, geometry of lines and distances. The R package date is required for the two data functions.



File: utilities/distributions.r

View File Source Download File No help file available

Function: dpower

Function Description: dpower

A probability distribution defined by a power function. There is a dpareto in R, but quite different, with two parameters. In this, the exponent is the only parameter, and it must be < (-1); x must be >= 0.

Function Arguments:

ArgumentDefault Value
x
beta
logFALSE

Function Source:

dpower=function(x,beta,log=FALSE)
{
if(beta>=(-1)) return(rep(NA,length(x)))

xpos=x>=0
y=numeric()

y[xpos]=log(-beta-1)+beta*log(x[xpos]+1)
if(!log) y[xpos]=exp(y[xpos])

return(y)
}