Learn R Programming

GLDEX (version 2.0.0.9.3)

fun.plot.fit: Plotting the univariate generalised lambda distribution fits on the data set.

Description

This function is designed for univariate generalised lambda distribution fits only.

Usage

fun.plot.fit(fit.obj, data, nclass = 50, xlab = "", name = "", param.vec,
ylab="Density", main="")

Value

A graphical output showing the data and the resulting distributional fits.

Arguments

fit.obj

Fitted object from fun.data.fit.ml, fun.data.fit.hs, fun.data.fit.hs.nw, fun.RPRS.ml, fun.RMFMKL.ml, fun.RPRS.hs, fun.RMFMKL.hs, fun.RPRS.hs.nw, fun.RMFMKL.hs.nw

data

Dataset to be plotted.

nclass

Number of class of histogram, the default is 50.

xlab

Label on the x axis.

name

Naming the type of distribution fits.

param.vec

A vector describing the type of generalised lambda distribution used in the fit.obj.

ylab

Label on the y axis.

main

Title of the graph.

Author

Steve Su

See Also

fun.plot.fit.bm, fun.data.fit.ml, fun.data.fit.hs, fun.data.fit.hs.nw, fun.RPRS.ml, fun.RMFMKL.ml, fun.RPRS.hs, fun.RMFMKL.hs, fun.RPRS.hs.nw, fun.RMFMKL.hs.nw

Examples

Run this code
# \donttest{
# Generate Normally distribute random numbers as dataset
 junk<-rnorm(1000,3,2)

# Fit the data set using fun.data.fit.ml. 
# Also, fun.data.fit.hs or fun.data.fit.hs.nw can be used.
 obj.fit<-fun.data.fit.ml(junk)

# Plot the resulting fits
 fun.plot.fit(obj.fit,junk,xlab="x",name=".ML",param.vec=c("rs","fmkl","fmkl"))

# This function also works for singular fits such as those by fun.RPRS.ml,
# fun.RMFMKL.ml, fun.RPRS.hs, fun.RMFMKL.hs, fun.RPRS.hs.nw, fun.RMFMKL.hs.nw
 junk<-rnorm(1000,3,2)
 obj.fit<-fun.RPRS.ml(junk)
 fun.plot.fit(obj.fit,junk,xlab="x",name="RPRS.ML",param.vec=c("rs"))
# }

Run the code above in your browser using DataLab