Lambert W x F distributions are a generalized framework to analyze skewed, heavy-tailed data. It is based on an input/output system, where the output random variable (RV) Y is a non-linearly transformed version of an input RV X ~ F with similar properties as X, but slightly skewed (heavy-tailed). The transformed RV Y has a Lambert W x F distribution. This package contains functions to model and analyze skewed, heavy-tailed data the Lambert Way: simulate random samples, estimate parameters, compute quantiles, and plot/ print results nicely. Probably the most important function is 'Gaussianize', which works similarly to 'scale', but actually makes the data Gaussian. A do-it-yourself toolkit allows users to define their own Lambert W x 'MyFavoriteDistribution' and use it in their analysis right away.
rewrote a couple of functions in C++ using the amazing (!) Rcpp package.
3-4x speed up for
W related functions; also for
added bootstrap functions for users to easily check if a Lambert W x F distribution with finite mean and variance input makes sense:
use.mean.variance argument to distinguish between mean-variance
Lambert W x F distributions and general location-scale Lambert W x F
distributions. See also Goerg (2015b). See the help file on these functions for references on why they were included.
added more unit tests (moving code from "Examples" to unit tests)
thetaargument in the
dpqrfunction becomes the recommended argument to specify the distribution.
deltanow give warnings and will be deprecated in future versions.
gamma_Taylorfor better initial estimates.
kurtosis()instead directly in LambertW.
moved from gsl to lamW R package: the Lambert W implementation is ~4x faster than for gsl. Needless to say that this will also speed up many computations in the LambertW package. Thank you Avraham Adler for the lamW package.
lots of performance improvements (not only due to lamW package). Leads to 2-3x faster estimation via IGMM or MLE overall.
added (first iteration) of unit tests using the testthat package
NAMESPACEfollowing new CRAN policies
from = 0in
plot.LambertW_fitfor scale families with all positive values.
get_distname_familyreturns a third logical entry
non.negativeto check whether a distribution is for non-negative random variables (e.g., exponential or Gamma).
loglik_penaltyloses the "distname" argument, but gains the "is.non.negative" argument.
deriv_Wfaster and more precise using a log transform first and using mathematial identities of the derivative of W, its derivative, and logarithm.
gamma_GMM(it's about 30% faster than "nlm")
deltatoo large (
>1e100) the backtransformed data
uwould become negligibly small and numerically a constant (
kurtosis()estimate would be
NaN, which resulted in stop of
delta_GMM. Added an
NAcheck and returned large value for objective function, for
nlm()to search for a better
get_initial_theta: if initial estimates of
gammaare too extreme, then the backtransformed input data for X contains
NA. This caused an error in
NAs are removed before passing
NA; fixed to return
qLambertW()didn't compute correct quantiles for non-negative distributions (e.g.,
type = "s"; replaced now with closed form expressions.
Gaussianize()does not have to have
colnames; will be assigned by default if
colnames(data) = NULL
deltavalues passed via
Several deprecated functions (see also
test_normality(previously known as
Version 0.5 is a long awaited - big - update to the LambertW package. That's why it's a big bump from 0.2.9.9 to 0.5.
It has lots of improved code, bug fixes, more user friendly function (names) and implementation, more explicit error checking and meaningful error messages, etc.
Definitely check out the new manual - it has been reviewed very thoroughly.
W()(and related functions) gained a
branchargument (see also deprecated functions below).
Gaussianize()gained several new arguments that allow to do the inverse ''DeGaussianization'' as well. See
get_output()(due to popular demand)
CITATIONfile. See citation information with
thetaas argument in functions instead of
delta. Passing the elements as single arguments still works, but using
theta = list(beta = ..., gamma = ..., delta = ..., alpha = ...)is preferred. In future versions the
deltaarguments will be deprecated.
_as separator in function names
_helps understanding; e.g.,
ysubscript in LaTeX / pdf)
normfitis often called for visual checks only, I made the normality tests optional. They are called if the nortest package is available (
require(nortest) == TRUE); otherwise it just returns
NA. This is useful in case users do not have the nortest package available in their R installation.
pU(): incorrect usage of standard deviation vs scale in t distribution (
dU()and thus log-likelihood was correct).
ks.test.tnow uses the scale parameter, rather than standard deviation. This now allows to test also if degrees of freedom < 2.
Several deprecated functions (see also
W(z, branch = -1); similarly for
W_gamma(..., branch = -1).
G()since it was never used. If you need it use
G_delta(z, delta = 0).
MLE_LambertWnow works also for unbounded optimziation.
MLE_LambertW. They just work one way on a numeric vector.
optim(..., hessian = TRUE)instead.
get.input()had the wrong variable for
nu > 2(
0/0when computing inverse transformation. Replaced this term with equivalent expression avoiding