pc_sdfactor: Compute normalising factors

View source: R/acfsums.R

pc_sdfactorR Documentation

Compute normalising factors

Description

Compute a matrix of factors such that elementwise division of the periodic autocovariance matrix by it will give the periodic autocorrelations.

Usage

pc_sdfactor(sd, maxlag)

Arguments

sd

standard deviations of the seasons numeric.

maxlag

maximal lag, a number.

Value

a matrix of coefficients of size period x (maxlag+1). The length of sd is taken to be the period.

Author(s)

Georgi N. Boshnakov

See Also

autocorrelations

Examples

## equivalent to  data(Fraser, package = "pear")
Fraser <- window(Fraser2017, start = c(1912, 3), end = c(1990, 12))

logfraser <- window(pcts(log(Fraser)), start = c(1913, 1))
acvf1 <- autocovariances(logfraser, maxlag = 2)
fac <- pc_sdfactor(sqrt(acvf1[ , 0]), 2)
fac[ , 1:3]

acrf1 <- autocorrelations(logfraser, maxlag = 2)
all.equal(acvf1[], acrf1[] * fac) # TRUE

GeoBosh/pcts documentation built on Dec. 8, 2023, 9:57 p.m.