model_GAIC | R Documentation |
The function model_GAIC()
is similar to the function GAIC.scaled()
of the package gamlss. It produces, [for a given set of different fitted models or for a table produced by chooseDist()
], the scaled Akaike values (see Burnham and Anderson (2002) section 2.9 for a similar concept of the GAIC weights. The plot of the GAIC's should not be interpreted as posterior probabilities of models given the data but can be used for model selection purpose since they produce a scaled ranking of the model using their relative importance i.e. from the worst to the best model.
The function model_GAIC_lollipop()
is almost identical to model_GAIC()
but the result is a lollipop plot.
model_GAIC(object, ..., k = 2, c = FALSE, plot = TRUE,
which = 1, diff.dev = 1000, text.to.show = NULL,
col = "rosybrown", width = 0.9, horiz = TRUE,
scale = c("[0,1]","[max,min]"), title)
model_GAIC_lollipop(object, ..., k = 2, c = FALSE, plot = TRUE,
which = 1, diff.dev = 1000, text.to.show = NULL,
col = "skyblue", col.point = "blue", pch.point = 19,
width = 0.9, horiz = TRUE,
scale = c("[0,1]", "[max,min]"), order.val = TRUE, title)
object |
a set of |
... |
it allows several GAMLSS object to be compared using a GAIC |
k |
the penalty with default k=2 |
c |
whether the corrected AIC, i.e. AICc, should be used, note that it applies only when |
plot |
whether to plot with default equal |
which |
which column of GAIC table to plot |
diff.dev |
this argument applies only a matrix table produced by |
text.to.show |
if NULL, |
col |
The colour of the bars (or lines. in the lollipop) |
col.point |
The colour of the points in the lollipop |
pch.point |
The points character in the lollipop |
width |
the width of the bars |
horiz |
whether to plot the bars horizontally (default) or vertically |
scale |
the scale of the plot, |
title |
if different title is needed |
order.val |
whether to order the models from the best to the worst |
The option allow the AIC to be plotted from worst to best on a
[0,1]
scale using the formula i.e. (AIC_w-AIC_m)/(AIC_w-AIC_b))
where the AIC_w
and AIC_b
are the worst and best AIC, respectively, and AIC_m
is the AIC of the current model. If the option scale
is set to[max,min]
the difference (AIC_w-AIC_m)
is plotted.
It returns a bar plot using package ggplot2.
Mikis Stasinopoulos, Bob Rigby and Fernanda De Bastiani
Burnham K. P. and Anderson D. R (2002). Model Selection and Multimodel Inference A Practical Information-Theoretic Approach, Second Edition, Springer-Verlag New York, Inc.
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554.
Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) Distributions for modeling location, scale, and shape: Using GAMLSS in R, Chapman and Hall/CRC. An older version can be found in https://www.gamlss.com/.
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, https://www.jstatsoft.org/v23/i07/.
Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) Flexible Regression and Smoothing: Using GAMLSS in R, Chapman and Hall/CRC. Stasinopoulos, M.D., Kneib, T., Klein, N., Mayr, A. and Heller, G.Z., (2024). Generalized Additive Models for Location, Scale and Shape: A Distributional Regression Approach, with Applications (Vol. 56). Cambridge University Press.
(see also https://www.gamlss.com/).
GAIC.scaled
data(abdom)
m1 <- gamlss(y~x, family=NO, data=abdom)
m2 <- gamlss(y~x, sigma.fo=~x, family=NO, data=abdom)
m3 <- gamlss(y~pb(x), sigma.fo=~x, family=NO, data=abdom)
m4 <- gamlss(y~pb(x), sigma.fo=~pb(x), family=NO, data=abdom)
model_GAIC(m1,m2, m3, m4)
MT <- chooseDist(m3)
model_GAIC(MT)
model_GAIC(MT, which=2)
model_GAIC_lollipop(m1,m2, m3, m4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.