TIME SERIES Notes

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

TIME SERIES - 2Pep Video

Time Series Overview:


 Time Series: a set of observations typically over equal intervals (monthly, quarterly,
weekly)
 Further we forecast in time, the less accurate our projections are going to be
 Do better when dealing with aggregates compared to individual item
 Ex: forecast GPA of class on grad day vs forecast GPA of single student
on grad day
 Forecasts used as motivators
 Ex: "Need sales value of $150K for the month" --> motivating to meet
the target
 Always a good idea to make a forecast with an individual or point estimate and a
range because we're dealing with samples, and there's always wiggle room that
we need to account for
 3 kinds of forecasting engines:
 Judgmental (aka Managerial forecasting): using your own insights/opnions
 Ex: ask an executive for their opinion as to the state of the economy
using their judgement
 Times Series: THE CORE ISSUE = The past is a good indicator of the future (with
caveat that no fundamental changes in the underlying structure)
 Relationships/relational analysis (regression): Connecting 2 variables together
-- yrs of exp and compensation
 2 Data Classifications: Note: variables are the columns in excel and rows are the
observations
 Cross-Sectional Data: snapshot in time -- performance metrics recorded for
numerous variables at the same point in time (ie. Wins, home runs, team salary,
manager's exp for MLB teams for 2018) -- what it would take for a particular
team to make the playoffs
 Concerned about variables
 Ex: Columns = variables of interest (winning, home runs, salary); rows =
teams/players
  Winning Home Runs Team Salary
Dodgers      
Red sox      
o Time Series Data: Chronologically ordered sequence of data values for one variable
(ie. Month unemployment rate for period 2010 to 2019)
 In Excel, Columns = variables (unemployment rate); Rows = monthly
observations
 Concerned about time frame
 
 Graphic below highlights 2 variables - availability of data (horizontal axis from low to high)
and time horizons (vertical axis from short to long [upwards])
 Near the top "Delphi" and these kinds of forecasting techniques are used when we want
to project ahead to 10 to 20 years
 Across horizontal axis, "extrapolation" -- take time series data and assume that the
underlying structure has remained more or less the same and take past trends and project
them into the future
 Ex: earned 70 on a quiz then 80 then 90. If nothing changed, next quiz = 100 -->
that’s extrapolation
 Things change so extrapolating too far in future can cause significant variance to
reality
 "Regression" = combining couple variables together; instead of relying on a single variable
like time series, we look at combinations which help us improve
 Yellow zone = combo; call in expert judgment and combine that with our 'data-based
analysis'
 

 If looking at upward trend, use model that had trend component


 If looking at no trend, my goal is to smooth out the data to get a better handle on what's
occurring
 

 Seasonality is measured within the period of one year so if you have, for example, annual
data, the question of seasonality disappears
 Lower left (Cyclic) is the business cycle = variance in demand over years
o Important because if we in recession, might not be best time for me to launch new
product/service
o Cyclic is just the economy - regularly impacted by the business cycle --> economy is
good, business goes up; recession, business goes down
 Irregular component - hard to get hands around, but it's real
o Ex: Ended up with a trade deal with China or not, continued unrest in the Middle East,
continued unrest here locally --> these effects have big impact on overall forecasting
accuracy
 

 Candidate Forecasting Models:


o Moving average
 Simple
 Weighted
 Difference b/t the two is in weighted category we put more
emphasis on more recent values
o Smoothing
 Consists of single/simple component
 Smoothing with trend
 Smoothing with trend/seasonal
o Regression model
 Where the x variable from your undergrad days is time
 
200-Day Moving Average
 Why are moving day averages important in general?
o Coronavirus ex:
o We want to remove/identify the outliers
o Data collection might not be correct over time
o Would mitigate outliers
Autocorrelation—The degree of time lagged correlation in the time series
Autoregressive—A method that uses regression analysis based on past time values to forecast future
variable values (professor mentioned it)
Casual Relationship (11.15) --- Where the values of the indep variables are thought to have a direct
impact of the value of a time series
Predictive Relationship (11.15) --- Where the values of the indep variables are not casual but correlate
with time series to help forecast future values
 Predictor variable does not have a cause-and-effect relationship with the time series
Cyclic component—The long-term variations around the trend of a time series generally attributed to
changing business and economic conditions
Decomposition—The process of separating a times series into its basic components
Double Moving Average (11.11) --- Forecasting technique for non-stationary data that uses avgs of avgs
to compute an estimated forecast level and trend adjustment

Where:

 Values of Et and Tt are derived by minimizing the sum of squared errors using
the last k periods of data
 Et represents the estimated level of the time series at period t and Tt represents
the estimated trend
 Thus at period t, the forecast n periods into the future would be Et + nTt
Double Exponential Smoothing (aka Holt's method) (11.12) --- forecasting technique for non-stationary
data that uses weighted avgs to compute an estimated forecast level and trend adjustment
 Holt's method is a simple 3-step process:
1. Compute the base level Et for time period t using first equation below
2. Compute expected trend value Tt for time period t using 2nd equation
below
3. Compute the final forecast Yt+n for time period t + n
 Holt's method computes an estimate of the base, or expected, level of time series (Et),
and the expected rate of increase or decrease (trend) per period (Tt)
 Forecasting function in Holt's method is represented by:

 Can use this function to obtain forecasts n time periods into the future where n
= 1,2,3, etc
 Forecast for time period t + n (or Yt+n) is the base level at time period t (given
by Et) + expected influence of the trend during the next n time periods (given by
nTt)
Where:


o Smoothing parameters a and B assume any value bt 0 and 1 (0 <_ a,B <_1)
Linear Trend (11.12), (11.16 Linear Trend Model)--- trend with a constant slope
 How we might use time as an independent variable:
o
 X1t = t
 The error term Et represents the unsystematic, or random, variation in
the time series not accounted for by our model
 Values of Yt are assumed to vary randomly (above and below) the
regression function B0 + B1X1t, the avg (or expected) value of Et = 0
Exponential smoothing (11.6) —A forecasting method for stationary data that allows weights to be
assigned to past data; Exponential smoothing model assume the following:


o Indicates that the predicted value for time period t + 1 (Yt+1) = predicted
value for previous period (Y^t) plus an adjustment for the error made in
predicting the previous period's value (a(Yt-Y^t))
 Parameter x can assume any value bt 0 and 1 (0 <_ a <_ 1)
o Y^t+1 in exponential smoothing is a weighted combo of all prev values in
the time series where the most recent observation Yt receives the heaviest
weight (a), the next most recent observation Yt-1 receives the next heaviest
weight (a(1-a)), etc…
o In exponential smoothing model, small values of a tend to product sluggish
forecast that don't react quickly to changes in the data
 A value of x near 1 produces a forecast that reacts more
quickly to change in data
o In expo smoothing forecasting model, it's customary to assume Y^1 = Y1
 Forecasting with Exponential Smoothing Model (11.6.1)
o

o Expo smoothing technique becomes apparent when we forecast more than


one time period into the future
Extrapolation (11.1) --- The idea that history repeats itself and we can project into the future from what
we've observed in the past; general form of extrapolation model is:

 Predicted value = f(actual value of time series variable in time period t, actual value of
time series in time period t - 1, etc…)
 Goal of the model is to identify f( ) that produces accurate forecasts of future values of the
time series variable
Forecasting—A process for predicting the future
Holt-Winter's Method (for Additive Seasonal Effects) (11.13) --- extension of Holt's Method to apply to
time series exhibiting trend and seasonality
 4-step process:
1. Compute base level Et for time period t using 2nd equation below
2. Compute the estimated trend value Tt for time period t using 3rd equation
below
3. Compute the estimated seasonal factor St, for time period t using 4th
equation
4. Compute the final forecast Y^t+n for time period t + n using 1st equation
below

Where:



Holt-Winter's Method (for Multiplicative Seasonal Effects) (11.14) --- seasonal effects in the data may
be becoming more pronounced over time
 Use same process as additive above but with these new equations

Where:

Irregular component—The impact of random events on the time series (COVID)


Mean absolute deviation (MAD) (11.2)—A method for measuring the accuracy of a forecast by
summing the absolute differences between the actual and forecast values
Mean absolute percentage error (MAPE) (11.2)—A method for measuring the accuracy of a forecast by
summing the absolute percentage error
Mean square error (MSE) (11.2)—A method for measuring the accuracy of a forecast by summing the
squared differences between the actual and forecast values
Root Mean Square Error (RMSE) (11.2) - A method for measuring accuracy by the square root of the
mean square error(?)
Moving average (11.4)—A forecasting method for stationary data based on averaging two or more
consecutive time series observations; data you use for your forecast is always moving; Ex:

 Predicted value of the time series in period t + 1 (denoted by Yt+1) is simply the avg of the
k previous obs in the series
 ~Seems like k is an unknown amount of yrs/time that we need to figure out; The example
seems to show values of 2 and 4, which are shown by 2 and 4 month ranges~
 Sometimes referred to as a smoothing method
 Larger the value of k (or the more past data pts averaged together), the smoother moving
avg prediction will be
 Can evaluate the relative accuracy of two moving avg forecasting functions by comparing
the MSE values; MSE value describes the overall fit of the forecasting technique to the
historical data; this formula calculates MSE:

 SUMXYMY2( ) function calculates the sum of squared differences bt
corresponding values in two different ranges
 If a time series is stationary (or has no trend), it is reasonable to assume that the forecast
of the next and all future time periods equal the same value
 Drawback of moving avg technique is that all the past data used in calculating the avg are
weighted equally; we obtain a more accurate forecast by assigning different weights to
the data --- weighted moving avg
Nonstationary time series—A time series containing a trend
Quadratic Trend (11.17) --- A trend with a non-constant curvilinear slope
Regression—A process for fitting a straight line through a time series
Seasonal component (11.7)—Represents a pattern of change that is completed within one year and
repeats itself regularly over the time series
 2 different types of seasonal effects in time series data: additive effects and multiplicative
effects
 Additive Seasonal effects --- remain approx constant order of magnitude over time a
given season is encountered
 Unit sales tend to be higher in quarters 1 and 3 and low in quarters 2 and 4 = 4
accurate forecasts
 Following model for stationary time series data w additive seasonal effects:

 Forecast for time period t + n is simply the expected lvl of the time
series at period t adjusted up or down by seasonal factor St+n-p

 Estimates expected lvl for period t as a weighted avg of the
deseasonalized data for period t(Yt - St-p) and the prev period's
level (Et-1)

Estimates seasonal factor for period t as the weighted avg of the


estimated seasonal effect in period t (Yt - Et) and prev seasonal
factor for that same season (St-p)
o In these models Et represents the expected level of time series in period t,
and St reps the seasonal factor for period t
o The constant p reps the # of seasonal periods in the data
o To use all these equations 11.5 to 11.7, we must initialize the estimated
levels and seasonal factors for the first p time periods
 We will use the avg value for the first p time periods as the initial expected
levels for each of these time periods; then use difference bt actual values
and expected levels as the initial seasonal factors for the first p time periods
 Multiplicative Seasonal Effects (11.9) --- increasing or decreasing in magnitude over time
o Slight modification from additive seasonal effects; models below Et reps the expected level
of the time series in period t, and St represents seasonal factor for period t. The constant p
reps the number of seasonal periods in the data

 (same as additive effects except it is multiplication)

 (same as additive effects except Yt is divided by St-p)

 (same as additive effect except t(Yt/Et) and (St-p)


Simple moving average—A forecasting method based on averaging two or more consecutive time series
data points
Stationary time series (11.3) —A time series where the process average remains unchanged over time
Time series (11.2)—A set of data points recorded over successive time periods
 Evaluate techniques by constructing line graphs that show the actual data vs values
predicted by various modeling techniques
Trend component (11.10)—The general long-term up or down sweep or direction of the time series
 Because the moving avg, weighted moving avg, and exponential smoothing techniques
use some avg of the prev values to forecast future values, they consistently
underestimate the actual values if there is an upward trend in the data
 Weighted avgs could not forecast #'s past the largest available number
 If downward trend in data over time, methods discussed so far would product predictions
that overestimate the actual values in the time series
Weighted moving average (11.5) —A forecasting method for stationary data based on placing a larger
weight on the more recent of two or more consecutive time series observations

 Offers greater flexibility than moving avg but we must determine values for the weights wi
and k in equation above
 Ex: using 2 variables to predict something else; weighted avg - predicted what how many
calories the kids had per year; more relevant what happened 2 months vs. 12 months =
more recent is more accurate or weighed more heavily
 3 variables (eating, height, age)

You might also like