permean2intercept | R Documentation |
Convert a periodic mean to periodic intercept and vice versa.
permean2intercept(mean, coef, order, nseasons = nrow(coef))
intercept2permean(intercept, coef, order, nseasons = nrow(coef))
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. |
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.
a numeric vector
Georgi N. Boshnakov
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) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.