Skip to contents

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

Georgi N. Boshnakov

See also

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]
#>             [,1]       [,2]       [,3]
#>  [1,] 0.07080708 0.08050247 0.08238189
#>  [2,] 0.06684956 0.06879987 0.07822042
#>  [3,] 0.07282971 0.06977560 0.07181128
#>  [4,] 0.13251199 0.09823854 0.09411891
#>  [5,] 0.05316391 0.08393364 0.06222469
#>  [6,] 0.03112889 0.04068088 0.06422578
#>  [7,] 0.04293554 0.03655866 0.04777678
#>  [8,] 0.04014200 0.04151528 0.03534934
#>  [9,] 0.04792497 0.04386119 0.04536171
#> [10,] 0.07893476 0.06150566 0.05629031
#> [11,] 0.09584884 0.08698164 0.06777576
#> [12,] 0.09152542 0.09366219 0.08499728

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