Learn R Programming

BETS (version 0.4.9)

corrgram: Plot the ACF or the PACF of a time series

Description

Plot correlograms using plot.ly and several other options that differ theses plots from forecasts ACF and PACF.

Usage

corrgram(ts, lag.max = 12, type = "correlation", mode = "simple",
  ci = 0.95, style = "plotly", knit = F)

Arguments

ts

An object of type ts or xts. The time series for which the plot must be constructed.

lag.max

A numeric value. The number of lags to be shown in the plot.

type

A character. Can be either 'correlation' (for the ACF) or 'partial' (for the PACF).

mode

A character. Set this parameter to 'bartlett' if you want the variance to be calculated according to Bartlett's formula. Otherwise, it is going to be simply equal to 1/sqrt(N).

ci

A numeric value. The confidence interval to be shown in the plot.

style

A character. Set this parameter to 'normal' if you want it made with ggplot2 or to 'plotly' if you want to be a plotly object.

knit

A boolean. If you're using this function to exhibit correlograms on a R dynamic report, set this parameter to true.

Value

A plot and a vector containing the correlations.