acf_by_block: Block-wise autocorrelation function

View source: R/acf_by_block.R

acf_by_blockR Documentation

Block-wise autocorrelation function

Description

This original version of this function was written by Stacy DeRuiter. It computes the ACF of a vector passed as input, ignoring time lags that overlap blocks (i.e., time series).

Usage

acf_by_block(x, blocks, lag_max = NULL, make_plot = TRUE, ...)

Arguments

x

Numeric vector

blocks

Vector of indices of blocks, of same length as x

lag_max

Maximum lag at which to calculate the ACF. Defaults to the length of the shortest block.

make_plot

Logical: should the ACF be plotted? Defaults to TRUE.

Value

Vector of ACF at each time lag


TheoMichelot/utilTM documentation built on April 14, 2025, 12:52 p.m.