
Understanding Time Series Analysis: Techniques and Applications
Explore various techniques like Bounded Window, Exponential Weight Moving Average, and Double Exponential Smoothing in Time Series Analysis. Learn how to set parameters, handle trends, and improve forecasting for better decision-making in data analysis.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
SADNA Ad Auction lecture #3 Time Series Yishay Mansour Mariano Schain
1.5 1 0.5 Series1 Series2 0 49 47 45 43 41 39 37 35 33 31 29 27 25 23 21 19 17 15 13 11 9 7 5 3 1 Series3 -0.5 -1 -1.5
30 35 30 25 25 20 20 15 Series1 Series1 15 10 10 5 5 0 0 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 Pg-dvd 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 Pg-null 40 35 90 80 30 70 25 60 20 Series1 50 15 Series1 40 10 30 5 20 0 10 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 null-dvd 0 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 null-null
40 35 30 25 Series2 20 Series3 Series1 15 10 5 0 1 2 3 4 5 6 7 8 9 1011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
Bounded Window Parameter W Take the average of the last W samples Smooth the samples Larger W smoother outcome Smaller W better following recent trends Computationally Requires keeping last W samples Simple update: St+1 St- yt-W/W + yt/W
Exponential Weight Moving average Parameter 0 < < 1 Formula: St+1 yt+ (1- )St Effect of : Smaller : larger weight to history Large : short reaction to trend Effective window size: 1/ Why exponential : St+1= (1- )jyt-j
1.5 1 0.5 Series1 Series2 0 49 47 45 43 41 39 37 35 33 31 29 27 25 23 21 19 17 15 13 11 9 7 5 3 1 Series3 -0.5 -1 -1.5
Discussion Setting up the parameters: = depends on the stability of the data Can be found by minimizing objective function Rt= yt St Minimize MSE = min Rt2 why MSE ? Note St+1= St+ Rt S1= undefined (need to initialize somehow) Problems: Trend
Double Exponential Smoothing Handles trend Parameters: , Formula: St+1 yt+ (1- )(St+ bt) equivalent: St+1 St+ (yt- (St+ bt)) bt+1 (St+1- St) + (1- ) bt Motivation Sttracks the smoothed point bttracks the smoothed slope Forecasting: Ft+1= St+ bt
5 4.5 4 3.5 3 Series1 Series2 2.5 Series3 Series4 2 1.5 1 0.5 0 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49
Double Exponential Smoothing Simple Example: yt= t Then: bt= 1 and St=t-1 Residual Analysis Rt= yt St Again St+1= St+ Rt Why not: bt+1 (yt yt-1) + (1- ) bt
Triple Exponential Smoothing Handles seasonality of cycle L (Holt-Winters) Parameters: , , Formula: St+1 yt/It+ (1- )(St+ bt) bt+1 (St+1- St) + (1- ) bt It+1 yt/ St+ (1- )It-L Ft+1 (St+ bt) It-L
Triple Exponential Smoothing Average and trend as before Itshould be cyclic cycle size L (how to find it?) measures that ratio of current value to average. Illustrative: I=2 I=2 I=1 I=1 I=0.5
Linear Regression: Basics Simple model to fit the data Basic example a1X1+ + apXp Goal: minimize square error (MSE) t(a1X1t+ + apXpt Yt)2 The constants are the X s and Y s We are solving for the coefficients: a s
Linear Regression What counts as linear ?! a0+ a1x a0+ a1x + a2x2+ a3x3 a1x1+ a2x2+ a3x1x2+ a4x12+ a5x22 a1log x1+ a2exp(x2) a0+ a1a0x1 a + x/a
Linear Regression: Computation Simple case: ax + b Minimize t(a xt+ b yt)2 Need to solve for a and b t2 (a xt+ b yt) xt= 0 t2 (a xt+ b yt) =0 The equations: a*avg(x2) +b*avg(x) = avg (xy) a * avg(x) + b = avg(y) The Solution ( ( )( ) x x y y i i 2) = a x x i = b y a x
Non-Linear Regression We need to optimize the MSE Now the derivatives are not linear in the a s Need a more complicate solver There are software out there that do it non-linear fitting procedures
Autoregressive Model (AR) A model of the current value given previous observed values Model Xt= c0+ a1Xt-1+ a2Xt-2+ + apXt-p+ t usually ai< 1 c0= (1- ai) E[X] Need to solve for the coefficients Simple linear regression
Moving Average Model (MA) A model of the current value given previous unobserved residuals Model: Xt= + t- b1 t-1- b2 t-2- - bq t-q This is a linear regression in the residuals s PROBLEM: we do not observe the residuals directly non-linear fitting procedures
ARIMA(p,q) Combines an autoregressive model (AR) p values back a moving average (MA) q values back Model: Xt= c0+ a1Xt-1+ a2Xt-2+ + apXt-p + t - b1 t-1- b2 t-2- - bq t-q
Detecting change When is there a shift Consider the Residuals Rt= yt Ft Stable residuals No change Much higher residuals maybe change In the simulation: detect a burst
How can you use this Understand the concepts Understand the alternatives There is enough software you can use you will need to select the model specify the input understand what the output means If you use software, remember: document which software you use document where you use it