estimate_pacf: Estimate partial autocorrelations by time series

View source: R/analyze_data.R

estimate_pacfR Documentation

Estimate partial autocorrelations by time series

Description

Estimate the sample partial autocorrelation function for one or more time series in a tibble.

Usage

estimate_pacf(.data, context, lag_max = 24, level = 0.9, ...)

Arguments

.data

A tibble containing the time series data.

context

A named list with the identifiers for series_id, value_id, and index_id.

lag_max

Integer. Maximum lag for which the partial autocorrelation is estimated.

level

Numeric value. Confidence level used to calculate the approximate significance bound.

...

Further arguments passed to stats::pacf().

Details

estimate_pacf() groups the input data by the series identifier supplied in context and estimates the sample partial autocorrelation function for each time series separately.

The output contains one row per series and lag. The column bound contains an approximate significance threshold based on the selected confidence level. The logical column sign indicates whether the absolute partial autocorrelation is larger than this threshold.

Value

A tibble with the series identifier and the columns type, lag, value, bound, and sign.

See Also

Other data analysis: acf_vec(), estimate_acf(), estimate_kurtosis(), estimate_mode(), estimate_skewness(), pacf_vec(), summarise_data(), summarise_split(), summarise_stats()

Examples

library(dplyr)

context <- list(
  series_id = "series",
  value_id = "value",
  index_id = "index"
)

data <- M4_monthly_data |>
  filter(series %in% c("M23100", "M14395"))

estimate_pacf(
  .data = data,
  context = context,
  lag_max = 12
)

tscv documentation built on May 13, 2026, 9:07 a.m.