pacf_vec: Estimate partial autocorrelations of a numeric vector

View source: R/analyze_data.R

pacf_vecR Documentation

Estimate partial autocorrelations of a numeric vector

Description

Estimate the sample partial autocorrelation function of a numeric vector.

Usage

pacf_vec(x, lag_max = 24, ...)

Arguments

x

Numeric vector.

lag_max

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

...

Further arguments passed to stats::pacf().

Details

pacf_vec() is a small wrapper around stats::pacf(). It returns the sample partial autocorrelations as a numeric vector for lags 1 to lag_max.

Value

A numeric vector containing the sample partial autocorrelations for lags 1 to lag_max.

See Also

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

Examples

library(dplyr)

x <- M4_monthly_data |>
  filter(series == first(series)) |>
  pull(value)

pacf_vec(
  x = x,
  lag_max = 12
)

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