Skip to contents

Computes autocorrelation function values and returns them as a tibble. Useful for examining temporal dependence structure in buoy data.

Usage

compute_acf_summary(data, variable = "wave_height", max_lag = 48)

Arguments

data

Data frame with the variable to analyze

variable

Name of the variable (default: "wave_height")

max_lag

Maximum number of lags (default: 48)

Value

A tibble with columns lag and acf.

Examples

set.seed(1)
data <- data.frame(
  time = seq(as.POSIXct("2020-01-01"), by = "hour", length.out = 1000),
  wave_height = 2 + sin(seq(0, 20, length.out = 1000)) + rnorm(1000, 0, 0.3)
)
acf_result <- compute_acf_summary(data)
head(acf_result)
#> # A tibble: 6 × 2
#>     lag   acf
#>   <int> <dbl>
#> 1     1 0.826
#> 2     2 0.827
#> 3     3 0.826
#> 4     4 0.823
#> 5     5 0.830
#> 6     6 0.812