|
3 | 3 | \alias{AIC.gamlss}
|
4 | 4 | \alias{GAIC}
|
5 | 5 | \alias{extractAIC.gamlss}
|
| 6 | +\alias{GAIC.table} |
| 7 | +\alias{GAIC.scaled} |
| 8 | + |
6 | 9 | %- Also NEED an '\alias' for EACH other topic documented here.
|
7 | 10 | \title{Gives the GAIC for a GAMLSS Object}
|
| 11 | + |
8 | 12 | \description{
|
9 |
| - \code{IC} is a function to calculate the Generalised Akaike information criterion (GAIC) for a given penalty \code{k} for a fitted GAMLSS object. |
10 |
| - The function \code{AIC.gamlss} is the method associated with a GAMLSS object of the generic function \code{AIC}. |
11 |
| - The function \code{GAIC} is a synonymous of the function \code{AIC.gamlss}. |
| 13 | + The function \code{GAIC()} calculates the Generalised Akaike information criterion (GAIC) for a given penalty \code{k} for a fitted GAMLSS object. |
| 14 | + |
| 15 | + The function \code{AIC.gamlss()} is the method associated with a GAMLSS object of the generic function \code{AIC()}. Note that \code{GAIC()} is a synonymous of the function \code{AIC.gamlss}. |
| 16 | + |
| 17 | + The function \code{IC()} is an old version of \code{GAIC()}. |
| 18 | + |
| 19 | + The function \code{GAIC.table()} produces a table with different models as rows and different penalties, \code{k}, as columns. |
| 20 | + |
| 21 | +The function \code{GAIC.scaled()} produces, [for a given set of different fitted models or for a table produced by \code{chooseDist()}], the scaled Akaike values (see Burnham and Anderson (2002) section 2.9 for a similar concept the GAIC weights. The scaled Akaike should not be interpreted as posterior probabilities of models given the data but for model selection purpose they produce a scaled ranking of the model using their relative importance i.e. from the worst to the best model. |
| 22 | + |
| 23 | + |
12 | 24 | The function \code{extractAIC} is a the method associated a GAMLSS object of the generic function \code{extractAIC} and it is
|
13 | 25 | mainly used in the \code{stepAIC} function.
|
| 26 | + |
14 | 27 | The function \code{Rsq} compute a generalisation of the R-squared for not normal models.
|
15 | 28 | }
|
16 | 29 | \usage{
|
17 | 30 | IC(object, k = 2)
|
18 | 31 | \method{AIC}{gamlss}(object, ..., k = 2, c = FALSE)
|
19 | 32 | GAIC(object, ..., k = 2, c = FALSE )
|
| 33 | +GAIC.table(object, ..., k = c(2, 3.84, round(log(length(object$y)), 2)), |
| 34 | + text.to.show=NULL) |
| 35 | +GAIC.scaled(object,..., k = 2, c = FALSE, plot = TRUE, |
| 36 | + text.cex = 0.7, which = 1, diff.dev = 1000, |
| 37 | + text.to.show = NULL, col = NULL, horiz = FALSE) |
20 | 38 | \method{extractAIC}{gamlss}(fit, scale, k = 2, c = FALSE, ...)
|
21 | 39 | }
|
22 | 40 | %- maybe also 'usage' for other objects documented here.
|
23 | 41 | \arguments{
|
24 |
| - \item{object}{an gamlss fitted model} |
| 42 | + \item{object}{an gamlss fitted model(s) [or for \code{GAIC.scaled()} a table |
| 43 | + produced by \code{chooseDist()}].} |
25 | 44 | \item{fit}{an gamlss fitted model}
|
26 | 45 | \item{\dots}{allows several GAMLSS object to be compared using a GAIC}
|
27 | 46 | \item{k}{the penalty with default \code{k=2.5}}
|
28 | 47 | \item{c}{whether the corrected AIC, i.e. AICc, should be used, note that it applies only when \code{k=2}}
|
29 | 48 | \item{scale}{this argument is not used in gamlss}
|
| 49 | + \item{plot}{whether to plot the ranking in \code{GAIC.scaled()}.} |
| 50 | + \item{text.cex}{the size of the models/families in the text of the plot of \code{GAIC.scaled()}.} |
| 51 | + \item{diff.dev}{this argument prevents models with a difference in deviance greater than \code{diff.dev} from the `best' model to be considered (or plotted).} |
| 52 | + \item{which}{which column of GAIC scaled to plot in \code{GAIC.scaled()}.} |
| 53 | + \item{text.to.show}{if NULL, \code{GAIC.scaled()} shows the model names otherwise the character in this list} |
| 54 | + \item{col}{The colour of the bars in \code{GAIC.scaled()}} |
| 55 | + \item{horiz}{whether to plot the bars vertically (default) or horizontally} |
| 56 | + |
30 | 57 | }
|
31 | 58 |
|
32 | 59 | \value{
|
33 |
| - The function \code{IC} returns the GAIC for given penalty k of the GAMLSS object. |
34 |
| - The function \code{AIC} returns a matrix contains the df's and the GAIC's for given penalty k. |
35 |
| - The function \code{GAIC} returns identical results to \code{AIC}. |
36 |
| - The function \code{extractAIC} returns vector of length two with the degrees of freedom and the AIC criterion. |
| 60 | + The function \code{IC()} returns the GAIC for given penalty k of the GAMLSS object. |
| 61 | + The function \code{AIC()} returns a matrix contains the df's and the GAIC's for given penalty k. |
| 62 | + The function \code{GAIC()} returns identical results to \code{AIC}. |
| 63 | + The function \code{GAIC.table()} returns a table which its rows showing different models and its columns different \code{k}'s. |
| 64 | + The function \code{extractAIC()} returns vector of length two with the degrees of freedom and the AIC criterion. |
37 | 65 | }
|
38 | 66 | \references{
|
| 67 | + |
| 68 | +Burnham K. P. and Anderson D. R (2002). \emph{Model Selection and Multi model Inference |
| 69 | +A Practical Information-Theoretic Approach}, Second Edition, Springer-Verlag New York, Inc. |
| 70 | + |
39 | 71 | Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion),
|
40 | 72 | \emph{Appl. Statist.}, \bold{54}, part 3, pp 507-554.
|
41 | 73 |
|
42 | 74 |
|
| 75 | +Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) |
| 76 | + \emph{Distributions for modeling location, scale, and shape: Using GAMLSS in R}, Chapman and Hall/CRC. An older version can be found in \url{https://www.gamlss.com/}. |
| 77 | + |
43 | 78 | Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R.
|
44 |
| -\emph{Journal of Statistical Software}, Vol. \bold{23}, Issue 7, Dec 2007, \url{http://www.jstatsoft.org/v23/i07}. |
| 79 | +\emph{Journal of Statistical Software}, Vol. \bold{23}, Issue 7, Dec 2007, \url{https://www.jstatsoft.org/v23/i07/}. |
45 | 80 |
|
46 |
| -Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) \emph{Flexible Regression and Smoothing: Using GAMLSS in R}, Chapman and Hall/CRC. |
| 81 | +Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) |
| 82 | +\emph{Flexible Regression and Smoothing: Using GAMLSS in R}, Chapman and Hall/CRC. |
47 | 83 |
|
48 |
| -(see also \url{http://www.gamlss.org/}). |
| 84 | +(see also \url{https://www.gamlss.com/}). |
49 | 85 | }
|
50 |
| -\author{Mikis Stasinopoulos \email{mikis.stasinopoulos@gamlss.org} } |
| 86 | +\author{Mikis Stasinopoulos \email{d.stasinopoulos@londonmet.ac.uk} } |
51 | 87 |
|
52 | 88 | \seealso{ \code{\link{gamlss}} }
|
53 | 89 | \examples{
|
54 | 90 | data(abdom)
|
55 |
| -mod1<-gamlss(y~pb(x),sigma.fo=~pb(x),family=BCT, data=abdom) |
56 |
| -IC(mod1) |
57 |
| -mod2<-gamlss(y~pb(x),sigma.fo=~x,family=BCT, data=abdom) |
58 |
| -AIC(mod1,mod2,k=3) |
59 |
| -GAIC(mod1,mod2,k=3) |
60 |
| -extractAIC(mod1,k=3) |
61 |
| -rm(mod1,mod2) |
| 91 | +m1 <- gamlss(y~x, family=NO, data=abdom) |
| 92 | +IC(m1) |
| 93 | +extractAIC(m1,k=2) |
| 94 | +m2 <- gamlss(y~x, sigma.fo=~x, family=NO, data=abdom) |
| 95 | +m3 <- gamlss(y~pb(x), sigma.fo=~x, family=NO, data=abdom) |
| 96 | +m4 <- gamlss(y~pb(x), sigma.fo=~pb(x), family=NO, data=abdom) |
| 97 | +AIC(m1,m2, m3, m4) |
| 98 | +AIC(m1,m2, m3, m4, c=TRUE) |
| 99 | +AIC(m1,m2, m3, m4, k=3) |
| 100 | +GAIC.table(m1,m2, m3, m4) |
| 101 | +GAIC.scaled(m1,m2, m3, m4) |
| 102 | +\dontrun{ |
| 103 | +MT <- chooseDist(m3) |
| 104 | +GAIC.scaled(MT) |
| 105 | +GAIC.scaled(MT, which=2)} |
62 | 106 | }
|
63 | 107 |
|
64 | 108 | \keyword{regression}%
|
0 commit comments