prof.term: Plotting the Profile: deviance or information criterion for...

Description Usage Arguments Details Value Warning Author(s) References See Also Examples

Description

This functions plots the profile deviance for a chosen parameter included in the linear predictor of any of the mu,sigma, nu or tau models so profile confidence intervals can be obtained. In can also be used to plot the profile of a specified information criterion for any hyper-parameter when smooth additive terms are used.

Usage

1
2
3
4
prof.term(model = NULL, criterion = c("GD", "GAIC"), penalty = 2.5, 
          other = NULL, min = NULL, max = NULL, step = NULL, 
          length = 7, xlabel = NULL, plot = TRUE, perc = 95, 
          start.prev = TRUE, col="darkgreen")

Arguments

model

this is a GAMLSS model, e.g.
model=gamlss(y~cs(x,df=this),sigma.fo=~cs(x,df=3),data=abdom), where this indicates the (hyper)parameter to be profiled

criterion

whether global deviance ("GD") or information criterion ("GAIC") is profiled. The default is global deviance criterion="GD"

penalty

The penalty value if information criterion is used in criterion, default penalty=2.5

other

this can be used to evaluate an expression before the actual fitting of the model (Make sure that those expressions are well define in the global environment)

min

the minimum value for the parameter e.g. min=1

max

the maximum value for the parameter e.g. max=20

step

how often to evaluate the global deviance (defines the step length of the grid for the parameter) e.g. step=1

length

if the step is left NULL then length is considered for evaluating the grid for the parameter. It has a default value of 11

xlabel

if a label for the axis is required

plot

whether to plot, plot=TRUE the resulting profile deviance (or GAIC)

perc

what % confidence interval is required

start.prev

whether to start from the previous fitted model parameters values or not (default is TRUE)

col

the color of the profile line

Details

This function can be use to provide likelihood based confidence intervals for a parameter involved in terms in the linear predictor(s). These confidence intervals are more accurate than the ones obtained from the parameters' standard errors. The function can also be used to plot a profile information criterion (with a given penalty) against a hyper-parameter. This can be used to check the uniqueness in hyper-parameter determination using for example find.df.

Value

Return a profile plot (if the argument plot=TRUE) and an ProfLikelihood.gamlss object if saved. The object contains:

values

the values at the grid where the parameter was evaluated

fun

the function which approximates the points using splines

min

the minimum values in the grid

max

the maximum values in the grid

max.value

the value of the parameter maximising the Profile deviance (or GAIC)

CI

the profile confidence interval (if global deviance is used)

criterion

which criterion was used

Warning

A dense grid (i.e. small step) evaluation of the global deviance can take a long time, so start with a sparse grid (i.e. large step) and decrease gradually the step length for more accuracy.

Author(s)

Mikis Stasinopoulos d.stasinopoulos@londonmet.ac.uk and Bob Rigby

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.

(see also https://www.gamlss.com/).

See Also

gamlss, prof.dev

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(aids)
# fitting a linear model
gamlss(y~x+qrt,family=NBI,data=aids)
# testing the linear beta parameter
mod<-quote(gamlss(y ~ offset(this * x) + qrt, data = aids, family = NBI))
prof.term(mod, min=0.06, max=0.11)
# find the hyper parameter using cubic splines smoothing
mod1<-quote(gamlss(y ~ cs(x,df=this) + qrt, data = aids, family = NBI))
prof.term(mod1, min=1, max=15, step=1, criterion="GAIC", penalty=log(45))
# find a break point in x
mod2 <- quote(gamlss(y ~ x+I((x>this)*(x-this))+qrt,family=NBI,data=aids))
prof.term(mod2, min=1, max=45, step=1, criterion="GD")
rm(mod,mod1,mod2)

Example output

Loading required package: splines
Loading required package: gamlss.data

Attaching package: 'gamlss.data'

The following object is masked from 'package:datasets':

    sleep

Loading required package: gamlss.dist
Loading required package: MASS
Loading required package: nlme
Loading required package: parallel
 **********   GAMLSS Version 5.1-3  ********** 
For more on GAMLSS look at http://www.gamlss.org/
Type gamlssNews() to see new features/changes/bug fixes.

GAMLSS-RS iteration 1: Global Deviance = 492.7119 
GAMLSS-RS iteration 2: Global Deviance = 492.6375 
GAMLSS-RS iteration 3: Global Deviance = 492.6373 

Family:  c("NBI", "Negative Binomial type I") 
Fitting method: RS() 

Call:  gamlss(formula = y ~ x + qrt, family = NBI, data = aids) 

Mu Coefficients:
(Intercept)            x         qrt2         qrt3         qrt4  
    2.88546      0.08743     -0.12038      0.11175     -0.07554  
Sigma Coefficients:
(Intercept)  
     -1.603  

 Degrees of Freedom for the fit: 6 Residual Deg. of Freedom   39 
Global Deviance:     492.637 
            AIC:     504.637 
            SBC:     515.477 
GAMLSS-RS iteration 1: Global Deviance = 508.1867 
GAMLSS-RS iteration 2: Global Deviance = 508.1845 
GAMLSS-RS iteration 3: Global Deviance = 508.1845 
GAMLSS-RS iteration 1: Global Deviance = 500.8052 
GAMLSS-RS iteration 2: Global Deviance = 500.8046 
GAMLSS-RS iteration 1: Global Deviance = 495.352 
GAMLSS-RS iteration 2: Global Deviance = 495.3517 
GAMLSS-RS iteration 1: Global Deviance = 492.7741 
GAMLSS-RS iteration 2: Global Deviance = 492.7741 
GAMLSS-RS iteration 1: Global Deviance = 493.4323 
GAMLSS-RS iteration 2: Global Deviance = 493.4321 
GAMLSS-RS iteration 1: Global Deviance = 496.919 
GAMLSS-RS iteration 2: Global Deviance = 496.9187 
GAMLSS-RS iteration 1: Global Deviance = 502.4451 
GAMLSS-RS iteration 2: Global Deviance = 502.4447 
****************************************************************** 
The Maximum Likelihood estimator is  0.08739487 
with a Global Deviance equal to  492.6384 
A  95 % Confidence interval is: ( 0.07458118 , 0.1008422 ) 
****************************************************************** 
GAMLSS-RS iteration 1: Global Deviance = 419.651 
GAMLSS-RS iteration 2: Global Deviance = 423.8293 
GAMLSS-RS iteration 3: Global Deviance = 425.0032 
GAMLSS-RS iteration 4: Global Deviance = 425.0032 
GAMLSS-RS iteration 1: Global Deviance = 388.6841 
GAMLSS-RS iteration 2: Global Deviance = 391.3464 
GAMLSS-RS iteration 3: Global Deviance = 391.3969 
GAMLSS-RS iteration 4: Global Deviance = 391.3964 
GAMLSS-RS iteration 1: Global Deviance = 379.5593 
GAMLSS-RS iteration 2: Global Deviance = 379.8544 
GAMLSS-RS iteration 3: Global Deviance = 379.8779 
GAMLSS-RS iteration 4: Global Deviance = 379.8779 
GAMLSS-RS iteration 1: Global Deviance = 373.89 
GAMLSS-RS iteration 2: Global Deviance = 373.9232 
GAMLSS-RS iteration 3: Global Deviance = 373.9311 
GAMLSS-RS iteration 4: Global Deviance = 373.9313 
GAMLSS-RS iteration 1: Global Deviance = 369.3946 
GAMLSS-RS iteration 2: Global Deviance = 369.4118 
GAMLSS-RS iteration 3: Global Deviance = 369.4167 
GAMLSS-RS iteration 4: Global Deviance = 369.4169 
GAMLSS-RS iteration 1: Global Deviance = 365.4751 
GAMLSS-RS iteration 2: Global Deviance = 365.5071 
GAMLSS-RS iteration 3: Global Deviance = 365.5113 
GAMLSS-RS iteration 4: Global Deviance = 365.5116 
GAMLSS-RS iteration 1: Global Deviance = 362.0692 
GAMLSS-RS iteration 2: Global Deviance = 362.109 
GAMLSS-RS iteration 3: Global Deviance = 362.1121 
GAMLSS-RS iteration 4: Global Deviance = 362.1124 
GAMLSS-RS iteration 1: Global Deviance = 359.1964 
GAMLSS-RS iteration 2: Global Deviance = 359.2321 
GAMLSS-RS iteration 3: Global Deviance = 359.2344 
GAMLSS-RS iteration 4: Global Deviance = 359.2348 
GAMLSS-RS iteration 1: Global Deviance = 356.8284 
GAMLSS-RS iteration 2: Global Deviance = 356.8543 
GAMLSS-RS iteration 3: Global Deviance = 356.8559 
GAMLSS-RS iteration 4: Global Deviance = 356.8563 
GAMLSS-RS iteration 1: Global Deviance = 354.8884 
GAMLSS-RS iteration 2: Global Deviance = 354.9056 
GAMLSS-RS iteration 3: Global Deviance = 354.9066 
GAMLSS-RS iteration 4: Global Deviance = 354.9069 
GAMLSS-RS iteration 1: Global Deviance = 353.2625 
GAMLSS-RS iteration 2: Global Deviance = 353.2737 
GAMLSS-RS iteration 3: Global Deviance = 353.2744 
GAMLSS-RS iteration 1: Global Deviance = 351.8566 
GAMLSS-RS iteration 2: Global Deviance = 351.8638 
GAMLSS-RS iteration 3: Global Deviance = 351.8643 
GAMLSS-RS iteration 1: Global Deviance = 350.5468 
GAMLSS-RS iteration 2: Global Deviance = 350.551 
GAMLSS-RS iteration 3: Global Deviance = 350.5514 
GAMLSS-RS iteration 1: Global Deviance = 349.2648 
GAMLSS-RS iteration 2: Global Deviance = 349.2661 
GAMLSS-RS iteration 3: Global Deviance = 349.2667 
GAMLSS-RS iteration 1: Global Deviance = 347.9362 
GAMLSS-RS iteration 2: Global Deviance = 347.9345 
GAMLSS-RS iteration 3: Global Deviance = 347.9341 
****************************************************************** 
The Mimimum is  5.728306 
with an an GAIC( 3.806662 ) = 411.169 
****************************************************************** 
GAMLSS-RS iteration 1: Global Deviance = 492.7119 
GAMLSS-RS iteration 2: Global Deviance = 492.6375 
GAMLSS-RS iteration 3: Global Deviance = 492.6373 
GAMLSS-RS iteration 1: Global Deviance = 483.1175 
GAMLSS-RS iteration 2: Global Deviance = 483.1128 
GAMLSS-RS iteration 3: Global Deviance = 483.1127 
GAMLSS-RS iteration 1: Global Deviance = 478.249 
GAMLSS-RS iteration 2: Global Deviance = 478.2475 
GAMLSS-RS iteration 3: Global Deviance = 478.2475 
GAMLSS-RS iteration 1: Global Deviance = 474.0472 
GAMLSS-RS iteration 2: Global Deviance = 474.0458 
GAMLSS-RS iteration 3: Global Deviance = 474.0458 
GAMLSS-RS iteration 1: Global Deviance = 469.3261 
GAMLSS-RS iteration 2: Global Deviance = 469.3245 
GAMLSS-RS iteration 3: Global Deviance = 469.3245 
GAMLSS-RS iteration 1: Global Deviance = 463.9904 
GAMLSS-RS iteration 2: Global Deviance = 463.9877 
GAMLSS-RS iteration 3: Global Deviance = 463.9877 
GAMLSS-RS iteration 1: Global Deviance = 457.2532 
GAMLSS-RS iteration 2: Global Deviance = 457.2484 
GAMLSS-RS iteration 3: Global Deviance = 457.2485 
GAMLSS-RS iteration 1: Global Deviance = 450.9158 
GAMLSS-RS iteration 2: Global Deviance = 450.9101 
GAMLSS-RS iteration 3: Global Deviance = 450.9102 
GAMLSS-RS iteration 1: Global Deviance = 445.2548 
GAMLSS-RS iteration 2: Global Deviance = 445.2514 
GAMLSS-RS iteration 3: Global Deviance = 445.2515 
GAMLSS-RS iteration 1: Global Deviance = 439.8398 
GAMLSS-RS iteration 2: Global Deviance = 439.8355 
GAMLSS-RS iteration 3: Global Deviance = 439.8354 
GAMLSS-RS iteration 1: Global Deviance = 434.1987 
GAMLSS-RS iteration 2: Global Deviance = 434.1951 
GAMLSS-RS iteration 3: Global Deviance = 434.1951 
GAMLSS-RS iteration 1: Global Deviance = 427.9561 
GAMLSS-RS iteration 2: Global Deviance = 427.9518 
GAMLSS-RS iteration 3: Global Deviance = 427.9517 
GAMLSS-RS iteration 1: Global Deviance = 421.3125 
GAMLSS-RS iteration 2: Global Deviance = 421.3074 
GAMLSS-RS iteration 3: Global Deviance = 421.3074 
GAMLSS-RS iteration 1: Global Deviance = 412.7375 
GAMLSS-RS iteration 2: Global Deviance = 412.7268 
GAMLSS-RS iteration 3: Global Deviance = 412.7268 
GAMLSS-RS iteration 1: Global Deviance = 402.9311 
GAMLSS-RS iteration 2: Global Deviance = 402.9131 
GAMLSS-RS iteration 3: Global Deviance = 402.9129 
GAMLSS-RS iteration 1: Global Deviance = 392.778 
GAMLSS-RS iteration 2: Global Deviance = 392.7554 
GAMLSS-RS iteration 3: Global Deviance = 392.7553 
GAMLSS-RS iteration 1: Global Deviance = 382.8674 
GAMLSS-RS iteration 2: Global Deviance = 382.848 
GAMLSS-RS iteration 3: Global Deviance = 382.848 
GAMLSS-RS iteration 1: Global Deviance = 377.8746 
GAMLSS-RS iteration 2: Global Deviance = 377.8707 
GAMLSS-RS iteration 3: Global Deviance = 377.8706 
GAMLSS-RS iteration 1: Global Deviance = 378.9361 
GAMLSS-RS iteration 2: Global Deviance = 378.936 
GAMLSS-RS iteration 1: Global Deviance = 385.9809 
GAMLSS-RS iteration 2: Global Deviance = 385.9718 
GAMLSS-RS iteration 3: Global Deviance = 385.9718 
GAMLSS-RS iteration 1: Global Deviance = 394.6293 
GAMLSS-RS iteration 2: Global Deviance = 394.6019 
GAMLSS-RS iteration 3: Global Deviance = 394.6017 
GAMLSS-RS iteration 1: Global Deviance = 404.4438 
GAMLSS-RS iteration 2: Global Deviance = 404.3851 
GAMLSS-RS iteration 3: Global Deviance = 404.3848 
GAMLSS-RS iteration 1: Global Deviance = 413.5801 
GAMLSS-RS iteration 2: Global Deviance = 413.514 
GAMLSS-RS iteration 3: Global Deviance = 413.5135 
GAMLSS-RS iteration 1: Global Deviance = 421.1914 
GAMLSS-RS iteration 2: Global Deviance = 421.1412 
GAMLSS-RS iteration 3: Global Deviance = 421.1408 
GAMLSS-RS iteration 1: Global Deviance = 428.116 
GAMLSS-RS iteration 2: Global Deviance = 428.0718 
GAMLSS-RS iteration 3: Global Deviance = 428.0714 
GAMLSS-RS iteration 1: Global Deviance = 434.0359 
GAMLSS-RS iteration 2: Global Deviance = 434.0053 
GAMLSS-RS iteration 3: Global Deviance = 434.005 
GAMLSS-RS iteration 1: Global Deviance = 439.0664 
GAMLSS-RS iteration 2: Global Deviance = 439.0459 
GAMLSS-RS iteration 3: Global Deviance = 439.0456 
GAMLSS-RS iteration 1: Global Deviance = 443.8416 
GAMLSS-RS iteration 2: Global Deviance = 443.8229 
GAMLSS-RS iteration 3: Global Deviance = 443.8228 
GAMLSS-RS iteration 1: Global Deviance = 447.5496 
GAMLSS-RS iteration 2: Global Deviance = 447.5401 
GAMLSS-RS iteration 3: Global Deviance = 447.54 
GAMLSS-RS iteration 1: Global Deviance = 451.4804 
GAMLSS-RS iteration 2: Global Deviance = 451.4696 
GAMLSS-RS iteration 3: Global Deviance = 451.4695 
GAMLSS-RS iteration 1: Global Deviance = 455.4097 
GAMLSS-RS iteration 2: Global Deviance = 455.3994 
GAMLSS-RS iteration 3: Global Deviance = 455.3994 
GAMLSS-RS iteration 1: Global Deviance = 459.2939 
GAMLSS-RS iteration 2: Global Deviance = 459.2846 
GAMLSS-RS iteration 3: Global Deviance = 459.2845 
GAMLSS-RS iteration 1: Global Deviance = 462.9457 
GAMLSS-RS iteration 2: Global Deviance = 462.9385 
GAMLSS-RS iteration 3: Global Deviance = 462.9384 
GAMLSS-RS iteration 1: Global Deviance = 466.451 
GAMLSS-RS iteration 2: Global Deviance = 466.4452 
GAMLSS-RS iteration 3: Global Deviance = 466.4452 
GAMLSS-RS iteration 1: Global Deviance = 469.7953 
GAMLSS-RS iteration 2: Global Deviance = 469.7907 
GAMLSS-RS iteration 3: Global Deviance = 469.7907 
GAMLSS-RS iteration 1: Global Deviance = 472.6051 
GAMLSS-RS iteration 2: Global Deviance = 472.6025 
GAMLSS-RS iteration 3: Global Deviance = 472.6025 
GAMLSS-RS iteration 1: Global Deviance = 475.4832 
GAMLSS-RS iteration 2: Global Deviance = 475.4808 
GAMLSS-RS iteration 3: Global Deviance = 475.4807 
GAMLSS-RS iteration 1: Global Deviance = 477.9931 
GAMLSS-RS iteration 2: Global Deviance = 477.9915 
GAMLSS-RS iteration 3: Global Deviance = 477.9915 
GAMLSS-RS iteration 1: Global Deviance = 480.5113 
GAMLSS-RS iteration 2: Global Deviance = 480.51 
GAMLSS-RS iteration 3: Global Deviance = 480.51 
GAMLSS-RS iteration 1: Global Deviance = 482.8512 
GAMLSS-RS iteration 2: Global Deviance = 482.8503 
GAMLSS-RS iteration 1: Global Deviance = 485.0938 
GAMLSS-RS iteration 2: Global Deviance = 485.093 
GAMLSS-RS iteration 1: Global Deviance = 487.2029 
GAMLSS-RS iteration 2: Global Deviance = 487.2023 
GAMLSS-RS iteration 1: Global Deviance = 489.2268 
GAMLSS-RS iteration 2: Global Deviance = 489.2263 
GAMLSS-RS iteration 1: Global Deviance = 490.8663 
GAMLSS-RS iteration 2: Global Deviance = 490.866 
GAMLSS-RS iteration 1: Global Deviance = 492.6376 
GAMLSS-RS iteration 2: Global Deviance = 492.6373 
****************************************************************** 
The Maximum Likelihood estimator is  18.3469 
with a Global Deviance equal to  377.5065 
A  95 % Confidence interval is: ( 17.2034 , 19.41171 ) 
****************************************************************** 

gamlss documentation built on March 31, 2021, 5:10 p.m.