rLambertW {LambertW}R Documentation

Random Generation of Lambert W RV

Description

Random generation of Lambert W RV

Usage

rLambertW(n, theta = c(0, 0, 1), distname = "normal", innov = NULL, ZmUv = FALSE)

Arguments

n number of observations
theta parameter vector
distname distribution
innov pre-specified input. optional.
ZmUv Should the mean and stand. dev. of X be chosen such that Y is a zero mean, unit variance RV. default FALSE

Details

If the input data is given via innov, then the theoretical mean and standard deviation are replace by the empirical counterparts.

Value

data vector y

Author(s)

Georg M. Goerg

References

Goerg, G.M. (2009). “Lambert W Random Variables - A new class of skewed distribution functions”. Unpublished

Examples

set.seed(1)
x=rnorm(1000)
skewness(x) #almost no skewness
mc(x) # close to zero

y=rLambertW(n=1000, c(0.5,0,1))
mom.LambertW.X.Gauss(c(0.5,0,1))
skewness(y) # high positive skewness (in theory equal to 3.70)
mc(y) # also the robust measure gives a high value

op=par(no.readonly=TRUE)
par(mfrow=c(2,2), mar=c(2,4,3,1))
plot(x)
hist(x, prob=TRUE, 15)
lines(density(x))

plot(y)
hist(y, prob=TRUE, 15)
lines(density(y))
par(op)

[Package LambertW version 0.1.6 Index]