R/acf.custom.R

Defines functions mutual.custom pacf.custom acf.custom

acf.custom <- function(..., main, ylim) {
  obj <- acf(..., plot=FALSE)
  obj$acf <- obj$acf[-1,,,drop=FALSE]
  obj$lag <- obj$lag[-1,,,drop=FALSE]
  plot(obj, main=main, ylim=ylim)
}

#' @export
pacf.custom <- function(..., main, ylim) {
  obj <- pacf(..., plot=FALSE)
  obj$acf <- obj$acf[-1,,,drop=FALSE]
  obj$lag <- obj$lag[-1,,,drop=FALSE]
  plot(obj, main=main, ylim=ylim)
}

mutual.custom <- function(..., main, ylim) {
  mi <- mutual(..., plot=FALSE)[-1]
  plot(1:length(mi), mi, type = "h", xlab = "lag", ylab = "AMI",
         main = main, ylim=ylim)
  abline(h = 0)
}

Try the tsDyn package in your browser

Any scripts or data that you put into this service are public.

tsDyn documentation built on Oct. 31, 2024, 5:08 p.m.