Learn R Programming

GLDEX (version 2.0.0.9.3)

fun.comp.moments.ml: Compare the moments of the data and the fitted univariate generalised lambda distribution.

Description

After fitting the distribution, it is often desirable to see whether the moments of the data matches with the fitted distribution. This function computes the theoretical and actual moments especially for fun.data.fit.ml function output.

Usage

fun.comp.moments.ml(theo.obj, data, name = "ML")

Value

r.mat

A matrix showing the mean, variance, skewness and kurtosis of the fitted distribution in comparison to the data set.

eval.mat

Absolute difference in each of the four moments from the data under each of the distibutional fits.

Arguments

theo.obj

Fitted distribution parameters, usually output from fun.data.fit.ml

data

Data set used

name

Naming the method used in fitting the distribution, by default this is "ML".

Author

Steve Su

See Also

fun.comp.moments.ml.2

Examples

Run this code
# \donttest{
# Generate random normally distributed observations.
 junk<-rnorm(1000,3,2)

# Fit the dataset using fun.data.ml
 fit<-fun.data.fit.ml(junk)

# Compare the resulting fits. It is usually the case the maximum likelihood 
# provides better estimation of the moments than the starship method.
 fun.comp.moments.ml(fit,junk)
# }

Run the code above in your browser using DataLab