Time Series Forecasting
Prepared by:
Omar Al-dabash
Computer Engineering Department
Time series forecasting
 A time series is a set of observations on the values that a variable
takes at different times.
 Time series are used in statistics, econometrics, mathematical
finance, weather forecasting, earthquake predication and many
other application.
Component of time series
 The change which are in time series, they are effected by economic, social,
natural, Industrial & Political Reasons. These reasons are component of time
series.
• Secular Trend.
• Seasonal variation.
• Cyclical Variation.
• Irregular variation.
Secular Trend.
 The increase or decrease in the movements of a time series is called Secular Trend.
A time series data may show upward trend or downward trend for a period of years and
this may be due to factors like.
• Increase in population.
• Change in technological progress.
• Large scale shift in consumers demands.
Seasonal variation
 Seasonal variation is a short- term fluctuation in a time series which occur
periodically in year.
• The weather conditions
 Cyclical Variation
Cyclical Variations are recurrent upward or downward movements in the
time series but the period of cycle is greater than a year.
Irregular variation
 Irregular variation are fluctuations in time series that are short
duration, erratic in natural and follow no regularity in the occurrence
pattern.
 The Irregular fluctuations results due to the occurrence unforeseen
event like floods, earthquakes, wars and famines.
Example
from pandas import Series
from matplotlib import pyplot
from statsmodels.tsa.ar_model import AR
from sklearn.metrics import
mean_squared_error
import numpy
# create a difference transform of the dataset
def difference(dataset):
diff = list()
for i in range(1, len(dataset)):
value = dataset[i] - dataset[i - 1]
diff.append(value)
return numpy.array(diff)
def predict(coef, history):
# Make a prediction give regre
yhat = coef[0]
for i in range(1, len(coef)):
yhat += coef[i] * history[-i]
return yhat
series = Series.from_csv('daily-total-female-
Time serial forcasting

Time serial forcasting

  • 1.
    Time Series Forecasting Preparedby: Omar Al-dabash Computer Engineering Department
  • 2.
    Time series forecasting A time series is a set of observations on the values that a variable takes at different times.  Time series are used in statistics, econometrics, mathematical finance, weather forecasting, earthquake predication and many other application.
  • 3.
    Component of timeseries  The change which are in time series, they are effected by economic, social, natural, Industrial & Political Reasons. These reasons are component of time series. • Secular Trend. • Seasonal variation. • Cyclical Variation. • Irregular variation.
  • 4.
    Secular Trend.  Theincrease or decrease in the movements of a time series is called Secular Trend. A time series data may show upward trend or downward trend for a period of years and this may be due to factors like. • Increase in population. • Change in technological progress. • Large scale shift in consumers demands.
  • 5.
    Seasonal variation  Seasonalvariation is a short- term fluctuation in a time series which occur periodically in year. • The weather conditions  Cyclical Variation Cyclical Variations are recurrent upward or downward movements in the time series but the period of cycle is greater than a year.
  • 6.
    Irregular variation  Irregularvariation are fluctuations in time series that are short duration, erratic in natural and follow no regularity in the occurrence pattern.  The Irregular fluctuations results due to the occurrence unforeseen event like floods, earthquakes, wars and famines.
  • 7.
    Example from pandas importSeries from matplotlib import pyplot from statsmodels.tsa.ar_model import AR from sklearn.metrics import mean_squared_error import numpy # create a difference transform of the dataset def difference(dataset): diff = list() for i in range(1, len(dataset)): value = dataset[i] - dataset[i - 1] diff.append(value) return numpy.array(diff) def predict(coef, history): # Make a prediction give regre yhat = coef[0] for i in range(1, len(coef)): yhat += coef[i] * history[-i] return yhat series = Series.from_csv('daily-total-female-

Editor's Notes

  • #5 Example to upward trend “”””Population increases over a period of time, price increases over a period of years, production of goods on the capital market of the country increases over a period of years. Example to Downward trend “”””””””””” the sales of a commodity may decrease over a period of time because of better products coming to the market.
  • #6 sales and temperature readings.  This type of variation is easy to understand and can be easily measured or removed from the data to give de-seasonalized data. Seasonal Fluctuations describes any regular fluctuation with a period of less than one year for example cost of variation types of fruits and vegetables, cloths, unemployment figures, average daily rainfall, cyclical variation For example, economic data affected by business cycles with a period varying between about 5 and 7 years.In weekly or monthly data, the cyclical component may describes any regular variation (fluctuations) in time series data. The cyclical variation are periodic in nature and repeat themselves like business cycle, which has four phases (i) Peak (ii) Recession (iii) Trough/Depression (iv) Expansion.