IST718 WK4

3 minute read

FROM LIVE CLASS:

https://colab.research.google.com/drive/1yDJ5cr1mtTOqjRdkcQO2R9eSwVI8KnKs

https://colab.research.google.com/drive/1r7gvr6uxRHvYoN3t6YMDMRskVd8yRngu

WEEK 4

4.1 Scenario Introduction

Are our sales going up or down? Economic data Seasonality? Will we be able to determine if we are going to sell more candy of less candy?

TOOLS:

  • Autocorrelation
  • Partial autocorrelation

4.2 Data Review

TEMPORAL DATA

  • Time period, temporal data (weekly, monthly, yearly)
  • Seasonal data – Reoccuring pattern on a time scale

IN SAMPLE – OUT OF SAMPLE

  • In sample – candy
  • Out of sample – us holiday dates

CORRELATION: We want to know T and T-1 and T-2

4.3 Model Review

  • White Noise (mean of 0)
  • BOX JENKINS
  • ARMA

4.4 Recommendation

  • Augmented Dickey-Fuller test
  • We’re using the Augmented Dickey-Fuller Test, or statistic, to determine if this model– correction– if this time series has elements of stationary. Or if this time series has elements of a trend. When we look at the augmented Dickey-Fuller statistic, the more negative it is, the more likely that the time series being reviewed has trend.

OUR RECOMMENDATION:

  • Increasing sales in next quarter
  • Opportunity to close forecast gap
  • Consider data transformations
  • Consider methods to acccount for holiday

Finally, we need some methods to account for the holidays. One of the things that we can look at going forward is when we use an autoregressive integrated moving average model, how do we use that integrated function to give us an account for a holiday so we can shift our forecast up or down, depending on the presence or the absence of a holiday?

4.5 Code Review

TODO – hands on keyboard

4.6 Time Series

PATTERNS IN TEMPORAL DATA:

  • Stock prices
  • Call centers
  • Receipts

Forecasting

  • White noise
  • Covariance
  • Seasonality
  • Stationary

4.7 ARIMA

Dynamics of a Time Series

  • Moving Average: Weighted sum of most recent
  • Autoregressive: dependent on previous values
    • ACF – decay to zero
    • PACT – identify order at decay
    • AR1 model is what we know NOW to predict how many lags in that time series might be relevant (statistically sig) in being able to make a prediction
    • STRONG ACT – moving average model
    • STRONG PACF – auto regressive model
    • manually plot out ACF PACF
  • ARMA/ARIMA: Mix of Moving Average and Autoregression

4.8 Forecasting

  • Moving Average Smoothing
    • If we’re trying to predict the next 10 weeks, the next 12 weeks, we might use a forecast window that is four weeks. And so therefore, we’d take the previous four weeks, take the equally-weighted average across those four weeks in order to predict into the next time period.
  • Exponential Smoothing
    • For exponential smoothing, the moving average is going to take equal weightings. An exponential smoothing model is going to decrease the weightings the further back into the average window, or the further back into the time series you go. So an exponential smoothing model is going to give more weight to the time period that occurs directly before the time period you’re trying to predict, versus a time period that occurred four, five, six weeks prior to the time period you’re going to predict.
  • Box Jenkins Models (AKA ARIMA)

Model Validation

How do we compare against a test set? So what is our root mean square error? So the mean squared error is just comparing our prediction versus our actual. The root mean squared error is taking the square root of our mean squared error. And again, we’re taking the value we predict versus the value that we actually observe, and we’re looking to see how our model performs in that scenario.

4.9 Data Structure

Transformations

  • Normalize
    • subtract mean
    • Dividing maximum value
  • Take the log
  • Make categorical – bucketize
  • Define threshold and make binary
    • = threshold? 1

    • <= threshold? 0

4.10 Introduction to Case Study

Tags:

Updated: