s.gld.from.moments {ldt}R Documentation

Get the GLD Parameters from the moments

Description

Calculates the parameters of the generalized lambda distribution (FKML), given the first four moments of the distribution.

Usage

s.gld.from.moments(
  mean = 0,
  variance = 1,
  skewness = 0,
  excessKurtosis = 0,
  type = 0,
  start = NULL,
  nelderMeadOptions = get.options.neldermead()
)

Arguments

mean

A number for the mean of the distribution.

variance

A number for the variance of the distribution.

skewness

A number for the skewness of the distribution.

excessKurtosis

A number for the excess kurtosis of the distribution.

type

An integer to restrict the shape of the distribution. See details section.

start

A numeric vector of size 2 for the starting value.

nelderMeadOptions

A list of options for Nelder-Mead algorithm. Use get.options.neldermead for initialization.

Details

The type of the distribution is determined by one or two restrictions:

Value

A vector of length 5. The first 4 elements are the parameters of the GLD distribution. The last one is the number of iterations.

Examples

res <- s.gld.from.moments(0,1,0,0, start = c(0,0), type = 4)
probs <- seq(0.1,0.9,0.1)
x <- s.gld.quantile(probs, res[1],res[2],res[3],res[4])
y <- s.gld.density.quantile(probs, res[1],res[2],res[3],res[4])
plot(x,y)
lines(x,y)



[Package ldt version 0.5.3 Index]