Time Series Analysis: What to Know Before You Start — Requirements, Prophet, ARIMA and Anomaly Detection in Production

Ask ten analysts what "forecasting" means and you will get ten answers — and nine of them will be wrong in the same way. They will describe a model. The job is not a model. The job is a pipeline: a data feed that breaks silently at 03:00, a seasonal pattern that shifts when a retailer changes its promo calendar, and a forecast nobody trusts because the last one was off by a wide margin and no one can say why.

This article is about what sits between the textbook and the production system — the requirements you need before you open a notebook, the trade-offs between Prophet and ARIMA, and the specific places where time series analysis quietly fails. If you are deciding whether to learn this properly, read the failure modes first. They tell you more about the field than any syllabus.

The requirement nobody lists: a timestamp you can trust

Before any model, you need to answer three questions about your data, and none of them are about statistics.

  1. What is the grain? One row per hour per store, or per day per region? If the grain is inconsistent — a store that reports every 15 minutes while another reports hourly — every aggregate downstream is wrong, and the model learns an artifact of reporting, not demand.
  2. Is the timestamp the event time or the arrival time? An order placed at 23:58 and recorded at 00:03 belongs to yesterday's demand. Systems that mix the two produce a phantom spike at midnight that a model will happily learn and forecast forever.
  3. What happens in the gaps? A missing hour is not zero sales. Filling gaps with zero teaches the model that the business periodically stops, and it will reproduce that pattern in the forecast.

A team that skips these three checks can spend a week tuning a model that is fitting a data-pipeline bug. The forecast looks plausible, the backtest looks fine, and the error only surfaces when someone in operations says "we never had a day with zero orders in that region."

Do this before touching a model Plot the raw series for one entity (one store, one sensor, one server) over the full period, at full resolution. Count the gaps. Mark the days when the value is exactly zero. Half of the "modeling problems" people bring to a mentor are visible on that one chart.

Prophet or ARIMA: the choice is about your data, not your skill

This is the question beginners ask first, and the honest answer is that the two models fail in different ways — so you pick the failure you can live with.

ARIMA (and its seasonal extension, SARIMA) assumes the series is stationary after differencing, and that the relationship between past values and the future is linear and stable. When that holds, it is efficient and interpretable: the orders p, d, q have meaning, and the residuals tell you whether you have left structure on the table. When it does not hold — a level shift after a pricing change, a holiday that moves every year — a fixed ARIMA will keep forecasting the old regime until you refit it.

Prophet was built for business series with trend changes and multiple seasonalities, and it handles missing data and outliers more gracefully out of the box. The price is that its defaults are opinionated: the changepoint prior decides how flexibly the trend bends, and if you never touch it, you get whatever the default assumes about your business. Prophet is also easy to misread — a smooth forecast with a wide uncertainty band looks authoritative on a slide even when the underlying series is mostly noise.

Situation Lean toward What you pay
Stable, well-sampled series; you need to explain the model ARIMA / SARIMA Manual handling of holidays and level shifts
Strong multiple seasonality, gaps, trend changes Prophet Defaults you must tune; weaker residual diagnostics
Non-linear patterns, long history, many related series Gradient boosting or neural approaches (e.g. LSTM) Data hunger, harder debugging, less interpretability
You need a baseline today Seasonal naive (repeat last week/last year) No explanatory power — but it is the bar every model must beat

That last row matters more than it looks. A seasonal naive forecast — "next Tuesday looks like last Tuesday" — is the benchmark. If your carefully tuned model cannot beat it on a proper backtest, the model is not adding value, and shipping it is a net negative because it costs maintenance and earns no trust.

A walkthrough: forecasting daily orders for one region

Take a concrete task. You have two years of daily order counts for a region and need a 14-day forecast. Here is the order of operations a practitioner actually follows.

Step 1 — Split by time, never randomly. The last 60 days become the test set. A random split on time series leaks the future into the training set and produces a backtest score that has nothing to do with reality. This single mistake is the most common reason a model "works in the notebook and fails in production." More on the topic: “Time Series Analysis: Why Prophet and ARIMA Break Where You Least Expect It”.

Step 2 — Establish the baseline. Compute seasonal naive: the forecast for each of the next 14 days equals the value from the same weekday one week earlier. Note its error. Everything after this is measured against it.

Step 3 — Look at the components. Decompose into trend, weekly seasonality and residual. If the residual is as large as the seasonal component, the series is mostly noise and no model will forecast it well — the right output is a wide interval, not a confident line.

Step 4 — Fit and compare. Fit ARIMA with a weekly seasonal term and Prophet with weekly and yearly seasonality. Evaluate both on the same 60-day holdout with a metric that matches the decision: if over-forecasting costs you inventory and under-forecasting costs you stockouts, an asymmetric metric reflects the business better than plain error.

Step 5 — Check the errors, not just the score. Plot residuals over time. If the model systematically under-forecasts the last three weeks, there is a trend change it has not absorbed, and a better score on the holdout will not save you next month.

Step 6 — Refit and monitor. In production the model refits on a schedule and the residuals are tracked. When the error drifts past a threshold, the pipeline alerts — because the alternative is discovering the drift when the business does.

The baseline is the whole argument A forecast is only worth shipping if it beats seasonal naive on a time-ordered holdout and its residuals behave. Both checks take an afternoon. Skipping them takes a quarter — and ends with a model nobody uses.

Anomaly detection is not the same job as forecasting

People often bundle these together, and that is where projects get muddled. Forecasting asks "what will the value be?" Anomaly detection asks "is this value surprising given what we expected?"

The practical consequence: a good forecaster gives you a natural anomaly detector for free. Forecast an interval, and any point outside it is a candidate anomaly. But the reverse is not true — a detector tuned to flag spikes will flag every legitimate promotion, and a team that routes those alerts to a human quickly teaches that human to ignore them.

The work that actually matters in anomaly detection is not the algorithm. It is deciding what counts as anomalous for this series — a 30% jump in a stable server metric is alarming; the same jump in a retail series during a sale is Tuesday. That judgment lives in the domain, not in the model, and no library supplies it.

If you have ever stared at a chart wondering whether a dip is a real signal or a reporting artifact, the reasoning is the same one that applies when you hand the chart to a language model and ask it to find the seasonality.

More on the topic: “Six Prompts That Read Your Time Series Better Than the Chart — Trend, Seasonality, Anomalies and the Breakpoint You Keep Missing”.

Where practitioners actually get burned

The failure modes are remarkably consistent across teams, and almost none of them are about model choice.

  • Backtest leakage. Random splits, or tuning on the test period. The score looks great; the first real forecast is a surprise.
  • One model for all entities. A single global model trained on regions with wildly different scales will be dominated by the largest one. Hierarchical or per-entity approaches exist for a reason.
  • Multi-step drift. A 1-step-ahead model recursively fed its own predictions compounds error. A 30-day forecast built that way is not the same animal as a 1-day forecast, and evaluating it as if it were is misleading.
  • Silent schema changes. A new column, a renamed region, an upstream system that switches from UTC to local time. The pipeline keeps running and the numbers quietly change meaning.
  • No retraining trigger. The model is refit "quarterly" until someone notices the residuals have been drifting for two months.
The question that catches most of these Before shipping, ask: "If this model were wrong, how would I know, and how fast?" If the answer is "someone would complain," the monitoring is missing — and that is the part of time series analysis that separates a notebook from a system.

Learning paths and what each one actually costs you

There are three realistic routes into this field, and they differ less in price than in what they give you back.

Self-study from documentation and textbooks. Cheapest in money, most expensive in time. Prophet and statsmodels have good documentation, and you can reproduce a tutorial in an evening. What you do not get is feedback: nobody tells you that your split was wrong, that your residual plot shows a trend you missed, or that the "anomaly" you found is a known promotion. The typical outcome is a set of notebooks that all look like the tutorial and none of which you can defend in a review.

A structured course with exercises and an AI tutor. You pay for the feedback loop — someone (or something) checking your reasoning against a correct one, on tasks designed to expose the mistakes above. The trade-off is that you follow someone else's sequence, which may move faster or slower than you need. On asibiont.com the lessons are text-based and adapt to your results: the starting modules set the base, and the material then deepens on strong scores or returns to fundamentals on weak ones, with an AI tutor answering questions on the topic.

Learning on the job. The fastest route to competence and the most expensive to your employer if you get it wrong. You inherit a real pipeline, real data and real consequences — and usually a senior colleague whose time is the real cost. It works well when there is someone to review your work and badly when there is not.

The honest recommendation: self-study gets you to a first working model; feedback gets you to a model you can defend. If you have neither a mentor nor a review process, the gap is not knowledge — it is correction.

Who this suits, and who should walk away

This path rewards people who are comfortable with a messy table and an ambiguous question. Concretely, it fits:

  • Analysts who already write SQL and want to move from describing the past to forecasting the future.
  • Data engineers who own the pipeline and are tired of being handed models they cannot monitor.
  • Scientists and engineers in domains where the series is physical — sensor readings, load, temperature — and where the cost of a wrong forecast is measurable.

It fits less well if you want a purely visual, no-code workflow: the judgment calls here — the split, the grain, the threshold — are made in code and in conversation with the business, not in a dashboard builder.

And it does not suit anyone hoping for a shortcut past the data checks. The most common disappointment is not "the models were too hard." It is "I built a model and nobody used it" — which almost always traces back to a timestamp, a grain, or a baseline that was never established.

A quick self-test Take any series you can access. Can you state its grain, its gaps, and its seasonal naive error within an hour? If yes, you are ready for the modeling. If not, the modeling will not save you — and the first thing to fix is upstream.

Time series analysis is one of the few areas where the boring parts — the timestamp, the split, the baseline — decide the outcome more than the algorithm. Learn the models, by all means; but learn them in the order the job demands: data first, baseline second, model third, monitoring always. The course walks through that sequence with hands-on tasks and gives you feedback on your decisions at each step, adapting the depth to how you do — you can find the details and enrolment on the Time Series Analysis page.

AssetMaterials for this article

A document from this article — download and apply it.

  • XLSXPre-Model Timestamp & Grain Audit Checklist.xlsxXLSX · 8.4 KBDownload
← All posts

Ask AI about this article

Ask a question about this article — ASI Biont will answer based on its text and the attached files.