Learn R Programming

gamlss.util (version 4.2-7)

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

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
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")

Run the code above in your browser using DataLab