Professional Documents
Culture Documents
Time Series Trend Finding and Removing
Time Series Trend Finding and Removing
Introduction
Time Series Data: We study/survey one cross section over the period.
1. Trends
2. Seasons
3. Cycles
In simple estimation data gives inaccurate results. It does not show exact impact of Independent
variable on Dependent variable. For accurate impact we have to find the effect of Trends,
Seasons, and Cycles on the model and remove them.
Trends: It is slow evolving long-run evolution in the variable that we want to estimate or
forecast.
Evolution:
But these things are not explicitly included in the model. All these things changes with the Time.
Time is important.
Estimation of Trends:
Estimate the model by using OLS method. Estimate it with one variable first and take it as
dependent variable and Time as Independent variable. Then estimate it with another variable
taking it as dependent variable and Time as Independent variable.
Detrend: Remove impact of trends from model. Remove it from both variables.
Then their residuals series is obtained which is the data of both variables without trend effect.
Study the impact of Exchange rate on Exports of Pakistan from time period 2002(i) to
2006(xii) (Monthly).
𝐸𝑋 = 𝛼 + 𝛽𝐸𝑅 + 𝜇
Here,
EX=Exports
ER=Exchange rate
Simple estimation
Dependent Variable: EX
Method: Least Squares
Date: 08/13/15 Time: 14:04
Sample: 2002M01 2006M12
Included observations: 60
1,600
1,400
600 1,200
400
1,000
200
800
0
600
-200
-400
-600
5 10 15 20 25 30 35 40 45 50 55 60
𝐻ₒ: 𝛽̂ = 0
𝐻1 : 𝛽̂ ≠ 0
From above results we are interested in result of coefficient of ER, which means that there is no
impact of Exchange rate on Exports.
In Time series just this analysis is of no work, because there may be impact of trends. So
therefore, we have to remove the impact of trends then we will get accurate result.
Estimation of Trends
Dependent Variable: EX
Method: Least Squares
Date: 08/13/15 Time: 14:07
Sample: 2002M01 2006M12
Included observations: 60
Graphical analysis:
mjddmdkdkdkdkdkdk
1,600
1,400
600 1,200
400 1,000
200 800
0 600
-200
-400
2002 2003 2004 2005 2006
𝐻1 : 𝛽̂ ≠ 0
From above results we are interested in result of coefficient (β=12.47451), which means that
12.47451 is the effect of trends in Exchange rate data.
Detrending
Residuals Series obtained
2002M01 -63.96108
2002M02 -124.1086
2002M03 -66.28410
2002M04 -10.77860
2002M05 30.01689
2002M06 137.7674
2002M07 -24.54313
2002M08 48.09937
2002M09 4.762859
2002M10 12.43935
2002M11 -38.32216
2002M12 -39.96666
2003M01 31.79983
2003M02 -152.2087
2003M03 -2.344185
2003M04 38.29831
2003M05 85.55480
2003M06 289.2503
2003M07 -98.07922
2003M08 45.34128
2003M09 29.64677
2003M10 -18.43774
2003M11 -175.3692
2003M12 12.18325
2004M01 34.97874
2004M02 -169.6258
2004M03 -29.56027
2004M04 2.085218
2004M05 -45.90929
2004M06 402.1262
2004M07 48.75170
2004M08 41.54719
2004M09 -44.34732
2004M10 -164.3218
2004M11 -272.8683
2004M12 -64.47084
2005M01 -59.64535
2005M02 -28.20986
2005M03 119.3356
2005M04 52.68113
2005M05 117.3566
2005M06 260.4321
2005M07 -21.10239
2005M08 102.7131
2. Finding effect of trends on Exchange rate data.
Dependent Variable: ER
Method: Least Squares
Date: 08/13/15 Time: 14:09
Sample: 2002M01 2006M12
Included observations: 60
Graphical analysis:
800,000
600,000
600,000
400,000 400,000
200,000
200,000
0
0
-200,000
-200,000
2002 2003 2004 2005 2006
𝐻ₒ: 𝛽̂ = 0
𝐻1 : 𝛽̂ ≠ 0
Here 𝐻ₒ is rejected and 𝐻1 is accepted because
Probability of coefficient (𝛽 is 0.0886). Hence 𝐻1 is
significant. This implies that Exchange rate has effect on
Exports.
Detrending
Residuals Series obtained
2002M01 19297.06
2002M02 18298.88
2002M03 17300.80
2002M04 16302.77
2002M05 15304.75
2002M06 14306.62
2002M07 13308.06
2002M08 12309.81
2002M09 11311.59
2002M10 10313.28
2002M11 9314.646
2002M12 8316.614
2003M01 7318.367
2003M02 6320.246
2003M03 5321.914
2003M04 4323.821
2003M05 3325.614
2003M06 2327.742
2003M07 1329.639
2003M08 331.5789
2003M09 -666.3383
2003M10 -1664.850
2003M11 -2663.096
2003M12 -3660.936
2004M01 -4659.007
2004M02 -5657.130
2004M03 -6655.024
2004M04 -7653.107
2004M05 -8650.931
2004M06 -9648.527
2004M07 -10646.28
2004M08 -11644.06
2004M09 -12641.62
2004M10 -13637.59
2004M11 -14637.18
2004M12 -15635.54
2005M01 -16633.72
2005M02 -17631.76
2005M03 -18629.77
2005M04 -19627.75
2005M05 -20625.68
2005M06 -21623.63
2005M07 -22621.73
2005M08 -23619.73
2005M09 -24617.76
2005M10 -25615.81
2005M11 -26613.81
2005M12 -27611.83
2006M01 -28609.82
2006M02 -29607.85
2006M03 -30605.80
2006M04 -31603.79
2006M05 -32601.67
2006M06 -33599.74
2006M07 -34597.64
2006M08 -35595.63
2006M09 -36593.53
2006M10 -37591.52
2006M11 -38589.36
2006M12 569206.8
Conclusion:
Now, the effect of Trends has been removed from Model and residual series are obtained which
have no effect of trends in them. Estimate the model by OLS and get the accurate results of
impact of Exchange rate on Exports of Pakistan from 2002(I) to 2006(XII).
Second Assignment:
MODELING SEASONALITY
Seasonality in a time series is a regular pattern of changes that repeats over S time periods, where
S defines the number of time periods until the pattern repeats again.
For example, there is seasonality in monthly data for which high values tend always to occur in
some particular months and low values tend always to occur in other particular months. In this
case, S = 12 (months per year) is the span of the periodic seasonal behavior.
Note: If data is annual then we find trend, but if data is divided then we find seasonality.
𝐸𝑋 = 𝛼 + 𝛽𝐸𝑅 + 𝜇
Here,
EX=Exports
ER=Exchange rate
Modeling Seasonality:
2006
𝑌 = ∑ 𝛾𝑖𝐷𝑖+∈
𝑡=2002
S=12
i=1,2,3,…….,12
Time=2002-2006
Estimate the model by OLS method
Dependent Variable: EX
Method: Least Squares
Date: 08/13/15 Time: 14:32
Sample: 2002M01 2006M12
Included observations: 60
Graphical analysis:
1,600
1,400
1,200
600
1,000
400
800
200
0 600
-200
-400
-600
2002 2003 2004 2005 2006
Seasonal adjustment
2002M01 -324.4178
2002M02 -307.6474
2002M03 -395.6740
2002M04 -335.8934
2002M05 -321.0776
2002M06 -396.4916
2002M07 -285.6074
2002M08 -309.3208
2002M09 -318.3924
2002M10 -213.1856
2002M11 -173.5094
2002M12 -346.3192
2003M01 -78.96280
2003M02 -186.0534
2003M03 -182.0400
2003M04 -137.1224
2003M05 -115.8456
2003M06 -95.31460
2003M07 -209.4494
2003M08 -162.3848
2003M09 -143.8144
2003M10 -94.36860
2003M11 -160.8624
2003M12 -144.4752
2004M01 73.91020
2004M02 -53.77640
2004M03 -59.56200
2004M04 -23.64140
2004M05 -97.61560
2004M06 167.2554
2004M07 87.07560
2004M08 -16.48480
2004M09 -68.11440
2004M10 -90.55860
2004M11 -108.6674
2004M12 -71.43520
2005M01 128.9802
2005M02 237.3336
2005M03 239.0280
2005M04 176.6486
2005M05 215.3444
2005M06 175.2554
2005M07 166.9156
2005M08 194.3752
2005M09 305.4956
2005M10 222.4614
2005M11 91.27460
2005M12 257.2448
2006M01 200.4902
2006M02 310.1436
2006M03 398.2480
2006M04 320.0086
2006M05 319.1944
2006M06 149.2954
2006M07 241.0656
2006M08 293.8152
2006M09 224.8256
2006M10 175.6514
2006M11 351.7646
2006M12 304.9848
Conclusion: Now, the effect of Seasons has been removed from Model and residual series are
obtained which have no effect of Seasons in them. Estimate the model by OLS and get the
accurate results of impact of Exchange rate on Exports of Pakistan from 2002(I) to 2006(XII).