Upload
saikiran38
View
212
Download
0
Embed Size (px)
Citation preview
8/4/2019 Time_series_analysis1a
1/31
Time series analysis
8/4/2019 Time_series_analysis1a
2/31
Sales
2000-01 Apr 6.6
May 6.7
Jun 5.9
Jul 4.9
Aug 5.8Sep 6.4
Oct 6.2
Nov 6.3
Dec 9.6
Jan 7.5
Feb 7.6Mar 8.1
2001-02 Apr 6.6
May 6.7
Jun 5.9
Jul 4.9
Aug 5.8
Sep 6.4Oct 6.2
Nov 6.3
Dec 9.6
Jan 7.5
Feb 7.6
Mar 8.1
Copy and paste monthly
sales year on year onebelow the other
8/4/2019 Time_series_analysis1a
3/31
Sales MA-12
2000-01 Apr 6.6
May 6.7
Jun 5.9
Jul 4.9
Aug 5.8Sep 6.4 6.80
Oct 6.2 6.80
Nov 6.3 6.80
Dec 9.6 6.80
Jan 7.5 6.80
Feb 7.6 6.80
Mar 8.1 6.80
2001-02 Apr 6.6 6.80
May 6.7 6.80
Jun 5.9 6.80
Jul 4.9 6.80
Aug 5.8 6.80
Sep 6.4 6.80Oct 6.2 6.89
Nov 6.3 7.01
Dec 9.6 7.24
Jan 7.5 7.52
Feb 7.6 7.60
Mar 8.1 7.61
Formula for Moving
average = Enter@average(c2..c13) in d2
Copy and paste the
formula to d3
D3 will read as@average(c3..c14)
Now copy till D.., leaving
the last 6
Next center Movingaverage
8/4/2019 Time_series_analysis1a
4/31
Canceling random variation
Inherent in the collection of data taken overtime is some form of random variation.
There exist methods for reducing of canceling
the effect due to random variation. An often-used technique in industry is
"smoothing".
This technique, when properly applied, revealsmore clearly the underlying trend, seasonaland cyclic components.
8/4/2019 Time_series_analysis1a
5/31
Moving Average Method
It is one of the most popular method for
calculating Long Term Trend.
This method is also used for Seasonal
fluctuation, cyclical fluctuation & irregular
fluctuation.
In this method we calculate the Moving
Average for certain periods.
8/4/2019 Time_series_analysis1a
6/31
Sales and Moving Averages
8/4/2019 Time_series_analysis1a
7/31
Seasonal variation: Seasonal variation are short-term
fluctuation in a time series which occurperiodically in a year. This continues torepeat year after year.
The major factors that are weather conditionsand customs of people.
More woolen clothes are sold in winter than inthe season of summer .
each year more ice creams are sold in summer
and very little in Winter season.
The sales in the departmental stores are moreduring festive seasons that in the normal days.
8/4/2019 Time_series_analysis1a
8/31
Seasonal Variation in one year or less
= ratio actual to Moving averageMonth Sales MA MAC Act/Mac
2000-01 Apr 1 6.6
May 2 6.7
Jun 3 5.9
Jul 4 4.9
Aug 5 5.8
Sep 6 6.4 6.800
Oct 7 6.2 6.825 6.813 0.910
Nov 8 6.3 6.875 6.850 0.920
Dec 9 9.6 6.983 6.929 1.385Jan 10 7.5 7.175 7.079 1.059
Feb 11 7.6 7.292 7.233 1.051
Mar 12 8.1 7.383 7.338 1.104
2001-02 Apr 13 6.9 7.467 7.425 0.929
May 14 7.3 7.558 7.513 0.972
Jun 15 7.2 7.350 7.454 0.966
Jul 16 7.2 7.375 7.363 0.978Aug 17 7.2 7.417 7.396 0.974
Sep 18 7.5 7.467 7.442 1.008
Oct 19 7.2 7.533 7.500 0.960
Nov 20 7.4 7.600 7.567 0.978
Dec 21 7.1 7.725 7.663 0.927
Jan 22 7.8 7.808 7.767 1.004
Feb 23 8.1 7.775 7.792 1.040Mar 24 8.7 7.692 7.733 1.125
8/4/2019 Time_series_analysis1a
9/31
Averaging Moving averages of different years
and rectification
Copy and paste seasonality ratios in year wise columns,calculate averages and adjust for total =12
2000-
01
2001-
02
2002-
03
2003-
04
2004-
05
2005-
06
2006-
07
2007-
08
2008-
09 Mean Index
Apr 0.929 0.999 1.130 0.884 1.115 1.040 1.028 1.012 1.017 1.019
May 0.972 1.047 1.060 0.988 1.120 1.073 1.151 0.932 1.043 1.045Jun 0.966 1.119 1.079 1.038 1.010 1.044 1.100 0.949 1.038 1.040
Jul 0.978 1.052 0.887 1.186 1.107 0.952 0.987 0.965 1.014 1.016
Aug 0.974 0.877 0.990 0.886 0.924 0.898 1.030 0.940 0.942
Sep 1.008 0.846 0.930 0.909 0.844 0.893 0.859 1.040 0.916 0.918
Oct 0.910 0.960 0.985 1.019 0.967 0.815 0.853 0.828 1.030 0.930 0.931
Nov 0.920 0.978 0.989 0.977 1.012 0.858 0.909 0.876 1.037 0.951 0.953
Dec 0.927 0.987 0.988 0.999 0.974 0.962 0.988 0.974 0.975 0.977
Jan 1.059 1.004 0.980 0.981 0.999 1.038 1.068 1.050 1.017 1.022 1.024
Feb 1.051 1.040 0.939 1.004 0.936 1.119 1.106 1.082 1.023 1.033 1.035
Mar 1.104 1.125 1.016 1.143 0.889 1.276 1.128 1.110 1.099 1.101
Sum 11.977 12.000
8/4/2019 Time_series_analysis1a
10/31
8/4/2019 Time_series_analysis1a
11/31
De-seasoning data
Actual sales
De-seasonalised sales = _______________
Monthly seasonal Index
8/4/2019 Time_series_analysis1a
12/31
Month Sales MAC Sales/Mac Index Salesd
2000-01 Apr 1 6.6 1.019 6.477
May 2 6.7 1.045 6.413
Jun 3 5.9 1.040 5.674
Jul 4 4.9 1.016 4.821
Aug 5 5.8 0.942 6.160Sep 6 6.4 0.918 6.973
Oct 7 6.2 6.81 0.910 0.931 6.656
Nov 8 6.3 6.85 0.920 0.953 6.614
Dec 9 9.6 6.93 1.385 0.977 9.829
Jan 10 7.5 7.08 1.059 1.024 7.327
Feb 11 7.6 7.23 1.051 1.035 7.342Mar 12 8.1 7.34 1.104 1.101 7.357
2001-02 Apr 13 6.9 7.43 0.929 1.019 6.772
May 14 7.3 7.51 0.972 1.045 6.987
Jun 15 7.2 7.45 0.966 1.040 6.924
Jul 16 7.2 7.36 0.978 1.016 7.084
Aug 17 7.2 7.40 0.974 0.942 7.646
Sep 18 7.5 7.44 1.008 0.918 8.171
Oct 19 7.2 7.50 0.960 0.931 7.729
Nov 20 7.4 7.57 0.978 0.953 7.769
Dec 21 7.1 7.66 0.927 0.977 7.270
Jan 22 7.8 7.77 1.004 1.024 7.620
Feb 23 8.1 7.79 1.040 1.035 7.825
Mar 24 8.7 7.73 1.125 1.101 7.902
8/4/2019 Time_series_analysis1a
13/31
Linear Trend: Least Squares
Slope of the best fitting line
sum XY- n*X mean*Y mean
b =_____________________________
Sum X^2 n * Xmean^2
Easy to remember variance xy/variance x^2
Since X mean and Y mean is on the regression
line
A = Y mean b* X mean
8/4/2019 Time_series_analysis1a
14/31
Simplify X in Time series
X = 2005, 2006, 2007, 2008, 2009,2010, 2011 X = -3, -2,-1, 0, 1, 2, 3 . X mean = 0
X = 2005, 2006, 2007, 2007.5, 2008,
2009,2010 X= 2*(-2.5), 2*(-1.5), 2*(-0.5), 2*(.5), 2*(1.5),
2*(2.5)
X = -5, -3, -1,1, 3,5 X mean = 0 N*X mean * Y mean = 0*Y mean =0
b = sum XY/sum X^2, a = Y mean
8/4/2019 Time_series_analysis1a
15/31
8/4/2019 Time_series_analysis1a
16/31
SUMMARY OUTPUT
Regression Statistics
Multiple R 0.799894
R Square 0.639831
Adjusted R
Square 0.636586
Standard
Error 0.771784
Observatio
ns 113
ANOVA
df SS MS F
Significanc
e F
Regression 1 117.4554 117.4554 197.1884 2.29E-26
Residual 111 66.11723 0.595651
Total 112 183.5726
Coefficient
s
Standard
Error t Stat P-value Lower 95% Upper 95%
Lower
95.0%
Upper
95.0%
Intercept 6.761015 0.146176 46.25262 2.27E-74 6.471358 7.050672 6.471358 7.050672
Month 0.031256 0.002226 14.04238 2.29E-26 0.026845 0.035666 0.026845 0.035666
Intercept and coefficients are
different as periods (x) is
numbered from 1 to 113
8/4/2019 Time_series_analysis1a
17/31
Cyclical Variations:Cyclical variations are recurrent upward or downward
movements in a time series but the period of cycle is
greater than a year. Also these variations are not regularas seasonal variation.
A business cycle showing these oscillatory movements hasto pass through four phases-prosperity, recession,depression and recovery. In a business, these four phasesare completed by passing one to another in this order.
8/4/2019 Time_series_analysis1a
18/31
8/4/2019 Time_series_analysis1a
19/31
8/4/2019 Time_series_analysis1a
20/31
Sales MA-12 MAC Trend MAC/trend
2000-01 Apr 6.6 6.57
May 6.7 6.61
Jun 5.9 6.64
Jul 4.9 6.67
Aug 5.8 6.71Sep 6.4 6.80 6.80 6.74 1.01
Oct 6.2 6.80 6.80 6.78 1.00
Nov 6.3 6.80 6.80 6.81 1.00
Dec 9.6 6.80 6.80 6.85 0.99
Jan 7.5 6.80 6.80 6.88 0.99
Feb 7.6 6.80 6.80 6.91 0.98Mar 8.1 6.80 6.80 6.95 0.98
2001-02 Apr 6.6 6.80 6.80 6.98 0.97
May 6.7 6.80 6.80 7.02 0.97
Jun 5.9 6.80 6.80 7.05 0.96
Jul 4.9 6.80 6.80 7.08 0.96
Aug 5.8 6.80 6.80 7.12 0.96
Sep 6.4 6.80 6.81 7.15 0.96
Oct 6.2 6.82 6.82 7.19 0.97
Nov 6.3 6.83 6.88 7.22 0.99
Dec 9.6 6.93 7.06 7.26 1.02
Jan 7.5 7.19 7.29 7.29 1.04
Feb 7.6 7.39 7.47 7.32 1.04
Mar 8.1 7.55 7.55 7.36 1.04
Cyclical
Factors
8/4/2019 Time_series_analysis1a
21/31
8/4/2019 Time_series_analysis1a
22/31
8/4/2019 Time_series_analysis1a
23/31
Time Series Model Addition Model:
Y = T + S + C + IWhere:- Y = Original Data
T = Trend Value
S = Seasonal FluctuationC = Cyclical Fluctuation
I =
I = IrregularFluctuation
Multiplication Model:Y = T x S x C x I
or
Y = TSCI
8/4/2019 Time_series_analysis1a
24/31
Irregular variation:Irregular variations are fluctuations in time series that are
short in duration, erratic in nature and follow no
regularity in the occurrence pattern. These variationsare also referred to as residual variations since by
definition they represent what is left out in a time series
after trend ,cyclical and seasonal variations. Irregular
fluctuations results due to the occurrence of unforeseen
events like :
Floods,
Earthquakes,
Wars,
Famines
8/4/2019 Time_series_analysis1a
25/31
Ad d T i
8/4/2019 Time_series_analysis1a
26/31
Advanced Topic
Parabolic Curve for Trend
Many times the line which draw by Least SquareMethod is not prove Line of best fit because it is
not present actual long term trend So we distributedTime Series in sub- part and make following equation:-
Yc = a + bx + cx2 If this equation is increase up to second degree then it is
Parabola of second degree and if it is increase up to thirddegree then it Parabola of third degree. There are three
constant a, b and c.
Its are calculated by following three equation:-
8/4/2019 Time_series_analysis1a
27/31
If we take the deviation from Mean year then the allthree equation are presented like this:
422
2
2
XcXaYX
XbXY
XCNaY
4322
32
2
XcXbXaYX
XcXbXaXY
XcXbNaY
Parabola of second degree:-
8/4/2019 Time_series_analysis1a
28/31
Year Production Dev. From MiddleYear(x)xY x2 x2Y x3 x4 Trend ValueY = a + bx + cx2
1992
1993
1994
1995
1996
5
7
4
9
10
-2
-1
0
1
2
-10
-7
0
9
20
4
1
0
1
4
20
7
0
9
40
-8
-1
0
1
8
16
1
0
1
16
5.7
5.6
6.3
8.0
10.5
= 35 = 0 =12 = 10 = 76 = 0 = 34Y X
XY
2X
YX2
3
X 4
X
Example:Draw a parabola of second degree from the following data:-
Year 1992 1993 1994 1995 1996
Production (000) 5 7 4 9 10
8/4/2019 Time_series_analysis1a
29/31
422
2
2
XcXaYX
XbXY
XNaY
Now we put the value of
35 = 5a + 10c (i)
12 = 10b (ii)76 = 10a + 34c .. (iii)
From equation (ii) we get b = = 1.2
NXXXXYYX ,&,,,,,432
10
12
We take deviation from middle year so the
equations are as below:
8/4/2019 Time_series_analysis1a
30/31
Equation (ii) is multiply by 2 and subtracted from (iii):
10a + 34c = 76 .. (iv)10a + 20c = 70 .. (v)
14c = 6 or c = = 0.43
Now we put the value of c in equation (i)
5a + 10 (0.43) = 35
5a = 35-4.3 = 5a = 30.7
a = 6.14
Now after putting the value of a, b and c, Parabola of second
degree is made that is:
Y = 6.34 + 1.2x + 0.43x2
14
6
8/4/2019 Time_series_analysis1a
31/31
Equation (ii) is multiply by 2 and subtracted from (iii):
10a + 34c = 76 .. (iv)10a + 20c = 70 .. (v)
14c = 6 or c = = 0.43
Now we put the value of c in equation (i)
5a + 10 (0.43) = 35
5a = 35-4.3 = 5a = 30.7
a = 6.14
Now after putting the value of a, b and c, Parabola of second
degree is made that is:
2
14
6