An Overview on R Packages for Seasonal Analysis of Time Series

Time series analysis consists of approaches for analysing time series data so thatimportant information and other features can be isolated from the data. Time series forecasting is the use of a model to predict perspective values on the basis of previouly observed values by a model. Statisticians generally use R project or R language, a free and popular programming language and computer software environment for statistical computing and graphics, for developing statistical computer software and data analysis. Plenty of time series display cyclic variation significant as seasonality, periodic variation, or periodic fluctuations in statistics. This study introducesabundant functions in the R packages TSA, marls, depersonalize and season for analyzing seasonal processes of time series, are introduced in this study. Note that R packages marls, depersonalize and season are included in the comprehensive R archive network task view TimeSeries.


INTRODUCTION
In statistics, signal processing, econometrics and mathematical finance, a time series is a sequence of data points, measured characteristically at sequential time instants spaced at regalia time intervals (Box et al., 1976;Hamilton, 1994). Methods for analysing time series data are involved in the Time series so as to evacuate valuable statistics and other features from the data (Box et al., 1976;Hamilton, 1994). Time series forecasting uses a model to predict the prospect of values accordingto the past observed values. Time series are often drawn by line graphs (Box et al., 1976;Hamilton, 1994). R project or R language, which is an useful and free programming language and computer software surroundings for statistical computing and graphics, is widely applied to statisticians for inproving statistical computer software and data analysis (Ripley, 2001;Gentleman et al., 2003). Base R ships, which have a lot of functionalities, are helpful for time series, especially in the stats package. Various packages on CRAN with rapidly summarized below follow this.
In statistics, cyclic variation is shown in numerous time series significant as seasonality, periodic variation, or periodic fluctuations. When examing non-seasonal tendencies, seasonal adjustment is used to shedthe seasonal component of a time series. Seasonally adjusted data for unemployment rates always been reported to reveal the basic trends in labor markets (Wallis, 1974;Hillmer and Tiao, 1982). A cycle-stationary process, a signal having statistical properties that vary cyclically with time, can be regarded as multiple interspersed motionless processes (Gardner, 1986;Gardner et al., 2006). Seasonal variation is a part of a time series which is described as the regular and predictable movement around the tendency line in no more than one year (Hylleberg, 1992;Barnett and Dobson, 2010). Organizations affected by seasonal variationneed to identify and measure this seasonality to help with planning for temporary increases or decreases in labor requirements, inventory, training, periodic maintenance and so on (Hylleberg, 1992;Barnett and Dobson, 2010). Besidesthese considerations, the organizations should know that if the variations they have experienced have been more or lessexpected given the regularcyclic variations (Hylleberg, 1992;Barnett and Dobson, 2010). The purpose of this study is to review R packages for seasonal analysis of time series.

R PACKAGES FOR SEASONAL ANALYSIS OF TIME SERIES
Functions in the R packages TSA, marls, depersonalize and season for analyzing seasonal processes of time series, are introduced in this section. Note thatthe comprehensive R archive network task view TimeSeries encloses the R packages marls, depersonalize and season (Hyndman and Zeileis, 2012).

Seasonal analysis with the R package TSA:
The function acf is modified from the acf function in the stats package (Chan, 2012). The function arima is identical to the arimax function which builds on and expands the capability of the arima function in R stats viapermitting the combination of transfer functions and innovative and additiveoutliers (Chan, 2012). Note in the computation of Akanke's Information Criterion (AIC), the number of parameters excludes the noise variance (Cryer and Chan, 2008;Chan, 2012). This function is deeply builted on the arima function of the stats center of R (Chan, 2012). The R function seasonextract the season information from an equally spaced time series and makes vector of the season information (Chan, 2012).

Seasonal analysis of health data:
The Rpackage season is for seasonal analysis of health data, containing regression models, time-stratified casecrossover, plotting functions and residual checks (Barnett et al., 2012). The R package season aims to fill up a sizable gap in the R software by offering numeroustools for analyzing seasonal data (Barnett et al., 2012). The package season includes graphical methods for showing seasonal data and reversion models for checkting and appraisting seasonal patterns (Barnett et al., 2012). The regression models can be used to normal, Poisson or binomial dependent data distributions (Barnett et al., 2012). Tools can be applied to not only time series data (equally spaced intime) but alsosurvey data (unequally spaced in time) (Barnett et al., 2012). Sinusoidal (parametric) seasonal patterns are available incosinor, nscosinor, as well as models for monthly data in monthglm and the case-crossover method to management for seasonality in the R function nonlintestcasecross (Barnett et al., 2012). The R function aaftmakes random linear surrogate data of a time series with the same second-order properties (Barnett et al., 2012). The AAFT uses phasescrambling to create a surrogate of the time series, having a similar spectrum and thenparallel secondorder statistics (Barnett et al., 2012). The AAFT is valuable for checking for non-linearity in a time series and can be used by nonlintest. (Kugiumtzis, 2000;Barnett et al., 2012). The R function case cross suits a time-stratified case-crossover to regularly spaced time series data but not suitable for irregularly spaced discrete data (Barnett et al., 2012). The case-crossover method compares "case" days when events occurred (e.g., deaths) with control days to look for differences in exposure that might explain differences in the number of cases (Barnett et al., 2012). Control days are chosen to be closed to case days, meaning that only recent variations in the independent variables are related (Barnett et al., 2012). Any long-term or seasonal variation in the dependent and independent variables can be eliminated by simply comparing recent values, (Barnett et al., 2012). The definition of nearby and the seasonal and long-term models in the independent variables determine this elimination (Barnett et al., 2012). Control and case days can be contrastedonly when they are in the same stratum (Barnett et al., 2012). The strata length, the default value is 28 days, rules the stratum,hence that cases and controls are compared in four week sections (Barnett et al., 2012). Smaller stratum lengths provide a closer control for season, but then decrease the functional number of controls (Barnett et al., 2012). Control days,closing to the case day, may have comparable levels of the independent variables (Barnett et al., 2012). It is likelytoput an exclusion around the casesto reduce this correlation (Barnett et al., 2012). It is possible to additionally match by day of the week (matchdow) to delete any confounding by day of the week, regardless of the fact that this often reduces the number of available controls (Barnett et al., 2012). This matching is in exclusive of the strata matching (Barnett et al., 2012). To eliminate its effect, it is probable to additionally match case and control days by an influential on-founder (matchconf) (Barnett et al., 2012). The method utilizes conditional logistic regression (see coxph and so the parameter estimates are odds ratios (Barnett et al., 2012). The code presumes that the data frame includes a date variable (in Date format) called date (Janes et al., 2005;Barnett and Dobson, 2010;Barnett et al., 2012). The function ciPhase computes the mean and confidence interval for the phase based on aseries of MCMC samples (Barnett et al., 2012). The evaluation of the phase are rotated to have a centre of n, the point on the circumference of a unitradius circle that is furthest from zero (Barnett et al., 2012). The mean and confidence interval are computed on the rotated values and then the estimates are rotated backward. Fisher (1996), Barnett and Dobson (2010) and Barnett et al. (2012). The function nonlintest realizes a bootstrap test of nonlinearity in a time series, which uses the third-order moment (Barnett et al., 2012). The aaft is used to make linear surrogates with the same second-order properties, but no (third-order) non-linearity (Barnett et al., 2012). The third-order moments (third) of these linear surrogates and the actual series are then comparedfrom lags 0 up to n.lag (excluding the skew at the coordinates (0, 0)) ( Barnett et al., 2012). The bootstrap test applies on the whole area outside the limits and provides an indication of the overall non-linearity (Barnett et al., 2012). The plot using region reveals those co-ordinates of the third order moment that beyonded the null hypothesis limits and can be a valuable clue for guessing the type of non-linearity (Barnett et al., 2012). A non-stationary seasonal pattern changes over time; so this model offers potentially extremly elastic seasonal assessments (Barnett et al., 2012). The cycle controlles thefrequency of the seasonal estimates and ought to be specified in units of time (Barnett et al., 2012). The estimates are made using a forward and backward sweep of the Kalman filter (Barnett et al., 2012). Repeated estimates are made using Markov Chain Monte Carlo (MCMC) (Barnett et al., 2012). For this reason the model can take a long time to run (we will perfect this in the next version) (Barnett et al., 2012). A reasonably longtermmodel should be applied (niters) and the probably inadequate initial estimates should be abandoned (burn in) to give stable estimates. Dobson, 2004, 2010;Barnett et al., 2012). The function phasecalc computes the phase given the estimated sine and cosine values from a cosinor model (Barnett et al., 2012) and returns the phase in radians, in the range (0, 2) (Barnett et al., 2012). The phase is at the top of the sinusoid (Fisher, 1996;Barnett et al., 2012). The function plot Circular applies a circular plot helpful for visualising monthly or weekly data (Barnett et al., 2012). The length of the variable area 1 is determined by the number of segments (Barnett et al., 2012). The plots are also called rose diagrams, with the segments then called 'petals' (Fisher, 1996;Barnett et al., 2012). The function plot Month plots results by month (Barnett and Dobson, 2010;Barnett et al., 2012). For modelling seasonal data, sinusoidal curves are highly prized (Barnett et al., 2012). The function sinusoid plots a sinusoid from 0 to 2 (Barnett et al., 2012). West for a seasonal pattern in Binomial data, a test of whether monthly data has a sinusoidal seasonal pattern, has little influence compared with the cosinor test. Walter and Elwood (1975), Barnett and Dobson (2010) and Barnett et al. (2012). The function nscosinor will be made faster and the plots are to be improved in the next version, (Barnett et al., 2012).
The function decomposes. Ar1 extracts AR (1) process residuals from time series (Paramonov, 2012). The function decompose. mar1s extracts MAR(1)S process components from time series (Paramonov, 2012). The function sim.mar1s simulates from MAR(1)S process (Paramonov, 2012). The function predict.mar1s is a wrapper around the functionsim.mar1s which estimates confidence intervals for the future values of the MAR(1)S process (Paramonov, 2012). The function seasonal.ave extracts seasonal component of time series by averaging observations on the same place in the cycle (Paramonov, 2012). The function seasonal. smooth extracts seasonal component of time series by fitting the data with a linear combination of smooth periodic functions (Paramonov, 2012).
Optimal depersonalization for geophysical time series using AR fitting: A harmonic regression is fit to the data to estimate the seasonal means and standard deviations (Young et al., 1999;McLeod, 2012). The number of terms in the harmonic regression may be determined using the Bayesian Information Criterion (BIC) or generalized Akaike's Information Criterion (generalized AIC) (Young et al., 1999;McLeod, 2012;Sakai, 1990;Haughton et al., 1990;Albert and Hansberger, 2005;Tominaga, 2010). The R package deseasonalize that is an optimal depersonalization for geophysical time series using AR fitting, depersonalize daily or monthly time series (McLeod, 2012;Hipel and McLeod, 1994;McLeod and Zhang, 2008). In R package depersonalizethe main function ds is a depersonalization process for monthly and annual (McLeod, 2012;Hipel and McLeod, 1994;McLeod and Zhang, 2008). Most users would employ the ds, but not the utility function getds in R package depersonalize (McLeod, 2012). The function print.depersonalizecan give a terse summary (McLeod, 2012). The function summary. Depersonalize provides summary for depersonalize objects (McLeod, 2012;Hipel and McLeod, 1994;McLeod and Zhang, 2008).

CONCLUSION
Time series analysis includes methods for analysing time series data so as to deracinate meaningful statistics and other characteristics from the data. Plenty of functions in the R packages TSA, mar1s, depersonalize and season for analyzing seasonal processes of time series, are introduced in this study.