The function fitted_terms()
is doing what the function term.plot()
is doing for GAMLSS models but it uses ggplot2
package.
The function pe_terms()
is synonymous to fitted_terms()
in the package gamlss.
fitted_terms(object,
what = c("mu", "sigma", "nu", "tau"),
parameter = NULL, data = NULL, terms = NULL,
envir = environment(formula(object)),
partial = FALSE, rug = FALSE, rug.sides = "b",
rug.col = "gray", alpha = 0.2,
ylim = c("common", "free"), xlabs = NULL,
ylabs = NULL, main = NULL, term.col = "darkred",
resid.col = "lightblue", resid.alpha = 0.8,
resid.size = 1, nrow = NULL, ncol = NULL,
plots.per.page = 9, one.by.one = FALSE,
surface.gam = FALSE, polys = NULL,
polys.scheme = "topo", col.ribbon = "darksalmon",
col.shaded = "gray", ...)pe_terms(object,
what = c("mu", "sigma", "nu", "tau"),
parameter = NULL, data = NULL, terms = NULL,
envir = environment(formula(object)),
partial = FALSE, rug = FALSE, rug.sides = "b",
rug.col = "gray", alpha = 0.2,
ylim = c("common", "free"), xlabs = NULL,
ylabs = NULL, main = NULL, term.col = "darkred",
resid.col = "lightblue", resid.alpha = 0.8,
resid.size = 1, nrow = NULL, ncol = NULL,
plots.per.page = 9, one.by.one = FALSE,
surface.gam = FALSE, polys = NULL,
polys.scheme = "topo", col.ribbon = "darksalmon",
col.shaded = "gray", ...)
A multiple plot
a gamlss fitted model
which distribution parameters, i.e. "mu"
which distribution parameters (equivalent to what
)
data frame in which variables in object
can be found
which terms to plot (default NULL means all terms); a vector passed to lpred(..., type = "terms", terms =*)
environment in which variables in object
can be found
logical; should partial residuals be plotted?
add rug plots to the axes
which side the rug "b"=bottom
the colour for the rug
the alpha for the shade
there are two options here a) "common" and b) "free". The "common"" option plots all figures with the same ylim range and therefore allows the viewer to check the relative contribution of each terms compate to the rest. In the `free' option the limits are computed for each plot seperatly.
the x label
the y label
title NOT WORKING
the colour of the line for term
the colour of the partial residuals
The alpha for the partial residuals
the size of the partial residuals
the number or rows in a mupliple plot
the number of rows in a mupliple plot
the number of plots per page in multiple plots
whether to plot the terms one by one
whether to use surface plot if a ga() term is fitted
for GRMF models
The polygone information file for MRF models
he colour of the ribbon
he colour of the shaded area
for extra argument
Mikis Stasinopoulos
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/).
term.plot
data(aids)
a <- gamlss(y ~ pb(x) + qrt, data = aids, family = NBI)
fitted_terms(a, pages = 1)
Run the code above in your browser using DataLab