SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Time Series Analysis & fpp
• Used to predict wind speeds at forecast horizons of 10
minutes to 1 day ahead, based on historical wind speeds (10
minute averages).
• Forecast package: Rob Hyndman
• https://www.otexts.org/fpp - good explanations and worked
examples.
1
Fiona McGroarty
Dublin R 24/03/2016
Time Series Data
• Forecasting extrapolates trend and seasonal patterns.
• Trend : long term increased/decrease.
• Seasonal: e.g. daily
weekly, yearly (fixed
& known length).
• Cycle: rises/falls that
are not a fixed period
(variable & unknown
length).
Trend: Generally increasing
Seasonal Pattern: Sharp rise at the
end of each year (stockpiling)
• Observations (at regular intervals) sequentially over time.
2
Fiona McGroarty
Dublin R 24/03/2016
Autocorrelations
• Correlation: lags 4 & 8 –
seasonal pattern, peaks are
4 quarters apart.
• Linear relationship between
lagged values of a time series
(quarterly beer production):
Lag.plot(beer2, lags=9).
• Corr. Coefficient -1 ≤ r ≤ 1.
• Correlation: lags 2 & 6 –
troughs are 2 quarters
behind peaks.
3
Fiona McGroarty
Dublin R 24/03/2016
Autocorrelations
• Plot ACF (acf(beer2)):
• White Noise: 95% of spikes
are within ±2/T (T = length
of time series=50).
4
Fiona McGroarty
Dublin R 24/03/2016
Autocorrelations
• Plot ACF (acf(beer2)):
• White Noise: 95% of spikes
are within ±2/T (T = length
of time series=50).
5
Fiona McGroarty
Dublin R 24/03/2016
Simple Forecasts (Benchmarks)
• Naïve method: forecast = value of last observation:
naive(beer2, h=11) or rwf(beer2, h=11).
• Average method: forecast = mean of historical data:
meanf(beer2, h=11).
• Seasonal naïve: forecast = value of last observation from the
previous season
(month/quarter/year ...)
snaive(beer2, h=11).
6
Fiona McGroarty
Dublin R 24/03/2016
Simple Forecasts (Benchmarks)
• Drift: variation on naïve, allow forecast to increase/decrease
over time: rwf (dj2, h=42, drift=TRUE)
7
Fiona McGroarty
Dublin R 24/03/2016
Time Series Decomposition
• fit <- stl (elecequip,
t.window=15,
s.window=“periodic”,
robust=TRUE).
Plot(fit).
• Time series decomposition: yt = St + Tt + Et or yt = St × Tt × Et
Electrical equipment orders. (Seasonal, Trend, Error)
• Set trend window and seasonal
window sizes – small values
allow more rapid changes.
8
Fiona McGroarty
Dublin R 24/03/2016
Forecast: ETS
• Effects of components can be additive (A), multiplicative (M) or
ignored (N, none). EG ETS (MAN) forecasts by multiplying errors
(M), adding trends (A) and ignoring seasonal effects (N).
SES: Simple Exponential Smoothing
Holts Linear Method
Additive Holts-Winter Method
Multiplicative Holts-Winter Method
Holts-Winter damped method
• ETS (ANN) SES with + errors; ETS (MNN) SES with × errors.
• Some are numerically unstable e.g. if data contains 0 or neg. values.
• ETS(ZZZ) – runs all (stable) ETS models and returns the optimal one.
• ETS (Error, Trend, Seasonal OR ExponenTial Smoothing)
9
Fiona McGroarty
Dublin R 24/03/2016
EG: Forecasts using Holt’s method
10
Fiona McGroarty
Dublin R 24/03/2016
Forecast: ETS
• oildata <- window(oil, start=1996,end=2007)
fit <- ets(oildata, model=“ANN”)
plot(forecast(fit, h=3), ylab=“Oil (millions of tonnes)”)
• Point forecasts and 80% and 95% prediction intervals.
11
Fiona McGroarty
Dublin R 24/03/2016
ARIMA Models
• ARIMA (p, d, q) e.g. ARIMA101 model uses one past time-
lagged wind speed autocorrelation term (p = 1), is not
differentiated (d = 0) and uses one past forecast error (q = 1).
• ARIMA = Auto Regression (detects similarity in the data using
timelagged values of the variable) Integrated (the data may
have to be differentiated a number of times to make it
stationary) Moving Average (using weighted moving average
of the past few forecast errors).
• Can specify the ARIMA (p, d, q) model to use, or use
auto.arima
12
Fiona McGroarty
Dublin R 24/03/2016
ARIMA Models
• fit <- auto.arima (usconsumption[,1], seasonal=FALSE
plot(forecast(fit, h=10), include=80)
• Best ARIMA model is returned, in this case it’s ARIMA(0,0,3).
• fit <- Arima(usconsumption[,1], order=c(0,0,3))
13
Fiona McGroarty
Dublin R 24/03/2016
Lots of other things to consider….
• Stationarity of data
• Transforming data before forecasting – differentiating…
• Error Metrics! Calculate MAE, RMSE,…..
14
Fiona McGroarty
Dublin R 24/03/2016

Weitere ähnliche Inhalte

Was ist angesagt?

2. 8085 introduction to instruction
2. 8085 introduction to instruction2. 8085 introduction to instruction
2. 8085 introduction to instructionsandip das
 
A non-interpolating semi-Lagrangian scheme for the continuity equation of the...
A non-interpolating semi-Lagrangian scheme for the continuity equation of the...A non-interpolating semi-Lagrangian scheme for the continuity equation of the...
A non-interpolating semi-Lagrangian scheme for the continuity equation of the...Tomás Morales
 
Hydrology/Hydraulic Model for South Boston CSO Project
Hydrology/Hydraulic Model for South Boston CSO Project Hydrology/Hydraulic Model for South Boston CSO Project
Hydrology/Hydraulic Model for South Boston CSO Project dingfangliu
 
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 4
Class lectures on Hydrology by Rabindra Ranjan Saha  Lecture 4Class lectures on Hydrology by Rabindra Ranjan Saha  Lecture 4
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 4World University of Bangladesh
 
Future up-gradations to Flood Warning Systems in Assam
Future up-gradations to Flood Warning Systems in AssamFuture up-gradations to Flood Warning Systems in Assam
Future up-gradations to Flood Warning Systems in AssamAmaljit Bharali
 
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 9
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 9Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 9
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 9World University of Bangladesh
 
Nwp performance gonu Tropical Cyclone conference
Nwp performance gonu Tropical Cyclone conferenceNwp performance gonu Tropical Cyclone conference
Nwp performance gonu Tropical Cyclone conferenceSultan AL-Yahyai
 
New Microsoft Word Document
New Microsoft Word DocumentNew Microsoft Word Document
New Microsoft Word DocumentFarhan Shariff
 
SAS writing example
SAS writing exampleSAS writing example
SAS writing exampleTianyue Wang
 
MFord SSIE598 MRP v Lean
MFord SSIE598 MRP v LeanMFord SSIE598 MRP v Lean
MFord SSIE598 MRP v LeanMichael Ford
 
Use of the German Weather Services KLAM Model to Investigate the Cold Air Dra...
Use of the German Weather Services KLAM Model to Investigate the Cold Air Dra...Use of the German Weather Services KLAM Model to Investigate the Cold Air Dra...
Use of the German Weather Services KLAM Model to Investigate the Cold Air Dra...IES / IAQM
 
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 12
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 12Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 12
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 12World University of Bangladesh
 
Hydrocarbon estimation methods
Hydrocarbon estimation methodsHydrocarbon estimation methods
Hydrocarbon estimation methodsSohail Nawab
 

Was ist angesagt? (19)

CLIWOC Attributes
CLIWOC AttributesCLIWOC Attributes
CLIWOC Attributes
 
2. 8085 introduction to instruction
2. 8085 introduction to instruction2. 8085 introduction to instruction
2. 8085 introduction to instruction
 
Petrel course
Petrel coursePetrel course
Petrel course
 
The Analogues R-Package - Ramirez-Villegas
The Analogues R-Package - Ramirez-VillegasThe Analogues R-Package - Ramirez-Villegas
The Analogues R-Package - Ramirez-Villegas
 
A non-interpolating semi-Lagrangian scheme for the continuity equation of the...
A non-interpolating semi-Lagrangian scheme for the continuity equation of the...A non-interpolating semi-Lagrangian scheme for the continuity equation of the...
A non-interpolating semi-Lagrangian scheme for the continuity equation of the...
 
Hydrology/Hydraulic Model for South Boston CSO Project
Hydrology/Hydraulic Model for South Boston CSO Project Hydrology/Hydraulic Model for South Boston CSO Project
Hydrology/Hydraulic Model for South Boston CSO Project
 
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 4
Class lectures on Hydrology by Rabindra Ranjan Saha  Lecture 4Class lectures on Hydrology by Rabindra Ranjan Saha  Lecture 4
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 4
 
Future up-gradations to Flood Warning Systems in Assam
Future up-gradations to Flood Warning Systems in AssamFuture up-gradations to Flood Warning Systems in Assam
Future up-gradations to Flood Warning Systems in Assam
 
c
cc
c
 
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 9
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 9Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 9
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 9
 
Nwp performance gonu Tropical Cyclone conference
Nwp performance gonu Tropical Cyclone conferenceNwp performance gonu Tropical Cyclone conference
Nwp performance gonu Tropical Cyclone conference
 
New Microsoft Word Document
New Microsoft Word DocumentNew Microsoft Word Document
New Microsoft Word Document
 
SAS writing example
SAS writing exampleSAS writing example
SAS writing example
 
MFord SSIE598 MRP v Lean
MFord SSIE598 MRP v LeanMFord SSIE598 MRP v Lean
MFord SSIE598 MRP v Lean
 
Italian weather type
Italian weather typeItalian weather type
Italian weather type
 
Use of the German Weather Services KLAM Model to Investigate the Cold Air Dra...
Use of the German Weather Services KLAM Model to Investigate the Cold Air Dra...Use of the German Weather Services KLAM Model to Investigate the Cold Air Dra...
Use of the German Weather Services KLAM Model to Investigate the Cold Air Dra...
 
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 12
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 12Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 12
Class lectures on Hydrology by Rabindra Ranjan Saha Lecture 12
 
Hydrocarbon estimation methods
Hydrocarbon estimation methodsHydrocarbon estimation methods
Hydrocarbon estimation methods
 
Wimax
WimaxWimax
Wimax
 

Andere mochten auch

Introduction to RapidMiner Studio V7
Introduction to RapidMiner Studio V7Introduction to RapidMiner Studio V7
Introduction to RapidMiner Studio V7geraldinegray
 
PyDataDC- Forecasting critical food violations at restaurants using open data
PyDataDC- Forecasting critical food violations at restaurants using open dataPyDataDC- Forecasting critical food violations at restaurants using open data
PyDataDC- Forecasting critical food violations at restaurants using open dataNicole A. Donnelly, CMCP
 
ForecastIT 4. Holt's Exponential Smoothing
ForecastIT 4. Holt's Exponential SmoothingForecastIT 4. Holt's Exponential Smoothing
ForecastIT 4. Holt's Exponential SmoothingDeepThought, Inc.
 
Time series analysis of collaborative activities-CRIWG2012
Time series analysis of collaborative activities-CRIWG2012Time series analysis of collaborative activities-CRIWG2012
Time series analysis of collaborative activities-CRIWG2012Irene-Angelica Chounta
 
Forecasting Techniques - Data Science SG
Forecasting Techniques - Data Science SG Forecasting Techniques - Data Science SG
Forecasting Techniques - Data Science SG Kai Xin Thia
 
Anomaly detection
Anomaly detectionAnomaly detection
Anomaly detection철 김
 
Time series and forecasting from wikipedia
Time series and forecasting from wikipediaTime series and forecasting from wikipedia
Time series and forecasting from wikipediaMonica Barros
 
Trend adjusted exponential smoothing forecasting metho ds
Trend adjusted exponential smoothing forecasting metho dsTrend adjusted exponential smoothing forecasting metho ds
Trend adjusted exponential smoothing forecasting metho dsKiran Hanjar
 
Bba 1584 planning n forecasting
Bba 1584 planning n forecastingBba 1584 planning n forecasting
Bba 1584 planning n forecastinglecturer-notes2014
 
Scipy 2011 Time Series Analysis in Python
Scipy 2011 Time Series Analysis in PythonScipy 2011 Time Series Analysis in Python
Scipy 2011 Time Series Analysis in PythonWes McKinney
 
Lecture 13 profits and gains from business or profession
Lecture 13   profits and gains from business or professionLecture 13   profits and gains from business or profession
Lecture 13 profits and gains from business or professionsumit235
 
Forecasting-Exponential Smoothing
Forecasting-Exponential SmoothingForecasting-Exponential Smoothing
Forecasting-Exponential Smoothingiceu novida adinata
 
Lecture 12 income from business and profession
Lecture 12   income from business and professionLecture 12   income from business and profession
Lecture 12 income from business and professionsumit235
 
Class notes forecasting
Class notes forecastingClass notes forecasting
Class notes forecastingArun Kumar
 
Statistical Learning Based Anomaly Detection @ Twitter
Statistical Learning Based Anomaly Detection @ TwitterStatistical Learning Based Anomaly Detection @ Twitter
Statistical Learning Based Anomaly Detection @ TwitterArun Kejariwal
 
[devil's camp] - 알고리즘 대회와 STL (박인서)
[devil's camp] - 알고리즘 대회와 STL (박인서)[devil's camp] - 알고리즘 대회와 STL (박인서)
[devil's camp] - 알고리즘 대회와 STL (박인서)NAVER D2
 

Andere mochten auch (20)

Introduction to RapidMiner Studio V7
Introduction to RapidMiner Studio V7Introduction to RapidMiner Studio V7
Introduction to RapidMiner Studio V7
 
Sales forecasting & planing training
Sales forecasting & planing trainingSales forecasting & planing training
Sales forecasting & planing training
 
PyDataDC- Forecasting critical food violations at restaurants using open data
PyDataDC- Forecasting critical food violations at restaurants using open dataPyDataDC- Forecasting critical food violations at restaurants using open data
PyDataDC- Forecasting critical food violations at restaurants using open data
 
ForecastIT 4. Holt's Exponential Smoothing
ForecastIT 4. Holt's Exponential SmoothingForecastIT 4. Holt's Exponential Smoothing
ForecastIT 4. Holt's Exponential Smoothing
 
Time series analysis of collaborative activities-CRIWG2012
Time series analysis of collaborative activities-CRIWG2012Time series analysis of collaborative activities-CRIWG2012
Time series analysis of collaborative activities-CRIWG2012
 
Forecasting Techniques - Data Science SG
Forecasting Techniques - Data Science SG Forecasting Techniques - Data Science SG
Forecasting Techniques - Data Science SG
 
Anomaly detection
Anomaly detectionAnomaly detection
Anomaly detection
 
Time series and forecasting from wikipedia
Time series and forecasting from wikipediaTime series and forecasting from wikipedia
Time series and forecasting from wikipedia
 
Trend adjusted exponential smoothing forecasting metho ds
Trend adjusted exponential smoothing forecasting metho dsTrend adjusted exponential smoothing forecasting metho ds
Trend adjusted exponential smoothing forecasting metho ds
 
Bba 1584 planning n forecasting
Bba 1584 planning n forecastingBba 1584 planning n forecasting
Bba 1584 planning n forecasting
 
Scipy 2011 Time Series Analysis in Python
Scipy 2011 Time Series Analysis in PythonScipy 2011 Time Series Analysis in Python
Scipy 2011 Time Series Analysis in Python
 
Lecture 13 profits and gains from business or profession
Lecture 13   profits and gains from business or professionLecture 13   profits and gains from business or profession
Lecture 13 profits and gains from business or profession
 
Forecasting-Exponential Smoothing
Forecasting-Exponential SmoothingForecasting-Exponential Smoothing
Forecasting-Exponential Smoothing
 
Lecture 12 income from business and profession
Lecture 12   income from business and professionLecture 12   income from business and profession
Lecture 12 income from business and profession
 
demand forecasting
demand forecastingdemand forecasting
demand forecasting
 
Linear programing
Linear programingLinear programing
Linear programing
 
Class notes forecasting
Class notes forecastingClass notes forecasting
Class notes forecasting
 
Statistical Learning Based Anomaly Detection @ Twitter
Statistical Learning Based Anomaly Detection @ TwitterStatistical Learning Based Anomaly Detection @ Twitter
Statistical Learning Based Anomaly Detection @ Twitter
 
CTDM: 7Th semester : Unit 2 decision theory
CTDM: 7Th semester  : Unit 2   decision theoryCTDM: 7Th semester  : Unit 2   decision theory
CTDM: 7Th semester : Unit 2 decision theory
 
[devil's camp] - 알고리즘 대회와 STL (박인서)
[devil's camp] - 알고리즘 대회와 STL (박인서)[devil's camp] - 알고리즘 대회와 STL (박인서)
[devil's camp] - 알고리즘 대회와 STL (박인서)
 

Ähnlich wie Time series Analysis & fpp package

Conventional & Unconventional Reservoirs.pdf
Conventional & Unconventional Reservoirs.pdfConventional & Unconventional Reservoirs.pdf
Conventional & Unconventional Reservoirs.pdfSeyedAbolfazlHossein4
 
Forecasting_CO2_Emissions.pptx
Forecasting_CO2_Emissions.pptxForecasting_CO2_Emissions.pptx
Forecasting_CO2_Emissions.pptxMOINDALVS
 
Pressure & Rate Transient Analysis.pdf
Pressure & Rate Transient Analysis.pdfPressure & Rate Transient Analysis.pdf
Pressure & Rate Transient Analysis.pdfSeyedAbolfazlHossein4
 
Javier Garcia - Verdugo Sanchez - Six Sigma Training - W2 Multi - vari Studies
Javier Garcia - Verdugo Sanchez - Six Sigma Training - W2 Multi - vari StudiesJavier Garcia - Verdugo Sanchez - Six Sigma Training - W2 Multi - vari Studies
Javier Garcia - Verdugo Sanchez - Six Sigma Training - W2 Multi - vari StudiesJ. García - Verdugo
 
Demand time series analysis and forecasting
Demand time series analysis and forecastingDemand time series analysis and forecasting
Demand time series analysis and forecastingM Baddar
 
Download-manuals-surface water-waterlevel-40howtocompiledischargedata
 Download-manuals-surface water-waterlevel-40howtocompiledischargedata Download-manuals-surface water-waterlevel-40howtocompiledischargedata
Download-manuals-surface water-waterlevel-40howtocompiledischargedatahydrologyproject001
 
Ecm time series forecast
Ecm time series forecastEcm time series forecast
Ecm time series forecastAyapparaj SKS
 
Francisco J. Doblas-Big Data y cambio climático
Francisco J. Doblas-Big Data y cambio climáticoFrancisco J. Doblas-Big Data y cambio climático
Francisco J. Doblas-Big Data y cambio climáticoFundación Ramón Areces
 
Jaya r pudashine
Jaya r pudashineJaya r pudashine
Jaya r pudashineClimDev15
 
Statistical downscaling sdsm
Statistical downscaling sdsmStatistical downscaling sdsm
Statistical downscaling sdsmPutu Santikayasa
 
Navarro C - Results Climate Projection Development (CIAT-IDB Project)
Navarro C - Results Climate Projection Development (CIAT-IDB Project) Navarro C - Results Climate Projection Development (CIAT-IDB Project)
Navarro C - Results Climate Projection Development (CIAT-IDB Project) Decision and Policy Analysis Program
 
ICLR Friday Forum: Updating IDF curves for future climate (March 24, 2017)
ICLR Friday Forum: Updating IDF curves for future climate (March 24, 2017)ICLR Friday Forum: Updating IDF curves for future climate (March 24, 2017)
ICLR Friday Forum: Updating IDF curves for future climate (March 24, 2017)glennmcgillivray
 
Carlos N - CIAT Experience In Climate Modeling; Scenarios of future climate c...
Carlos N - CIAT Experience In Climate Modeling; Scenarios of future climate c...Carlos N - CIAT Experience In Climate Modeling; Scenarios of future climate c...
Carlos N - CIAT Experience In Climate Modeling; Scenarios of future climate c...Decision and Policy Analysis Program
 
Genealized Diagonal band copula wifth two-sided power densities
Genealized Diagonal band copula wifth two-sided power densitiesGenealized Diagonal band copula wifth two-sided power densities
Genealized Diagonal band copula wifth two-sided power densitiesLeon Adams
 
Uncertainty in simulating biomass yield and carbon-water fluxes from Euro-Med...
Uncertainty in simulating biomass yield and carbon-water fluxes from Euro-Med...Uncertainty in simulating biomass yield and carbon-water fluxes from Euro-Med...
Uncertainty in simulating biomass yield and carbon-water fluxes from Euro-Med...BC3 - Basque Center for Climate Change
 
Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter...
 Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter... Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter...
Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter...hydrologyproject001
 
Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter...
 Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter... Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter...
Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter...hydrologyproject001
 

Ähnlich wie Time series Analysis & fpp package (20)

Conventional & Unconventional Reservoirs.pdf
Conventional & Unconventional Reservoirs.pdfConventional & Unconventional Reservoirs.pdf
Conventional & Unconventional Reservoirs.pdf
 
Forecasting_CO2_Emissions.pptx
Forecasting_CO2_Emissions.pptxForecasting_CO2_Emissions.pptx
Forecasting_CO2_Emissions.pptx
 
Pressure & Rate Transient Analysis.pdf
Pressure & Rate Transient Analysis.pdfPressure & Rate Transient Analysis.pdf
Pressure & Rate Transient Analysis.pdf
 
Javier Garcia - Verdugo Sanchez - Six Sigma Training - W2 Multi - vari Studies
Javier Garcia - Verdugo Sanchez - Six Sigma Training - W2 Multi - vari StudiesJavier Garcia - Verdugo Sanchez - Six Sigma Training - W2 Multi - vari Studies
Javier Garcia - Verdugo Sanchez - Six Sigma Training - W2 Multi - vari Studies
 
Demand time series analysis and forecasting
Demand time series analysis and forecastingDemand time series analysis and forecasting
Demand time series analysis and forecasting
 
Download-manuals-surface water-waterlevel-40howtocompiledischargedata
 Download-manuals-surface water-waterlevel-40howtocompiledischargedata Download-manuals-surface water-waterlevel-40howtocompiledischargedata
Download-manuals-surface water-waterlevel-40howtocompiledischargedata
 
Abdel1
Abdel1Abdel1
Abdel1
 
Ecm time series forecast
Ecm time series forecastEcm time series forecast
Ecm time series forecast
 
Comparison of wepp and apex runoff
Comparison of wepp and apex runoffComparison of wepp and apex runoff
Comparison of wepp and apex runoff
 
Francisco J. Doblas-Big Data y cambio climático
Francisco J. Doblas-Big Data y cambio climáticoFrancisco J. Doblas-Big Data y cambio climático
Francisco J. Doblas-Big Data y cambio climático
 
MLOS forecasting
MLOS forecastingMLOS forecasting
MLOS forecasting
 
Jaya r pudashine
Jaya r pudashineJaya r pudashine
Jaya r pudashine
 
Statistical downscaling sdsm
Statistical downscaling sdsmStatistical downscaling sdsm
Statistical downscaling sdsm
 
Navarro C - Results Climate Projection Development (CIAT-IDB Project)
Navarro C - Results Climate Projection Development (CIAT-IDB Project) Navarro C - Results Climate Projection Development (CIAT-IDB Project)
Navarro C - Results Climate Projection Development (CIAT-IDB Project)
 
ICLR Friday Forum: Updating IDF curves for future climate (March 24, 2017)
ICLR Friday Forum: Updating IDF curves for future climate (March 24, 2017)ICLR Friday Forum: Updating IDF curves for future climate (March 24, 2017)
ICLR Friday Forum: Updating IDF curves for future climate (March 24, 2017)
 
Carlos N - CIAT Experience In Climate Modeling; Scenarios of future climate c...
Carlos N - CIAT Experience In Climate Modeling; Scenarios of future climate c...Carlos N - CIAT Experience In Climate Modeling; Scenarios of future climate c...
Carlos N - CIAT Experience In Climate Modeling; Scenarios of future climate c...
 
Genealized Diagonal band copula wifth two-sided power densities
Genealized Diagonal band copula wifth two-sided power densitiesGenealized Diagonal band copula wifth two-sided power densities
Genealized Diagonal band copula wifth two-sided power densities
 
Uncertainty in simulating biomass yield and carbon-water fluxes from Euro-Med...
Uncertainty in simulating biomass yield and carbon-water fluxes from Euro-Med...Uncertainty in simulating biomass yield and carbon-water fluxes from Euro-Med...
Uncertainty in simulating biomass yield and carbon-water fluxes from Euro-Med...
 
Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter...
 Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter... Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter...
Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter...
 
Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter...
 Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter... Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter...
Download-manuals-hydrometeorology-data processing-10howtocorrectandcompleter...
 

Kürzlich hochgeladen

Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)jennyeacort
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdfHuman37
 
Semantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxSemantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxMike Bennett
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queensdataanalyticsqueen03
 
While-For-loop in python used in college
While-For-loop in python used in collegeWhile-For-loop in python used in college
While-For-loop in python used in collegessuser7a7cd61
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectBoston Institute of Analytics
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhijennyeacort
 
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
 
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
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Jack DiGiovanna
 
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
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsVICTOR MAESTRE RAMIREZ
 
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
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Cathrine Wilhelmsen
 
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...limedy534
 
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
 

Kürzlich hochgeladen (20)

Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf
 
Semantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxSemantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptx
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queens
 
While-For-loop in python used in college
While-For-loop in python used in collegeWhile-For-loop in python used in college
While-For-loop in python used in college
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 
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
 
Heart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis ProjectHeart Disease Classification Report: A Data Analysis Project
Heart Disease Classification Report: A Data Analysis Project
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
 
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...
 
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
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
 
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
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business Professionals
 
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
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)
 
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
 
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.
 

Time series Analysis & fpp package

  • 1. Time Series Analysis & fpp • Used to predict wind speeds at forecast horizons of 10 minutes to 1 day ahead, based on historical wind speeds (10 minute averages). • Forecast package: Rob Hyndman • https://www.otexts.org/fpp - good explanations and worked examples. 1 Fiona McGroarty Dublin R 24/03/2016
  • 2. Time Series Data • Forecasting extrapolates trend and seasonal patterns. • Trend : long term increased/decrease. • Seasonal: e.g. daily weekly, yearly (fixed & known length). • Cycle: rises/falls that are not a fixed period (variable & unknown length). Trend: Generally increasing Seasonal Pattern: Sharp rise at the end of each year (stockpiling) • Observations (at regular intervals) sequentially over time. 2 Fiona McGroarty Dublin R 24/03/2016
  • 3. Autocorrelations • Correlation: lags 4 & 8 – seasonal pattern, peaks are 4 quarters apart. • Linear relationship between lagged values of a time series (quarterly beer production): Lag.plot(beer2, lags=9). • Corr. Coefficient -1 ≤ r ≤ 1. • Correlation: lags 2 & 6 – troughs are 2 quarters behind peaks. 3 Fiona McGroarty Dublin R 24/03/2016
  • 4. Autocorrelations • Plot ACF (acf(beer2)): • White Noise: 95% of spikes are within ±2/T (T = length of time series=50). 4 Fiona McGroarty Dublin R 24/03/2016
  • 5. Autocorrelations • Plot ACF (acf(beer2)): • White Noise: 95% of spikes are within ±2/T (T = length of time series=50). 5 Fiona McGroarty Dublin R 24/03/2016
  • 6. Simple Forecasts (Benchmarks) • Naïve method: forecast = value of last observation: naive(beer2, h=11) or rwf(beer2, h=11). • Average method: forecast = mean of historical data: meanf(beer2, h=11). • Seasonal naïve: forecast = value of last observation from the previous season (month/quarter/year ...) snaive(beer2, h=11). 6 Fiona McGroarty Dublin R 24/03/2016
  • 7. Simple Forecasts (Benchmarks) • Drift: variation on naïve, allow forecast to increase/decrease over time: rwf (dj2, h=42, drift=TRUE) 7 Fiona McGroarty Dublin R 24/03/2016
  • 8. Time Series Decomposition • fit <- stl (elecequip, t.window=15, s.window=“periodic”, robust=TRUE). Plot(fit). • Time series decomposition: yt = St + Tt + Et or yt = St × Tt × Et Electrical equipment orders. (Seasonal, Trend, Error) • Set trend window and seasonal window sizes – small values allow more rapid changes. 8 Fiona McGroarty Dublin R 24/03/2016
  • 9. Forecast: ETS • Effects of components can be additive (A), multiplicative (M) or ignored (N, none). EG ETS (MAN) forecasts by multiplying errors (M), adding trends (A) and ignoring seasonal effects (N). SES: Simple Exponential Smoothing Holts Linear Method Additive Holts-Winter Method Multiplicative Holts-Winter Method Holts-Winter damped method • ETS (ANN) SES with + errors; ETS (MNN) SES with × errors. • Some are numerically unstable e.g. if data contains 0 or neg. values. • ETS(ZZZ) – runs all (stable) ETS models and returns the optimal one. • ETS (Error, Trend, Seasonal OR ExponenTial Smoothing) 9 Fiona McGroarty Dublin R 24/03/2016
  • 10. EG: Forecasts using Holt’s method 10 Fiona McGroarty Dublin R 24/03/2016
  • 11. Forecast: ETS • oildata <- window(oil, start=1996,end=2007) fit <- ets(oildata, model=“ANN”) plot(forecast(fit, h=3), ylab=“Oil (millions of tonnes)”) • Point forecasts and 80% and 95% prediction intervals. 11 Fiona McGroarty Dublin R 24/03/2016
  • 12. ARIMA Models • ARIMA (p, d, q) e.g. ARIMA101 model uses one past time- lagged wind speed autocorrelation term (p = 1), is not differentiated (d = 0) and uses one past forecast error (q = 1). • ARIMA = Auto Regression (detects similarity in the data using timelagged values of the variable) Integrated (the data may have to be differentiated a number of times to make it stationary) Moving Average (using weighted moving average of the past few forecast errors). • Can specify the ARIMA (p, d, q) model to use, or use auto.arima 12 Fiona McGroarty Dublin R 24/03/2016
  • 13. ARIMA Models • fit <- auto.arima (usconsumption[,1], seasonal=FALSE plot(forecast(fit, h=10), include=80) • Best ARIMA model is returned, in this case it’s ARIMA(0,0,3). • fit <- Arima(usconsumption[,1], order=c(0,0,3)) 13 Fiona McGroarty Dublin R 24/03/2016
  • 14. Lots of other things to consider…. • Stationarity of data • Transforming data before forecasting – differentiating… • Error Metrics! Calculate MAE, RMSE,….. 14 Fiona McGroarty Dublin R 24/03/2016