fullscreen
ImpactMojoTime Series Analysis 101www.impactmojo.in
ImpactMojo 101 Series · Free Forever
Time Series
Analysis 101
Trend, Seasonality, Stationarity, ARIMA, Cointegration, VAR and Interrupted Time Series — for Applied Work with Indian Data
EconometricsSouth Asia Focus100 SlidesFree Access
ImpactMojoTime Series Analysis 101www.impactmojo.in
What We Cover
01
Why Time Series Is Different
Slides 3–10
02
Components and Decomposition
Slides 11–18
03
Stationarity and Unit Roots
Slides 19–28
04
ARIMA Modelling
Slides 29–37
05
Exponential Smoothing and Forecasting
Slides 38–45
06
Evaluating Forecasts
Slides 46–52
07
Regression with Time Series
Slides 53–64
08
VAR and Granger Causality
Slides 65–72
09
Volatility, Breaks and Seasonality
Slides 73–81
10
Time Series for Programme Evaluation
Slides 82–89
11
Indian Data, Software and Practice
Slides 90–99
ImpactMojoTime Series Analysis 101www.impactmojo.in
01
Section One
Why Time Series Is Different
ImpactMojoTime Series Analysis 101www.impactmojo.in
A time series is one unit observed many times, in order
Time series
A sequence of observations on one variable (or several) taken at regular intervals: monthly inflation, quarterly GDP, daily rainfall, weekly clinic attendance. The order carries information, and each observation is usually related to the ones before it.
Cross-sectional methods assume observations are independent draws from a population. A time series violates that assumption by construction: this month's CPI is last month's plus a change, and the change itself is related to earlier changes. Every method in this course exists because ordinary regression, applied to such data, gives standard errors that are wrong and relationships that are not there.
  • Autocorrelation: observations near each other in time are similar. Effective sample size is smaller than n.
  • Trend: the mean moves. Two trending series are correlated whether or not they are related.
  • Seasonality: a pattern that repeats within the year. Kharif harvests, festival spending, monsoon disease.
  • Non-stationarity: the distribution changes over time, so the past may not describe the future.
  • One realisation: there is one history of Indian inflation. Inference comes from assumptions about its structure, not from replication.
The question this course keeps returning to: is the pattern you see a relationship, or two things moving through time together?
ImpactMojoTime Series Analysis 101www.impactmojo.in
Time series in development work
SettingSeriesFrequencyTypical question
Macro policyGDP, CPI, repo rate, exchange rate, fiscal deficitQuarterly, monthly, dailyDoes monetary tightening reduce inflation, and after how long?
AgricultureRainfall, area sown, yields, mandi pricesDaily, seasonal, weeklyHow do prices respond to a weak monsoon?
HealthClinic attendance, disease counts, immunisation coverage, HMIS indicatorsWeekly, monthlyDid the programme change the trend after it started?
LabourPLFS quarterly unemployment, MGNREGA person-days, CMIE employmentQuarterly, monthlyIs the recovery structural or seasonal?
Programme monitoringEnrolment, disbursements, complaints, stock-outsMonthlyIs this month unusual, or within the normal range?
EnvironmentAQI, river flows, temperatureHourly, dailyTrend after removing seasonality and weather
Finance and microfinanceRepayment rates, portfolio at risk, pricesDaily, monthlyVolatility, early warning
Most monitoring dashboards in the sector plot a series and draw a line through it. The methods here are what you need to say whether the line means anything: whether a dip is a seasonal dip, whether a trend is a trend, and whether a change after a programme started is the programme.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Notation and vocabulary used throughout
Symbol or termMeaning
ytThe value at time t; t = 1, ..., T
yt−1, lagThe value one period earlier; L yt = yt−1
ΔytFirst difference, ytyt−1
Δ12ytSeasonal difference, ytyt−12 for monthly data
εt, white noiseErrors with mean zero, constant variance, no autocorrelation
ρkAutocorrelation at lag k: the correlation of yt with yt−k
hForecast horizon, periods ahead
I(0), I(1)Stationary; stationary after one difference (integrated of order 1)
TermMeaning
FrequencyObservations per year: 4, 12, 52, 365
TrendLong-run movement in the level
SeasonalPattern repeating at fixed frequency
CycleRises and falls of no fixed length (business cycles)
StationaryMean, variance and autocovariances do not depend on t
Random walkyt = yt−1 + εt; the simplest non-stationary series
PersistenceHow long a shock's effect lasts
In-sample, out-of-sampleData used to fit; data held back to test
Logs are natural logs, and Δ log y is approximately the growth rate. Most macro series enter in logs.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Plot it before you model it
Every time-series analysis begins with a line plot of the series against time, and most of the mistakes in published applied work could have been avoided by looking at it. The plot shows the trend, the seasonality, the outliers, the breaks, the changes in variance and the missing stretches. It also shows whether the series is one thing or two things spliced (a base-year revision, a definition change) that no test will diagnose.
  • Plot the level and the first difference (or the growth rate). Trend shows in the first; variance changes and outliers in the second.
  • Plot in logs if the series grows and its fluctuations grow with it. If the log plot is a straight line, the growth rate is constant.
  • Plot the seasonal sub-series (all Januaries, all Februaries) or a seasonal plot with one line per year.
  • Plot the autocorrelation function. It says how much memory the series has before any model is fitted.
What the plot tells you about the method
A series that wanders with no fixed mean needs differencing or cointegration methods, not regression in levels. A series with obvious annual peaks needs seasonal treatment before anything else. A series whose swings grow over time needs logs, or a variance model. A series with a jump in 2016 or 2020 needs a break handled, and every test run across the break without one is wrong. The plot decides the section of this course you need.
India's CPI base changed to 2012 = 100 in 2015; GDP moved to the 2011-12 base the same year. A series that spans a base change without splicing shows a jump that is an artefact.
ImpactMojoTime Series Analysis 101www.impactmojo.in
The autocorrelation function: the series' memory
SeriesACF patternReads as
White noiseAll lags near zeroNo memory; nothing to model
Stationary AR(1), φ = 0.7Decays geometrically: 0.7, 0.49, 0.34, ...Shocks fade over a few periods
Random walkNear 1 at every lag, declining very slowlyShocks never fade; non-stationary
Trending seriesVery slow decayTrend dominates; difference or detrend first
Monthly seasonalSpikes at lags 12, 24, 36Seasonality present
MA(1)One spike at lag 1, then zeroOne-period memory in the shocks
The sample ACF, ρ̂k, for k = 1 to about T/4, with bands at ±1.96/√T. A bar outside the band is significant at 5% on its own; with 40 bars, two will be by chance.
The partial autocorrelation
The PACF at lag k is the correlation between yt and yt−k after removing the effect of lags 1 to k − 1. An AR(p) process has a PACF that cuts off after lag p; an MA(q) process has an ACF that cuts off after lag q. The pair is the traditional way to pick ARIMA orders, and section 04 uses it.
The Ljung-Box test (Ljung and Box, Biometrika 1978, 65:297) tests whether the first m autocorrelations are jointly zero. It is the standard check on model residuals: if they fail it, the model has missed structure.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Why 120 monthly observations are not 120 observations
With autocorrelation ρ at lag 1, the variance of a sample mean is inflated by roughly (1 + ρ) / (1 − ρ). At ρ = 0.8 that factor is 9: ten years of monthly data carry about as much information about the mean as 13 independent observations. Standard errors computed as if the observations were independent are too small by a factor of three, and t-statistics too large by the same.
ρ = 0.5
variance factor 3; effective n is a third
(1 + ρ) / (1 − ρ)
ρ = 0.8
factor 9; 120 months act like 13
Same formula
ρ = 0.95
factor 39; 120 months act like 3
Same formula
  • The same inflation applies to every regression coefficient estimated on autocorrelated data with autocorrelated errors.
  • Fixes, in order of preference: model the dynamics (lags of y and x) so the errors are white; use HAC (Newey-West) standard errors as a second best; never ignore it.
  • The Durbin-Watson statistic tests first-order autocorrelation in residuals; Breusch-Godfrey tests higher orders and allows lagged dependent variables.
  • A coefficient with a t-statistic of 12 on 60 quarterly observations of two trending series is the ordinary result of doing it wrong.
Persistence is why a monthly programme series of three years is a small sample, and why 'significant' is cheap in time series and 'robust' is not.
ImpactMojoTime Series Analysis 101www.impactmojo.in
How the course is arranged, and what it assumes
01
DESCRIBE: components, decomposition, autocorrelation (02)
02
TEST: stationarity, unit roots, differencing (03)
03
MODEL ONE SERIES: ARIMA, exponential smoothing, forecasting and its evaluation (04–06)
04
RELATE SERIES: regression, ARDL, cointegration, VAR (07–08)
05
COMPLICATIONS: volatility, breaks, seasonality (09)
06
EVALUATE PROGRAMMES: interrupted time series, synthetic control (10)
07
PRACTICE: Indian data, software, pitfalls (11)
Assumed: the regression material in Econometrics 101 and the descriptive statistics in Data Analysis 101. Each method is presented with what it assumes, what it produces, how to read the output, and the mistake most often made with it in South Asian applied journals. Worked numbers are illustrative unless a source is named.
The free text that pairs with this course is Hyndman and Athanasopoulos, Forecasting: Principles and Practice (3rd ed., OTexts, 2021), online at otexts.com/fpp3. For the econometric half, Enders, Applied Econometric Time Series (4th ed., Wiley, 2014).
ImpactMojoTime Series Analysis 101www.impactmojo.in
02
Section Two
Components and Decomposition
ImpactMojoTime Series Analysis 101www.impactmojo.in
Trend, seasonal, cycle, remainder
A series is thought of as the sum (or the product) of a trend-cycle Tt, a seasonal component St and a remainder Rt. The additive form, yt = Tt + St + Rt, suits a series whose seasonal swings are roughly constant in size. The multiplicative form, yt = Tt × St × Rt, suits one whose swings grow with the level, and taking logs turns it into the additive form.
  • Trend-cycle: the smooth movement; trend and cycle are separated only in some methods.
  • Seasonal: the same shape each year, by construction summing to zero (additive) or averaging one (multiplicative) over a year.
  • Remainder: what is left. If it has structure, the decomposition missed something.
Seasonality in South Asia
Agricultural output follows kharif and rabi; food prices fall at harvest and rise before it; rural wages and MGNREGA demand peak in the lean season; hospital admissions rise with the monsoon (diarrhoea, dengue) and winter (respiratory); consumption spikes at Diwali, Eid, Pongal and Durga Puja, whose dates move relative to the Gregorian month. A seasonal model that assumes the same calendar month every year will mis-time the festivals; some series need a moving-holiday adjustment.
Before comparing any two months, ask whether the difference is the season. Year-on-year comparisons sidestep the problem and lose a year of data doing it.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Classical decomposition: the moving average and the seasonal index
StepWhat is computedMonthly example (illustrative)
1. Trend-cycleA centred 12-month moving average (2×12-MA)Smooths the year out; loses six months at each end
2. DetrendytTt (or divide, multiplicative)What remains is seasonal plus noise
3. Seasonal indexAverage the detrended values for each month across years; centre so they sum to zeroJanuary −4.2, ..., October +6.8, ...
4. RemainderytTtStShould look like noise
5. Seasonally adjustedytStThe series with the calendar removed
Simple, transparent, and still what many spreadsheets do. Its faults: the seasonal pattern is forced to be identical every year, the moving average cannot reach the ends of the series, and one outlier in a March distorts every March's index. Use it to understand what decomposition does; use STL or X-13 to publish.
'Seasonally adjusted' figures are model outputs and get revised as the model sees more data. Cite the series, the method and the vintage.
ImpactMojoTime Series Analysis 101www.impactmojo.in
STL and X-13ARIMA-SEATS: the methods statistical offices use
STL
Seasonal and Trend decomposition using Loess (Cleveland and colleagues, Journal of Official Statistics 1990, 6:3). Fits the trend and the seasonal by locally weighted regression, lets the seasonal pattern change slowly over time, is robust to outliers if asked, handles any frequency, and reaches the ends of the series. Two tuning choices: the seasonal window (how fast the pattern may change) and the trend window (how smooth). In R, stl() or feasts::STL; in Python, statsmodels.tsa.seasonal.STL.
X-13ARIMA-SEATS
The US Census Bureau's program, used by statistical offices including for India's seasonally adjusted IIP and by the RBI. Fits a seasonal ARIMA model to extend the series at both ends, then applies moving-average filters (X-11) or a model-based decomposition (SEATS), with built-in handling of trading days, moving holidays and outliers. Free; R's seasonal package wraps it. The standard when the adjusted series will be published.
For research use, STL is enough and easier to explain. For a series that will be compared with an official seasonally adjusted one, use X-13 with the same options, or the difference between yours and theirs will be the method, not the data.
  • Check the remainder: its ACF should be flat and its variance roughly constant.
  • Plot the seasonal component over time. If it drifts, say so; the drift is often the finding.
  • Do not seasonally adjust a series and then fit a seasonal model to it. One or the other.
MoSPI publishes IIP and GDP without seasonal adjustment; the RBI publishes adjusted versions of some series. Know which you are using.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Deterministic and stochastic trends: the distinction everything depends on
Deterministic trend
yt = α + βt + εt. The series fluctuates around a line. A shock pushes it away and it returns. Detrend by regressing on t and keeping the residuals; the series is 'trend-stationary'.
Stochastic trend
yt = δ + yt−1 + εt, a random walk with drift. The series wanders; a shock shifts its path permanently and it never returns. Difference it: Δyt = δ + εt is stationary. The series is 'difference-stationary' or I(1).
The two look alike in a plot of fifty years and call for opposite treatments. Detrending a random walk leaves a non-stationary residual and spurious cycles; differencing a trend-stationary series introduces an MA error and throws away information. Nelson and Plosser (Journal of Monetary Economics 1982, 10:139) tested fourteen US macro series and could not reject a unit root in thirteen, which is why the unit-root test (section 03) sits before every model in this course.
The practical consequence: regressing one random walk on another, unrelated, produces a 'significant' coefficient most of the time. Section 07 shows the numbers.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Logs, differences, growth rates and indices
TransformationFormulaUse whenWatch for
Loglog ytGrowth is proportional; variance rises with levelZeros and negatives; log(1 + y) changes the meaning
First differenceytyt−1Removing a stochastic trendOver-differencing a stationary series adds an MA(1) with a unit root
Log differenceΔ log yt ≈ growth rateGrowth rates for macro seriesThe approximation is poor above about 20% growth
Seasonal differenceytyt−sRemoving stable seasonality; year-on-year changeLoses a year; does not remove trend on its own
Box-Cox(yλ − 1)/λStabilising variance when log is too strong or weakλ is estimated; report it
Index, base 100100 × yt / ybaseComparing series with different unitsThe base year choice changes every visual impression
Per capita, realDivide by population, deflate by a price indexAlmost always for macro seriesWhich deflator: CPI, WPI, GDP deflator? Say which
Moving averageMean of the last k valuesSmoothing for displayLags turning points by k/2; never model the smoothed series
Report every transformation and apply it before any test. A unit-root test on nominal rupee GDP and one on log real per capita GDP are testing different things, and only the second is usually what the question needs.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Missing values, irregular spacing and revisions
Time-series methods assume regular spacing and no gaps, and administrative data provide neither. A monthly HMIS series has districts that reported late, months with zero because the form was not filed, and a reporting-system change in 2018. Weekly mandi prices have no trades some weeks. The choices made here decide everything after, and they should be listed in the methods.
  • A zero that means 'not reported' is missing, not zero. Check the reporting completeness field, and treat it as missing.
  • Short gaps: linear or seasonal interpolation, or a state-space model that handles missing values natively (Kalman filter; imputeTS in R).
  • Long gaps: do not interpolate across them. Model the segments, or shorten the sample.
  • Irregular spacing: aggregate to a regular frequency, and say what was lost.
Revisions and vintages
GDP, IIP and CPI are revised, sometimes for years. The series available today is not the series a decision-maker saw at the time. For a forecasting study, use the vintage that existed at each forecast origin (a real-time dataset); for a structural study, the latest. India's quarterly GDP has been revised by more than a percentage point at several points; state which release you used and when it was downloaded.
Keep the raw download, dated, unchanged. Every cleaning step is in code, so a reviewer can see what a gap became.
ImpactMojoTime Series Analysis 101www.impactmojo.in
A worked decomposition: monthly clinic attendance
Month (year 3)ObservedTrend-cycleSeasonalRemainderAdjusted
Jan1,2401,310−62−81,302
Apr1,1901,325−140+51,330
Jul1,5101,340+155+151,355
Aug1,5851,348+210+271,375
Oct1,3201,360−30−101,350
Dec1,2901,372−75−71,365
Illustrative, additive. The seasonal component peaks in the monsoon months and troughs in April; the trend rises about 60 visits a year; the remainder is small and patternless. The adjusted column is what a manager should compare month to month.
Reading it
August's 1,585 looks like a surge; adjusted, it is 1,375, about 20 above trend, ordinary. April's 1,190 looks like a collapse; adjusted, it is on trend. A programme that started in May and claimed the July–August rise as its effect would be claiming the monsoon. The comparison that answers the programme question is section 10's.
Three years of monthly data give three observations of each month's seasonal effect. The seasonal indices are therefore uncertain, and STL's smoothing across months helps.
ImpactMojoTime Series Analysis 101www.impactmojo.in
03
Section Three
Stationarity and Unit Roots
ImpactMojoTime Series Analysis 101www.impactmojo.in
What stationarity means and why every method wants it
Weak (covariance) stationarity
The mean and variance are constant over time and the covariance between yt and yt−k depends only on the lag k, not on t. The series may be autocorrelated; it must not drift, trend or change its variability.
Stationarity is what makes one history usable: if the process generating the series is the same throughout, the past describes the future and averages over time estimate the process's parameters. Without it, a sample mean is the mean of nothing in particular, regression t-statistics have non-standard distributions, and forecasts inherit whichever part of the past the model happened to see.
  • Stationary: an AR(1) with |φ| < 1; white noise; the growth rate of most macro series; the interest-rate spread.
  • Not stationary: a random walk; a series with a trend; a series whose variance grows; a series with a break in its mean.
  • Trend-stationary: stationary around a deterministic trend (rare in practice).
  • I(1): stationary after one difference (most macro levels). I(2): needs two (some price levels, rarely).
  • Cointegrated: a set of I(1) series with a stationary combination (section 07).
'The series was found to be stationary at first difference' is the sentence in every South Asian applied paper. What follows it decides whether the paper is right.
ImpactMojoTime Series Analysis 101www.impactmojo.in
The random walk, and why it fools the eye
yt = yt−1 + εt. Each period adds a fresh shock and nothing is forgotten, so yt is the sum of every shock since the start: its variance is tσ² and grows without bound. Plotted, a random walk shows long swings that look like trends and cycles, and no two simulated random walks look alike. Every one of those 'trends' is noise accumulated.
  • The best forecast of a random walk is its last value, at every horizon. Elaborate models of exchange rates rarely beat it (Meese and Rogoff, Journal of International Economics 1983, 14:3).
  • With drift, yt = δ + yt−1 + εt: a trend plus wandering. Most nominal macro levels look like this.
  • The ACF of a random walk decays very slowly from near one. That pattern, in a sample ACF, is the first warning.
Simulate it once
Generate 200 draws of white noise, take the cumulative sum, plot. Repeat five times. The five plots will show 'trends' up and down, 'cycles' of varying length, apparent 'breaks', and no two alike. Then regress one on another and read the t-statistic. Ten minutes in R or Python (cumsum(rnorm(200))) teaches more about non-stationarity than any test.
Everything in section 07 about spurious regression follows from this slide.
ImpactMojoTime Series Analysis 101www.impactmojo.in
The augmented Dickey-Fuller test: the regression and the null
The test regression
Δyt = α + βt + γyt−1 + Σi=1..p δi Δyt−i + εt

H0: γ = 0 (unit root; the series is I(1)).
H1: γ < 0 (stationary, or trend-stationary if β is included).

The statistic is the t-ratio on γ, but under H0 it does not follow the t distribution. Dickey and Fuller (JASA 1979, 74:427) tabulated its distribution; MacKinnon's response surfaces give the critical values software reports. The lagged differences (the 'augmentation') soak up serial correlation so εt is white noise.
The null is non-stationarity. Failing to reject means 'we could not show it is stationary', not 'it is a random walk'. The test has low power against near-unit roots (φ = 0.95) in samples of the size applied work has.
  • Deterministic terms: none, constant, or constant and trend. Choose by looking at the plot: a series that trends needs the trend term under the alternative. Critical values differ across the three cases.
  • Lag length p: by AIC or BIC over a range, or Ng-Perron's modified criteria; too few lags leaves autocorrelation and biases the test, too many loses power. Report the choice.
  • Report: the statistic, the critical value at 5%, the deterministic terms, the lags, the sample. 'ADF = −1.84, not rejected' with nothing else is uninterpretable.
  • Then test the first difference. If the level is not rejected and the difference is, the series is I(1).
A common error: including a trend term for a series that does not trend, which throws away power; or omitting it for one that does, which biases toward non-rejection.
ImpactMojoTime Series Analysis 101www.impactmojo.in
KPSS, Phillips-Perron, and using them together
TestNull hypothesisHow it differs from ADFUse it for
ADF (Dickey-Fuller 1979; Said-Dickey 1984)Unit rootParametric augmentation with lagged differencesThe default; always report
Phillips-Perron (Biometrika 1988, 75:335)Unit rootNon-parametric correction for serial correlation and heteroskedasticityA check on ADF; behaves badly with large negative MA components
KPSS (Kwiatkowski et al., J Econometrics 1992, 54:159)StationarityThe null is reversed; rejection means non-stationaryConfirmatory: ADF not rejected + KPSS rejected is strong evidence of I(1)
DF-GLS (Elliott, Rothenberg, Stock, Econometrica 1996, 64:813)Unit rootGLS-detrends first; more power near the nullSmall samples; near-unit-root alternatives
Ng-Perron (2001)Unit rootModified statistics and lag selection; good size and powerWhen results are borderline
Zivot-Andrews (JBES 1992, 10:251)Unit root, with no breakAllows one endogenous break under the alternativeSeries with a visible break (2016, 2020); see section 09
HEGY (1990)Seasonal unit rootsTests at seasonal frequenciesMonthly and quarterly data with strong seasonality
The confirmatory pair is ADF and KPSS. If ADF does not reject a unit root and KPSS rejects stationarity, the series is I(1) and both tests agree. If both reject, or neither does, the data are not informative enough and the paper should say so rather than pick the convenient result. Papers that run six tests and report the one that suited the model are common and are read as such.
ImpactMojoTime Series Analysis 101www.impactmojo.in
A worked unit-root test: log real GDP, quarterly
SeriesTermsLags (AIC)ADF statistic5% critical valueKPSSConclusion
log GDP (level)Constant, trend3−2.11−3.450.19* (crit 0.146)Unit root not rejected; stationarity rejected: I(1)
Δ log GDPConstant2−5.87−2.890.09 (crit 0.463)Unit root rejected; stationarity not rejected: I(0)
log CPI (level)Constant, trend4−1.62−3.450.24*I(1), possibly I(2): test the second difference
Δ log CPI (inflation)Constant3−3.41−2.890.31Rejected at 5%, borderline; note the 2020 break
Illustrative statistics with realistic magnitudes; critical values are MacKinnon's for about 100 observations. The KPSS critical values differ between the trend case (0.146) and the constant case (0.463).
What the table settles
GDP and CPI enter any regression in growth rates or in an error-correction form, never in log levels by OLS. Inflation is stationary enough to model directly, with a dummy or a break test for 2020. The lag choices and the deterministic terms are in the table because a reader who disagrees with them can see what changes.
Two decimal places and the critical value beside every statistic. A star alone hides the margin.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Why unit-root tests fail: power, breaks and the near-unit root
With sixty quarterly observations, the ADF test has perhaps a one-in-three chance of rejecting a unit root when the true autoregressive coefficient is 0.9. A stationary but persistent series will therefore be labelled I(1) most of the time, and the label decides the model. The test also assumes no break: Perron (Econometrica 1989, 57:1361) showed that a stationary series with one shift in its mean or trend is nearly always classified as a unit root by ADF.
  • Longer span beats higher frequency: forty years of annual data have more power than ten years of monthly.
  • Use DF-GLS or Ng-Perron when the sample is short and the result matters.
  • If the plot shows a break, use a break-allowing test (section 09) or split the sample, and say so.
  • Treat the classification as a working assumption, and check that the substantive result survives the other classification.
The economist's escape
The ARDL bounds test (section 07) was designed for exactly this uncertainty: it allows the regressors to be I(0), I(1) or a mix, and asks about the long-run relationship without first settling each series' order. That is why it dominates applied work in South Asian journals. It still requires that nothing is I(2), so the unit-root tests are run anyway, on the differences.
The honest sentence: 'Tests cannot distinguish a unit root from a root of 0.95 in this sample; we proceed under I(1) and show in Appendix B that the conclusions hold under trend-stationarity.'
ImpactMojoTime Series Analysis 101www.impactmojo.in
How many differences, and the cost of too many
Difference until the tests say the series is stationary and no further. One difference removes a stochastic trend; a seasonal difference removes stable seasonality; a second ordinary difference is needed only when the growth rate itself wanders, which is unusual outside high-inflation episodes. Each difference costs observations and, if unnecessary, introduces a non-invertible moving-average term that ARIMA estimation handles badly.
  • Diagnostics for over-differencing: the lag-1 autocorrelation of the differenced series near −0.5; the variance of the series rising after differencing rather than falling.
  • Order of operations: transform (logs), then seasonal difference if needed, then ordinary difference, then test.
  • A series that needs two differences in a model is often a series with a break in a model without one.
Differencing versus modelling the level
Differencing throws away the long-run information in the levels. For a forecasting model of one series, that is a price worth paying. For a question about the long-run relationship between two series (does money growth drive inflation in the long run?), differencing removes exactly what the question is about, and the answer is cointegration and error correction, which keep the levels and the differences both. Section 07.
The ndiffs() and nsdiffs() functions in R's forecast package apply these tests automatically. Read what they chose and why before accepting it.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Panel unit roots: many short series instead of one long one
Twenty years of annual data for one state cannot settle whether a series has a unit root. Twenty years for 28 states can, if the states' series share the property. Panel unit-root tests pool the information: Levin, Lin and Chu (Journal of Econometrics 2002, 108:1) assume a common autoregressive coefficient; Im, Pesaran and Shin (2003, 115:53) average individual ADF statistics and allow each state its own; Fisher-type tests combine the individual p-values.
  • The null is that all series have a unit root; the alternative differs by test (all stationary, or some), and the difference matters for what a rejection means.
  • Cross-sectional dependence, which Indian states have in abundance through common national shocks, biases the first-generation tests toward rejection. Pesaran's CIPS test (2007) allows it.
  • Panel cointegration follows the same logic: Pedroni, Kao, and Westerlund's tests, then the pooled mean group ARDL for the long-run coefficients.
What pooling assumes
That the question is about the states in general, and that a common answer means something. A panel test that rejects a unit root for state per capita income is not a finding about Bihar; it is a finding that not every state's income is a random walk. For a question about one state, the panel adds nothing and the short series stays short.
Test for cross-sectional dependence first (Pesaran's CD test). If it is there, and it will be, use the second-generation tests and say so.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Reporting unit-root results so a reader can check them
  • One table, all series, level and first difference, for every test used.
  • Columns: deterministic terms, lag length and how chosen, statistic, 5% (and 1%) critical value or p-value, conclusion.
  • The sample period and any adjustments (logs, seasonal adjustment, splicing) in the note.
  • Where tests disagree, say so in the text and say what you did.
  • Where a break is visible, the break-allowing test alongside the standard one.
What not to write
'All variables were found to be stationary at first difference and hence the Johansen cointegration test was applied.' Three claims in one sentence, none of them shown: which tests, at what lag, with what terms, with what margin, and why Johansen rather than ARDL. Referees at good journals now reject on this sentence alone, and they are right to, because the sentence is where a wrong classification becomes a wrong model.
The unit-root table is an appendix table in a good paper and the whole methods section in a weak one.
ImpactMojoTime Series Analysis 101www.impactmojo.in
04
Section Four
ARIMA Modelling
ImpactMojoTime Series Analysis 101www.impactmojo.in
Autoregressive and moving-average processes
AR(p)
yt = c + φ1yt−1 + ... + φpyt−p + εt. Today depends on its own past. Stationary if the roots of the characteristic polynomial lie outside the unit circle; for AR(1), |φ1| < 1. A shock decays geometrically.
MA(q)
yt = μ + εt + θ1εt−1 + ... + θqεt−q. Today depends on recent shocks. Always stationary; a shock lasts exactly q periods. Invertible (expressible as an infinite AR) if the roots condition holds, which estimation requires.
ARMA(p, q)
Both together. Parsimonious: an ARMA(1,1) can mimic a long AR. Box and Jenkins (1970) built the identify-estimate-check cycle around it.
The point of the family is that a stationary series' autocorrelation structure, however complicated, can usually be reproduced with a few parameters, and a model that reproduces the autocorrelation forecasts well. Nothing in the model is about economics; it is a description of the series' memory.
ProcessACFPACF
AR(p)Decays (geometric or damped sine)Cuts off after lag p
MA(q)Cuts off after lag qDecays
ARMA(p, q)Decays after lag qDecays after lag p
Wold's theorem: any stationary series can be written as an MA(∞). ARMA is the practical approximation.
ImpactMojoTime Series Analysis 101www.impactmojo.in
ARIMA(p, d, q): differencing brought inside the model
An ARIMA(p, d, q) model is an ARMA(p, q) fitted to the d-th difference of the series. ARIMA(0,1,0) is the random walk; ARIMA(0,1,1) is simple exponential smoothing; ARIMA(1,1,0) is a series whose growth rate is AR(1). The d comes from section 03, p and q from the ACF and PACF of the differenced series or from an information criterion, and the forecasts are integrated back to levels.
  • Include a constant when d = 0 (it is the mean) or when d = 1 and the series drifts (it is the drift). Software defaults differ; check.
  • Keep p + q small. An ARIMA(5,1,5) on 80 observations fits the noise.
  • Estimate by maximum likelihood; conditional sum of squares is an older approximation that some packages still default to.
Seasonal ARIMA
ARIMA(p,d,q)(P,D,Q)s adds seasonal AR, differencing and MA terms at lag s (12 for monthly, 4 for quarterly). The 'airline model', ARIMA(0,1,1)(0,1,1)12, fits a remarkable share of monthly economic series and is the sensible first candidate. Seasonal differencing (D = 1) is usually enough; D = 2 is almost never right.
Write the model out in full in the paper, with the estimated coefficients and their standard errors. 'An ARIMA model was fitted' is not a method.
ImpactMojoTime Series Analysis 101www.impactmojo.in
The Box-Jenkins cycle: identify, estimate, check, forecast
01
TRANSFORM: logs if variance grows; note the seasonality
02
DIFFERENCE: d and D from the tests and the ACF
03
IDENTIFY: p, q, P, Q from the ACF/PACF of the differenced series, or an information-criterion search
04
ESTIMATE: maximum likelihood; check the coefficients are significant and the roots are inside bounds
05
CHECK: residual ACF flat; Ljung-Box not rejected; residuals roughly normal; no outliers left
06
FORECAST: with intervals; compare with a benchmark (section 06)
The cycle is iterative: a failed check sends you back to identification. Two candidate models that both pass the checks are compared on AIC or BIC (lower is better; BIC penalises parameters more) and, where forecasting is the aim, on out-of-sample accuracy. Report the models that were tried, not only the winner.
Information criteria compare models with the same d and D on the same sample. An AIC from a model of levels and one from a model of differences are not comparable, because the likelihoods are of different series.
ImpactMojoTime Series Analysis 101www.impactmojo.in
A worked identification: monthly inflation
CandidateParametersLog-likelihoodAICBICLjung-Box (24 lags) pVerdict
ARIMA(1,0,0)φ1 = 0.62 (0.07)−188.4382.8391.10.003Residuals autocorrelated; seasonality missed
ARIMA(1,0,0)(1,0,0)12φ1 = 0.58 (0.07); Φ1 = 0.31 (0.09)−176.1360.2371.20.21Passes; best BIC
ARIMA(2,0,1)(1,0,0)12Four parameters; θ1 insignificant−175.4362.8379.40.24No better; drop
ARIMA(0,1,1)(0,1,1)12Airline model on the level of the indexn/a: different dn/an/a0.18A model of the price index, not of inflation; compare on forecasts only
Illustrative, for 132 months of year-on-year CPI inflation, which the section 03 tests classed as I(0). Standard errors in parentheses. The seasonal AR term is what the residual check demanded; the extra ARMA terms bought nothing.
Reading the coefficients
φ1 = 0.58: about 58% of last month's deviation from mean inflation carries into this month; a shock has a half-life of about 1.3 months (log 0.5 / log 0.58). Φ1 = 0.31: this month resembles the same month last year, which is the seasonal food-price pattern. The mean of the series, 5.1%, is the level forecasts revert to.
The half-life is the number a policymaker understands. Report it beside the coefficient.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Residual checks: what a good model leaves behind
CheckHowPass looks likeFail means
Residual autocorrelationACF of residuals; Ljung-Box at 10–24 lagsAll bars inside the band; p > 0.05Structure missed: add AR/MA or seasonal terms
Residual meant-test that the mean is zeroNear zeroConstant or drift mis-specified
Constant variancePlot residuals over time; ARCH-LM testNo fanning; ARCH not rejectedVariance changes: logs, or a GARCH model (section 09)
NormalityHistogram, QQ plot, Jarque-BeraRoughly normalPrediction intervals wrong; outliers present; consider bootstrapped intervals
OutliersStandardised residuals beyond ±3None, or explained (demonetisation, lockdown)Add an intervention dummy; do not delete the observation
Parameter stabilityRecursive estimates; CUSUMStableA break; split the sample or model it
RootsInverse AR and MA roots inside the unit circle, not near itWell insideNear-cancelling roots (p and q both too high) or non-invertibility
A model that passes every check is not thereby the right model; it is a model the data do not contradict. Two such models often exist. The forecast comparison in section 06 is what separates them.
ImpactMojoTime Series Analysis 101www.impactmojo.in
auto.arima and its cousins: use them, and check them
Hyndman and Khandakar's algorithm (Journal of Statistical Software 2008, 27(3)), in R's forecast and fable packages and Python's pmdarima, chooses d and D by unit-root tests and then searches over p, q, P, Q by AICc with a stepwise procedure. It is fast, reproducible, and usually lands near what a careful analyst would choose. It is also a starting point, not a verdict.
  • Read what it chose and why. The unit-root decision is the one to check by hand.
  • Run the residual checks on its model as on any other.
  • Compare with the simplest reasonable model (seasonal naive; the airline model). If the automatic choice does not beat them out of sample, use the simple one.
  • Set stepwise = FALSE for a full search when the series matters; it takes longer and occasionally finds a better model.
In Stata, EViews and gretl
Stata's arima command estimates a specified model; there is no built-in search, and analysts loop over orders and compare estat ic. EViews has an automatic ARIMA forecasting procedure in recent versions. gretl, free and menu-driven, estimates ARIMA with exact ML and shows the roots and the correlogram in one window, which makes it the best free teaching tool for this section.
Whatever picked the model, the paper reports the model, the alternatives, the criteria and the checks. The software is a footnote.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Intervention dummies and outliers: demonetisation, lockdown, a policy change
A known event that hits a series is modelled, not deleted. A pulse dummy (1 in one period) captures a one-off; a step dummy (1 from a date onward) captures a permanent shift; a step passed through the model's dynamics captures a shift that arrives gradually. India's series carry several: November 2016 (demonetisation), July 2017 (GST), April 2020 (lockdown), and base-year revisions that need splicing rather than dummies.
  • The dummy's coefficient is the estimated size of the event's effect, with a standard error; report it.
  • Without the dummy, the event inflates the residual variance and widens every forecast interval, and it may push the unit-root tests toward non-rejection.
  • A model with a 2020 dummy is a model that says 2020 was unlike other years. That is usually right, and it means the model has learned nothing about pandemics.
Automatic outlier detection
X-13 and the tsoutliers R package find additive outliers, level shifts and temporary changes by search. Useful for a long series with events you do not know about; dangerous when it finds a level shift where the analyst would have found a trend change. Every detected outlier should be matched to something that happened; one that cannot be is a warning about the data.
Deleting the observation and interpolating is falsification if it is not disclosed, and it is wrong even when disclosed: the event happened.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Forecasting from ARIMA: point forecasts and intervals
The one-step forecast substitutes the last observed values and the last residuals into the model; the two-step forecast substitutes the one-step forecast, and so on. For a stationary ARMA the forecasts converge to the mean and the interval widens to the unconditional variance; for an I(1) model the forecasts follow the drift and the interval widens without limit, at a rate proportional to √h.
  • Report the point forecast with 80% and 95% intervals, on a plot with the history. A point forecast alone is a guess dressed up.
  • Intervals assume normal, homoskedastic, uncorrelated residuals and a correctly specified model. They are too narrow in practice; simulation or bootstrap intervals help.
  • Forecasts of a logged series are back-transformed; the median forecast is exp(forecast), and the mean needs a bias correction of half the variance.
  • Forecasts beyond about two seasonal cycles from an ARIMA are the mean plus the trend, whatever the model says.
What the interval says
An 80% interval for inflation twelve months out of 3.2% to 7.4% is the honest statement of what the model knows. Users who want 'the number' are asking for the midpoint and will hold you to it; give them the interval in the same sentence. The RBI's fan charts in the Monetary Policy Report are the model for the presentation.
Every forecast in this course is judged in section 06 against a benchmark it must beat. An ARIMA that does not beat the seasonal naive forecast should not be published as a forecasting model.
ImpactMojoTime Series Analysis 101www.impactmojo.in
05
Section Five
Exponential Smoothing and Forecasting
ImpactMojoTime Series Analysis 101www.impactmojo.in
The four benchmarks every forecast must beat
MethodForecastRight for
MeanThe historical averageStationary, no trend, no season
NaiveThe last valueRandom walks; most financial series
Seasonal naiveThe value from the same season last yearStrongly seasonal series with little trend
DriftThe last value plus the average historical changeTrending series
Each costs nothing to compute and each is hard to beat on the right kind of series. The M-competitions (Makridakis and Hibon, International Journal of Forecasting 2000, 16:451; M4, Makridakis and colleagues, 2020, 36:54) found repeatedly that simple methods forecast about as well as complex ones and that combinations of methods beat most single methods.
The rule
A forecasting model earns its place by beating the appropriate benchmark out of sample by a margin large enough to matter, on the horizon that matters. A monthly disease model that beats seasonal naive by 3% on one-month-ahead RMSE and loses to it at six months is a model for one horizon. A paper that presents a model with no benchmark comparison has not shown it forecasts.
'Our model achieved a MAPE of 4.2%' means nothing without the benchmark's MAPE beside it.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Simple exponential smoothing: a weighted average that forgets
The forecast is a weighted average of past observations with weights that decline geometrically: ŷt+1 = αyt + (1 − α)ŷt, with 0 < α < 1. A large α trusts the latest observation; a small one averages over a long memory. α is estimated by minimising the one-step squared errors. The forecast is flat: the same number at every horizon.
  • Equivalent to ARIMA(0,1,1); the two families overlap heavily.
  • Right for a series with no trend and no seasonality that drifts slowly: a stable programme's monthly caseload.
  • An α near 1 means the series is nearly a random walk and the naive forecast would do as well.
Holt's linear trend and the damped trend
Holt's method adds a second smoothing equation for the slope, so the forecast is a line. Gardner and McKenzie's damped trend (1985) multiplies the slope by φh so the line flattens with the horizon, which is what long-run growth usually does; it was one of the best single methods in the M3 competition. Use damped unless there is a reason to believe the trend continues unchecked.
Three parameters (α, β, φ), a level and a slope. Everything is interpretable and a spreadsheet can do it.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Holt-Winters: level, trend and season together
ComponentAdditiveMultiplicative
Levelt = α(ytst−m) + (1 − α)(ℓt−1 + bt−1)t = α(yt / st−m) + (1 − α)(ℓt−1 + bt−1)
Trendbt = β(ℓt − ℓt−1) + (1 − β)bt−1Same
Seasonst = γ(yt − ℓt−1bt−1) + (1 − γ)st−mst = γ(yt / (ℓt−1 + bt−1)) + (1 − γ)st−m
Forecastt + h bt + st+h−m(ℓt + h bt) st+h−m
Three smoothing parameters, a level, a slope and m seasonal indices, updated each period. Additive when the seasonal swing is constant in size; multiplicative when it scales with the level, which is the common case for counts and sales. With a damped trend it is the workhorse for monthly operational forecasting: clinic loads, stock requirements, collections.
Needs at least two full seasons to initialise, and three or four to estimate the seasonal indices with any confidence.
ImpactMojoTime Series Analysis 101www.impactmojo.in
The ETS framework: smoothing as a statistical model
Hyndman, Koehler, Ord and Snyder (Forecasting with Exponential Smoothing, Springer, 2008) showed that every smoothing method is the forecast function of a state-space model with Error, Trend and Seasonal components, each Additive, Multiplicative, Damped or None. ETS(A,N,N) is simple smoothing; ETS(A,Ad,M) is damped Holt-Winters with multiplicative seasonality. The state-space form gives likelihoods, so models are chosen by AICc and forecast intervals come from the model rather than from ad hoc formulas.
  • In R: ets() in forecast, ETS() in fable; both select automatically by AICc.
  • Thirty models in the family; automatic selection is reliable, and the residual checks apply as for ARIMA.
  • ETS and ARIMA overlap but are not nested. Fit both, compare out of sample, or combine them.
When to prefer which
ETS handles multiplicative seasonality natively and is usually better on short, seasonal, operational series. ARIMA handles autocorrelation structures ETS cannot express, admits regressors cleanly (section 07), and links to the econometric tradition. For a monthly operational series with three to eight years of history, fit both and average; for a macro series entering a structural question, ARIMA with regressors.
The M4 competition's best entries were combinations of ETS, ARIMA and theta, with a little machine learning on top. Simple average of two good models beats either.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Adding regressors: dynamic regression and regARIMA
A forecast of clinic attendance can use rainfall; a forecast of mandi prices can use the sown area. A regression with ARIMA errors, yt = βxt + ηt with ηt following an ARIMA process, keeps the regressor's effect and lets the error carry the series' memory. OLS with the same regressor and autocorrelated errors gives the right β and the wrong standard error; the ARIMA errors fix both.
  • To forecast y you need forecasts of x, or a lagged x that is already known. A regressor you must also forecast adds its own uncertainty to the interval.
  • Deterministic regressors (dummies for holidays, a trend, Fourier terms for long seasonal periods) are always known ahead and are the common case.
  • Both y and x should be stationary, or both differenced, or the model becomes section 07's problem.
Fourier terms and long seasons
Daily data with a yearly cycle (365 periods) cannot be handled by seasonal ARIMA. Fourier terms, a few sine and cosine pairs at the yearly frequency, as regressors with ARIMA errors, capture the annual shape with three to six parameters; weekly seasonality is then handled by the ARIMA part or by day-of-week dummies. This is the standard treatment for daily AQI, hospital admissions and electricity demand.
In R, auto.arima(y, xreg = ...); in Python, SARIMAX(y, exog = ...); in Stata, arima y x, ar(1).
ImpactMojoTime Series Analysis 101www.impactmojo.in
Forecasting many series: hierarchies and reconciliation
A state programme forecasts caseload for 700 blocks, 38 districts and the state. Forecasting each level separately produces forecasts that do not add up, and the district forecast made from district data ignores what the blocks know. Reconciliation methods (bottom-up, top-down, and the optimal 'MinT' combination of Wickramasuriya, Athanasopoulos and Hyndman, JASA 2019, 114:804) produce forecasts at every level that are coherent and, usually, more accurate than any single level's.
  • Bottom-up: forecast the blocks, sum. Noisy at the bottom, but no aggregation bias.
  • Top-down: forecast the state, share out by historical proportions. Smooth, and blind to local change.
  • MinT: forecast every level, then adjust all of them together using the errors' covariance. Implemented in R's fable (reconcile()).
Batch forecasting in practice
Seven hundred series cannot be hand-modelled. Automatic ETS or ARIMA per series, a benchmark per series, out-of-sample accuracy per series, and a report that names the series where the model lost to the benchmark. Those are the districts where something is changing, and finding them is more valuable than the forecasts.
A dashboard that flags the blocks whose last three months fell outside their own forecast interval is the practical output of everything in sections 04 and 05.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Judgemental adjustment and combining forecasts
The statistical forecast does not know that a new district hospital opens in March or that the state has announced a scheme. The manager does. The evidence on adjusting model forecasts by judgement (Fildes and colleagues, International Journal of Forecasting 2009, 25:3, on 60,000 adjustments in four firms) is that large adjustments made for a stated reason improve accuracy, small adjustments made from habit worsen it, and optimistic adjustments are the worst.
  • Record every adjustment with its reason and its size. Review them against outcomes twice a year.
  • Adjust for information the model cannot have; never for a feeling that the model is 'too low'.
  • Structure the judgement: what will change, from when, by how much, with what confidence.
Combination
Averaging the forecasts of two or three reasonable models reduces error more reliably than choosing among them, because their errors are imperfectly correlated. Equal weights are hard to beat; estimated weights overfit. Bates and Granger showed it in 1969 and every competition since has confirmed it. A combination of ETS, ARIMA and the seasonal naive is the default production forecast for a monthly operational series.
The forecast is a process, not a number: model, benchmark, adjustment log, and a monthly review of last month's error.
ImpactMojoTime Series Analysis 101www.impactmojo.in
06
Section Six
Evaluating Forecasts
ImpactMojoTime Series Analysis 101www.impactmojo.in
In-sample fit is not forecast accuracy
A model with enough parameters fits any history. R², in-sample RMSE and 'the fitted line tracks the data closely' say nothing about the next twelve months, and models chosen on in-sample fit are systematically overfitted. Accuracy is measured on observations the model did not see: hold back the last portion of the series, fit on the rest, forecast the holdout, compare.
01
SPLIT: training set to time T−H, test set of the last H periods
02
FIT on training; FORECAST H ahead
03
SCORE against the test set, by horizon
04
REPEAT for the benchmark, the same way
05
ROLL: move the origin forward and repeat, so the score is an average over many origins
Rolling-origin evaluation
One holdout of twelve months is one draw. Rolling the forecast origin forward month by month (time-series cross-validation) gives dozens of one-step, two-step, ... twelve-step errors and a reliable accuracy profile by horizon. Implemented as tsCV() in R's forecast and by stretch_tsibble() in fable. It is the standard, and a paper reporting a single holdout should say why.
Random k-fold cross-validation, which shuffles observations, is wrong for time series: it lets the model see the future. The folds must respect time.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Accuracy measures: what each rewards and where each breaks
MeasureFormula (errors et = ytŷt)ScaleBreaks when
MAEmean |et|Units of the seriesComparing series in different units
RMSE√(mean et²)Units; penalises large errorsA few outliers dominate
MAPEmean |et / yt| × 100Percentyt near zero (infinite); asymmetric: over-forecasts penalised less
sMAPEmean 2|et| / (|yt| + |ŷt|)PercentStill unstable near zero; used in M3/M4
MASE (Hyndman and Koehler, IJF 2006, 22:679)MAE / MAE of the in-sample seasonal naiveScale-free; 1 = as good as naiveRarely; the recommended default
Interval coverageShare of test observations inside the 80% or 95% intervalShould match the nominal levelIntervals are too narrow, which they usually are
Pinball / CRPSScores for quantile and distributional forecastsProper scoring rulesNeeds a full predictive distribution
Report MASE and RMSE by horizon, with the benchmark's values, and the interval coverage. MAPE alone is the commonest choice in applied papers and the worst: it cannot be computed for a series with zeros, it rewards under-forecasting, and 'MAPE 4.2%' cannot be compared across series or against anything.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Is the difference real? Diebold-Mariano and its use
Model A has RMSE 4.1 and model B 4.4 on 36 out-of-sample months. Whether that difference is more than noise is a testable question: Diebold and Mariano (Journal of Business & Economic Statistics 1995, 13:253) test whether the mean of the loss differential, dt = eA,t² − eB,t², is zero, with a standard error that allows the differentials to be autocorrelated (as multi-step errors are).
  • In R: dm.test(); in Python: statsmodels has no built-in, but the test is six lines.
  • Use the Harvey-Leybourne-Newbold small-sample correction for fewer than about 50 forecasts.
  • Compare against the benchmark first, then between candidates. Report the p-value and the loss used.
  • A model that is not significantly better than seasonal naive after 36 months is not shown to be better, whatever the RMSE says.
Forecast encompassing
A different question: does model A's forecast contain all the information in model B's? Regress the outcome on both forecasts; if B's coefficient is zero, A encompasses B and combination adds nothing. If both coefficients matter, combine. This is the principled version of 'average them', and it explains why averages usually win: models rarely encompass each other.
Thirty-six evaluation points is a small sample for these tests. Say so, and do not report three decimal places on the p-value.
ImpactMojoTime Series Analysis 101www.impactmojo.in
A worked evaluation: four models, three horizons
ModelMASE h=1MASE h=3MASE h=1280% coverageDM vs seasonal naive (h=1)
Seasonal naive (benchmark)1.001.001.00n/a
ETS(A,Ad,M)0.710.780.9274%p = 0.01
ARIMA(1,0,0)(1,0,0)120.740.800.9771%p = 0.02
ARIMA with rainfall regressor0.660.750.95*76%p < 0.01
Average of ETS and ARIMA0.680.740.9079%p < 0.01
Illustrative, 48 rolling origins on monthly clinic attendance. *Twelve-month-ahead forecasts of rainfall were used for the regressor model; its long-horizon advantage disappears because rainfall is not forecastable at that range.
What to conclude
Every model beats the benchmark at short horizons by 25–35% and by almost nothing at twelve months, where seasonality is all anyone knows. Coverage below 80% says every model's intervals are too narrow; widen them or bootstrap. The combination is the production choice: best at three and twelve months, best coverage, and no worse than the best single model at one. The rainfall model is worth using for one to three months ahead, when rainfall is known.
This table is the results section of a forecasting paper. Everything else is method.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Prediction intervals are almost always too narrow
Model-based intervals account for the error term's variance and nothing else. They ignore parameter uncertainty, model uncertainty, breaks, and the fact that the future contains events the past did not. Empirically, 95% intervals from ARIMA and ETS models cover about 80–90% of outcomes, and macro forecasters' intervals have historically done worse. A calibrated interval is one whose coverage on the evaluation set matches its label.
  • Check coverage in the rolling evaluation and report it beside the point accuracy.
  • Widen by simulation: bootstrap the residuals, or simulate future paths with parameter draws.
  • Conformal methods (calibrate the interval width on held-out errors) give correct coverage by construction and are easy to implement.
  • Present fan charts: the 50%, 80% and 95% bands together, so the reader sees the shape of the uncertainty.
Why it matters in the sector
A stock-out forecast with an interval that is too narrow leads to too little buffer stock; a budget forecast with one leads to a supplementary demand. The cost of an interval error is asymmetric and the decision should use the quantile that matches the asymmetry (the 90th percentile of demand, say), not the mean. That requires an interval that is right.
A forecast that says '1,350 visits, 80% interval 1,180 to 1,540, based on 48 months, coverage checked at 79%' is a forecast a manager can use.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Forecasting pitfalls seen in applied papers
PitfallWhat it looks likeFix
No benchmark'The ARIMA model achieved MAPE 3.8%'Seasonal naive in every table
In-sample accuracyR² = 0.98 reported as forecast performanceRolling out-of-sample evaluation
One holdoutThe last 12 months, onceRolling origins, accuracy by horizon
MAPE on counts with zerosInfinite or absurd values silently droppedMASE, RMSE
Test set used for selectionBest of 30 models on the holdout, reported as the forecastSelect on a validation set, report on a separate test set, or use rolling evaluation
Forecasting a regressor you do not haveNext year's rainfall as a known inputLagged or forecastable regressors only; report the cost
Long horizons from short samplesTen-year forecasts from eight years of dataDo not; or present as scenarios, not forecasts
Machine learning without a reasonAn LSTM on 96 monthly observations, beaten by ETSFit the simple models first; ML earns its place on long, high-frequency, many-series problems
Point forecasts onlyA single line into the futureIntervals, with coverage checked
Every row is common in journals that publish South Asian forecasting work, and every row is a reason a methods-literate referee rejects. The fixes are all in this section and none is expensive.
ImpactMojoTime Series Analysis 101www.impactmojo.in
07
Section Seven
Regression with Time Series
ImpactMojoTime Series Analysis 101www.impactmojo.in
Spurious regression: two random walks and a t-statistic of 8
Granger and Newbold (Journal of Econometrics 1974, 2:111) generated pairs of independent random walks and regressed one on the other. With fifty observations, the t-statistic on the slope exceeded the 5% critical value in about three-quarters of the pairs. R² was often above 0.5. Nothing was related to anything. Phillips (Journal of Econometrics 1986, 33:311) proved why: with I(1) variables the t-statistic does not converge; it grows with the sample, so more data make the problem worse.
~75%
of regressions between independent random walks 'significant' at 5%, n = 50
Granger and Newbold 1974
~0.3
typical Durbin-Watson: the warning sign
Same experiment
R² > DW
Granger and Newbold's rule of thumb for suspecting a spurious regression
Same paper
  • Symptoms: a high R² between trending series, a very low Durbin-Watson, coefficients that change wildly when the sample is shifted.
  • Yule showed the same thing in 1926 with Church of England marriages and the mortality rate, correlated at 0.95.
  • Detrending does not fix it when the trends are stochastic. Differencing does, at the cost of the long run. Cointegration keeps both, if it holds.
  • Test the orders of integration first (section 03), always, before any regression in levels.
A large share of published regressions of one Indian macro series on another in levels, with no cointegration test, are this experiment run once.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Cointegration: when levels do carry a relationship
Cointegration
Two or more I(1) series are cointegrated if some linear combination of them is I(0). They wander individually but not apart: an equilibrium relationship ties them, and deviations from it are temporary. Engle and Granger, Econometrica 1987, 55:251.
Consumption and income; the prices of the same commodity in two markets; short and long interest rates; money and nominal GDP, perhaps. Each pair drifts together because something (a budget constraint, arbitrage, a policy rule) pulls them back when they separate. The combination that is stationary is the long-run relationship, and its coefficient is what a levels regression is trying to estimate.
  • If y and x are cointegrated, OLS of y on x in levels is consistent (super-consistent, in fact), but its t-statistics are still not standard.
  • If they are not, the levels regression is spurious and only differences or a model of each series alone is valid.
  • Cointegration implies an error-correction representation and is implied by one (the Granger representation theorem). That is the model to estimate.
  • A cointegrating relationship is a statistical property. Whether it is 'equilibrium' in an economic sense is an argument, not a test result.
Wholesale onion prices in Lasalgaon and Delhi: each I(1), the spread I(0). That is cointegration, and the ECM says how fast a gap closes.
ImpactMojoTime Series Analysis 101www.impactmojo.in
The Engle-Granger two-step and the error-correction model
01
STEP 1: regress y on x in levels by OLS; save the residuals u
02
TEST: ADF on u, using Engle-Granger critical values (more negative than standard ADF, because u was estimated)
03
IF REJECTED: cointegrated; the OLS slope is the long-run coefficient
04
STEP 2: regress Δy on Δx, lags of both, and u lagged once; the coefficient on u is the speed of adjustment
The ECM
Δyt = c + α(yt−1 − βxt−1) + Σ γiΔyt−i + Σ δjΔxt−j + εt

β is the long-run relationship; α (negative, between −1 and 0) is the share of last period's gap closed this period; the δs are short-run effects. α = −0.25 means a quarter of any disequilibrium is corrected each period, a half-life of about 2.4 periods.
  • Simple and transparent, and fine for two variables with one obvious dependent variable.
  • Its weaknesses: the step-1 regression's small-sample bias, the arbitrary choice of which variable is on the left, and no way to handle more than one cointegrating relationship among three or more variables.
  • Dynamic OLS (Stock and Watson 1993) adds leads and lags of Δx to step 1 and gives valid standard errors for β.
  • Report the step-1 residual test with its own critical values; a standard ADF table over-rejects.
The ECM is the equation a policy reader can use: a long-run pass-through and a speed. Both numbers belong in the abstract.
ImpactMojoTime Series Analysis 101www.impactmojo.in
The Johansen procedure: several series, several relationships
For k I(1) variables there may be up to k − 1 cointegrating relationships. Johansen (Journal of Economic Dynamics and Control 1988, 12:231; Econometrica 1991, 59:1551) estimates all of them at once in a vector error-correction model (VECM) by maximum likelihood, and tests how many there are with the trace and maximum-eigenvalue statistics, each compared against critical values that depend on the deterministic terms assumed.
H0: rankTrace statistic5% critical valueConclusion
r = 042.729.8Reject: at least one relationship
r ≤ 111.215.5Not rejected: exactly one
r ≤ 22.93.8
Illustrative, three variables. Read down until the first non-rejection; the rank is one.
  • Lag length of the underlying VAR, chosen by information criteria, changes the result. Report the choice and the sensitivity.
  • The deterministic specification (Johansen's cases 1 to 5: no constant; restricted constant; unrestricted constant; restricted trend; unrestricted trend) changes the critical values and often the rank. Choose by the plot and by economics, and say which.
  • The cointegrating vector is identified only up to normalisation with r = 1, and needs restrictions to be interpretable with r > 1.
  • Small samples over-reject; Reinsel-Ahn or Bartlett corrections help; sixty quarterly observations with four variables and four lags is stretching it.
In R: urca::ca.jo; Stata: vecrank then vec; gretl and EViews: menu items. All show the same tables; the judgement is the same.
ImpactMojoTime Series Analysis 101www.impactmojo.in
The ARDL bounds test: the workhorse of South Asian applied work
Pesaran, Shin and Smith (Journal of Applied Econometrics 2001, 16:289) proposed testing for a long-run relationship in a single equation, an autoregressive distributed lag model, without first classifying each regressor as I(0) or I(1). The conditional ECM is estimated and an F-test of the joint significance of the lagged levels is compared against two bounds: the lower assumes all regressors I(0), the upper all I(1).
The equation
Δyt = c + θ0yt−1 + θ1xt−1 + Σ γiΔyt−i + Σ δjΔxt−j + εt

H0: θ0 = θ1 = 0 (no long-run relationship). F above the upper bound: cointegration. Below the lower bound: none. Between: inconclusive, and the orders of integration must be settled after all.
  • Requirements that are routinely violated: no variable may be I(2); there must be one long-run relationship and y must be the variable it explains; the errors must be serially uncorrelated, which the lag choice must deliver.
  • Lags by AIC or SIC over a grid, up to a maximum set by frequency and sample; report the chosen ARDL(p, q) orders.
  • Small-sample critical values (Narayan, Applied Economics 2005, 37:1979) for fewer than about 80 observations; Pesaran's are asymptotic.
  • Then report the long-run coefficients (−θ10) with standard errors, the ECM term (which should be negative, significant and larger than −1), and the diagnostics: serial correlation, functional form, normality, heteroskedasticity, CUSUM.
The method is sound. The abuse is running it on annual series of 30 observations with five regressors, which no bounds table was made for.
ImpactMojoTime Series Analysis 101www.impactmojo.in
A worked ARDL: money growth and inflation
ItemResultReads as
Orders of integrationInflation I(0) borderline; money growth I(0); output gap I(0); exchange-rate change I(0)All I(0) or I(1), none I(2); ARDL admissible
Selected modelARDL(2, 1, 1, 0) by AIC, max 4 lags, quarterly, n = 96Two lags of inflation, one each of money and output, none of the exchange rate
Bounds F6.31; I(0) bound 3.23, I(1) bound 4.35 at 5% (k = 3)Above the upper bound: long-run relationship
Long-run coefficientsMoney growth 0.48 (0.14); output gap 0.22 (0.10); exchange-rate change 0.09 (0.05)A percentage point of money growth raises inflation by about half a point in the long run
ECM term−0.31 (0.07)31% of a disequilibrium closes each quarter; half-life about 1.9 quarters
DiagnosticsBreusch-Godfrey p = 0.41; RESET p = 0.28; ARCH p = 0.19; CUSUM within boundsNo evidence of misspecification
Break checkDummy for 2020Q2 significant; results unchanged without 2020Reported in the appendix
Illustrative numbers with realistic magnitudes. Every row is a decision a reader can dispute, which is why every row is reported. A paper that gave the long-run coefficients and nothing else would be unreviewable.
The half-life from the ECM term, log 0.5 / log(1 + α), is the sentence for the policy reader: 'about half of a monetary shock's long-run effect on inflation arrives within two quarters.'
ImpactMojoTime Series Analysis 101www.impactmojo.in
Engle-Granger, Johansen or ARDL: which, and when
SituationMethodWhy
Two variables, both I(1), one clearly dependentEngle-Granger, or ARDLSimple; ARDL adds valid inference on the long-run coefficient
Mixed I(0) and I(1) regressors, one dependent variable, small sampleARDL boundsBuilt for this; single equation; small-sample critical values exist
Three or more I(1) variables, possibly several relationships, no obvious dependent variableJohansen VECMEstimates all relationships jointly and tests their number
Regressors may be endogenous; feedback both waysJohansen VECM or a VARSingle-equation methods assume weak exogeneity
Any variable I(2)None of the aboveDifference the I(2) variable to I(1) first, or rethink the variables (a price level and its inflation rate cannot both be in the system)
A structural break in the relationshipGregory-Hansen (1996) test; or split the sampleStandard tests lose power under a break
Panel of countries or statesPedroni or Westerlund panel cointegration; panel ARDL (PMG)Cross-section adds power; cross-sectional dependence must be handled
Running all three and reporting the one that found cointegration is not robustness. Choose by the situation, state the reasons, and show the others in an appendix if a referee will ask.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Distributed lags and the difference between short and long run
Most effects in time series arrive over several periods. A finite distributed lag, yt = Σj=0..q βjxt−j + εt, gives the effect at each lag; the sum Σβj is the long-run multiplier. Adding lags of y (an ARDL) lets the effect decay geometrically with few parameters: in yt = φyt−1 + βxt + εt, the impact effect is β and the long-run effect is β/(1 − φ).
  • Report both the impact and the long-run effect, with standard errors for each (the delta method for the ratio).
  • The lag structure is a finding: a monsoon shock that reaches food inflation with a two-month lag and fades over six is a statement about markets.
  • Choose lag length by information criteria and residual autocorrelation, not by which lags are significant.
Stationarity still applies
All of this assumes stationary variables, or a cointegrated system in error-correction form. A distributed lag of one I(1) series on another, without the ECM structure, is the spurious regression with extra lags. The lag terms make the residuals look better and the problem is unchanged.
The ARDL in ECM form is exactly this model rewritten so that the long-run coefficient and the adjustment speed appear as parameters. Sections 07's methods are one model in several notations.
ImpactMojoTime Series Analysis 101www.impactmojo.in
When you cannot model the dynamics: Newey-West standard errors
Sometimes the question is a single coefficient in a regression of stationary variables and the dynamics are a nuisance. Heteroskedasticity-and-autocorrelation-consistent (HAC) standard errors (Newey and West, Econometrica 1987, 55:703) leave the OLS coefficients alone and correct their standard errors for serial correlation up to a chosen lag. The coefficients are unbiased if the model is right; only the inference was wrong.
  • The bandwidth (number of lags) matters and the automatic rules (Newey-West 1994; Andrews 1991) are a starting point. Report it.
  • HAC errors do not fix a spurious regression, an omitted lagged dependent variable, or a wrong functional form. They fix standard errors.
  • Modelling the dynamics (lags of y and x) is better when the dynamics are of interest, and often when they are not: a well-specified dynamic model has white-noise errors and needs no correction.
  • In Stata, newey; R, sandwich::NeweyWest; Python, cov_type='HAC'.
A common abuse
A regression of a trending outcome on a trending policy variable in levels, with Newey-West errors and a note that 'standard errors are robust to autocorrelation'. The errors are not the problem; the coefficient is meaningless. Robust standard errors on a spurious regression are precise nonsense.
Order of business: integration orders, then the model form, then the standard errors.
ImpactMojoTime Series Analysis 101www.impactmojo.in
What a time-series regression can and cannot say about causes
A cointegrating relationship between money growth and inflation is a statement that they move together in the long run. It does not say which moves which, whether a third thing moves both, or what would happen if the central bank changed money growth on purpose. Those are causal questions, and a time-series regression answers them only under assumptions that must be argued: that x is not itself responding to y, that no omitted series drives both, that the relationship would survive the intervention (the Lucas critique).
  • 'Is associated with in the long run' and 'adjusts toward' are what the ECM licenses.
  • 'Causes' needs exogeneity, argued from institutions or timing, or an identification strategy (section 08's structural VAR, section 10's designs).
  • 'Granger causes' means 'helps predict' and nothing more; the next section says why.
Weak, strong and super exogeneity
Engle, Hendry and Richard (1983) drew the distinctions. Weak exogeneity: x can be treated as given for estimating the parameters of interest. Strong: plus y does not Granger-cause x, so forecasting conditional on x is valid. Super: plus the relationship is invariant to interventions in x, so policy analysis is valid. Each is a stronger claim and the ECM assumes the first, tests the second, and cannot deliver the third.
Write the causal sentence you want in the abstract, then list the assumptions it needs. If you cannot defend them, weaken the verb.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Reporting a time-series regression: the table a referee expects
ElementContent
Sample and frequency1996Q2 to 2024Q4, quarterly, n = 115; source and vintage of each series; transformations
Integration ordersThe unit-root table (section 03), in the appendix, referred to
Model formThe equation written out; lag orders and how chosen; deterministic terms; dummies with dates
Cointegration evidenceThe bounds F or the trace statistics with critical values; or the statement that all variables are I(0) and none is needed
CoefficientsLong-run and short-run, with standard errors; the ECM term; the half-life
DiagnosticsSerial correlation (Breusch-Godfrey), heteroskedasticity, ARCH, normality, RESET, CUSUM and CUSUMSQ: statistics and p-values
StabilityRecursive coefficients or a sub-sample estimate; break tests where the plot suggested one
RobustnessAlternative lag lengths, deterministic cases, sample periods; the result's sensitivity in one sentence each
InterpretationMagnitudes in units a reader can use; the causal verb scaled to the exogeneity assumed
The table is long because the method has many decisions and each one can change the answer. A paper that reports the coefficients and 'the model passes all diagnostic tests' has reported the answer without the working.
ImpactMojoTime Series Analysis 101www.impactmojo.in
08
Section Eight
VAR and Granger Causality
ImpactMojoTime Series Analysis 101www.impactmojo.in
Vector autoregression: every variable on every variable's past
Sims (Econometrica 1980, 48:1) proposed treating a small set of macro variables symmetrically: each is regressed on p lags of itself and of all the others. No variable is assumed exogenous; the data decide the dynamics. A VAR with k variables and p lags has k²p slope coefficients, which is why VARs are small: three or four variables, two to four lags, and a sample long enough to estimate forty coefficients.
A two-variable VAR(1)
yt = c1 + a11yt−1 + a12xt−1 + e1t
xt = c2 + a21yt−1 + a22xt−1 + e2t

Estimated equation by equation by OLS. The errors e1 and e2 are contemporaneously correlated, and that correlation is where identification lives.
  • Variables should be stationary (differences, growth rates, gaps), or the system should be a VECM if cointegrated. A VAR in I(1) levels is consistent but its tests are non-standard (Sims, Stock and Watson, Econometrica 1990, 58:113); Toda-Yamamoto's fix is on the next slide.
  • Lag length by AIC, HQ or SC, then check that residuals are white; SC chooses fewer lags and is usually right in small samples.
  • Stability: all eigenvalues of the companion matrix inside the unit circle. Software reports them; check.
  • Uses: forecasting (often good), Granger causality, impulse responses, variance decompositions. Each needs different assumptions.
A VAR is a description of the joint dynamics. Everything causal about it comes from what is added afterwards.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Granger causality: prediction, not causation
Granger causality
x Granger-causes y if past values of x help predict y beyond what past values of y already do. Tested by a Wald or F test that the coefficients on lagged x in the y equation are jointly zero. Granger, Econometrica 1969, 37:424.
The name has caused fifty years of confusion. Granger causality is incremental predictive content, and it fails as causation in every direction: a variable that anticipates another (the weather forecast Granger-causes the rain), two effects of a common cause, a variable omitted from the system, and a policy variable set in response to forecasts of the outcome (which will appear to be Granger-caused by it).
  • Report it as 'helps forecast' or 'temporally precedes'. Never as 'causes' in the abstract.
  • The result depends on lag length, on which other variables are in the system, and on stationarity. Report the sensitivity.
  • With I(1) variables, Toda and Yamamoto (Journal of Econometrics 1995, 66:225): estimate the VAR in levels with p + dmax lags and test only the first p. Valid whatever the integration and cointegration properties.
  • Bidirectional 'causality' between two macro aggregates is the usual finding and is usually uninformative.
Papers whose entire contribution is a Granger-causality table between GDP and one other series are the most-published and least-cited genre in South Asian economics. Do not add to it.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Impulse responses: what a shock does over time
An impulse response function traces the effect of a one-time shock to one variable on itself and on the others, period by period, holding other shocks at zero. It is the VAR's answer to 'what happens to inflation after a policy-rate shock, and when?' The difficulty is that the estimated errors are correlated across equations, so a 'shock to the policy rate' has to be separated from the part of the rate's error that is just the economy's own noise arriving in the same quarter.
  • Cholesky (recursive) identification: order the variables so that each responds contemporaneously only to those before it. The ordering is an assumption and the results change with it; report the ordering and try the alternatives.
  • Structural VARs impose economic restrictions (short-run zeros, long-run neutrality, sign restrictions) instead; each is an argument.
  • Confidence bands by bootstrap; the bands are wide and should be shown.
  • Horizon: the responses fade in a stationary VAR; show 12 to 24 periods and stop where the bands cover zero.
Reading an IRF plot
A one-standard-deviation policy-rate shock (say 25 basis points) raises the rate on impact, output growth falls from the second quarter, troughs around the fourth, and returns to baseline by the eighth; inflation falls with a longer lag and the band covers zero for the first three quarters. That is the standard shape of monetary transmission, and the RBI's own working papers find peak effects at three to four quarters. Illustrative; the exact numbers are the paper's finding.
The IRF is the result. Granger tables and coefficient tables are intermediate outputs and belong in the appendix.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Forecast error variance decomposition, and local projections
FEVD
At each horizon, the share of the forecast error variance of each variable attributable to each shock. 'At eight quarters, 30% of the variance of inflation is due to exchange-rate shocks, 15% to policy-rate shocks, the rest to its own.' Same identification assumptions as the IRF, same sensitivity to ordering, and a useful summary of which shocks matter for which variables.
Local projections
Jordà (American Economic Review 2005, 95:161): instead of iterating a VAR forward, regress yt+h directly on the shock at t and controls, one regression per horizon. The coefficient at each h is the impulse response. Robust to VAR misspecification, easy to add nonlinearities and state dependence, and now the default in much applied macro. Standard errors need HAC correction because the errors overlap.
Both tools answer the same question as the IRF with different trade-offs. Local projections are simpler to explain, more flexible and noisier at long horizons; VAR IRFs are smoother and more dependent on the model being right. A careful paper shows both agree on the shape.
  • Identification does not go away with local projections: the shock still has to be argued exogenous, from a VAR ordering, a narrative series, or an external instrument.
  • In R: vars for VAR/IRF/FEVD, lpirfs for local projections; Stata: var, irf, and lpirf in Stata 17+.
Plot the local-projection and VAR responses on the same axes. Where they differ is where the VAR's lag structure is doing work.
ImpactMojoTime Series Analysis 101www.impactmojo.in
A worked three-variable VAR: growth, inflation, policy rate
StepChoiceResult
VariablesGDP growth (y/y), CPI inflation (y/y), repo rate; quarterly 2001Q2–2024Q4All I(0) by ADF and KPSS (rate borderline); VAR in levels of these
LagsAIC 4, HQ 2, SC 2VAR(2); residuals pass Ljung-Box at 12 lags
StabilityLargest eigenvalue modulus 0.91Stable
Granger testsRate → inflation p = 0.03; inflation → rate p < 0.01; growth → rate p = 0.04; rate → growth p = 0.09The policy rate responds to both and helps predict inflation
IdentificationCholesky, ordered growth, inflation, rateRate responds to growth and inflation within the quarter; they respond to the rate with a lag
IRF: rate shock → inflationPeak −0.35 points at 5 quarters; band excludes zero from quarters 3 to 8Transmission with a lag of about a year
FEVD at 8 quartersInflation: own 68%, growth 12%, rate 20%Policy shocks explain a fifth of inflation variance
RobustnessReverse ordering of growth and inflation; 3 lags; sample from 2016 (inflation targeting)Shape unchanged; peak effect larger post-2016
Illustrative throughout. The rows are the decisions; a reader who would have ordered the variables differently can see what that changes. The finding is the IRF shape and the timing, and the robustness row is what makes it a finding rather than an artefact of the ordering.
The post-2016 sample has under 40 quarters. A VAR(2) with three variables uses 21 coefficients on it. Say so.
ImpactMojoTime Series Analysis 101www.impactmojo.in
The VECM: a VAR for cointegrated variables
When the variables are I(1) and cointegrated, the VAR in differences is misspecified (it omits the error-correction terms) and the VAR in levels wastes the long-run restrictions. The VECM has both: each variable's change depends on lagged changes of all variables and on the lagged cointegrating residual(s), with a speed-of-adjustment coefficient per equation. The Johansen procedure (section 07) estimates it; the IRFs and decompositions follow as for a VAR, with permanent effects of some shocks allowed.
  • The adjustment coefficients tell you which variable does the adjusting. If only the exchange rate adjusts toward the money-price relationship, prices are weakly exogenous and a single-equation model of the exchange rate was enough.
  • Test restrictions on the cointegrating vector (does the long-run coefficient on money equal one?) with likelihood-ratio tests; they are cheap and informative.
  • IRFs from a VECM do not die out for the common trends; that is the point.
When to stay with a VAR in differences
When the variables are I(1) and not cointegrated, or when the sample is too short to estimate the long-run relationship with any confidence, or when the question is short-run dynamics only. Report the cointegration test that justified the choice, either way.
In Stata: vec; R: urca::cajorls then vec2var for IRFs; gretl and EViews: the VECM menu after the Johansen test.
ImpactMojoTime Series Analysis 101www.impactmojo.in
VAR pitfalls and what to do about each
PitfallConsequenceFix
Too many variables or lags for the sampleOverfitted, unstable, meaningless IRFsThree or four variables; SC lags; Bayesian VAR shrinkage if more are needed
Mixed integration orders without a VECMNon-standard inference; spurious dynamicsTest; VECM or Toda-Yamamoto
Cholesky ordering unreported or unmotivatedResults not reproducible; identification hiddenState the ordering and the reasoning; show alternatives
Granger causality as the findingPrediction reported as causationIRFs with bands; causal language scaled to identification
IRFs without confidence bandsPrecision overstatedBootstrap bands; report where they cover zero
Breaks ignored (2016, 2020)Parameters are averages over regimesSub-samples; dummies; time-varying-parameter VAR if the sample allows
Seasonally unadjusted monthly dataSeasonal dynamics dominate the lagsAdjust, or use seasonal dummies and enough lags
Overlapping horizons in local projectionsStandard errors too smallHAC standard errors with bandwidth at least h
The VAR is the easiest model in this course to estimate and the easiest to over-interpret. Its output is dynamics; its causal content is exactly what the identification assumptions put in.
ImpactMojoTime Series Analysis 101www.impactmojo.in
09
Section Nine
Volatility, Breaks and Seasonality
ImpactMojoTime Series Analysis 101www.impactmojo.in
Volatility clustering: modelling a variance that moves
Financial returns, exchange-rate changes and some commodity prices have a mean that is nearly unpredictable and a variance that is not: large changes follow large changes, calm follows calm. Engle's ARCH (Econometrica 1982, 50:987) let the conditional variance depend on recent squared errors; Bollerslev's GARCH (Journal of Econometrics 1986, 31:307) added its own lag, so that GARCH(1,1), σ²t = ω + αε²t−1 + βσ²t−1, describes most such series with three parameters.
  • α + β is the persistence of volatility; values near 1 (0.95 is typical for daily returns) mean shocks to variance fade slowly.
  • Test for ARCH effects first (Engle's LM test on squared residuals of the mean model). No ARCH, no GARCH.
  • The mean equation (an ARMA, or a constant) and the variance equation are estimated jointly by maximum likelihood, usually with Student-t errors because returns have fat tails.
Variants, and when they earn their place
EGARCH (Nelson 1991) and GJR-GARCH (Glosten, Jagannathan and Runkle, Journal of Finance 1993, 48:1779) let negative shocks raise volatility more than positive ones, which equity returns show and exchange rates mostly do not. GARCH-in-mean puts the variance into the mean equation as a risk premium. Multivariate GARCH models co-movement of volatilities and needs long samples. Each variant is one more parameter to defend.
Outside finance: the volatility of food inflation, of rainfall, of remittance flows. A GARCH model of onion price changes is a model of when the market is dangerous.
ImpactMojoTime Series Analysis 101www.impactmojo.in
A worked GARCH(1,1): daily rupee-dollar returns
ParameterEstimateSEReads as
Mean equation: constant0.006%0.004No predictable daily drift
ω0.00120.0004Long-run variance floor
α (ARCH)0.080.02Yesterday's surprise raises today's variance
β (GARCH)0.900.02Yesterday's variance carries forward
α + β0.98Highly persistent; half-life of a volatility shock about 34 days
Student-t degrees of freedom5.40.7Fat tails; normal errors would understate extremes
ARCH-LM on standardised residualsp = 0.62No remaining ARCH
Unconditional daily SD0.35%√(ω/(1 − α − β))
Illustrative, 2,500 daily observations. The output that matters is the conditional variance series plotted over time: the spikes at the 2013 taper episode, March 2020 and any other event are the model's identification of stress periods, and the half-life says how long each took to subside.
GARCH forecasts the variance, not the direction. A paper that reports a GARCH model and then predicts the exchange rate has confused the two equations.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Structural breaks: known dates and unknown dates
TestBreak dateWhat it testsNotes
Chow (Econometrica 1960, 28:591)KnownCoefficients equal before and after a dateF-test; the date must come from outside the data (a policy, a definition change)
Quandt-Andrews (Andrews, Econometrica 1993, 61:821)Unknown, singleSupremum of Chow statistics over all candidate dates in the middle 70%Non-standard critical values; software has them
Bai-Perron (Econometrica 1998, 66:47; J Applied Econometrics 2003, 18:1)Unknown, multipleNumber and dates of breaks by sequential or global searchThe standard; needs a minimum segment length; R strucchange, Stata estat sbknown/sbsingle, EViews built-in
CUSUM, CUSUMSQ (Brown, Durbin and Evans 1975)UnknownInstability of coefficients (CUSUM) or variance (CUSUMSQ) from recursive residualsGraphical; low power; good for a first look
Zivot-Andrews; PerronUnknown, one, under a unit-root nullUnit root allowing one break in level and/or trendSection 03: a stationary series with a break looks I(1) to ADF
Gregory-Hansen (1996)Unknown, oneCointegration allowing a regime shiftWhen the long-run relationship may have changed (1991, 2016)
Markov switching (Hamilton, Econometrica 1989, 57:357)Recurring, probabilisticThe series switches between regimes with estimated probabilitiesFor recessions, high and low volatility; needs long samples
India's series have candidate dates every analyst knows: 1991 (liberalisation), 2008–09, November 2016, July 2017, 2016 (inflation targeting), April 2020. A model estimated across them without a test is assuming they did not matter. The test either supports that or it does not, and either way the paper should say.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Once a break is found: dummies, splits and what each costs
  • Intercept dummy: the level shifts, the dynamics do not. One parameter; keeps the whole sample.
  • Interaction dummies: the slopes change too. Several parameters; still one sample.
  • Split the sample: separate models before and after. Honest when everything changed; expensive when the post-break sample is short.
  • Rolling or recursive estimation: show how the coefficients evolve. A figure, not a test, and often the most persuasive evidence.
  • Time-varying parameters: state-space models that let coefficients drift. Powerful, and demanding of data and explanation.
The 2020 problem
Every monthly Indian series has an April–June 2020 that is unlike anything before or since. Left in, it dominates the variance, breaks the seasonal estimates and can flip unit-root tests. Dummied out, the model has learned nothing about pandemics and says so. Excluded, the series has a hole. There is no right answer; there is a stated one. Most careful work uses pulse dummies for the lockdown months and reports results with and without 2020.
A break found by search should match an event. A break at March 2015 in a CPI series is the base-year revision, and the fix is splicing, not a dummy.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Seasonality in models: dummies, seasonal ARIMA, Fourier, holidays
ApproachHowSuitsLimits
Seasonal dummiess − 1 indicator variables in a regressionStable, deterministic seasonality; short seriesCannot change over time; many parameters at high frequency
Seasonal differencingΔsySeasonal unit roots (HEGY); slowly changing seasonalityLoses a year; over-differences deterministic seasonality
Seasonal ARIMAAR/MA terms at lag sMonthly and quarterly dataNot for s above about 24
Fourier termsK sine-cosine pairsDaily and weekly data; long or multiple seasonsFixed shape; choose K by AICc
STL then model the remainderDecompose, model the adjusted seriesComplex, evolving seasonalityTwo-step; intervals understate uncertainty
ETS with seasonal componentState-space seasonal statesOperational forecastingOne seasonal period only (TBATS handles more)
Holiday regressorsDummies or ramps for moving festivalsRetail, transport, health series around Diwali, Eid, OnamDates must be computed per year (X-13's genhol)
The choice depends on whether the seasonal pattern is fixed or drifting, how many periods it has, and whether the goal is a forecast or a coefficient on something else. For a regression of monthly outcome on monthly policy, seasonal dummies in both equations are usually enough and the reader can see them.
Lunar-calendar festivals move by about eleven days a year against the Gregorian calendar. A monthly dummy for 'October' captures Diwali in some years and misses it in others. Build the holiday regressor from the actual dates.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Threshold and regime models: when the dynamics depend on the state
A linear model says a shock has the same effect in a boom and a slump, a rate rise the same effect at 4% inflation and at 9%. Threshold autoregressions (Tong) switch coefficients when an observed variable crosses a threshold; smooth-transition models let the switch be gradual; Markov-switching models (Hamilton 1989) let an unobserved state govern the regime, with the state's probability estimated each period. All need longer samples than linear models and all are harder to explain.
  • Test for nonlinearity before fitting it: the linearity tests of Teräsvirta, or simply compare out-of-sample forecasts.
  • A threshold at a policy-relevant level (inflation above the target band) is interpretable; one estimated at 6.37% with no story is a fit.
  • Markov-switching output is a probability-of-regime plot; the dating of Indian growth regimes is a legitimate use.
Asymmetry in local projections
A simpler route to state dependence: estimate local projections separately for periods when a state variable (the output gap, the credit-to-GDP ratio) is above and below its median, or interact the shock with a smooth transition function. Auerbach and Gorodnichenko's fiscal-multiplier work (2012) made this the standard approach, and it needs no new estimator.
Nonlinearity is a finding only if the linear model fails in a way the nonlinear one fixes, out of sample. Report both.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Daily and intraday data: the problems scale up
Daily AQI, hourly electricity load, tick-level prices. Everything in the course applies and three things get harder. Seasonality is multiple: hour of day, day of week, annual. Missing values and irregular timestamps are the norm. And the sample is enormous, so everything is 'significant' and the question becomes size, not existence.
  • Aggregate to the frequency the question needs. A policy that works over months does not need hourly data.
  • Multiple seasonalities: Fourier terms for each period, TBATS, or Prophet-style models with explicit components. Seasonal ARIMA cannot do it.
  • Calendar effects: trading days, holidays, leap years, the number of Sundays in a month. X-13 and the seasonal package handle these for monthly data.
  • Realised volatility from intraday returns is a better volatility measure than a GARCH on daily returns when the tick data exist.
Daily AQI in an Indian city
Annual seasonality (winter peak), weekly (weekend dip), a trend that the question is about, weather covariates that must be controlled (wind speed, humidity, temperature), missing days when the monitor failed, and a change in the monitor network in 2018. A regression on time alone finds a 'trend' that is the network change; a model with Fourier terms, weather, monitor dummies and ARIMA errors finds the trend that is left, which is smaller and real.
JanVayu's air-quality work in this family of sites is the applied version of this slide.
ImpactMojoTime Series Analysis 101www.impactmojo.in
State-space models and the Kalman filter: the general framework
Almost every model in this course is a special case of a state-space model: an unobserved state (level, slope, seasonal, regime) evolves by a transition equation, and the observation is the state plus noise. The Kalman filter computes the likelihood and the best estimate of the state at each date; the smoother revises those estimates using the whole sample. ETS, ARIMA, time-varying-parameter regressions and unobserved-components trend models all fit here.
  • Handles missing observations natively: the filter skips the update and the uncertainty grows.
  • Handles mixed frequencies: monthly indicators to nowcast quarterly GDP, which is how the RBI and many central banks do it.
  • Gives the trend and cycle as estimated states with uncertainty, which is what 'potential output' and 'the output gap' are.
  • In R: KFAS, dlm, bsts; Python: statsmodels.tsa.statespace; Stata: sspace, ucm.
Why it matters for section 10
The Bayesian structural time-series approach to programme evaluation (CausalImpact) is a state-space model of the outcome before the intervention, projected forward as the counterfactual. Understanding the framework is what makes its assumptions visible: the counterfactual is the pre-period model continuing, and it is only as good as that model.
You do not need to write a Kalman filter. You need to know that the software fitting your ETS or your unobserved-components trend is running one, and what it assumes.
ImpactMojoTime Series Analysis 101www.impactmojo.in
10
Section Ten
Time Series for Programme Evaluation
ImpactMojoTime Series Analysis 101www.impactmojo.in
Interrupted time series: the strongest design when there is no control group
A programme starts at a known date; an outcome is measured repeatedly before and after. The interrupted time series (ITS) design asks whether the level or the trend of the series changed at that date, against the counterfactual that the pre-intervention trend would have continued. Bernal, Cummins and Gasparrini (International Journal of Epidemiology 2017, 46:348) give the tutorial that applied health and policy work now follows; Wagner and colleagues (2002) gave the segmented-regression form.
Segmented regression
yt = β0 + β1t + β2Dt + β3(tt0)Dt + seasonal terms + εt

Dt = 1 from the intervention date t0. β1 is the pre-trend; β2 the immediate level change; β3 the change in slope. The effect at any later date is β2 + β3(tt0).
  • Specify the impact model before looking: level change, slope change, both, delayed, temporary. The choice is a hypothesis, not a fit.
  • Enough points: Penfold and Zhang (Academic Pediatrics 2013, 13:S38) suggest at least eight before and eight after as a floor; power depends on variance and autocorrelation more than on the count.
  • Autocorrelated errors are the rule: model them (ARIMA errors, Prais-Winsten) or use Newey-West; a naive OLS overstates precision badly.
  • Seasonality must be in the model, or a programme that starts in May 'reduces' diarrhoea by October.
The design's assumption, in one sentence: nothing else that affects the outcome changed at the same time. Write that sentence and then test it.
ImpactMojoTime Series Analysis 101www.impactmojo.in
A worked ITS: institutional deliveries after a transport scheme
TermEstimate95% CIReads as
Pre-intervention level (β0)58.2%56.1 to 60.3Institutional delivery share at the start
Pre-trend (β1)+0.21 points/month0.14 to 0.28Rising before the scheme: about 2.5 points a year
Level change (β2)+4.8 points2.1 to 7.5An immediate jump at launch
Slope change (β3)+0.09 points/month−0.02 to 0.20Trend possibly steeper; not distinguishable from zero
Effect at 12 months+5.9 points2.4 to 9.4Against the counterfactual of the pre-trend continuing
Effect at 24 months+7.0 points1.8 to 12.2Widening interval: the counterfactual is extrapolated further
Seasonal termsFourier, 2 pairsMonsoon dip captured
Error modelAR(1), φ = 0.43Chosen by residual ACF; OLS CIs were 35% narrower
Illustrative, 36 months before and 30 after. The reading: a real and immediate level effect of about five points; no clear acceleration beyond the pre-existing trend; the two-year effect is mostly the initial jump carried forward. The result is stated against a counterfactual that is a straight-line extrapolation, and the limitations section says so.
Plot it. The pre-period fit, the counterfactual dashed line, the post-period fit, and the data. Every ITS paper's Figure 1, and the referee's first stop.
ImpactMojoTime Series Analysis 101www.impactmojo.in
What can go wrong with an ITS, and the checks
ThreatWhat it looks likeCheck or fix
Co-interventionAnother programme, a price change or an election at the same timeDocument the timeline; use a control series (next slide); test for the effect on an outcome the programme should not touch
AnticipationThe series moves before the official datePlot; test with the date shifted earlier; treat the announcement as the start
Changed measurementThe reporting system, definition or denominator changed at the interventionRead the metadata; a level change with no plausible mechanism is usually this
Wrong impact modelA temporary effect modelled as permanent, or the reversePre-specify; show the alternatives in the appendix
Pre-trend misspecifiedA curved pre-trend fitted as a line, so the counterfactual is wrongLonger pre-period; a quadratic or a local trend; sensitivity to the pre-period length
Autocorrelation ignoredConfidence intervals too narrowARIMA errors, Prais-Winsten or Newey-West; report the residual ACF
Too few pointsSix months before, six afterSay the design is descriptive; do not report a p-value as if it settled anything
Regression to the meanProgramme launched because the series was at its worstLonger pre-period; a control series; state the selection
The last is the one that catches programmes evaluated after a crisis. A malnutrition scheme launched at the peak of a bad year will show improvement whatever it does, because bad years end.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Controlled ITS: adding a comparison series
The single-series ITS cannot separate the programme from anything else that changed at the same time. A comparison series that was exposed to everything except the programme (a neighbouring district, an outcome the programme should not affect, the same outcome in an unexposed group) turns the design into a difference-in-differences in time-series form: the effect is the change in the treated series' level and slope minus the change in the control's. Lopez Bernal, Cummins and Gasparrini (International Journal of Epidemiology 2018, 47:2082) set out the options.
  • Location control: another area. Assumes common shocks; check that pre-trends match.
  • Outcome control: a series in the same place the programme should not move. Assumes the co-intervention would have moved it too.
  • Both, where available. Disagreement between them is informative.
  • Model: pool the series with an indicator for treated, interactions with the segmented-regression terms; cluster or model the errors within series.
The assumption, again
The control series must have followed the same path as the treated one in the absence of the programme. That is testable in the pre-period (parallel trends) and unverifiable after. A control district chosen because it looks similar today may have been chosen on the outcome; state how it was chosen, before the data were seen if possible.
With many districts and a staggered rollout, the design becomes a panel event study, and Impact Evaluation 101 covers the estimators that handle it.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Synthetic control: building the counterfactual from donors
One state adopts a policy; thirty do not. No single control state matches the treated one, but a weighted average of several might: weights chosen so the combination reproduces the treated state's pre-period outcome path and covariates. The post-period gap between the treated series and its synthetic twin is the estimated effect. Abadie, Diamond and Hainmueller (JASA 2010, 105:493) introduced it with California's tobacco law; Abadie (Journal of Economic Literature 2021, 59:391) reviews a decade of use and misuse.
  • Weights are non-negative and sum to one, so the synthetic unit stays inside the range of the donors: no extrapolation.
  • Inference by permutation: apply the method to every donor as if it were treated, and see where the real gap sits in the distribution of placebo gaps.
  • Report the weights, the pre-period fit (RMSPE), and the placebo plot. A poor pre-period fit means no credible counterfactual.
Where it fits Indian work
State-level policies with annual or quarterly outcomes and a long pre-period: a state's prohibition, a labour-law amendment, a free-electricity scheme. Donor pool of the other states, excluding those with similar policies. Needs perhaps ten or more pre-periods and a treated unit that is not an outlier among donors; Bihar's outcomes often cannot be synthesised from the other states, and the method says so through the fit.
R: Synth, tidysynth; Stata: synth, synth_runner; Python: pysyncon. The augmented and penalised variants handle imperfect fit.
ImpactMojoTime Series Analysis 101www.impactmojo.in
CausalImpact: the forecasting counterfactual
Brodersen and colleagues (Annals of Applied Statistics 2015, 9:247) fit a Bayesian structural time-series model to the outcome in the pre-period, using control series as regressors, then forecast it through the post-period as the counterfactual. The effect is observed minus forecast, with a credible interval that widens with the horizon. It is an ITS whose counterfactual is a state-space forecast rather than a straight line, and a synthetic control whose weights are regression coefficients rather than constrained to a simplex.
  • Suits high-frequency series with several controls: daily web or transaction data, weekly disease counts with neighbouring districts as controls.
  • The controls must not be affected by the intervention; that is the identifying assumption, and it is the same one as everywhere in this section.
  • Run it on a pre-period placebo date. If it finds an 'effect' there, the model is finding noise.
Choosing among the three
One treated series, no controls: segmented-regression ITS. One treated unit, many potential control units, few time points: synthetic control. One treated series, several control series, many time points: CausalImpact or a controlled ITS. Many treated units, staggered: a panel event study. In every case the plot of treated versus counterfactual is the result and the placebo checks are the credibility.
R: CausalImpact; Python: tfcausalimpact. Both need the pre-period to be long enough for the state-space model to learn the seasonality.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Reporting an evaluation built on time series
ElementContent
DesignITS, controlled ITS, synthetic control or BSTS; why this one; the intervention date and how it was set
DataSeries, frequency, source, period, number of points before and after, missing values and how handled, any measurement changes
Impact modelLevel, slope, both, lagged, temporary; pre-specified and stated
ModelThe segmented-regression equation; seasonal terms; error structure and how chosen; or the donor pool, weights and pre-period fit
Figure 1Data, pre-period fit, counterfactual, post-period fit, with intervals; or treated versus synthetic with the gap
EffectsLevel and slope changes with CIs; effects at stated horizons; placebo results
ThreatsCo-interventions considered and how excluded; anticipation; measurement; regression to the mean
SensitivityPre-period length; error model; impact model; control choice; excluding 2020
Language'Associated with a change of X at the intervention date, relative to the pre-trend', with the causal verb earned by the controls and checks
The design is only as strong as its counterfactual, and the counterfactual is an assumption the reader must be able to see. Every row above is there so they can.
ImpactMojoTime Series Analysis 101www.impactmojo.in
11
Section Eleven
Indian Data, Software and Practice
ImpactMojoTime Series Analysis 101www.impactmojo.in
Where Indian macroeconomic time series live
SourceSeriesFrequency and spanNotes
RBI DBIE (Database on Indian Economy)Money, credit, interest rates, exchange rates, external sector, some prices and outputDaily to annual; decadesThe single best portal; bulk download; document the extraction date
MoSPI (NSO)CPI (base 2012 = 100), IIP (2011–12), quarterly GDP and GVA (2011–12), PLFS quarterly bulletinsMonthly, quarterly; CPI from 2011, quarterly GDP from 1996–97Base changes need splicing; GDP revisions are large
Office of the Economic Adviser, DPIITWPI (base 2011–12) and componentsMonthly; long series with base linksThe producer-price side of inflation
Labour BureauCPI-IW (base 2016), CPI-AL/RLMonthly; longUsed for wage indexation and rural real wages
Ministry of Finance, PIB, GSTNGST collections, fiscal data, monthly economic reportMonthly since July 2017GST is a short series with a strong seasonal and a COVID break
IMD; IITMRainfall by subdivision; the homogeneous all-India series from 1871Daily, monthly; 150 yearsThe longest Indian series; the monsoon is a regressor in half of applied macro
CMIE (Economic Outlook, CPHS)High-frequency employment, sentiment, company dataMonthly, weekly; paidCoverage and weighting debates; cite the vintage
IMF IFS; World Bank WDI; FREDCross-country comparables; some Indian series mirroredMonthly (IFS), annual (WDI)Definitions may differ from the domestic source; say which you used
For Bangladesh, Pakistan, Nepal and Sri Lanka the central bank (Bangladesh Bank, State Bank of Pakistan, Nepal Rastra Bank, Central Bank of Sri Lanka) and the statistics bureau are the equivalents, with shorter and more revised series.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Programme and administrative series: the sector's own time series
SourceSeriesFrequencyTraps
HMIS (Health Management Information System)Facility-reported health service indicators by districtMonthly since 2008Reporting completeness varies by month and district; denominators are projections; a zero is often a non-report
MGNREGA MISPerson-days, households, wages, works by blockMonthly, daily updatesStrong lean-season seasonality; data revised as muster rolls are entered; state-level differences in reporting lag
AgmarknetMandi arrivals and prices by commodity and marketDailyMissing days with no trade; variety and grade changes; outliers from entry error
UDISE+; school MISEnrolment, teachers, infrastructureAnnualNot a time series in the sense here; annual with definitional changes
NFHS, NSS, PLFSSurvey roundsEvery few years; PLFS quarterly for urbanRounds are comparable only with care; not for ARIMA
CPCB; state pollution boardsAQI and pollutant concentrations by monitorHourly, dailyMonitor network changes; missing hours; calibration
Programme MIS (your own)Beneficiaries, disbursements, complaints, stockMonthlyEverything above, plus the definition changed when the software did
Administrative series are where the methods in section 10 earn their keep, and where the cleaning decisions in section 02 matter most. Keep the reporting-completeness series alongside the outcome series and plot both; a change in one explains many changes in the other.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Software: what each does, and what it costs
ToolCostTime-series strengthsGaps
R: forecast, fable/tsibble/feasts, urca, vars, ARDL, strucchange, rugarch, CausalImpact, SynthFreeEverything in this course, with the reference implementations for forecasting and the best documentation (fpp3)Several packages to learn; Johansen output is less friendly than Stata's
Python: statsmodels (ARIMA, SARIMAX, VAR, VECM, ARDL, unit-root tests, state space), pmdarima, arch, rupturesFreeFull coverage; integrates with data pipelines and machine learningFewer diagnostics printed by default; more code per result
Stata: tsset, arima, dfuller/pperron, vecrank/vec, var/irf, ardl (Kripfganz and Schneider), itsa (Linden), synth, neweyLicenceClean output; the econometric tradition; ARDL and ITS commands are excellentNo automatic ARIMA or ETS; forecasting is weaker than R
EViewsLicenceMenu-driven ARDL with bounds test, Johansen, Bai-Perron, X-13, GARCH; the tool most South Asian econometrics courses teachCost; scripting is awkward; reproducibility depends on saving workfiles and programs
gretlFree, open sourceMenu-driven like EViews: unit-root tests, Johansen, VAR, ARDL via scripts, GARCH, X-13 interface, good graphsSmaller community; fewer new methods
Excel / Google SheetsFree or licensedPlotting, moving averages, classical decomposition, simple smoothingNo unit-root tests, no ARIMA worth using, no reproducibility; fine for a first look
For a learner: gretl to see every method with menus, then R with fpp3 for forecasting and urca/vars for the econometrics. For a Stata department: Stata plus R for forecasting. EViews is a fine tool whose cost is the only argument against it, and everything it does, gretl does free.
ImpactMojoTime Series Analysis 101www.impactmojo.in
A reproducible time-series workflow
01
DOWNLOAD raw data with a script; save with the date and source URL
02
CLEAN in code: splice bases, handle missing, transform; log every decision
03
PLOT: levels, differences, ACF, seasonal plots; save the figures
04
TEST: integration orders, breaks, seasonality; one table
05
MODEL: the candidates, the diagnostics, the chosen model
06
EVALUATE: rolling out-of-sample against benchmarks, or placebos for evaluation designs
07
REPORT: tables from code, figures from code, the script in the replication package
Time-series results are unusually sensitive to small decisions (lag length, deterministic terms, the sample start, a dummy), and the only defence is that every decision is in a script a reader can change. Quarto or R Markdown, with the data download at the top and the tables generated at the bottom, is the form that makes this automatic.
Data vintage is a decision too. 'GDP series downloaded from MoSPI on 12 March 2026, base 2011–12, second revised estimates for 2023–24' is the sentence that lets a reader in 2028 know why their numbers differ.
ImpactMojoTime Series Analysis 101www.impactmojo.in
A worked study outline: does MGNREGA demand respond to rainfall shocks?
StepDecisionSection
QuestionDoes a rainfall deficit in the monsoon raise MGNREGA person-days in the following lean season, by how much, and how fast?01
DataMonthly person-days by state (MIS, 2012–2025); IMD subdivision rainfall; state population; a 2020 dummy02, 11
TransformLog person-days per 1,000 rural population; rainfall as percentage deviation from the long-period average; seasonal plots show a June–July trough and a March–May peak02
IntegrationLog person-days: I(0) around seasonal means with a break in 2020 by ADF, KPSS and Zivot-Andrews; rainfall deviation I(0)03, 09
ModelDynamic regression with seasonal dummies, distributed lags of rainfall deviation (0 to 9 months), AR errors, state fixed effects; a panel ARDL as a check07
Finding (illustrative)A 20% monsoon deficit raises person-days by 11% at a 4–6 month lag, fading by month 9; larger in states with lower irrigation cover07, 09
Evaluation designFor the 2016 wage revision: controlled ITS with states that revised later as controls10
RobustnessDrop 2020; alternative lag lengths; Newey-West vs AR errors; district-level replication for two states06, 07
ReportUnit-root table in the appendix; IRF-style plot of the rainfall lag coefficients with bands; the ITS figure; replication package on a repository11
Numbers are illustrative; the structure is the point. Each step names the section of this course that governs it, and the paper's methods section is this table written out.
The lag structure is the policy result: if demand peaks five months after a failed monsoon, that is when the funds must be in the states' accounts.
ImpactMojoTime Series Analysis 101www.impactmojo.in
The dozen errors that get time-series papers rejected
ErrorSectionFix in one line
Regression in levels of I(1) series with no cointegration test07Test; ECM or differences
Unit-root tests with unreported terms, lags and margins03One full table
Six unit-root tests, the convenient one reported03ADF and KPSS, both, always
ARDL on 30 annual observations with five regressors07Fewer regressors, or admit the design cannot answer
Granger causality as the contribution08IRFs, and a question
Cholesky ordering unreported08State it; try alternatives
Forecast accuracy with no benchmark, in-sample05, 06Seasonal naive, rolling origin, MASE
MAPE on a series with zeros06MASE or RMSE
Seasonality ignored in a monthly model02, 09Dummies, seasonal ARIMA or STL
2016, 2020 and base-year changes left untreated09Dummies, splicing, sub-samples; report both
ITS with six points each side and a p-value10Descriptive claim only; more data
'Causes' from a model that shows co-movement07, 08, 10Scale the verb to the identification
Every one of these appears in most issues of the journals that publish South Asian applied time-series work. Avoiding them is the difference between those journals and the ones on the reading list.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Before you submit: the time-series checklist
Data and descriptionDone
Every series plotted in levels and differences, with the figures kept
Source, vintage, base year, transformations and sample stated
Missing values and reporting gaps identified and handled in code
Seasonality examined and treated
Known breaks (2016, 2017, 2020, base changes) tested and handled
Integration orders tested with two tests, reported in one table
Modelling and reportingDone
Model form justified by the tests and the question, not by the software default
Lag lengths and deterministic terms chosen by stated criteria and reported
Residual diagnostics passed and reported with statistics
Forecasts evaluated out of sample against benchmarks, by horizon, with coverage
Identification assumptions (ordering, exogeneity, counterfactual) stated in words
Sensitivity to the main choices shown
Causal verbs scaled to what the design supports
Script and data (or download code) in a replication package
Fourteen lines. The unit-root table and the benchmark comparison are the two most often missing.
ImpactMojoTime Series Analysis 101www.impactmojo.in
Where to go next
ResourceWhat it coversNotes
Hyndman and Athanasopoulos, Forecasting: Principles and Practice (3rd ed., OTexts, 2021)Sections 02, 04, 05, 06 with R code for everythingFree online at otexts.com/fpp3; the first thing to read
Enders, Applied Econometric Time Series (4th ed., Wiley, 2014)Unit roots, cointegration, VAR, GARCH, breaks; the applied econometrics halfThe standard graduate applied text
Stock and Watson, Introduction to Econometrics (4th ed., Pearson, 2019), the time-series chaptersDynamic regression, forecasting, cointegration, at an accessible levelWhere most economists first meet the material
Kilian and Lütkepohl, Structural Vector Autoregressive Analysis (Cambridge University Press, 2017)Everything about VARs and identificationFor section 08 in depth
Hamilton, Time Series Analysis (Princeton University Press, 1994)The theory, completeReference, not a first read
Shumway and Stoffer, Time Series Analysis and Its Applications (4th ed., Springer, 2017)Statistical treatment with R, including state spaceFree PDF from the authors
Bernal, Cummins and Gasparrini, Int J Epidemiol 2017, 46:348; Lopez Bernal et al. 2018, 47:2082Interrupted time series, with and without controlsThe two papers to cite and follow
Abadie, J Econ Lit 2021, 59:391Synthetic control: method, practice, pitfallsRead before using the method
Pesaran, Shin and Smith, J Applied Econometrics 2001, 16:289; Kripfganz and Schneider's ardl documentationThe bounds test and its correct useRead the original, not the summaries
ImpactMojo: Econometrics 101, Impact Evaluation 101, Data Analysis 101The regression and evaluation foundations this course assumesimpactmojo.in/101-courses/
ImpactMojoTime Series Analysis 101www.impactmojo.in
What to remember
  • Plot first. The plot decides the method and shows what no test will.
  • Autocorrelation shrinks your sample; persistence makes 'significant' cheap.
  • Test the order of integration, with two tests, and report the table. Everything after depends on it.
  • Two trending series correlate whether or not they are related. Cointegration is the exception, and it is tested, not assumed.
  • Forecasts are judged out of sample, by horizon, against a benchmark, with interval coverage checked.
  • The ECM gives a long-run relationship and a speed of adjustment; those two numbers are the finding.
  • A VAR describes dynamics; its causal content is the identification you added. Granger causality is prediction.
  • Breaks, seasonality and 2020 are modelled, not ignored and not deleted.
  • An ITS is a counterfactual drawn from the pre-period; the controls and placebos are what make it credible.
  • Every decision in a script; every table from code; the vintage of every series stated.
The question this course began with, asked of every result: a relationship, or two things moving through time together?
ImpactMojoTime Series Analysis 101www.impactmojo.in
Time Series Analysis 101 · Complete
Now go find out
whether the trend is real.
CC BY-NC-ND 4.0·Free Forever·ImpactMojo 101 Series