Skip to content

Commit e3d8174

Browse files
committedJul 8, 2023
madual commit
1 parent 6dad0df commit e3d8174

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+833
-326
lines changed
 

‎man/DevianceIncr.Rd

+13-11
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ Returns a vector of the global deviance increments for each observation.
2020
\references{
2121
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, 1-38.
2222

23-
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, \url{http://www.jstatsoft.org/v23/i07}.
23+
Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019)
24+
\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/}.
2425

25-
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.
26+
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R.
27+
\emph{Journal of Statistical Software}, Vol. \bold{23}, Issue 7, Dec 2007, \url{https://www.jstatsoft.org/v23/i07/}.
2628

27-
(see also \url{http://www.gamlss.org/}).
29+
Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017)
30+
\emph{Flexible Regression and Smoothing: Using GAMLSS in R}, Chapman and Hall/CRC.
31+
32+
(see also \url{https://www.gamlss.com/}).
2833
}
2934
\author{Mikis Stasinopoulos}
3035

@@ -59,7 +64,7 @@ m1 <- gamlss(head~pb(age), data=db[1:6000,])
5964
p1<-devianceIncr(m1)
6065
m2 <- gamlss(head~pb(age), sigma.fo=~pb(age), nu.fo=~pb(age),
6166
tau.fo=~pb(age), data=db[1:6000,], family=BCT)
62-
p2<-d.evianceIncr(m2)
67+
p2<-devianceIncr(m2)
6368
# comparing using summaries
6469
summary(p1); summary(p2)
6570
# comparing using boxplots
@@ -69,14 +74,11 @@ hist(p1, col=rgb(1,0,0,0.5), xlim=c(0,50), breaks=seq(0,50,2))
6974
hist(p2, col=rgb(0,0,1,0.5), add=T)
7075
# comparing using emphirical cdf
7176
plot(ecdf(p1))
72-
lines(ecdf(p2), col=2)}
77+
lines(ecdf(p2), col=2)
78+
}
7379
#----------------------------------------------------------------
74-
75-
76-
77-
7880
}
7981
% Add one or more standard keywords, see file 'KEYWORDS' in the
8082
% R documentation directory.
81-
\keyword{ ~kwd1 }% use one of RShowDoc("KEYWORDS")
82-
\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
83+
\keyword{regression}% use one of RShowDoc("KEYWORDS")
84+

‎man/IC.Rd

+63-19
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,106 @@
33
\alias{AIC.gamlss}
44
\alias{GAIC}
55
\alias{extractAIC.gamlss}
6+
\alias{GAIC.table}
7+
\alias{GAIC.scaled}
8+
69
%- Also NEED an '\alias' for EACH other topic documented here.
710
\title{Gives the GAIC for a GAMLSS Object}
11+
812
\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+
1224
The function \code{extractAIC} is a the method associated a GAMLSS object of the generic function \code{extractAIC} and it is
1325
mainly used in the \code{stepAIC} function.
26+
1427
The function \code{Rsq} compute a generalisation of the R-squared for not normal models.
1528
}
1629
\usage{
1730
IC(object, k = 2)
1831
\method{AIC}{gamlss}(object, ..., k = 2, c = FALSE)
1932
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)
2038
\method{extractAIC}{gamlss}(fit, scale, k = 2, c = FALSE, ...)
2139
}
2240
%- maybe also 'usage' for other objects documented here.
2341
\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()}].}
2544
\item{fit}{an gamlss fitted model}
2645
\item{\dots}{allows several GAMLSS object to be compared using a GAIC}
2746
\item{k}{the penalty with default \code{k=2.5}}
2847
\item{c}{whether the corrected AIC, i.e. AICc, should be used, note that it applies only when \code{k=2}}
2948
\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+
3057
}
3158
3259
\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.
3765
}
3866
\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+
3971
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion),
4072
\emph{Appl. Statist.}, \bold{54}, part 3, pp 507-554.
4173

4274

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+
4378
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/}.
4580

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.
4783

48-
(see also \url{http://www.gamlss.org/}).
84+
(see also \url{https://www.gamlss.com/}).
4985
}
50-
\author{Mikis Stasinopoulos \email{mikis.stasinopoulos@gamlss.org} }
86+
\author{Mikis Stasinopoulos \email{d.stasinopoulos@londonmet.ac.uk} }
5187

5288
\seealso{ \code{\link{gamlss}} }
5389
\examples{
5490
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)}
62106
}
63107

64108
\keyword{regression}%

0 commit comments

Comments
 (0)
Please sign in to comment.