Learn R Programming

SDD (version 1.0)

ADF: Serial Dependence Diagrams

Description

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

Usage

ADF(x, dtype = c("ADF", "CADF", "RPADF", "DeltaADF", "ACF"), lag.max, alpha = 0.05, 
    num.clas, alphaRP = 0.5, B = 99, bandwidth, delta = "Delta_1", fres = ".Perm", 
    fdenest = ".denest", fdiv, argacf, plot = TRUE, ...)

## S3 method for class 'SDD':
print(x, digits=3, \dots)

Arguments

x
an "ADF" object (not ADF) 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)
  • "CADF"
  • "RPADF"
  • "DeltaADF"
  • "ACF"
lag.max
maximum lag at which to calculate the ADF. Default is 10*log10(n) where n is the number of observations.
alpha
significance level of the tests of lag-independence (related to each bar). Default value is 0.05.
alphaRP
when dtype="RPADF", it sets the significance level of the confidence intervals to evaluate the stability of the test-results. Default value is 0.5.
num.clas
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 thumb described in Bagnato L, Punzo A, Nicolis O (2012).
B
when dtype="DeltaADF", it sets the number of permutations used. Default value is 99 (see Bagnato L, De Capitani L, Punzo A, 2013b).
bandwidth
when dtype="DeltaADF", it sets the bandwidth used. Default value is computed with likelihood cross-validation (see Bagnato L, De Capitani L, Punzo A, 2013b).
delta
a character vector; when dtype="DeltaADF", it specifies the type of divergence measure used (see Bagnato L, De Capitani L, Punzo A, 2013c); 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 function(x,B) specifying the resampling method from the raw series, where x is a time series and B
    fdenest
    an optional character string which specifies when dtype="DeltaADF", the name of the external function function(x,m,ngrid,bandwidth) to use to make univariate and bivariate density estimations where x is the time s
    fdiv
    an optional character string which specifies, when dtype="DeltaADF" and delta="Delta_fdiv" , the name of the external function function(fi,gi,ngi) to use to compute divergence, its arguments are defined as in f
    plot
    if TRUE (default), the specified ADF is displayed.
    argacf
    when dtype="ACF", it is a list with optional arguments for function acf().
    ...
    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}
      • pstartransformed p-values associated to the the bars of the diagram. Ifdtype="DeltaADF"transformed p-values arevbar
      • nvector, of lengthlag.max, containing the effective number of pairs considered for each lag
      • crit.valvector, of length lag.max, with the critical values
      • xminvector, of lengthlag.max, containing the noncentrality parameters for each bar of the RP-ADF
      • lower (upper)
      {a numeric vector; when dtype="RPADF", it contains the lower (upper) bounds (for all bars) of the confidence intervals for the RP-tests at level alphaRP }

    item

    • dtype
    • delta
    • num.clas
    • alpha
    • alphaRP
    • df
    • bandwidth
    • series

    code

    x

    Details

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

    References

    Bagnato L, Punzo A, Nicolis O (2012). The autodependogram: a graphical device to investigate serial dependences. Journal of Time Series Analysis, 33(2), 233-254. Bagnato L, De Capitani L, Punzo A (2013a). Detecting Serial Dependencies with the Reproducibility Probability Autodependogram. Advances in Statistical Analysis. doi: 10.1007/s10182-013-0208-y. 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, 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, 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