permean2intercept: Convert between periodic centering and intercepts

View source: R/PeriodicCalc.R

permean2interceptR Documentation

Convert between periodic centering and intercepts

Description

Convert a periodic mean to periodic intercept and vice versa.

Usage

permean2intercept(mean, coef, order, nseasons = nrow(coef))

intercept2permean(intercept, coef, order, nseasons = nrow(coef))

Arguments

mean

periodic mean, numeric.

coef

PAR coefficients, matrix.

order

PAR order, vector of positive integers.

nseasons

number of seasons, a.k.a. period.

intercept

periodic intercepts, numeric.

Details

A PAR model can be written in mean corrected or intercept form. permean2intercept calculates the intercepts from the means, while intercept2permean does the inverse (means from intercepts).

No check is made for periodic stationarity of the model. Converting from mean corrected to intercept form allways succeeds and in fact the means do not need to be means. In the opposite direction there may be problems due to unit roots and similar features.

Value

a numeric vector

Author(s)

Georgi N. Boshnakov

Examples

mu <- c(1, 2)
pm1 <- PeriodicArModel(matrix(c(0.5, 0.5), nrow = 2), order = rep(1, 2), sigma2 = 1, mean = mu)

cc <- permean2intercept(mu, pm1@ar@coef, c(1,1))
cc
intercept2permean(cc, pm1@ar@coef, c(1,1))

d <- 4
mu <- 1:d
co <- rep(0.5, d)
pm1 <- PeriodicArModel(matrix(co, nrow = d), order = rep(1, d), sigma2 = 1, mean = mu)

cc <- permean2intercept(mu, pm1@ar@coef, order = rep(1, d))
cc
intercept2permean(cc, pm1@ar@coef, order = rep(1, d) )


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