SlideShare uma empresa Scribd logo
1 de 51
Baixar para ler offline
Time series Forecasting
Presented	
  at:	
  Big	
  Data	
  Analy2cs	
  	
  Programme	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  NIT	
  Srinagar	
  (15	
  March	
  2017)	
  
Presenter:	
  Haroon	
  Rashid	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  haroonr@iiitd.ac.in	
  
Help Yourself!
2
Contents
– What	
  is	
  forecas2ng	
  
–  Why	
  we	
  need	
  it	
  
– Forecas2ng	
  approaches	
  
– Forecas2ng	
  evalua2on	
  
– Forecas2ng	
  applica2ons	
  
3
Forecasting: Case Scenario - I
500
1000
Aug 28 Aug 29 Aug 30 Aug 31 Sep 01
Timestamp
Power(W)
variable
Train
Forecast
4
Forecasting: Case Scenario - II
5
Find	
  carbon	
  footprint	
  for	
  Toyota	
  Matrix	
  with	
  capacity	
  of	
  1.8	
  
(L),	
  and	
  	
  mileages	
  of	
  	
  25	
  (C)	
  and	
  31	
  (H)?	
  
Sta2s2cs	
  of	
  4	
  cylinder	
  cars	
  	
  
Table:	
  hWps://www.otexts.org/fpp/1/4	
  
Forecasting Types
– Time	
  series	
  Forecas2ng	
  
–  Data	
  collected	
  at	
  regular	
  intervals	
  of	
  2me	
  
–  e.g.,	
  	
  Weather,	
  electricity	
  forecas2ng	
  
– Cross-­‐Sec2onal	
  Forecas2ng	
  
–  Data	
  collected	
  at	
  single	
  point	
  in	
  2me	
  
–  e.g.,	
  Carbon	
  emission,	
  disease	
  predic2on	
  
6
Time	
  series	
  
Forecas2ng	
  
(Energy)	
  
Assumptions
1.  Historical	
  informa2on	
  is	
  available	
  
2.  Past	
  paWerns	
  will	
  con2nue	
  in	
  the	
  future	
  
7
100
200
300
400
Aug 03 Aug 04 Aug 05 Aug 06
Timestamp
Power(W)
500
1000
Aug 27 Aug 28 Aug 29 Aug 30
Timestamp
Power(W)
Forecasting Horizon
1.  Short-­‐term	
  forecas2ng:	
  
–  	
  Hours	
  to	
  few	
  days	
  ahead	
  
2.  Medium-­‐term	
  forecas2ng:	
  	
  
–  Few	
  days	
  to	
  months	
  ahead	
  
3.  Long-­‐term	
  forecas2ng:	
  
–  	
  Months	
  to	
  years	
  ahead	
  
8
I.	
  Short	
  term	
  decision	
   II.	
  Long	
  term	
  investment	
  
9
Why electricity forecasting
2
3
4
5
0 20 40 60 80
Months (Approx. 6 years)
Power(gW)
Sol:	
  Backup	
  Generators	
  
1.  Renewables	
  (Solar)	
  
2.  Diesel	
  Generators	
  
3.  Power	
  plants	
  
Img:	
  hWp://www.installeronline.co.uk/brownout-­‐one-­‐coming/	
  
Forecasting steps
1.  Problem	
  defini2on	
  
–  Purpose	
  (demand	
  supply,	
  Fault	
  detec2on)	
  
–  Factors	
  (Weather,	
  occupancy,	
  day	
  type)	
  
2.  Informa2on	
  gathering	
  
–  Sense	
  [Sensors:	
  smart	
  meters,	
  temperature,	
  PIR]	
  
–  Retrieve	
  [Z-­‐wave,	
  Bluetooth,	
  Wi-­‐Fi,	
  GSM]	
  
–  Store	
  [Mongo	
  DB,	
  MySQL]	
  
3.  Preliminary	
  analysis	
  
–  Visualiza2ons	
  [R,	
  Python,	
  Matlab,	
  Plotly]	
  
4.  Choosing	
  &	
  Fieng	
  models	
  
5.  Model	
  evalua2on	
  
10
3. Preliminary analysis
0.5
1.0
0.0
0.5
1.0
1.5
2.0
0
25
50
75
100
125
0
2
4
6
Apartment_1Apartment_2HVACChillerStreetLights
Aug 09 Aug 10 Aug 11 Aug 12 Aug 13 Aug 14 Aug 15
Power(KW)
11
Sunday	
   Saturday	
  
3. Preliminary analysis
500
1000
1500
2000
2012−05−01 2012−11−01 2013−05−01 2013−11−01 2014−05−01 2014−11−01
Timestamp
Power(watts)
12
3. Preliminary analysis: Seasonality,
trend
13
dataseasonaltrendremainder
2 4 6 8 10 12
200
400
600
−40
0
40
200
300
400
500
−50
−25
0
25
50
75
Time
4. Model fitting: Averaging approach
500
1000
1500
2000
Aug 30 Sep 01 Sep 03 Sep 05 Sep 07 Sep 09
Timestamp
Energy(W)
variable
Actual
Forecast
Average last 6, RMSE = 251.44
14
ˆYt+1|1...t =
(Y1 + Y2 + ... + Yt)
length(t)
4. Model fitting: Naïve approach
500
1000
1500
2000
Aug 30 Sep 01 Sep 03 Sep 05 Sep 07 Sep 09
Timestamp
Energy(W)
variable
Actual
Forecast
Naive, RMSE = 246.14
15
ˆYt+1|t = Yt
4. Model fitting: Vertical approach
16
0.1
0.2
0.3
0.4
0 5 10 15 20 25
Hour of the Day
0.1
0.2
0.3
0.4
0 5 10 15 20 25
Hour of the Day
Power(kW)
Day
2
9
16
23
Forecast	
  of	
  Day	
  30,	
  ‘15	
  
Weighted Forecasting
5. Model evaluation: Prediction accuracy
Root	
  mean	
  square	
  error	
  (RMSE):	
  Lower	
  is	
  beWer	
  
17
RMSE =
v
u
u
t 1
n
nX
i=1
(yi ˆyi)2
n = values
yi = Actual values
ˆyi = Forecast values
y = [713, 711, 652, 522]
ˆy = [751, 713, 711, 652]
RMSE = 73
5 .Model evaluation: Residual diagnostics
−1000
0
1000
Aug 30 Sep 01 Sep 03 Sep 05 Sep 07 Sep 09
Timestamp
Residuals(W)
Naive − Residuals
18
Demo
1	
  
Summary - I
1.  Time	
  series	
  forecas2ng	
  
2.  Steps	
  in	
  forecas2ng	
  
3.  Forecas2ng	
  models:	
  Naïve,	
  averaging	
  
4.  Model	
  evalua2on	
  
5.  Demonstra2on	
  in	
  R	
  
	
  
19
Line fitting
20
●
●
●
●
●
●
●
●
●
●
10
20
30
1 2 3 4 5 6 7 8 9 10
X
Y
Line Fitting
Y = mX + C
Slope	
  =	
  3,	
  	
  	
  Intercept	
  =	
  0	
  Approx.	
  
Linear Regression
●
● ●
●
●
●
●
●
●
●
●
●
●
●
●
200
400
600
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Hour of a day
Power(W)
21
Linear Regression
●
● ●
●
●
●
●
●
●
●
●
●
●
●
●
200
400
600
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Hour of a day
Power(W)
Intercept:764.2 Slope:−45.6
22
y = 0 + 1x + ✏
power = 0 + 1(dayhour) + ✏
Least squares
●
● ●
●
●
●
●
●
●
●
●
●
●
●
●
200
400
600
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Hour of a day
Power(W)
Intercept:764.2 Slope:−45.6
23
NX
i=1
✏2
i =
NX
i=1
(yi 0 1xi)2
Error	
  	
  
Minimize	
  	
  
Evaluation
1.  Standard	
  error:	
  Lower	
  is	
  beWer	
  
2.  Goodness	
  of	
  fit:	
  Higher	
  is	
  beWer	
  
24
ei = yi ˆyi
se =
v
u
u
t 1
N 2
NX
i=1
e2
i
R2
=
P
( ˆyi ¯y)2
P
(yi ¯y)2
R_squared:	
  hWps://goo.gl/Xm5gUd	
  
Evaluation
25
Regression: Scenario II
●
● ●
●
●
●
●
● ●
●
●
●
●
●
● ●
●
●
●
● ●
●
●
●
●
●
●
●
●
●
●
●
● ●
●
●
●
●
●
●
●
●
●
●
●
●
● ●
●
●
● ●
●
●
●
●
●
●
● ●
●
●
● ● ● ● ●
●
● ●
●
●
500
1000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Hour of a day
Power(W)
26
Regression: Scenario II
27
●
● ●
●
●
●
●
● ●
●
●
●
●
●
● ●
●
●
●
● ●
●
●
●
●
●
●
●
●
●
●
●
● ●
●
●
●
●
●
●
●
●
●
●
●
●
● ●
●
●
● ●
●
●
●
●
●
●
● ●
●
●
● ● ● ● ●
●
● ●
●
●
500
1000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Hour of a day
Power(W)
Residual error:297.01
y = 0 + 1x + ✏
Polynomial regression
●
● ●
●
●
●
●
● ●
●
●
●
●
●
● ●
●
●
●
● ●
●
●
●
●
●
●
●
●
●
●
●
● ●
●
●
●
●
●
●
●
●
●
●
●
●
● ●
●
●
● ●
●
●
●
●
●
●
● ●
●
●
● ● ● ● ●
●
● ●
●
●
500
1000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Hour of a day
Power(W)
Residual error:174.48
28
y = 0 + 1x + 1x2
+ ... + 1xp
+ ✏
Spline regression
29
●
● ●
●
●
●
●
● ●
●
●
●
●
●
● ●
●
●
●
● ●
●
●
●
●
●
●
●
●
●
●
●
● ●
●
●
●
●
●
●
●
●
●
●
●
●
● ●
●
●
● ●
●
●
●
●
●
●
● ●
●
●
● ● ● ● ●
●
● ●
●
●
500
1000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Hour of a day
Power(W)
Multiple regression
−1
0
1
2
3
Aug 28 Aug 29 Aug 30 Aug 31 Sep 01
Timestamp
Power(W)
variable
Train
Forecast
Actual
Residual Test RMSE:1.05
30
Demo	
  
2	
  
Summary - II
1.  Regression	
  (Line	
  fieng)	
  
1.  Linear	
  	
  
2.  Non-­‐Linear	
  	
  (Cousin	
  :	
  Splines)	
  
3.  Mul2ple	
  	
  
2.  Demonstra2on	
  
	
  
31
Auto-regressive (AR) model
– Auto-­‐regressive	
  model:	
  	
  
–  Models	
  future	
  values	
  as	
  a	
  func2on	
  of	
  recent	
  past	
  
sequen2al	
  values	
  
– Representa2on:	
  An	
  AR	
  model	
  with	
  past	
  p	
  values	
  is	
  
denoted	
  as	
  AR(p)	
  
32
Yt = f(Yt 1, Yt 2, ..., Yt p, ✏t)
Yt = 0 + 1Yt 1 + 2Yt 2 + ... + pYt p + ✏t
Moving Average (MA) model
33
Yt = 0 + ✏t + 1✏t 1 + 2✏t 2 + ... + q✏t q
Yt = f(✏t, ✏t 1, ✏t 2, ..., ✏t q)
•  Moving	
  average	
  model:	
  
•  Models	
  future	
  values	
  as	
  a	
  func2on	
  of	
  recent	
  
past	
  sequen2al	
  error	
  terms	
  
•  Representa2on:	
  An	
  MA	
  model	
  with	
  past	
  q	
  
values	
  is	
  denoted	
  as	
  MA(q)	
  
AR MA model
34
Yt = f(✏t, ✏t 1, ✏t 2, ..., ✏t q, Yt 1, Yt 2, ..., Yt p)
Yt = 0 + 1Yt 1 + 2Yt 2 + ... + pYt p+
✏t + 1✏t 1 + 2✏t 2 + ... + q✏t q
•  Auto	
  regressive	
  Moving	
  Average	
  (ARMA)	
  model:	
  
•  Models	
  future	
  values	
  as	
  a	
  func2on	
  of	
  recent	
  
past	
  sequen2al	
  values	
  and	
  error	
  terms	
  
•  Representa2on:	
  ARMA(p,	
  q)	
  model	
  
Stationary vs. Non stationary time-series
200
300
400
500
0 20 40 60 80
Timestamp
Beerproduction(megalitres)
35
400
450
500
550
600
0 20 40 60 80
Timestamp
Beerproduction(megalitres)
−100
−50
0
50
100
0 20 40 60 80
Timestamp
Beerproduction(mL)
Non-­‐sta2onary	
   Non-­‐sta2onary	
  
Sta2onary	
  
Differencing (Non-stat. -> Stat.)
36
−100
−50
0
50
100
0 20 40 60 80
Timestamp
Beerproduction(mL)
200
300
400
500
0 20 40 60 80
Timestamp
Beerproduction(mL)
Yt = Yt Yt 1
Differencing	
  order	
  
(d):	
  Number	
  of	
  
2mes	
  differencing	
  is	
  
done	
  	
  
ARIMA model
37
ARIMA	
  is	
  defined	
  by	
  a	
  tuple	
  (p,	
  d,	
  q)	
  
	
  
Auto-­‐Regressive	
   Integrated	
   Moving	
  Average	
  
AR	
  	
  	
  I	
  	
  MA	
  
Yt = 0 + ✏t + 1✏t 1 + 2✏t 2 + ... + q✏t q
Yt = 0 + 1Yt 1 + 2Yt 2 + ... + pYt p + ✏t
Yt = Yt Yt 1
[Order	
  p]	
  
[Order	
  d]	
  
[Order	
  q]	
  
ACF/PACF plots
1.  Auto-­‐Correla2on	
  Func2on	
  (ACF)	
  	
  Plot:	
  
–  Correla2on	
  coefficients	
  of	
  2me-­‐series	
  at	
  different	
  lags	
  
–  Defines	
  q	
  order	
  of	
  MA	
  model	
  
	
  
2.  Par2al	
  Auto-­‐correla2on	
  Func2on	
  (PACF)	
  Plot:	
  
–  Par2al	
  correla2on	
  coefficients	
  of	
  2me	
  series	
  at	
  
different	
  lags	
  
–  Defines	
  p	
  order	
  of	
  AR	
  model	
  
	
  
38
ACF/PACF plots
39
500
1000
Aug 29 Aug 30 Aug 31 Sep 01
Timestamp
Power(W)
−0.25
0.00
0.25
0.50
5 10 15
Lag
PACF
−0.25
0.00
0.25
0.50
5 10 15
Lag
ACF
Data	
  
PACF	
  plot	
  
ACF	
  plot	
  
Model evaluation
– AIC/BIC	
  
– Residual	
  errors	
  
40
Demo	
  
3	
  
Seasonality
41
dataseasonaltrendremainder
2 4 6 8 10 12
200
400
600
−40
0
40
200
300
400
500
−50
−25
0
25
50
75
Time
SARIMA (Seasonal ARIMA)
	
  
– SARIMA(p,d,q)	
  (P,D,Q):	
  
–  Order	
  (P,D,Q)	
  handles	
  the	
  seasonality	
  part	
  
42
Complete Forecasting pseudocode
1.  Visualize	
  2me-­‐series	
  data	
  
2.  If	
  data	
  is	
  noisy	
  
–  Apply	
  averaging	
  	
  or	
  naïve	
  model	
  
3.  If	
  data	
  is	
  not	
  sta2onary	
  
–  First,	
  sta2onarize	
  data	
  using	
  differencing	
  
–  Next,	
  apply	
  any	
  2me	
  series	
  model	
  
4.  If	
  data	
  is	
  already	
  sta2onary	
  
–  Apply	
  any	
  2me	
  series	
  model	
  
43
Challenges : Outliers
44
0.5
1.0
0 5 10 15 20 25
Hour of the Day
Power(kW)
Day
26
27
28
29
Anomalous	
  usage	
  
0.25
0.50
0.75
1.00
1.25
0 5 10 15 20 25
Hour of the Day
Forecast
Actual
Day	
  30	
  
Challenges: Domain Knowledge
45
100
200
300
400
0 5 10 15 20 25
Hour of the Day
Power
Day
2
9
16
23
250
500
750
0 5 10 15 20 25
Hour of the Day
Power(w)
Forecast
Actual
1	
  
500
1000
0 5 10 15 20 25
Hour of the Day
Power(w)
Day
26
27
28
29
250
500
750
1000
1250
0 5 10 15 20 25
Hour of the Day
Power(w)
Forecast
Actual
2	
  
Application: Anomaly Detection
46
References
1.  Book:	
  Forecas2ng	
  principles	
  and	
  prac2ce,	
  hWps://
www.otexts.org/fpp	
  
2.  Understanding	
  seasonality	
  and	
  trend	
  with	
  code:	
  
hWps://anomaly.io/seasonal-­‐trend-­‐decomposi2on-­‐
in-­‐r/	
  
3.  ARIMA	
  ordering:	
  
hWps://people.duke.edu/~rnau/411arim3.htm	
  
4.  Time	
  series	
  Forecas2ng	
  theory:	
  
hWps://www.youtube.com/watch?v=Aw77aMLj9uM	
  
5.  Book:	
  Applied	
  predic2ve	
  modeling	
  by	
  kuhn	
  et	
  al.	
  
6.  Book:	
  An	
  introduc2on	
  to	
  sta2s2cal	
  learning	
  by	
  
Gareth	
  et	
  al.	
  
47
Annexure
48
Multidimensional Scaling (MDS)
0
300
600
900
0 5 10 15 20 25
Hour of the day
Power(watts)
Day1
Day2
Day3
Day4
49
●
●
●
●
−1500 −1000 −500 0 500 1000 1500
−600−2000200600
MDS Dimension−1
MDSDimension−2
Day1
Day2
Day3
Day4
Dissimilarity/Distance	
  Matrix	
  
Apply	
  MDS	
  
Day1	
   Day2	
  	
   Day3	
   Day4	
  
Day1	
   0000	
   2789	
   1194	
   2699	
  
Day2	
   2789	
   0000	
   2516	
   0254	
  
Day3	
   1194	
   2516	
   0000	
   2371	
  
Day4	
   2699	
   0254	
   2371	
   0000	
  
dist(dayx, dayy) =
qPn=24
i=1 (dayi
x dayi
y)2
Regression coefficient
1 =
PN
i=1(yi ¯y)(xi ¯x)
PN
i=1(xi ¯x)2
0 = ¯y 1 ¯x
50
Forecasting band
51
200
204
208
0 5 10 15 20 25
Hour of the day
Power(watts)
Actual_Usage
Forecast

Mais conteúdo relacionado

Mais procurados

Arima model (time series)
Arima model (time series)Arima model (time series)
Arima model (time series)Kumar P
 
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet MahanaArima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet MahanaAmrinder Arora
 
Time series analysis in Stata
Time series analysis in StataTime series analysis in Stata
Time series analysis in Statashahisec1
 
Time-series Analysis in Minutes
Time-series Analysis in MinutesTime-series Analysis in Minutes
Time-series Analysis in MinutesOrzota
 
Introduction to Stata
Introduction to StataIntroduction to Stata
Introduction to Stataizahn
 
Descriptive statistics
Descriptive statisticsDescriptive statistics
Descriptive statisticsHiba Armouche
 
Basic regression with time series data
Basic regression with time series dataBasic regression with time series data
Basic regression with time series datasaidasa
 
Lesson 5 arima
Lesson 5 arimaLesson 5 arima
Lesson 5 arimaankit_ppt
 
SAMPLING AND ESTIMATION PPT.pptx
SAMPLING AND ESTIMATION PPT.pptxSAMPLING AND ESTIMATION PPT.pptx
SAMPLING AND ESTIMATION PPT.pptxYashikaSaini24
 
Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Ram Narasimhan
 

Mais procurados (20)

Arima model (time series)
Arima model (time series)Arima model (time series)
Arima model (time series)
 
ARIMA Models - [Lab 3]
ARIMA Models - [Lab 3]ARIMA Models - [Lab 3]
ARIMA Models - [Lab 3]
 
Time series
Time seriesTime series
Time series
 
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet MahanaArima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
Arima Forecasting - Presentation by Sera Cresta, Nora Alosaimi and Puneet Mahana
 
Time series analysis in Stata
Time series analysis in StataTime series analysis in Stata
Time series analysis in Stata
 
Time Series Analysis/ Forecasting
Time Series Analysis/ Forecasting  Time Series Analysis/ Forecasting
Time Series Analysis/ Forecasting
 
Time-series Analysis in Minutes
Time-series Analysis in MinutesTime-series Analysis in Minutes
Time-series Analysis in Minutes
 
Introduction to Stata
Introduction to StataIntroduction to Stata
Introduction to Stata
 
Descriptive statistics
Descriptive statisticsDescriptive statistics
Descriptive statistics
 
Ols
OlsOls
Ols
 
Time series analysis
Time series analysisTime series analysis
Time series analysis
 
Regression models for panel data
Regression models for panel dataRegression models for panel data
Regression models for panel data
 
Basic regression with time series data
Basic regression with time series dataBasic regression with time series data
Basic regression with time series data
 
Lesson 5 arima
Lesson 5 arimaLesson 5 arima
Lesson 5 arima
 
MModule 1 ppt.pptx
MModule 1 ppt.pptxMModule 1 ppt.pptx
MModule 1 ppt.pptx
 
Time series Analysis
Time series AnalysisTime series Analysis
Time series Analysis
 
Time series Analysis
Time series AnalysisTime series Analysis
Time series Analysis
 
SAMPLING AND ESTIMATION PPT.pptx
SAMPLING AND ESTIMATION PPT.pptxSAMPLING AND ESTIMATION PPT.pptx
SAMPLING AND ESTIMATION PPT.pptx
 
ECONOMETRICS
ECONOMETRICSECONOMETRICS
ECONOMETRICS
 
Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)Data Manipulation Using R (& dplyr)
Data Manipulation Using R (& dplyr)
 

Destaque

Linked data representation
Linked data representationLinked data representation
Linked data representationharoonrashidlone
 
Demand forecasting by time series analysis
Demand forecasting by time series analysisDemand forecasting by time series analysis
Demand forecasting by time series analysisSunny Gandhi
 
Time Series
Time SeriesTime Series
Time Seriesyush313
 
Ontology of a temperature sensor
Ontology of a temperature sensorOntology of a temperature sensor
Ontology of a temperature sensorharoonrashidlone
 
Time series and forecasting from wikipedia
Time series and forecasting from wikipediaTime series and forecasting from wikipedia
Time series and forecasting from wikipediaMonica Barros
 
Automatic algorithms for time series forecasting
Automatic algorithms for time series forecastingAutomatic algorithms for time series forecasting
Automatic algorithms for time series forecastingRob Hyndman
 
Chapter 16
Chapter 16Chapter 16
Chapter 16bmcfad01
 
Analysis of time series
Analysis of time seriesAnalysis of time series
Analysis of time seriesPablosperessos
 
Chap15 time series forecasting & index number
Chap15 time series forecasting & index numberChap15 time series forecasting & index number
Chap15 time series forecasting & index numberUni Azza Aunillah
 
Forecasting Slides
Forecasting SlidesForecasting Slides
Forecasting Slidesknksmart
 
Marketing Forecasting at Post Foods division of Ralcorp Holding
Marketing Forecasting at Post Foods division of Ralcorp HoldingMarketing Forecasting at Post Foods division of Ralcorp Holding
Marketing Forecasting at Post Foods division of Ralcorp HoldingDavid Zatz
 
Naming in content_oriented_architectures [repaired]
Naming in content_oriented_architectures [repaired]Naming in content_oriented_architectures [repaired]
Naming in content_oriented_architectures [repaired]haroonrashidlone
 
Time Series Forecasting using Neural Nets (GNNNs)
Time Series Forecasting using Neural Nets (GNNNs)Time Series Forecasting using Neural Nets (GNNNs)
Time Series Forecasting using Neural Nets (GNNNs)Sean Golliher
 

Destaque (20)

Linked data representation
Linked data representationLinked data representation
Linked data representation
 
Timeseries forecasting
Timeseries forecastingTimeseries forecasting
Timeseries forecasting
 
Demand forecasting by time series analysis
Demand forecasting by time series analysisDemand forecasting by time series analysis
Demand forecasting by time series analysis
 
Time Series
Time SeriesTime Series
Time Series
 
Ontology of a temperature sensor
Ontology of a temperature sensorOntology of a temperature sensor
Ontology of a temperature sensor
 
Binary decision diagrams
Binary decision diagramsBinary decision diagrams
Binary decision diagrams
 
Time series and forecasting from wikipedia
Time series and forecasting from wikipediaTime series and forecasting from wikipedia
Time series and forecasting from wikipedia
 
Automatic algorithms for time series forecasting
Automatic algorithms for time series forecastingAutomatic algorithms for time series forecasting
Automatic algorithms for time series forecasting
 
Chapter 16
Chapter 16Chapter 16
Chapter 16
 
Analysis of time series
Analysis of time seriesAnalysis of time series
Analysis of time series
 
Chap15 time series forecasting & index number
Chap15 time series forecasting & index numberChap15 time series forecasting & index number
Chap15 time series forecasting & index number
 
Time series slideshare
Time series slideshareTime series slideshare
Time series slideshare
 
time series analysis
time series analysistime series analysis
time series analysis
 
Forecasting Slides
Forecasting SlidesForecasting Slides
Forecasting Slides
 
Marketing Forecasting at Post Foods division of Ralcorp Holding
Marketing Forecasting at Post Foods division of Ralcorp HoldingMarketing Forecasting at Post Foods division of Ralcorp Holding
Marketing Forecasting at Post Foods division of Ralcorp Holding
 
Routing papers in ccn
Routing papers in ccnRouting papers in ccn
Routing papers in ccn
 
Naming in content_oriented_architectures [repaired]
Naming in content_oriented_architectures [repaired]Naming in content_oriented_architectures [repaired]
Naming in content_oriented_architectures [repaired]
 
Time Series Forecasting using Neural Nets (GNNNs)
Time Series Forecasting using Neural Nets (GNNNs)Time Series Forecasting using Neural Nets (GNNNs)
Time Series Forecasting using Neural Nets (GNNNs)
 
Time series Forecasting using svm
Time series Forecasting using  svmTime series Forecasting using  svm
Time series Forecasting using svm
 
Time series
Time seriesTime series
Time series
 

Semelhante a Time series Forecasting

Measurement of losses in direct torque controlled
Measurement of losses in direct torque controlledMeasurement of losses in direct torque controlled
Measurement of losses in direct torque controlledeSAT Publishing House
 
Renewable energy course#02
Renewable energy course#02Renewable energy course#02
Renewable energy course#02Syed_Sajjad_Raza
 
Renewable energy course#02 gen
Renewable energy course#02 genRenewable energy course#02 gen
Renewable energy course#02 genSyed_Sajjad_Raza
 
IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...
IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...
IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...Juan C. Vasquez
 
Urban flood prediction digital ocean august edition
Urban flood prediction   digital ocean august editionUrban flood prediction   digital ocean august edition
Urban flood prediction digital ocean august editiontransight
 
Renewable Asset Risk Management
Renewable Asset Risk ManagementRenewable Asset Risk Management
Renewable Asset Risk ManagementManuele Monti
 
Oscillography analysis
Oscillography analysisOscillography analysis
Oscillography analysismichaeljmack
 
Ee w05.1 m_ 2. electricity generation _ part 4 (generation technologies)
Ee  w05.1 m_ 2. electricity generation _ part 4 (generation technologies)Ee  w05.1 m_ 2. electricity generation _ part 4 (generation technologies)
Ee w05.1 m_ 2. electricity generation _ part 4 (generation technologies)Silvester Van Koten
 
Design of Compensators for Speed Control of DC Motor by using Bode Plot Techn...
Design of Compensators for Speed Control of DC Motor by using Bode Plot Techn...Design of Compensators for Speed Control of DC Motor by using Bode Plot Techn...
Design of Compensators for Speed Control of DC Motor by using Bode Plot Techn...IRJET Journal
 
Lect2 up230 (100327)
Lect2 up230 (100327)Lect2 up230 (100327)
Lect2 up230 (100327)aicdesign
 
IRJET- An Approach to Offer Price (Generating Station) Arrival Process throug...
IRJET- An Approach to Offer Price (Generating Station) Arrival Process throug...IRJET- An Approach to Offer Price (Generating Station) Arrival Process throug...
IRJET- An Approach to Offer Price (Generating Station) Arrival Process throug...IRJET Journal
 
DESIGN OF TWO-STAGE OP AMPS.pdf
DESIGN OF TWO-STAGE OP AMPS.pdfDESIGN OF TWO-STAGE OP AMPS.pdf
DESIGN OF TWO-STAGE OP AMPS.pdftempor3
 
Particle Learning in Online Tool Wear Diagnosis and Prognosis
Particle Learning in Online Tool Wear Diagnosis and PrognosisParticle Learning in Online Tool Wear Diagnosis and Prognosis
Particle Learning in Online Tool Wear Diagnosis and PrognosisJianlei Zhang, PhD
 
Linear models
Linear modelsLinear models
Linear modelsFAO
 

Semelhante a Time series Forecasting (20)

Measurement of losses in direct torque controlled
Measurement of losses in direct torque controlledMeasurement of losses in direct torque controlled
Measurement of losses in direct torque controlled
 
Renewable energy course#02
Renewable energy course#02Renewable energy course#02
Renewable energy course#02
 
Renewable energy course#02 gen
Renewable energy course#02 genRenewable energy course#02 gen
Renewable energy course#02 gen
 
07
0707
07
 
KalmanForecast
KalmanForecastKalmanForecast
KalmanForecast
 
IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...
IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...
IECON Amjad Optimal planning and operatoin Management of a ship Electrical Po...
 
Urban flood prediction digital ocean august edition
Urban flood prediction   digital ocean august editionUrban flood prediction   digital ocean august edition
Urban flood prediction digital ocean august edition
 
Renewable Asset Risk Management
Renewable Asset Risk ManagementRenewable Asset Risk Management
Renewable Asset Risk Management
 
Unit Commitment
Unit CommitmentUnit Commitment
Unit Commitment
 
Oscillography analysis
Oscillography analysisOscillography analysis
Oscillography analysis
 
Ee w05.1 m_ 2. electricity generation _ part 4 (generation technologies)
Ee  w05.1 m_ 2. electricity generation _ part 4 (generation technologies)Ee  w05.1 m_ 2. electricity generation _ part 4 (generation technologies)
Ee w05.1 m_ 2. electricity generation _ part 4 (generation technologies)
 
Design of Compensators for Speed Control of DC Motor by using Bode Plot Techn...
Design of Compensators for Speed Control of DC Motor by using Bode Plot Techn...Design of Compensators for Speed Control of DC Motor by using Bode Plot Techn...
Design of Compensators for Speed Control of DC Motor by using Bode Plot Techn...
 
Lect2 up230 (100327)
Lect2 up230 (100327)Lect2 up230 (100327)
Lect2 up230 (100327)
 
IRJET- An Approach to Offer Price (Generating Station) Arrival Process throug...
IRJET- An Approach to Offer Price (Generating Station) Arrival Process throug...IRJET- An Approach to Offer Price (Generating Station) Arrival Process throug...
IRJET- An Approach to Offer Price (Generating Station) Arrival Process throug...
 
IMU General Introduction
IMU General IntroductionIMU General Introduction
IMU General Introduction
 
DESIGN OF TWO-STAGE OP AMPS.pdf
DESIGN OF TWO-STAGE OP AMPS.pdfDESIGN OF TWO-STAGE OP AMPS.pdf
DESIGN OF TWO-STAGE OP AMPS.pdf
 
Airo2014
Airo2014Airo2014
Airo2014
 
Particle Learning in Online Tool Wear Diagnosis and Prognosis
Particle Learning in Online Tool Wear Diagnosis and PrognosisParticle Learning in Online Tool Wear Diagnosis and Prognosis
Particle Learning in Online Tool Wear Diagnosis and Prognosis
 
power-generation
power-generationpower-generation
power-generation
 
Linear models
Linear modelsLinear models
Linear models
 

Último

PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
 
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一fhwihughh
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPTBoston Institute of Analytics
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptxthyngster
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfchwongval
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 
Defining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryDefining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryJeremy Anderson
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.natarajan8993
 
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSINGmarianagonzalez07
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfBoston Institute of Analytics
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Cantervoginip
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...soniya singh
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一F sss
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...Florian Roscheck
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort servicejennyeacort
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Colleen Farrelly
 

Último (20)

PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
 
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
 
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default  Presentation : Data Analysis Project PPTPredictive Analysis for Loan Default  Presentation : Data Analysis Project PPT
Predictive Analysis for Loan Default Presentation : Data Analysis Project PPT
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptxEMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM  TRACKING WITH GOOGLE ANALYTICS.pptx
EMERCE - 2024 - AMSTERDAM - CROSS-PLATFORM TRACKING WITH GOOGLE ANALYTICS.pptx
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdf
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 
Defining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryDefining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data Story
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.
 
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
2006_GasProcessing_HB (1).pdf HYDROCARBON PROCESSING
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
 
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Canter
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
 
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
办理学位证中佛罗里达大学毕业证,UCF成绩单原版一比一
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024
 
Call Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort ServiceCall Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort Service
 

Time series Forecasting

  • 1. Time series Forecasting Presented  at:  Big  Data  Analy2cs    Programme                                                    NIT  Srinagar  (15  March  2017)   Presenter:  Haroon  Rashid                                        haroonr@iiitd.ac.in  
  • 3. Contents – What  is  forecas2ng   –  Why  we  need  it   – Forecas2ng  approaches   – Forecas2ng  evalua2on   – Forecas2ng  applica2ons   3
  • 4. Forecasting: Case Scenario - I 500 1000 Aug 28 Aug 29 Aug 30 Aug 31 Sep 01 Timestamp Power(W) variable Train Forecast 4
  • 5. Forecasting: Case Scenario - II 5 Find  carbon  footprint  for  Toyota  Matrix  with  capacity  of  1.8   (L),  and    mileages  of    25  (C)  and  31  (H)?   Sta2s2cs  of  4  cylinder  cars     Table:  hWps://www.otexts.org/fpp/1/4  
  • 6. Forecasting Types – Time  series  Forecas2ng   –  Data  collected  at  regular  intervals  of  2me   –  e.g.,    Weather,  electricity  forecas2ng   – Cross-­‐Sec2onal  Forecas2ng   –  Data  collected  at  single  point  in  2me   –  e.g.,  Carbon  emission,  disease  predic2on   6 Time  series   Forecas2ng   (Energy)  
  • 7. Assumptions 1.  Historical  informa2on  is  available   2.  Past  paWerns  will  con2nue  in  the  future   7 100 200 300 400 Aug 03 Aug 04 Aug 05 Aug 06 Timestamp Power(W) 500 1000 Aug 27 Aug 28 Aug 29 Aug 30 Timestamp Power(W)
  • 8. Forecasting Horizon 1.  Short-­‐term  forecas2ng:   –   Hours  to  few  days  ahead   2.  Medium-­‐term  forecas2ng:     –  Few  days  to  months  ahead   3.  Long-­‐term  forecas2ng:   –   Months  to  years  ahead   8
  • 9. I.  Short  term  decision   II.  Long  term  investment   9 Why electricity forecasting 2 3 4 5 0 20 40 60 80 Months (Approx. 6 years) Power(gW) Sol:  Backup  Generators   1.  Renewables  (Solar)   2.  Diesel  Generators   3.  Power  plants   Img:  hWp://www.installeronline.co.uk/brownout-­‐one-­‐coming/  
  • 10. Forecasting steps 1.  Problem  defini2on   –  Purpose  (demand  supply,  Fault  detec2on)   –  Factors  (Weather,  occupancy,  day  type)   2.  Informa2on  gathering   –  Sense  [Sensors:  smart  meters,  temperature,  PIR]   –  Retrieve  [Z-­‐wave,  Bluetooth,  Wi-­‐Fi,  GSM]   –  Store  [Mongo  DB,  MySQL]   3.  Preliminary  analysis   –  Visualiza2ons  [R,  Python,  Matlab,  Plotly]   4.  Choosing  &  Fieng  models   5.  Model  evalua2on   10
  • 12. 3. Preliminary analysis 500 1000 1500 2000 2012−05−01 2012−11−01 2013−05−01 2013−11−01 2014−05−01 2014−11−01 Timestamp Power(watts) 12
  • 13. 3. Preliminary analysis: Seasonality, trend 13 dataseasonaltrendremainder 2 4 6 8 10 12 200 400 600 −40 0 40 200 300 400 500 −50 −25 0 25 50 75 Time
  • 14. 4. Model fitting: Averaging approach 500 1000 1500 2000 Aug 30 Sep 01 Sep 03 Sep 05 Sep 07 Sep 09 Timestamp Energy(W) variable Actual Forecast Average last 6, RMSE = 251.44 14 ˆYt+1|1...t = (Y1 + Y2 + ... + Yt) length(t)
  • 15. 4. Model fitting: Naïve approach 500 1000 1500 2000 Aug 30 Sep 01 Sep 03 Sep 05 Sep 07 Sep 09 Timestamp Energy(W) variable Actual Forecast Naive, RMSE = 246.14 15 ˆYt+1|t = Yt
  • 16. 4. Model fitting: Vertical approach 16 0.1 0.2 0.3 0.4 0 5 10 15 20 25 Hour of the Day 0.1 0.2 0.3 0.4 0 5 10 15 20 25 Hour of the Day Power(kW) Day 2 9 16 23 Forecast  of  Day  30,  ‘15   Weighted Forecasting
  • 17. 5. Model evaluation: Prediction accuracy Root  mean  square  error  (RMSE):  Lower  is  beWer   17 RMSE = v u u t 1 n nX i=1 (yi ˆyi)2 n = values yi = Actual values ˆyi = Forecast values y = [713, 711, 652, 522] ˆy = [751, 713, 711, 652] RMSE = 73
  • 18. 5 .Model evaluation: Residual diagnostics −1000 0 1000 Aug 30 Sep 01 Sep 03 Sep 05 Sep 07 Sep 09 Timestamp Residuals(W) Naive − Residuals 18 Demo 1  
  • 19. Summary - I 1.  Time  series  forecas2ng   2.  Steps  in  forecas2ng   3.  Forecas2ng  models:  Naïve,  averaging   4.  Model  evalua2on   5.  Demonstra2on  in  R     19
  • 20. Line fitting 20 ● ● ● ● ● ● ● ● ● ● 10 20 30 1 2 3 4 5 6 7 8 9 10 X Y Line Fitting Y = mX + C Slope  =  3,      Intercept  =  0  Approx.  
  • 21. Linear Regression ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 200 400 600 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Hour of a day Power(W) 21
  • 22. Linear Regression ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 200 400 600 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Hour of a day Power(W) Intercept:764.2 Slope:−45.6 22 y = 0 + 1x + ✏ power = 0 + 1(dayhour) + ✏
  • 23. Least squares ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 200 400 600 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Hour of a day Power(W) Intercept:764.2 Slope:−45.6 23 NX i=1 ✏2 i = NX i=1 (yi 0 1xi)2 Error     Minimize    
  • 24. Evaluation 1.  Standard  error:  Lower  is  beWer   2.  Goodness  of  fit:  Higher  is  beWer   24 ei = yi ˆyi se = v u u t 1 N 2 NX i=1 e2 i R2 = P ( ˆyi ¯y)2 P (yi ¯y)2 R_squared:  hWps://goo.gl/Xm5gUd  
  • 26. Regression: Scenario II ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 500 1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Hour of a day Power(W) 26
  • 27. Regression: Scenario II 27 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 500 1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Hour of a day Power(W) Residual error:297.01 y = 0 + 1x + ✏
  • 28. Polynomial regression ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 500 1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Hour of a day Power(W) Residual error:174.48 28 y = 0 + 1x + 1x2 + ... + 1xp + ✏
  • 29. Spline regression 29 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 500 1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Hour of a day Power(W)
  • 30. Multiple regression −1 0 1 2 3 Aug 28 Aug 29 Aug 30 Aug 31 Sep 01 Timestamp Power(W) variable Train Forecast Actual Residual Test RMSE:1.05 30 Demo   2  
  • 31. Summary - II 1.  Regression  (Line  fieng)   1.  Linear     2.  Non-­‐Linear    (Cousin  :  Splines)   3.  Mul2ple     2.  Demonstra2on     31
  • 32. Auto-regressive (AR) model – Auto-­‐regressive  model:     –  Models  future  values  as  a  func2on  of  recent  past   sequen2al  values   – Representa2on:  An  AR  model  with  past  p  values  is   denoted  as  AR(p)   32 Yt = f(Yt 1, Yt 2, ..., Yt p, ✏t) Yt = 0 + 1Yt 1 + 2Yt 2 + ... + pYt p + ✏t
  • 33. Moving Average (MA) model 33 Yt = 0 + ✏t + 1✏t 1 + 2✏t 2 + ... + q✏t q Yt = f(✏t, ✏t 1, ✏t 2, ..., ✏t q) •  Moving  average  model:   •  Models  future  values  as  a  func2on  of  recent   past  sequen2al  error  terms   •  Representa2on:  An  MA  model  with  past  q   values  is  denoted  as  MA(q)  
  • 34. AR MA model 34 Yt = f(✏t, ✏t 1, ✏t 2, ..., ✏t q, Yt 1, Yt 2, ..., Yt p) Yt = 0 + 1Yt 1 + 2Yt 2 + ... + pYt p+ ✏t + 1✏t 1 + 2✏t 2 + ... + q✏t q •  Auto  regressive  Moving  Average  (ARMA)  model:   •  Models  future  values  as  a  func2on  of  recent   past  sequen2al  values  and  error  terms   •  Representa2on:  ARMA(p,  q)  model  
  • 35. Stationary vs. Non stationary time-series 200 300 400 500 0 20 40 60 80 Timestamp Beerproduction(megalitres) 35 400 450 500 550 600 0 20 40 60 80 Timestamp Beerproduction(megalitres) −100 −50 0 50 100 0 20 40 60 80 Timestamp Beerproduction(mL) Non-­‐sta2onary   Non-­‐sta2onary   Sta2onary  
  • 36. Differencing (Non-stat. -> Stat.) 36 −100 −50 0 50 100 0 20 40 60 80 Timestamp Beerproduction(mL) 200 300 400 500 0 20 40 60 80 Timestamp Beerproduction(mL) Yt = Yt Yt 1 Differencing  order   (d):  Number  of   2mes  differencing  is   done    
  • 37. ARIMA model 37 ARIMA  is  defined  by  a  tuple  (p,  d,  q)     Auto-­‐Regressive   Integrated   Moving  Average   AR      I    MA   Yt = 0 + ✏t + 1✏t 1 + 2✏t 2 + ... + q✏t q Yt = 0 + 1Yt 1 + 2Yt 2 + ... + pYt p + ✏t Yt = Yt Yt 1 [Order  p]   [Order  d]   [Order  q]  
  • 38. ACF/PACF plots 1.  Auto-­‐Correla2on  Func2on  (ACF)    Plot:   –  Correla2on  coefficients  of  2me-­‐series  at  different  lags   –  Defines  q  order  of  MA  model     2.  Par2al  Auto-­‐correla2on  Func2on  (PACF)  Plot:   –  Par2al  correla2on  coefficients  of  2me  series  at   different  lags   –  Defines  p  order  of  AR  model     38
  • 39. ACF/PACF plots 39 500 1000 Aug 29 Aug 30 Aug 31 Sep 01 Timestamp Power(W) −0.25 0.00 0.25 0.50 5 10 15 Lag PACF −0.25 0.00 0.25 0.50 5 10 15 Lag ACF Data   PACF  plot   ACF  plot  
  • 41. Seasonality 41 dataseasonaltrendremainder 2 4 6 8 10 12 200 400 600 −40 0 40 200 300 400 500 −50 −25 0 25 50 75 Time
  • 42. SARIMA (Seasonal ARIMA)   – SARIMA(p,d,q)  (P,D,Q):   –  Order  (P,D,Q)  handles  the  seasonality  part   42
  • 43. Complete Forecasting pseudocode 1.  Visualize  2me-­‐series  data   2.  If  data  is  noisy   –  Apply  averaging    or  naïve  model   3.  If  data  is  not  sta2onary   –  First,  sta2onarize  data  using  differencing   –  Next,  apply  any  2me  series  model   4.  If  data  is  already  sta2onary   –  Apply  any  2me  series  model   43
  • 44. Challenges : Outliers 44 0.5 1.0 0 5 10 15 20 25 Hour of the Day Power(kW) Day 26 27 28 29 Anomalous  usage   0.25 0.50 0.75 1.00 1.25 0 5 10 15 20 25 Hour of the Day Forecast Actual Day  30  
  • 45. Challenges: Domain Knowledge 45 100 200 300 400 0 5 10 15 20 25 Hour of the Day Power Day 2 9 16 23 250 500 750 0 5 10 15 20 25 Hour of the Day Power(w) Forecast Actual 1   500 1000 0 5 10 15 20 25 Hour of the Day Power(w) Day 26 27 28 29 250 500 750 1000 1250 0 5 10 15 20 25 Hour of the Day Power(w) Forecast Actual 2  
  • 47. References 1.  Book:  Forecas2ng  principles  and  prac2ce,  hWps:// www.otexts.org/fpp   2.  Understanding  seasonality  and  trend  with  code:   hWps://anomaly.io/seasonal-­‐trend-­‐decomposi2on-­‐ in-­‐r/   3.  ARIMA  ordering:   hWps://people.duke.edu/~rnau/411arim3.htm   4.  Time  series  Forecas2ng  theory:   hWps://www.youtube.com/watch?v=Aw77aMLj9uM   5.  Book:  Applied  predic2ve  modeling  by  kuhn  et  al.   6.  Book:  An  introduc2on  to  sta2s2cal  learning  by   Gareth  et  al.   47
  • 49. Multidimensional Scaling (MDS) 0 300 600 900 0 5 10 15 20 25 Hour of the day Power(watts) Day1 Day2 Day3 Day4 49 ● ● ● ● −1500 −1000 −500 0 500 1000 1500 −600−2000200600 MDS Dimension−1 MDSDimension−2 Day1 Day2 Day3 Day4 Dissimilarity/Distance  Matrix   Apply  MDS   Day1   Day2     Day3   Day4   Day1   0000   2789   1194   2699   Day2   2789   0000   2516   0254   Day3   1194   2516   0000   2371   Day4   2699   0254   2371   0000   dist(dayx, dayy) = qPn=24 i=1 (dayi x dayi y)2
  • 50. Regression coefficient 1 = PN i=1(yi ¯y)(xi ¯x) PN i=1(xi ¯x)2 0 = ¯y 1 ¯x 50
  • 51. Forecasting band 51 200 204 208 0 5 10 15 20 25 Hour of the day Power(watts) Actual_Usage Forecast