26

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 ...


18

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.


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

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

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 ...


11

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 ...


10

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 ...


10

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 ...


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

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 ...


9

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 ...


8

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 <- ...


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

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

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: ...


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

First, mle_retvals should be an attribute of SARIMAXResults if it is constructed using a fit call, so you should be able to check it. What do you get when you try print(res.mle_retvals)? Second, do the estimated parameters seem "in the ballpark", or are they nonsense? Or are they NaN? Without knowing more: you might try increasing the maximum number of ...


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

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

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 ...


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

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, ...


7

In just the dataset you've provided, the only real downside to using polynomials over the Fourier basis is the issue of discontinuity at $T = 0$ and $T = 24$. As you stated, you can add constraints to fix this up if you really wished to. But more typically for this type of data, we observe several cycles. In this case, it would be the number of days of ...


7

No, you do not need to remove trend and/or seasonality before fitting an ARIMA model. These models can handle certain types of trends and certain types of seasonality by themselves, or by including external regressors (the xreg argument, where you could include more complicated related effects like moving holidays, or non-polynomial trends, breaks in the ...


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

You can start from Hyndman book at the section about Seasonal ARIMA here. Once you know the mathematical definition of B operator* it will be easy to write the extended formula of your model. Your model ARIMA(1,0,4)(2,0,2) period 12 becomes something like: $y_t = c + a_1 y_{t-1} + e_t + b_1 e_{t-1} + b_2 e_{t-2} + b_3 e_{t-3} + b_4 e_{t-4} + d_1 y_{t-12} + ...


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