Fiveable

Intro to Time Series Unit 15 Review

QR code for Intro to Time Series practice questions

15.1 Stock price and return analysis

15.1 Stock price and return analysis

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
Intro to Time Series
Unit & Topic Study Guides

Stock price analysis breaks down price movements into components like trend, seasonality, and cyclical fluctuations so you can better understand market behavior. Time series modeling takes this further by using techniques like ARIMA and GARCH to forecast future prices and quantify volatility, helping analysts manage risk more effectively.

Stock Price Time Series Analysis

Stock prices aren't just random numbers bouncing around. You can decompose their movements into distinct components, each telling you something different about what's driving the price.

  • Trend captures the long-term upward or downward direction (think bull vs. bear markets over years)
  • Seasonality refers to recurring patterns at fixed intervals, like the tendency for prices to shift around quarterly earnings reports
  • Cyclical fluctuations are tied to broader economic cycles such as expansions and recessions. Unlike seasonality, these don't have a fixed period.
  • Irregularity is the noise from unexpected events: natural disasters, geopolitical shocks, surprise announcements

Visual analysis techniques help you spot these components before running any formal tests:

  • Line plots show overall trends and patterns over time
  • Candlestick charts display the open, high, low, and close prices for each trading period (day, week, or month), giving you a richer picture than a simple line
  • Moving averages smooth out short-term noise to reveal the underlying trend. A 50-day moving average reacts faster to recent changes, while a 200-day moving average shows the broader direction. When a shorter moving average crosses above a longer one, traders often interpret that as a bullish signal.

Statistical analysis techniques let you quantify what you're seeing visually:

  • Autocorrelation (ACF) measures the correlation between a stock price and its own past values at various lags (e.g., how correlated is today's price with yesterday's?)
  • Partial autocorrelation (PACF) measures the correlation at a specific lag after removing the effects of all intermediate lags. This helps isolate the direct relationship between, say, today's price and the price two days ago.
  • Augmented Dickey-Fuller (ADF) test checks whether the time series is stationary, meaning its statistical properties (mean, variance) stay roughly constant over time. Raw stock prices almost always fail this test, which is one reason we often work with returns instead.

Anomaly detection methods flag unusual behavior:

  • Outlier detection identifies observations that deviate significantly from the norm, such as sudden spikes or crashes
  • Change point detection finds abrupt shifts in the series' properties, like a structural break where the market enters a fundamentally different regime
Analysis of stock price trends, Market Trader Tao Day Trading The SPY: Moving Average Stock Chart ...S$P 500

Calculation of stock returns

Raw stock prices are hard to model directly because they're non-stationary. Converting prices to returns solves this problem and makes different stocks comparable regardless of their price level.

Simple returns calculate the percentage change over one period:

Rt=PtPt1Pt1R_t = \frac{P_t - P_{t-1}}{P_{t-1}}

A positive value means the price went up; negative means it went down. If a stock goes from $100 to $105, the simple return is 0.05, or 5%.

Log returns give you a continuously compounded measure:

rt=ln(PtPt1)r_t = \ln\left(\frac{P_t}{P_{t-1}}\right)

Log returns have two big advantages for time series work. First, they're additive across time: to get the total log return over multiple periods, you just sum the individual log returns. Second, they're more symmetric than simple returns, which makes them better suited for statistical models that assume normality. For small returns, simple and log returns are nearly identical.

Adjusted returns account for dividends, stock splits, and other corporate actions:

Radj,t=Pt+DtPt1Pt1R_{adj,t} = \frac{P_t + D_t - P_{t-1}}{P_{t-1}}

Here DtD_t represents dividends paid during the period. Adjusted returns give a more accurate picture of the total return an investor actually receives, not just the price change.

Analysis of stock price trends, Candlestick chart - Wikipedia

Time Series Modeling and Forecasting

Time series models for forecasting

ARIMA models (Autoregressive Integrated Moving Average) capture linear dependencies in stock price data. Fitting one involves three steps:

  1. Identify the model order. Use the ACF and PACF plots along with information criteria (AIC, BIC) to choose the number of AR terms (pp), differencing steps (dd), and MA terms (qq). The differencing step is what makes a non-stationary price series stationary.
  2. Estimate parameters. Fit the model using maximum likelihood or least squares estimation.
  3. Diagnose the fit. Check that the residuals look like white noise: they should be approximately normal, have constant variance (homoscedasticity), and show no significant autocorrelation.

GARCH models (Generalized Autoregressive Conditional Heteroskedasticity) address something ARIMA can't: time-varying volatility. Stock returns tend to show volatility clustering, where periods of high volatility bunch together. GARCH models capture this pattern.

  1. Identify the order of the ARCH (qq) and GARCH (pp) terms using information criteria.
  2. Estimate parameters via maximum likelihood.
  3. Diagnose the model by checking that the standardized residuals are approximately normal and independent.

GARCH models are widely used in risk management (e.g., calculating Value at Risk) and option pricing (estimating implied volatility).

Evaluation of forecasting models

No model is useful unless you can measure how well it actually predicts. Several metrics quantify forecast accuracy:

  • MAE (Mean Absolute Error) gives the average absolute difference between forecasts and actual values. Easy to interpret.
  • MSE (Mean Squared Error) squares the errors before averaging, so large errors get penalized more heavily.
  • RMSE (Root Mean Squared Error) is the square root of MSE, putting the error back in the same units as the stock price.
  • MAPE (Mean Absolute Percentage Error) expresses errors as percentages, making it easier to compare across stocks with different price levels.

Validation techniques test whether your model generalizes beyond the data it was trained on:

  • Train-test split divides your data chronologically (e.g., 80% for training, 20% for testing). For time series, you always train on earlier data and test on later data to avoid look-ahead bias.
  • Rolling window moves the training window forward through time, refitting the model and generating forecasts at each step. This simulates how the model would perform in real-time use.
  • Time series cross-validation is similar to k-fold cross-validation but respects the temporal order of the data, expanding the training set at each fold.

Benchmark comparisons put your model's performance in context:

  • Always compare against a naive forecast like the random walk (tomorrow's price equals today's price) or a simple historical average. If your model can't beat these, it's not adding value.
  • Use formal statistical tests like the Diebold-Mariano test to check whether differences in predictive accuracy between two models are statistically significant, rather than just eyeballing the error metrics.