Learn R Programming

gamlss.util (version 4.3-4)

centiles.ts: Plots the centile curves for a time series GAMLSS object

Description

This function centiles.ts() plots centiles curves for time series response variables who's distributions belong to the GAMLSS family of distributions. The function also tabulates the sample percentages below each centile curve (for comparison with the model percentages given by the argument cent.)

Usage

centiles.ts(obj, xvar = NULL, cent = c(0.5, 2.5, 50, 95.5, 99.5), legend = TRUE, ylab = "y", xlab = "x", main = NULL, main.gsub = "@", xleg = min(xvar), yleg = max(obj$y), xlim = range(xvar), ylim = range(obj$y), save = FALSE, plot = TRUE, type = "l", points = TRUE, pch = "+", col = "blue", col.centiles = 1:length(cent) + 2, lty.centiles = 1, lwd.centiles = 1, ...)

Arguments

obj
a fitted gamlss object which has a time series response variable
xvar
the time of the time series
cent
a vector with elements the % centile values for which the centile curves have to be evaluated
legend
whether a legend is required in the plot or not, the default is legent=TRUE
ylab
the y-variable label
xlab
the x-variable label
main
the main title here as character. If NULL the default title "centile curves using NO" (or the relevant distributions name) is shown
main.gsub
if the main.gsub (with default "@") appears in the main title then it is substituted with the default title.
xleg
position of the legend in the x-axis
yleg
position of the legend in the y-axis
xlim
the limits of the x-axis
ylim
the limits of the y-axis
save
whether to save the sample percentages or not with default equal to FALSE. In this case the sample percentages are printed but are not saved
plot
whether to plot the centiles. This option is useful for centile.split
type
type of line
pch
the character to be used as the default in plotting points see par
col
plotting colour see par
col.centiles
Plotting colours for the centile curves
lty.centiles
line type for the centile curves
lwd.centiles
The line width for the centile curves
points
whether the data points should be plotted, default is TRUE for centiles() and FALSE for centiles.fan()
...
for extra arguments

Value

A centile plot is produced and the sample centiles below each centile curve are printed (or saved)

Details

Centiles are calculated using the fitted values in obj and xvar must correspond exactly to the time of the response time series object

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.

Stasinopoulos D. M., Rigby R.A. and Akantziliotou C. (2006) Instructions on how to use the GAMLSS package in R. Accompanying documentation in the current GAMLSS help files, (see also http://www.gamlss.org/).

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, http://www.jstatsoft.org/v23/i07.

See Also

centiles

Examples

Run this code

## Not run: 
# library(gamlss.add)
# dax <- EuStockMarkets[,"DAX"]
# # returs
# rdax <- diff(dax,1)
#   w1 <- wlag(rdax,30)
# # garch type 
# f1<- gamlss(rdax~ la(rdax, lags=30, from.lag=1), sigma.fo=~la(rdax^2, 
#             lags=30, from.lag=1), weights=w1, bf.cyc=10, family=TF)
# tiR <- as.numeric(time(rdax))
# centiles.ts(f1, xvar=tiR, cent=c(2.5,50,97.5), col.cent="black")
# ## End(Not run)

Run the code above in your browser using DataLab