# Tag Info

71

A really good way to find periodicity in any regular series of data is to inspect its power spectrum after removing any overall trend. (This lends itself well to automated screening when the total power is normalized to a standard value, such as unity.) The preliminary trend removal (and optional differencing to remove serial correlation) is essential to ...

25

Your ACF and PACF indicate that you at least have weekly seasonality, which is shown by the peaks at lags 7, 14, 21 and so forth. You may also have yearly seasonality, although it's not obvious from your time series. Your best bet, given potentially multiple seasonalities, may be a tbats model, which explicitly models multiple types of seasonality. Load ...

19

Here's an example using monthly data on log unemployment claims from a city in New Jersey (from Stata, only because that's what I analyzed these data in originally). The heights of the lines indicate the correlation between a variable and the sth lag of itself; the gray area gives you a sense of whether this correlation is significant (this range is a guide ...

16

Rather than try to decompose the time series explicitly, I would instead suggest that you model the data spatio-temporally because, as you'll see below, the long-term trend likely varies spatially, the seasonal trend varies with the long-term trend and spatially. I have found that generalised additive models (GAMs) are a good model for fitting irregular ...

15

There are no R packages that handle multiple seasonality for ARIMA models as far as I know. You could try the forecast package which implements multiple seasonality using models based on exponential smoothing. The dshw, bats and tbats functions will all handle data with two seasonal periods.

14

Don't use as.ts(). Do this (note: the parameter is called start, not begin): a.ts <- ts(a, frequency=12, start=c(1980,1))

13

The question is not about whether it is a monthly or a weekly data, but about how quickly the seasonality evolves. If you think the seasonal pattern is constant through time, you should set this parameter to a big value, so that you use the entire data to perform your analysis. If on the other way round, the seasonal pattern evolves quickly, reduce this ...

13

What about a Poisson regression? I created a data frame containing your data, plus an index t for the time (in months) and a variable monthdays for the number of days in each month. T <- read.table("suicide.txt", header=TRUE) U <- data.frame( year = as.numeric(rep(rownames(T),each=12)), month = rep(colnames(T),nrow(T)), t = seq(0, ...

12

The trouble with using the ACF is that there can be other reasons for significant spikes, not just seasonality. So it is indicative but cannot be conclusive. If the data had a small seasonal period (such as 4 for quarterly data or 12 for monthly data) then a simple approach is to use the ets function in the forecast package for R. If there is a seasonal ...

12

Loess decomposition is intended to smooth the series by applying averages to the data so that it collapses into components, e.g. the trend or seasonal, that are interesting for the analysis of the data. But this methodology is not intended to do a formal test for the presence of seasonality. Although in your example stl returns a smoothed pattern of ...

10

First, the model involves additive seasonality. It is not complicated -- just a simple Fourier approximation to the seasonal term. Yes, the original post missed the subscripts on the coefficients; the post has been subsequently edited. In stage 1 of your proposal, you ignore the autocorrelation in the residuals which means the coefficients are poorly ...

9

From the appearance of your data, after seasonal differencing, there may well be no substantive remaining seasonality. That peak at the start of each year, and the subsequent pattern through the rest of the year is quite well picked up by an $I_{[12]}$ model; the model has incorporated "obvious seasonality". Yes, indeed, the suggested model is "This June = ...

9

This is no more than a bundle of comments but it will be too long for that format. I am no more than a time series amateur, but I do have some simple suggestions. You may be under orders here, but I think this needs some sharpening up in terms of what you expect to achieve and what is most important to you. Forecasting visits is, unfortunately, a fuzzy ...

9

A glance at the manual for auto.arima shows that an explanation of precisely why it found the solution it did in this case would be complicated: depending on the fitting algorithm (conditional least squares by default); on the details of the stepwise selection procedure, & the criteria used (approximate AICc by default); & on the particular ...

8

This is partly a matter of taste and style, but my attitude here is that the dummies (indicators) are a team and should be used as such. The appropriate significance test thus considers the seasonal indicators jointly. Once you start fiddling around and making ad hoc decisions you run risks of arbitrary analyses, accusations of data dredging, and so forth. ...

8

How do I select the best ARIMA model (by trying all different orders and checking the best MASE/MAPE/MSE? where the selection of performance measurement can be a discussion in it's own..) Out of sample risk estimates are the gold standard for performance evaluation, and therefore for model selection. Ideally, you cross-validate so that your risk ...

8

Question #1: The problem is that in the MLE case, both the Python (statsmodels) and R procedures use state-space models to estimate the likelihood. In an SARIMAX class, the state-space grows linearly (or worse) with the number of seasons (because the state-space form incorporates all intermediate lags too - so if you have a lag at 3600, the state-space form ...

8

A chi-square test is a good approach as a preliminary view to your question. The stl decomposition can be misleading as a tool to test for the presence of seasonality. This procedure manages to return a stable seasonal pattern even if a white noise (random signal with no structure) is passed as input. Try for example: plot(stl(ts(rnorm(144), frequency=12),...

8

(First off, cmort is already a ts object with frequency 52, so you don't need to coerce it.) I'd say seasonality is visible, not that it is blatant: library(forecast) library(astsa) seasonplot(cmort) Per the help page (?auto.arima), auto.arima() decides whether or not to take seasonal differences by using a OCSB test. It's quite possible that this test ...

8

Using differences between succeeding days (more susceptible to noise) Compute for every week $i$ the seven values \begin{array}{rcl} d_{1i} &=& weight_{Monday}-weight_{Sunday} \\ d_{2i} &=& weight_{Tuesday}-weight_{Monday} \\ d_{3i} &=& weight_{Wednesday}-weight_{Tuesday} \\ d_{4i} &=& weight_{Thursday}-weight_{Wednesday} \...

7

ARIMA and ETS models are designed for relatively short seasonality (e.g., monthly or quarterly) and do not work well for seasonal periods that are much longer. The ets() error should be captured though --- I'll fix it in the next version of the forecast package. You might try instead a Fourier series model: library(forecast) X <- fourier(x, 3) m3 <- ...

7

auto.arima can select the order of differencing automatically, and make appropriate forecasts taking account of these differences. It can also include regressors via the xreg argument, and select the appropriate model order taking account of the regressors. If you include regressors, these will be differenced along with the response variable as part of the ...

7

Burman, J. Peter (1980), “Seasonal Adjustment by Signal Extraction,” Journal of the Royal Statistical Society, Series A, 143, p.321 The reasons according to Burman: The most common is to provide an estimate of the current trend so that judgemental short-term forecasts can be made. Alternatively, it may be applied to a large number of series which ...

7

A seasonal pattern that remains stable over time does not make the series non-stationary. A non-stable seasonal pattern, for example a seasonal random walk, will make the data non-stationary. Edit (after new answer and comments) A stable seasonal pattern is not stationary in the sense that the mean of the series will vary across seasons and, hence, depends ...

7

Let's load your data (this is why dput is useful): x.ts <- structure(c(7632, 6686, 3442, 4556, 7796, 1534, 1466, 3535, 2503, 7534, 1197, 5861, 8846, 7219, 5066, 13177, 7833, 5585, 6392, 5787, 13488, 9413, 7610, 11301, 14912, 13578, 12091, 14628, 10703, 7373, 13638, 10794, 12186, 8137, 7874, 7707, 11569, 13446, 10339, 19086, 15201, ...

6

Well, it's simply that clear seasonal correlations don't always imply that you need seasonal differencing; the seasonal effect can be modelled fine with seasonal moving average & autoregressive terms. It's the same in non-seasonal models; just because you see a strong autocorrelation doesn't necessarily mean you need to difference the series. Sounds ...

6

The short answer is "enormously". If you have time series data that you want to fit a regression to, you will need at a minimum to deal with the seasonality and with autocorrelation between residuals (because the data are related over time, each datapoint cannot be treated as an independent observation - the closer they are related over time, the less new ...

6

Your approach is one possibility. On the other hand, call center forecasting is an active area of research, and there are many people working in this field. One standard way of doing this is adding additional seasonal components to seasonal Exponential Smoothing, so you have one component for yearly and one component for weekly seasonality. You could even ...

6

There are two ways of dealing with circular variables, one hacky method would be to manually duplicate your data set on either side of the boundary conditions but the more elegant solution I think would be to use the built-in spline basis functions with periodic boundary conditions ! For example: bs="cc" specifies a cyclic cubic regression splines (see ...

6

IMHO, persistent seasonality, by definition, is a type of non-stationarity: the mean of a seasonal process varies with the season, E[z(t*s+j)] = f(j), where s is the number of seasons, j is a particular season (j=1,...,s), and t is specific period (typically a year). Thus, E[y(t)] = E[sin(t)+u(t)] = sin(t) is not a stable mean, although it is deterministic: ...

Only top voted, non community-wiki answers of a minimum length are eligible