pcts-package {pcts}R Documentation

Periodically Correlated and Periodically Integrated Time Series

Description

Classes and methods for modelling and simulation of periodically correlated (PC) and periodically integrated time series. Compute theoretical periodic autocovariances and related properties of PC autoregressive moving average models. Some original methods including Boshnakov & Iqelan (2009) <doi:10.1111/j.1467-9892.2009.00617.x>, Boshnakov (1996) <doi:10.1111/j.1467-9892.1996.tb00281.x>.

Details

The underlying assumption is that the observations are made at regular intervals, such as quarter, month, week, day — or represent data for such intervals — and these intervals are nested into larger periods. In pcts we call the larger period a cycle and its parts seasons. Typical examples of season-cycle timing are months in a year, quarters in a year, days in a week (or business week). The number of seasons in a cycle is called frequency in class "ts" in base R.

Cycles in pcts keep not only the number of seasons (frequency) but other information, such as the names of the seasons and units of seasons. In pcts there are a number of builtin cycle classes for typical cases, as well as provision for creation of custom cycles on the fly. See pcCycle and BuiltinCycle for ways to create cycle objects, and allSeasons for further examples.

Periodic time series can be created with pcts, which accepts as input vectors, matrices and time series objects from base R and some other packages, including zoo and xts. When importing data, the time information is taken from the data and an attempt is made to guess the periodicity from the frequency (for time series objects that have it set) and an analysis of the datetime stamps, if present. pcts also has arguments for specifying the number of seasons or the cycle, as well as the start datetime.

The main periodic time series classes in pcts are PeriodicTS and PeriodicMTS, for univariate and multivariate time series, respectively. Standard base-R time series functions can be used with them directly, see for example window, frequency, cycle, time, deltat, start, end, boxplot, monthplot, na.trim (na.trim is from package zoo).

Methods for plot, summary, print, show, head, tail, and other base-R functions are defined where suitable. Examples can be found in section Examples and in help pages for the corresponding functions, classes and methods.

The naming conventions are as follows. Names of classes generally consists of one or more words. The first letter of each word, is capitalised. Only the first letter of abbreviations for models, such as ARMA, is capitalised. Similarly for generic functions but for them the first word is not capitalised. In a few names PM stands for 'periodic model' and TS for 'time series'.

Significant portion of the code was written in 2005–2007. Many of the functions and classes have been renamed under the above conventions and most of those that are not are not exported but a few still are and they should be considered subject to change.

autocovariances, autocorrelations, partialAutocorrelations and others are one-stop generic functions for computation of properties of time series and models. What to compute is deduced from the type of the object. For models they compute theoretical quantities — periodic or non-periodic, scalar or multivariate. For time series they compute the corresponding sample counterparts.

Author(s)

Georgi N. Boshnakov [aut, cre]

Maintainer: Georgi N. Boshnakov <georgi.boshnakov@manchester.ac.uk>

References

Boshnakov GN (1994). “Periodically Correlated Sequences: Some Properties and Recursions.” Research Report 1, Division of Quality Technology and Statistics, Luleo University, Sweden.

Boshnakov GN (1996). “The asymptotic covariance matrix of the multivariate serial correlations.” Stochastic Process. Appl., 65(2), 251–258. ISSN 0304-4149, doi:10.1016/S0304-4149(96)00104-4.

Boshnakov GN (1996). “Recursive computation of the parameters of periodic autoregressive moving-average processes.” J. Time Ser. Anal., 17(4), 333–349. ISSN 0143-9782, doi:10.1111/j.1467-9892.1996.tb00281.x.

Boshnakov GN (1997). “Periodically correlated solutions to a class of stochastic difference equations.” In Csiszar I, Michaletzky G (eds.), Stochastic differential and difference equations (Gyor, 1996), volume 23 of Progr. Systems Control Theory, 1–9. Birkhauser Boston, Boston, MA.

Boshnakov GN (2002). “Multi-companion matrices.” Linear Algebra Appl., 354, 53–83. ISSN 0024-3795, doi:10.1016/S0024-3795(01)00475-X.

Boshnakov GN, Boteva A (1992). “An algorithm for the computation of the theoretical autocovariances of a periodic autoregression process.” Varna.

Boshnakov GN, Iqelan BM (2009). “Generation of time series models with given spectral properties.” J. Time Series Anal., 30(3), 349–368. ISSN 0143-9782, doi:10.1111/j.1467-9892.2009.00617.x.

Boshnakov GN, Iqelan BM (2012). “Maximum entropy models for general lag patterns.” Journal of Time Series Analysis, 33(1), 112–120. ISSN 1467-9892, doi:10.1111/j.1467-9892.2011.00744.x.

Boshnakov GN, Lambert-Lacroix S (2009). “Maximum entropy for periodically correlated processes from nonconsecutive autocovariance coefficients.” J. Time Series Anal., 30(5), 467–486. doi:10.1111/j.1467-9892.2009.00619.x.

Boshnakov GN, Lambert-Lacroix S (2011). pcme: Maximum entropy estimation of periodically correlated time series. R package version 0.55, https://personalpages.manchester.ac.uk/staff/georgi.boshnakov/Rpackages/.

Boshnakov GN, Lambert-Lacroix S (2012). “A periodic Levinson-Durbin algorithm for entropy maximization.” Computational Statistics & Data Analysis, 56, 15–24. ISSN 0167-9473, doi:10.1016/j.csda.2011.07.001, https://www.sciencedirect.com/science/article/pii/S0167947311002556.

Boswijk HP, Franses PH (1996). “Unit roots in periodic autoregressions.” Journal of Time Series Analysis, 17(3), 221–245.

Francq C, Roy R, Saidi A (2011). “Asymptotic properties of weighted least squares estimation in weak parma models.” Journal of Time Series Analysis, 32(6), 699–723.

Franses PH (1996). Periodicity and Stochastic Trends In Economic Time Series. Oxford University Press Inc., New York.

Franses PH, Paap R (2004). Periodic Time Series Models. Oxford University Press Inc., New York.

Grolemund G, Wickham H (2011). “Dates and Times Made Easy with lubridate.” Journal of Statistical Software, 40(3), 1–25. doi:10.18637/jss.v040.i03.

Hipel KW, McLeod AI (1994). Time series modelling of water resources and environmental systems, Developments in water science; 45. London; Amsterdam: Elsevier.

Lambert-Lacroix S (2000). “On periodic autoregressive process estimation .” IEEE Transactions on Signal Processing, 48( 6 ), 1800-1803.

Lambert-Lacroix S (2005). “ Extension of autocovariance coefficients sequence for periodically correlated processes.” Journal of Time Series Analysis, 26(3), 423-435.

Lancaster P, Tismenetsky M (1985). The theory of matrices, Second edition. Academic Press, New York.

McLeod AI (1993). “Parsimony, model adequacy and periodic correlation in time series forecasting.” Internat. Statist. Rev., 61(3), 387-393.

McLeod AI (1993). “Parsimony, model adequacy and periodic correlation in time series forecasting.” Internat. Statist. Rev., 61(3), 387-393.

McLeod AI (1994). “Diagnostic checking of periodic autoregression models with application.” Journal of Time Series Analysis, 15(2), 221–233.

McLeod AI (1995). “Diagnostic checking of periodic autoregression models with application.” Journal of Time Series Analysis, 16(6), 647-648. doi:10.1111/j.1467-9892.1995.tb00260.x, This corrects some typos in the eponimous article McLeod (1994).

Pagano M (1978). “On periodic and multiple autoregression.” Ann. Statist., 6, 1310-1317.

See Also

pcts,

fitPM, pclsdf, pclspiar

autocorrelations

dataFranses1996, Fraser2017, four_stocks_since2016_01_01,

mcompanion

Examples

data(dataFranses1996) 
class(dataFranses1996) # [1] "mts"    "ts"     "matrix"

pcfr <- pcts(dataFranses1996)

class(pcfr)        # "PeriodicMTS"
nSeasons(pcfr) # 4
allSeasons(pcfr)
allSeasons(pcfr, abb = TRUE)

## subsetting
## one index, x[i], is analogous to lists
pcfr2to4 <- pcfr[2:4]; class(pcfr2to4) # "PeriodicMTS"
pcfr2to2 <- pcfr[2];   class(pcfr2to2) # "PeriodicMTS"
pcfr2    <- pcfr[[2]]; class(pcfr2)    # note '[[', "PeriodicTS"

## data for 1990 quarter 3
pcfr2to4[as_date("1990-07-01")] # note: not "1990-03-01"!
pct1990_Q3 <- Pctime(c(1990, 3), pcCycle(pcfr2to4))
pcfr2to4[pct1990_Q3]

## with empty index, returns the underlying data
dim(pcfr[]) # [1] 148  19
dim(pcfr2to2[]) # 148 1
length(pcfr2[]) # 148 (this is numeric)

summary(pcfr2)
summary(pcfr2to4)
## make the output width shorter
summary(pcfr2to4, row.names = FALSE)
summary(pcfr2to4, row.names = 5) # trim row names to 5 characters

head(pcfr2to4)  # starts with NA's
tail(pcfr2to4)  # some NA's at the end too

## time of first and last data, may be NA's
start(pcfr2to4) # 1955 Q1
end(pcfr2to4)   # 1991 Q4

## time of first nonNA:
availStart(pcfr2)    # 1955 Q1
availStart(pcfr2to4) # 1955 Q1

## time of last nonNA:
availEnd(pcfr[[2]])   # 1991 Q4
availEnd(pcfr[[3]])   # 1987 Q4
availEnd(pcfr[[4]])   # 1990 Q4
## but at least one of them is  available for 1991 Q4, so:
availEnd(pcfr2to4)   # 1991 Q4

## use window() to pick part of the ts by time:
window(pcfr2to4, start = c(1990, 1), end = c(1991, 4))
## drop NA's at the start and end:
window(pcfr2to4, start = availStart(pcfr2to4), end = availEnd(pcfr2to4))

plot(pcfr2) # the points mark the first season in each cycle
boxplot(pcfr2)
monthplot(pcfr2)

[Package pcts version 0.15.7 Index]