LambertW (version 0.6.4)

tau-utils: Utilities for transformation vector tau

Description

All functions here are for the transformation parameter vector \(\tau = (\mu_x, \sigma_x, \gamma, \delta, \alpha)\).

check_tau checks if \(\tau\) is correctly specified (correct names, non-negativity constraints, etc.)

complete_tau completes missing values so users don't have to specify every element of \(\tau\) explicitly. 'mu_x' and 'sigma_x' must be specified, but alpha = 1, gamma = 0, and delta = 0 will be set automatically if missing.

get_initial_tau provides starting estimates for \(\tau\).

normalize_by_tau shifts and scales data given the tau vector as $$(data - \mu_x) / \sigma_x.$$

Parameters \(\mu_x\) and \(\sigma_x\) are not necessarily mean and standard deviation in the \(\tau\) vector; that depends on the family type and use.mean.variance (for location families they usually are mean and standard deviation if use.mean.variance = TRUE; for scale and non-location non-scale families they are just location/scale parameters for the transformation).

tau2theta converts \(\tau\) to the parameter list \(\theta\) (inverse of theta2tau).

tau2type guesses the type ('s', 'h', 'hh') from the names of tau vector; thus make sure tau is named correctly.

Usage

check_tau(tau)

complete_tau(tau, type = tau2type(tau))

get_initial_tau(y, type = c("h", "hh", "s"), location.family = TRUE)

normalize_by_tau(data, tau, inverse = FALSE)

tau2theta(tau, beta)

tau2type(tau)

Arguments

tau

named vector \(\tau\) which defines the variable transformation. Must have at least 'mu_x' and 'sigma_x' element; see complete_tau for details.

type

type of Lambert W \(\times\) F distribution: skewed "s"; heavy-tail "h"; or skewed heavy-tail "hh".

y

a numeric vector of real values (the observed data).

location.family

logical; if FALSE it sets mu_x to 0 and only estimates sigma_x; if TRUE (default), it estimates mu_x as well.

data

numeric; a numeric object in R. Usually this is either y or x (or z and u if inverse = TRUE.)

inverse

logical; if TRUE it applies the inverse transformation \(data \cdot \sigma_x + \mu_x\)

beta

numeric vector (deprecated); parameter \(\boldsymbol \beta\) of the input distribution. See check_beta on how to specify beta for each distribution.

Value

check_tau throws an error if \(\tau\) does not define a proper transformation.

complete_tau returns a named numeric vector.

get_initial_tau returns a named numeric vector.

tau2theta returns a list with entries alpha, beta, gamma, and delta.

tau2type returns a string: either "s", "h", or "hh".