GarchDistributionFits {fSeries}R Documentation

Parameter Fit of a Distribution

Description

A collection and description of maximum likelihood estimators to fit the parameters of a distribution and to compute basic statistical properties. Included are estimators for the symmetric and skew normal, the Student-t, and the generalized error distribution.

The functions are:

normFit MLE parameter fit for a Normal distribution,
snormFit MLE parameter fit for a skew Normal distribution,
stdFit MLE parameter fit for a Sudent-t distribution,
stdFit MLE parameter fit for a skew Sudent-t distribution,
gedFit MLE parameter fit for a generalized error distribution,
nigFit MLE parameter fit for a skew generalized error distribution.

Usage

normFit(x, ...)
snormFit(x, ...)
stdFit(x, ...)
sstdFit(x, ...)
gedFit(x, ...)
sgedFit(x, ...)

Arguments

x a numeric vector.
... parameters parsed to the optimization function nlm.

Details

The function nlm is used to minimize the "negative" maximum log-likelihood function. nlm carries out a minimization using a Newton-type algorithm.

Value

The functions *Fit return a list with the following components:

estimate the point at which the maximum value of the log liklihood function is obtained.
objective the value of the estimated maximum, i.e. the value of the log liklihood function.
message an integer indicating why the optimization process terminated.
code an integer indicating why the optimization process terminated.
1: relative gradient is close to zero, current iterate is probably solution;
2: successive iterates within tolerance, current iterate is probably solution;
3: last global step failed to locate a point lower than estimate. Either estimate is an approximate local minimum of the function or steptol is too small;
4: iteration limit exceeded;
5: maximum step size stepmax exceeded five consecutive times. Either the function is unbounded below, becomes asymptotic to a finite value from above in some direction or stepmax is too small.
gradient the gradient at the estimated maximum.
steps number of function calls.

Author(s)

Diethelm Wuertz for the Rmetrics R-port.

See Also

dsnorm, dsstd, dsged, nlm.

Examples

## SOURCE("fBasics.A0-SPlusCompatibility")
## SOURCE("fSeries.D1-HeavisideFunction")
## SOURCE("fSeries.D2-SkewNormalDistribution")
## SOURCE("fSeries.D3-SkewStudentDistribution")
## SOURCE("fSeries.D4-SkewGedDistribution")
## SOURCE("fSeries.D5-GarchDistributionFits")

## snormFit -
   xmpSeries("\nStart: MLE Fit to skew Normal Density > ")
   options(warn = -1) # suppress negative logs from nlm
   normFit(rnorm(1000))
   snormFit(rnorm(1000))
   
## sstdFit -
   xmpSeries("\nNext: MLE Fit to skew Student-t Density > ")
   sstdFit(rsstd(1000, mean = 1, sd = 1.5, nu = 7, xi = 2/3))
   
## sgedFit -
   xmpSeries("\nNext: MLE Fit to skew Generalized Error Density > ")
   sgedFit(rsged(1000, mean = -1, sd = 0.5, nu = 3, xi = 3/2),
         print.level = 2)

[Package fSeries version 201.10060 Index]