gamma_GMM: Estimate gamma

View source: R/gamma_GMM.R

gamma_GMMR Documentation

Estimate gamma

Description

This function minimizes the Euclidean distance between the theoretical skewness of a skewed Lambert W x Gaussian random variable and the sample skewness of the back-transformed data W_{\gamma}(\boldsymbol z) as a function of \gamma (see References). Only an interative application of this function will give a good estimate of \gamma (see IGMM).

Usage

gamma_GMM(
  z,
  skewness.x = 0,
  gamma.init = gamma_Taylor(z),
  robust = FALSE,
  tol = .Machine$double.eps^0.25,
  not.negative = FALSE,
  optim.fct = c("optimize", "nlminb")
)

Arguments

z

a numeric vector of data values.

skewness.x

theoretical skewness of the input X; default: 0.

gamma.init

starting value for \gamma; default: gamma_Taylor.

robust

logical; if TRUE, robust measure of asymmetry (medcouple_estimator) will be used; default: FALSE.

tol

a positive scalar; tolerance level for terminating the iterative algorithm; default: .Machine$double.eps^0.25.

not.negative

logical; if TRUE, the estimate for \gamma is restricted to non-negative reals, which is useful for scale-family Lambert W\times F random variables. Default: FALSE.

optim.fct

string; which R optimization function should be used. By default it uses optimize which is about 8-10x faster than nlminb.

Value

A list with two elements:

gamma

scalar; optimal \gamma,

iterations

number of iterations (NA for "optimize").

See Also

delta_GMM for the heavy-tail version of this function; medcouple_estimator for a robust measure of asymmetry; IGMM for an iterative method to estimate all parameters jointly.

Examples


# highly skewed
y <- rLambertW(n = 1000, theta = list(beta = c(1, 2), gamma = 0.5), 
               distname = "normal") 
gamma_GMM(y, optim.fct = "nlminb")
gamma_GMM(y)


LambertW documentation built on Nov. 2, 2023, 6:17 p.m.