acf_in_white_noise: Compute confidence intervals around an autocorrelation...

View source: R/acf_in_white_noise.R

acf_in_white_noiseR Documentation

Compute confidence intervals around an autocorrelation function (ACF)

Description

This function calculates confidence intervals around an ACF. This represents the upper limit of autocorrelation expected in white noise. This is useful for producing pretty plots.

Usage

acf_in_white_noise(acf, ci = 0.95, return = "upper")

Arguments

acf

An ACF object, produced by acf.

ci

An numeric value between 0 and 1 which defines the confidence interval (CI) to be calculated. The default is 0.95; i.e, a 95 percent CI.

return

A character input specifying "upper" or "CI". If return = "upper", a single number is returned which is the upper 95 percent confidence limit of the extent of autocorrelation in a sample of white noise. If return = "CI" a list comprising CI$fit (0), CI$lowerCI (the lower CI) and CI$upperCI (the upper CI) is returned. This can be plotted by add_error_envelope.

Value

The function returns a number or a list, depending on the input to return (see above).

Author(s)

Edward Lavender

See Also

acf, add_error_envelope


edwardlavender/Tools4ETS documentation built on Nov. 29, 2022, 7:41 a.m.