How much of Shopify's (SHOP) stock movement is explained by the overall market (S&P 500) and by interest rates (10-year US Treasury yield), and how much is company-specific?
This project answers that question with a set of multivariate time series models, from classical econometrics (VAR, ARDL, SVAR) to dynamic correlations (DCC-GARCH) and deep learning (LSTM).
Project for the Advanced Time Series Analysis course, Master's in Applied Statistics and Data Science, Bucharest University of Economic Studies (ASE). Authors: Diana-Maria Lazăr, Ruxandra-Elena Mărian
| Variable | Description |
|---|---|
Close_SHOP |
Shopify daily closing price |
Close_SP500 |
S&P 500 daily close |
VIXCLS |
CBOE Volatility Index ("fear index"), FRED series |
DGS10 |
10-year US Treasury yield (%), FRED series |
Volume_SHOP |
Shopify daily trading volume, from Yahoo Finance (yfinance) |
- Period: May 2015 – May 2026, 2,746 trading days
- Split: 80% train / 20% test, chronological, at both daily and monthly frequency
multivariate.xlsxholds the first four series.Volume_SHOPis downloaded on the first run and cached involume_shop.csv, so later runs are reproducible.
Which models use which data:
| Model | Variables | Frequency |
|---|---|---|
| Stationarity, cointegration, VAR, Granger, IRF, FEVD | SHOP, S&P 500, DGS10 | Monthly |
| DCC-GARCH | SHOP, S&P 500, VIX, Volume | Daily |
| ARDL + Bounds test | SHOP ~ S&P 500 + DGS10 | Monthly |
| SVAR (Cholesky) | DGS10 → S&P 500 → SHOP | Monthly |
| LSTM | all five variables | Daily |
VIX is left out of the linear models because it is derived from S&P 500 options and would duplicate the market signal. Volume is stationary (unlike prices), so it only enters DCC-GARCH and the LSTM.
- ADF and KPSS tests: log prices are I(1), and monthly log returns are stationary.
- Cointegration: neither Engle-Granger nor Johansen finds cointegration (trace statistic 14.7 vs. a 5% critical value of 29.8). A VAR on returns is therefore used instead of a VECM on levels.
- VAR(2) on monthly returns: residuals show no autocorrelation or ARCH effects, and the model is stable (all eigenvalues inside the unit circle).
- Granger causality: S&P 500 → SHOP (p = 0.010, at lag 2) and DGS10 → SHOP (p = 0.021). There is no causality in the reverse direction.
- FEVD at 12 months: 88% of SHOP's forecast error variance comes from its own shocks, 10.5% from the S&P 500 and 1.3% from rates.
Each series first gets a univariate GARCH(1,1), then a DCC model is estimated by maximum likelihood.
- DCC parameters: a = 0.019 and b = 0.953. Correlations change slowly but are highly persistent (0.972).
- Average SHOP–S&P 500 correlation: 0.46. It rises to about 0.65 in crises (COVID-19 in 2020, the 2022 growth-stock correction), so diversification weakens exactly when it is needed.
- Other average correlations: SHOP–VIX −0.40, S&P 500–VIX −0.81, SHOP–Volume ≈ 0.
- ARDL(1,1,1): the S&P 500 has a strong immediate effect (+2.21) that reverses the following month (−2.30).
- Bounds test (Pesaran, Shin & Smith, 2001): F = 2.06, below the 5% lower bound of 3.79, so there is no long-run relationship. The market and rate effects on SHOP are short-term only.
Cholesky ordering: DGS10 → S&P 500 → SHOP. Rates are the most exogenous, and a single stock cannot move rates or the index within the same month.
- Market shock: a structural S&P 500 shock moves SHOP 2.2 times as much as the index itself in the same month (+7.6% vs. +3.5%). This matches the ARDL coefficient.
- Rate shock: a one-standard-deviation rate shock lowers SHOP by 3.1% the following month and by ~8.2% cumulatively over 12 months (significant at 95%). The S&P 500 barely reacts (+0.5% cumulatively).
- Structural FEVD at 12 months: 55% of SHOP's variance comes from its own shocks, 35% from the market and 10% from rates.
- Architecture: 2 × LSTM(64) + Dropout(0.2) + Dense(32) + Dense(1), with a 60-day window over all five variables.
- Performance: MAE = $10.62, RMSE = $13.69, MAPE = 9.0% on the test period (2024–2026). The model follows the trend well but smooths out sudden moves.
| Model | MAE | RMSE | MAPE | Evaluation |
|---|---|---|---|---|
| ARDL (monthly) | $3.16 | $5.39 | 7.4% | in-sample |
| LSTM (daily) | $10.62 | $13.69 | 9.0% | out-of-sample, one day ahead |
| VAR (monthly) | $17.46 | $20.91 | 17.1% | out-of-sample, 27 months ahead |
These metrics are not directly comparable. ARDL is evaluated on training data. The LSTM predicts one day ahead using the actual previous 60 days. The VAR forecasts 27 months ahead with no new information.
- Shopify is mostly driven by company-specific factors. About 88% of its forecast uncertainty comes from its own shocks, not from the market or interest rates.
- The market transmits to SHOP amplified. A market shock moves SHOP about 2.2 times as much, and the effect shows up in Granger causality with a two-month lag.
- Interest rates hit SHOP, not the market. A rate shock lowers SHOP by ~8% over a year while the S&P 500 barely moves. This is typical of growth stocks valued on future profits.
- Correlations are not constant. The SHOP–S&P 500 correlation rises in crises and stays high for months.
- There is no long-run equilibrium between SHOP, the S&P 500 and rates. All effects are short-term.
Python · pandas · NumPy · statsmodels · arch · SciPy · scikit-learn · TensorFlow/Keras · yfinance · matplotlib · seaborn
- The monthly models are estimated on about 105 observations, so confidence bands are wide.
- The SVAR results depend on the chosen Cholesky ordering.
- The LSTM scaler is fitted on the full series (including the test period). A stricter setup would fit it on the training data only. LSTM results can also vary slightly between runs.
- Future work:
- add technical indicators (e.g. RSI) to the LSTM;
- try a Temporal Fusion Transformer;
- feed the DCC-GARCH correlation regime into the LSTM.