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: rsymexp

Function Description: rsymexp

Drawing a random variate on the symmetric exponential, based on the cumulative probability, as given in psymexp. A random uniform number on (0,1) is plugged in the inverse of the cumulative distribution.

Function Arguments:

ArgumentDefault Value
n
center
rate

Function Source:

rsymexp=function(n,center,rate)
{
y=numeric()

r=runif(n)
left=r<0.5
right=r>=0.5

y[left]=center+log(2*r[left])/rate
y[right]=center+-log(2*(1-r[right]))/rate

return(y)
}