gigFitStart: Find Starting Values for Fitting a Generalized Inverse...

View source: R/gigFitStart.R

gigFitStartR Documentation

Find Starting Values for Fitting a Generalized Inverse Gaussian Distribution

Description

Finds starting values for input to a maximum likelihood routine for fitting the generalized inverse Gaussian distribution to data.

Usage

  gigFitStart(x, startValues = c("LM","GammaIG","MoM","Symb","US"),
              paramStart = NULL,
              startMethodMoM = c("Nelder-Mead","BFGS"), ...)
  gigFitStartMoM(x, paramStart = NULL,
                 startMethodMoM = "Nelder-Mead", ...)
  gigFitStartLM(x, ...)

Arguments

x

Data vector.

startValues

Acronym indicating the method to use for obtaining starting values to be used as input to gigFit. See Details.

paramStart

Starting values for param if startValues = "US".

startMethodMoM

Method used by call to optim in finding method of moments estimates.

...

Passes arguments to optim and calls to hist.

Details

Possible values of the argument startValues are the following:

"LM"

Based on fitting linear models to the upper tails of the data x and the inverse of the data 1/x.

"GammaIG"

Based on fitting gamma and inverse gamma distributions.

"MoM"

Method of moments.

"Symb"

Not yet implemented.

"US"

User-supplied.

If startValues = "US" then a value must be supplied for paramStart.

When startValues = "MoM" an initial optimisation is needed to find the starting values. This optimisations starts from arbitrary values, c(1,1,1) for the parameters (\chi,\psi,\lambda) and calls optim with the method given by startMethodMoM. Other starting values for the method of moments can be used by supplying a value for paramStart.

The default method of finding starting values is "LM". Testing indicates this is quite fast and finds good starting values. In addition, it does not require any starting values itself.

gigFitStartMoM is called by gigFitStart and implements the method of moments approach.

gigFitStartLM is called by gigFitStart and implements the linear models approach.

Value

gigFitStart returns a list with components:

paramStart

A vector with elements chi, psi, and lambda giving the starting value of param.

breaks

The cell boundaries found by a call to hist.

midpoints

The cell midpoints found by a call to hist.

empDens

The estimated density found by a call to hist.

gigFitStartMoM and gigFitStartLM each return paramStart, the starting value of param, to the calling function gigFitStart

Author(s)

David Scott d.scott@auckland.ac.nz, David Cusack

See Also

dgig, gigFit.

Examples

param <- c(1, 1, 1)
dataVector <- rgig(500, param = param)
gigFitStart(dataVector)

GeneralizedHyperbolic documentation built on Nov. 26, 2023, 5:07 p.m.