Learn R Programming

fEGarch (version 1.0.1)

find_dist: Optimal Distribution Fitting to IID Data

Description

Given a series supposed to be from independent and identically distributed (iid) random variables, fit all eight distributions of this package to the data using maximum-likelihood estimation (MLE) and select the best one following either the BIC (the default) or the AIC.

Usage

find_dist(
  x,
  dists = c("norm", "std", "ged", "ald", "snorm", "sstd", "sged", "sald"),
  fix_mean = NULL,
  fix_sdev = NULL,
  Prange = c(1, 5),
  criterion = c("bic", "aic")
)

Value

Returns an object of class "fEGarch_distr_est" with various slots representing the estimation results of the selected fitted distribution.

Arguments

x

the vector of iid values to fit distributions to.

dists

a vector with all the distribution abbreviations which should be considered in the selection process; by default, all eight distributions of this package are considered.

fix_mean

a value to fix the unconditional mean of the distribution to; with the default NULL, the unconditional mean is estimated as an extra parameter.

fix_sdev

a value to fix the unconditional standard deviation of the distribution to; with the default NULL, the unconditional standard deviation is estimated as an extra parameter.

Prange

a two-element vector giving the search range for the shape parameter \(P\) of the (skewed) average Laplace distribution.

criterion

either "bic" or "aic" to use BIC or AIC as the final selection criterion; by default "bic" is implemented.

Details

For information on the method and distributions, we refer the reader to distr_est.

Examples

Run this code
x <- rnorm(2000) * 2.1 + 10.5
find_dist(x)

Run the code above in your browser using DataLab