logLik-plot: (Log)likelihood plot for a fit using maximum likelihood

Description Usage Arguments Details Author(s) References See Also Examples

Description

llplot plots the (log)likelihood around the estimation for distributions fitted by maximum likelihood.

Usage

1
2
3
llplot(mlefit, loglik = TRUE, expansion = 1, lseq = 50,
                   back.col = TRUE, nlev = 10, pal.col = terrain.colors(100),
                   fit.show = FALSE, fit.pch = 4, ...)

Arguments

mlefit

An object of class "fitdist" of "fitdistcens" obtained by maximum likelihood (with method = "mle")

loglik

a logical to plot log-likelihood or likelihood function.

expansion

a expansion factor to enlarge the default range of values explored for each parameter.

lseq

length of sequences of parameters.

back.col

logical (for llsurface only). Contours are plotted with a background gradient of colors if TRUE.

nlev

number of contour levels to plot.

pal.col

Palette of colors. Colors to be used as back (for llsurface only).

fit.show

a logical to plot the mle estimate.

fit.pch

the type of point used to plot the mle estimate.

...

Further graphical arguments passed to graphical functions.

Details

llplot plots the (log)likelihood surface(s) (or curve if there there is only one estimated parameter) around the maximum likelihood estimation. It internally calls function llsurface and llcurve. When there is more than two estimated parameters, the (log)likehood surface is plotted for each combination of two parameters, fixing the other ones to their estimated value. For each (log)likelihood surface, when back.col image (2D-plot) is used and when nlev > 0 contour (2D-plot) is used to add nlev contours. By default the range of values explored for each estimated parameter is of 2 standard error around the mle estimate but this range can be expanded (or contracted) using the argument expansion.

Author(s)

Marie-Laure Delignette-Muller and Christophe Dutang.

References

Delignette-Muller ML and Dutang C (2015), fitdistrplus: An R Package for Fitting Distributions. Journal of Statistical Software, 64(4), 1-34.

See Also

See llsurface and llcurve for manual (log)likelihood plots (surface ou curve) and plot, contour, image for classic plotting functions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# (1) a distribution with one parameter
#

x <- rexp(50)
fite <- fitdist(x, "exp")
llplot(fite)
llplot(fite, col = "red", fit.show = TRUE)
llplot(fite, col = "red", fit.show = TRUE, loglik = FALSE)


# (2) a distribution with two parameters
# 

data(groundbeef)
serving <- groundbeef$serving
fitg <- fitdist(serving, "gamma")
llplot(fitg)
## Not run: 
llplot(fitg, expansion = 2)
llplot(fitg, pal.col = heat.colors(100), fit.show = TRUE)
llplot(fitg, back.col = FALSE, nlev = 25, fit.show = TRUE)

## End(Not run)

# (3) a distribution with two parameters with one fixed
# 
fitg2 <- fitdist(serving, "gamma", fix.arg = list(rate = 0.5))
llplot(fitg2, fit.show = TRUE)

# (4) a distribution with three parameters
# 

## Not run: 
  data(endosulfan)
  ATV <-endosulfan$ATV
  library("actuar")
  fBurr <- fitdist(ATV, "burr", start = list(shape1 = 0.3, shape2 = 1, rate = 1))
  llplot(fBurr)
  llplot(fBurr, back.col = FALSE, fit.show = TRUE, fit.pch = 16)
  llplot(fBurr, nlev = 0, pal.col = rainbow(100), lseq = 100)

## End(Not run)

# (5) a distribution with two parameters fitted on censored data
# 
data(salinity)
fsal <- fitdistcens(salinity, "lnorm")
llplot(fsal, fit.show = TRUE)
llplot(fsal, fit.show = TRUE, loglik = FALSE)

fitdistrplus documentation built on May 28, 2021, 9:06 a.m.