fitted_devianceIncr: Plotting the deviance increment of GAMLSS

fitted_devianceIncrR Documentation

Plotting the deviance increment of GAMLSS

Description

There are two plotting function here:

i) fitted_devianceIncr() plots the fitted model deviance components. This is useful for identifying observations with unusual y-values (given the current fitted distribution).

iii) model_devianceIncr_diff plots the difference of deviance increments from two fitted GAMLSS model. This function is useful if the GAIC and the residuals contradict each other. For example the GAIC is better for model 1 but the residuals look lot better for model 2. This can happens if the two distributions are better suited to fit different parts of the response distribution i.e. one model fits the center better but the other fits the tail better.

Usage


fitted_devianceIncr(obj, plot = TRUE, title, quan.val = 0.99,
         annotate = TRUE, line.col = "steelblue4", 
         point.col = "darkblue", annot.col = "white",
         newdata = NULL)
         

model_devianceIncr_diff(model1, model2, against = "index", 
         tol = 20, data, newdata)

Arguments

obj

a GAMLSS fitted object

plot

whether to create just the plot or save also the values with high deviance increment

title

a tittle if needed it.

quan.val

The quantile values of the deviance increment from which the obsrevrvarion should be identify

annotate

whether to plot the quantile values above in the plot.

line.col

the colour of the line

point.col

the colour of the points

annot.col

the colour of the annotation for the deviance increment plot

model1

The first fitted GAMLSS model

model2

The second fitted GAMLSS model

against

you can plot the deviance increment an index, the response or an x-variable

tol

if the absolute value of deviance increment exceeds the tol the number of the observation is plotted

data

The data if can not be found from model1

newdata

evaluates the function in new data

Details

The functions are diagnostic tools to check unusual observations in the response.

Value

return a plot

Author(s)

Mikis Stasinopulos, Rober Rigby and Fernanda de Bastiani

References

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/).

See Also

gamlss

Examples

m1 <- gamlss(R~pb(Fl)+pb(A)+H+loc, data=rent, family=GA )
m2 <- gamlss(R~pb(Fl)+pb(A)+H+loc, data=rent, family=NO )
fitted_devianceIncr(m1)
model_devianceIncr_diff(m1,m2, against="Fl")

gamlss.ggplots documentation built on May 29, 2024, 1:34 a.m.