Learn R Programming

SDD (version 1.1)

ADF: Serial Dependence Diagrams

Description

The function computes (and by default plots) different types of serial dependence diagrams.

Usage

ADF(x, dtype = c("ADF", "CADF", "RPADF", "DeltaADF", "ACF"), 
    lag.max = floor(10 * log10(length(x))), alpha = 0.05, 
    num.clas, B = 99, bandwidth, delta = "Delta_1", fres = ".Perm", 
    fdenest = ".denest", fdiv, argacf, R = 1:lag.max, 
    p.adjust.method =  p.adjust.methods, plot = TRUE,
    ...)
## S3 method for class 'SDD':
print(x, digits=3, \dots)

Arguments

x
an "ADF" object or a univariate numeric time series object or a numeric vector.
dtype
an optional character string. It specifies the type of autodependence function and must be:
  • "ADF"(default; see Bagnato, Punzo, Nicolis, 2012)
  • "CADF"(see Bagnato, Punzo, Nicolis, 2012)
  • "RPADF"
lag.max
maximum lag at which to calculate the ADF. Default is 10*log10(n) where n is the length of the series .
alpha
significance level of the tests of lag-independence (related to each bar). Default value is 0.05.
num.clas
when dtype="ADF" or "CADF" or "RPADF", it sets the number of equifrequency classes for each of the two marginal distributions of the contingency table. If not specified, it is determined internally using a rule of
B
when dtype="DeltaADF", it sets the number of permutations used. Default value is 99 (see Bagnato, De Capitani, Punzo, 2013a,b).
bandwidth
when dtype="DeltaADF", it sets the bandwidth used for the Gaussian kernel density estimator. Default value is computed with likelihood cross-validation (see Bagnato, De Capitani, Punzo, 2013a,b).
delta
a character vector; when dtype="DeltaADF", it specifies the type of divergence measure used (see Bagnato, De Capitani, Punzo, 2013b); for each element in delta a different plot is produced. Possible values are:
fres
an optional character string which specifies, when dtype="DeltaADF", the name of the external function(x,B) specifying the resampling method from the raw series, where x is a time series and B the number
fdenest
an optional character string which specifies when dtype="DeltaADF", the name of the external function(x,m,ngrid,bandwidth) to use for univariate and bivariate density estimation, where x is the time series, m
fdiv
an optional character string which specifies, when dtype="DeltaADF" and delta="Delta_fdiv" , the name of the external function(fi,gi,ngi) to use to compute divergence; its arguments are defined as in fdenest
plot
if TRUE (default), the specified ADF is displayed.
argacf
when dtype="ACF", it is a list with optional arguments for function acf().
R
a vector. It specifies the lags on which to test for simultaneous independence (see Bagnato, Punzo, 2010, 2012 and Bagnato, De Capitani, Punzo, 2013b). Default value is 1:lag.max
p.adjust.method
a character string. It specifies the method to be used in the simultaneous independence test. It must be one of p.adjust.methods.
...
optional arguments to be passed to the plot.SDD method, such as graphical parameters.
digits
minimal number of significant digits.

Value

  • Returned from this function is a SDD object which is a list with the following components:
  • resa data frame. According to dtype, it may contain:
    • lag, {a numeric vector containing the lags at which the bars of the diagrams are computed}
    • vbar, {height of the bars of the diagram}
    • pvalue, {p-values associated to the bars of the diagram}
    • pstar, transformed p-values associated to the bars of the diagram. Ifdtype="DeltaADF"transformed p-values arevbar
    • n, vector of lengthlag.max, containing the effective number of pairs considered for each lag
    • crit.val, vector, of length lag.max, with the critical values
    • xminvector of lengthlag.max, containing the non-centrality parameters for each bar of the RP-ADF
  • dtypea character string. It specifies the type of serial dependence diagram generated.
  • deltaa character string. It specifies, when type="DeltaADF", the type divergence measure used.
  • num.clasa scalar. It is the number of classes in each contingency table.
  • alphaa scalar. It specifies the significance level of the tests of lag independence (related to each bar).
  • dfa scalar. It contains the degrees of freedom of the reference chi-square distribution used when dtype is one of: "ADF", "RPADF", or "CADF".
  • bandwidtha scalar. It is the bandwidth used in kernel density estimation.
  • seriesthe name of the series x.
  • Ra vector. It specifies the lags to test in the simultaneous independence tests.
  • p.adjust.methoda character string. It specifies the method to be used in the simultaneous independence tests. It must be one of p.adjust.methods.
  • p.adjusta vector. It contains the adjusted probabilities for the simultaneous independence tests.

Details

There are print and data.frame methods for objects of class "ADF".

References

Bagnato L, De Capitani L, Punzo A (2013a). Improving the autodependogram using the Kulback-Leibler divergence. Communications in Statistics - Simulation and Computation. (Submitted). Bagnato L, De Capitani L, Punzo A (2013b). Testing Serial Independence via Density-Based Measures of Divergence. Methodology and Computing in Applied Probability. doi:10.1007/s11009-013-9320-4. Bagnato L, De Capitani L, Punzo A (2014). Detecting Serial Dependencies with the Reproducibility Probability Autodependogram. Advances in Statistical Analysis, 98(1), 35-61. Bagnato L, Punzo A (2010). On the Use of $\chi^2$ Test to Check Serial Independence. Statistica & Applicazioni, VIII(1), 57-74. Bagnato L, Punzo A (2012). Checking Serial Independence of Residuals from a Nonlinear Model. In W Gaul, A Geyer-Shulz, L Schmidt-Thieme, J Kunze (eds.), Challenges at the Interface of Data Analysis, Computer Science, and Optimization, volume XIV of Studies in Classification, Data Analysis and Knowledge Organization, pp. 203-211. Springer-Verlag, Berlin Heidelberg. Bagnato L, Punzo A, Nicolis O (2012). The autodependogram: a graphical device to investigate serial dependencies. Journal of Time Series Analysis, 33(2), 233-254. Bagnato L, Punzo A (2013). Using the Autodependogram in Model Diagnostic Checking. In N Torelli, F Pesarin, A Bar-Hen (eds.), Advances in Theoretical and Applied Statistics, volume XIX of Studies in Theoretical and Applied Statistics, pp. 129-139. Springer-Verlag, Berlin Heidelberg.

See Also

SDD-package, plot.SDD, SMI, acf

Examples

Run this code
# Dependence Diagrams on raw data

data("SMI")
ADF(SMI^2, dtype="ACF", main="")
ADF(SMI, main="") 
ADF(SMI, dtype="RPADF", main="")

# Dependence Diagrams on residuals from a fitted model

library("tseries")
residuals <- garch(SMI, order=c(1,1))$residuals[-1]
ADF(residuals^2, dtype="ACF", main="")
ADF(residuals, dtype="RPADF", main="")

Run the code above in your browser using DataLab