Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 77

Time Series Project

Lindie Beukes
Hélène Sonnekus
Round 1
Simulations
Simulation Process
 Simulate data in R
 Read data into SPSS
 Inspect the following:

◦ Time Series Plot


◦ sACF & sPACF
 Estimate parameters
 Fit model
 Residual Analysis
Residual Analysis
 Test whether the residuals are independent.

Normality + zero correlation = Independence


White Noise Time Series Plot
Residuals - Normailty
 Investigate a histogram of the residuals.
◦ This should be approximately normal
 Investigate a P-P plot.
◦ Data points have to fall onto the straight line
 Test the hypothesis
H 0 :  res  0 vs. H a :  res  0

with test statistic


x   res
Z stat   1.96

Residuals – Zero Correlation
 Investigate sACF and sPACF.
◦ Should be white noise
Question 1
AR(1)
 Parameter:  1  0.3
 Time Series Plot:
 Parameter estimates:
Parameter Estimates

Estimates Std Error t Approx Sig


Non-Seasonal Lags AR1 .173 .057 3.030 .003
Melard's algorithm was used for estimation.

• Resisual Plot:
• Normality of Residuals:

Descriptive Statistics

N Minimum Maximum Mean Std.


Statistic Statistic Statistic Statistic Std. Error Deviation
Statistic
Error for V2 from ARIMA,
300 -2.52648 3.53768 .0593217 .05546748 .96072494
MOD_3, NOCON
Valid N (listwise) 300

0.0593217 0 Thus, the null hypothesis is


Z stat   0.06  1.96 not rejected and therefore it
0.96072494 can be concluded that the
residuals are normally
distributed with mean zero.
• Correlation of Residuals:

Since the residuals are normally distributed


and uncorrelated, they are independent.
Thus, the fitted model is adequate.
Question 2
MA(1)
 Parameter:  1  0.6
 Time Series Plot:
 Parameter estimates:
ParameterEstimates
Parameter Estimates

Estimates Std
Estimates StdError
Error tt Approx Sig
Approx Sig
Non-Seasonal
Non-Seasonal Lags Lags AR1
MA1 .173
.620 .057
.046 3.030
13.587 .003
.000
Melard's
Melard's algorithm
algorithm was
was used
used forfor estimation.
estimation.

• Resisual Plot:
• Normality of Residuals:

Descriptive
DescriptiveStatistics
Statistics

NN Minimum
Minimum Maximum
Maximum Mean
Mean Std.Std.
Statistic
Statistic Statistic
Statistic Statistic
Statistic Statistic
Statistic Std. Error
Std. Deviation
Deviation
Error Statistic
Statistic
Error for
Error for V2
V2 from
fromARIMA,
ARIMA,
300
300 -3.09188
-2.52648 2.43056 .0593217
3.53768 -.0795616 .05772432
.05546748 .99981460
.96072494
MOD_4, NOCON
MOD_3, NOCON
Valid N (listwise) 300
Valid N (listwise) 300

Thus, the null hypothesis is


 0.795616  0
Z stat   0.80  1.96 not rejected and therefore it
0.99981460 can be concluded that the
residuals are normally
distributed with mean zero.
• Correlation of Residuals:

Since the residuals are normally distributed


and uncorrelated, they are independent.
Thus, the fitted model is adequate.
Question 3
ARMA(1,1)
 Parameter:  1  0.8  1  0.4
 Time Series Plot:
 Parameter estimates:
Parameter Estimates
ParameterEstimates
Parameter Estimates
Estimates Std Error t Approx Sig
Non-Seasonal AR1 Estimates
Estimates
.817 Std
Std Error
Error
.055 tt
14.860 Approx.000
Approx Sig
Sig
Non-Seasonal
Lags Lags
Non-Seasonal LagsMA1 AR1
MA1 .173
.620
.415 .057
.046
.087 3.030
13.587
4.777 .003
.000
.000
Melard's
Melard's
Melard's algorithm
algorithm
algorithm was
was
was used
forfor
used
used forestimation.
estimation.
estimation.

• Resisual Plot:
• Normality of Residuals:

Descriptive Statistics
Descriptive
DescriptiveStatistics
Statistics
N Minimum Maximum Mean Std.
N Minimum Maximum Mean Std.
Std.
N
Statistic Minimum
Statistic Maximum
Statistic Statistic Mean
Std. Error Deviation
Statistic
Statistic Statistic Statistic Statistic Std. Error Deviation
Statistic
Deviation
Error Statistic Statistic Statistic Statistic Std. Error Statistic
Error forfor
V2V2fromfrom ARIMA,
ARIMA, 300 -2.52648 3.53768 .0593217 .05546748
Error for V2NOCON
MOD_3, from ARIMA, 300 -3.09188 2.43056 -.0795616 .05772432 .96072494
.99981460
MOD_4, NOCON 300 -2.33407 3.63265 -.0090055 .05760986 .99783200
MOD_3, NOCON
Valid
Valid N (listwise)
N (listwise) 300
300
Valid N (listwise) 300

Thus, the null hypothesis is


 0.009005  0
Z stat   0.009  1.96 not rejected and therefore it
0.99783200 can be concluded that the
residuals are normally
distributed with mean zero.
• Correlation of Residuals:

Since the residuals are normally distributed


and uncorrelated, they are independent.
Thus, the fitted model is adequate.
Question 4
MA(2)
 Parameter: 1 1  2  0.5
 Time Series Plot:
 Parameter estimates:
Parameter
ParameterEstimates
Estimates
ParameterEstimates
Parameter Estimates
Estimates
Estimates Std
StdError
Error t t Approx
ApproxSigSig
Non-Seasonal
Non-Seasonal AR1
MA1 Estimates
Estimates
.817
.969 Std Error
Std Error
.055
.049 t t
14.860
19.859 Approx Sig
Approx Sig
.000
.000
Non-Seasonal
Lags
Non-Seasonal
Lags Lags
LagsMA1 AR1
MA1
MA2 .173
.620
.415 .057
.046
.087 3.030
13.587
4.777 .003
.000
.000
-.543 .049 -11.082 .000
Melard's
Melard's
Melard's
Melard's algorithm
algorithm
algorithm
algorithm was
was
was
was used
forfor
used
used
used forestimation.
forestimation.
estimation.
estimation.

• Resisual Plot:
• Normality of Residuals:

Descriptive Statistics
Descriptive Statistics
Descriptive
DescriptiveStatistics
Statistics
NN Minimum
Minimum Maximum
Maximum Mean
Mean Std.
Std.
N Minimum Maximum Mean Std.
Std.
N
Statistic Minimum
Statistic Maximum
Statistic Statistic Mean
Std. Deviation
Deviation
Statistic
Statistic Statistic
Statistic Statistic
Statistic Statistic
Statistic Std.Error
Std. Error
Statistic
Error Deviation
Statistic
Statistic
Deviation
Error Statistic Statistic Statistic Statistic Std. Error Statistic
Error
Error forfor
for V2V2
V2 fromfrom
from ARIMA,
ARIMA,
ARIMA, 300 -2.52648 3.53768 .0593217
Error for V2NOCON
MOD_3, from ARIMA, 300
300 -3.53200
-3.09188 2.85306
2.43056 .0257887 .05546748
-.0795616 .05802645 .96072494
.05772432 1.005048
.99981460
MOD_3, NOCON
MOD_4, NOCON 300 -2.33407 3.63265 -.0090055 .05760986 .99783200
MOD_3, NOCON
Valid
Valid
Valid N N (listwise)
N (listwise)
(listwise) 300
300
Valid N (listwise) 300
300

Thus, the null hypothesis is


0.0257887  0 not rejected and therefore it
Z stat   0.0256591725  1.96
1.005048 can be concluded that the
residuals are normally
distributed with mean zero.
• Correlation of Residuals:

Since the residuals are normally distributed


and uncorrelated, they are independent.
Thus, the fitted model is adequate.
Question 5
AR(1)
 Parameter:  1  0.9
 Time Series Plot:
 Parameter estimates:
Parameter
ParameterEstimates
Estimates
Parameter Estimates
ParameterEstimates
Parameter Estimates
Estimates
Estimates Std
StdError
Error t t Approx
ApproxSigSig
Estimates
Estimates StdError
Std Error t t Approx
Approx Sig Sig
Non-Seasonal
Non-Seasonal
Non-Seasonal
AR1
Lags
MA1
AR1
Estimates
.817
.969 Std Error
.055
.049 t
14.860
19.859 Approx Sig
.000
.000
Non-Seasonal
Lags Lags AR1 .849
.173 .030
.057 28.069
3.030 .003.000
Non-Seasonal
Lags LagsMA1MA1
MA2 .620
.415
-.543 .046
.087
.049 13.587
4.777
-11.082 .000
.000
.000
Melard's algorithm was used for estimation.
Melard's
Melard's
Melard's
Melard's algorithm
algorithm
algorithm
algorithm was
was
was
was used
forfor
used
used
used forestimation.
forestimation.
estimation.
estimation.

• Resisual Plot:
• Normality of Residuals:

Descriptive Statistics
Descriptive Statistics
Descriptive
Descriptive Statistics
DescriptiveStatistics
Statistics
N N Minimum
Minimum Maximum
Maximum Mean
Mean Std.
Std.
Std.
N
N Minimum
Minimum Maximum
Maximum Mean
Mean Std.
Std.
N
Statistic Minimum
Statistic Maximum
Statistic Statistic Mean
Std. Error Deviation
Deviation
Statistic
Deviation
Statistic
Statistic
Statistic Statistic
Statistic
Statistic Statistic
Statistic
Statistic Statistic
Statistic
Statistic Std.Error
Std.
Std. Error
Error Statistic
Deviation
Statistic
Statistic
Deviation
Error Statistic Statistic Statistic Statistic Std. Error Statistic
Error forfor
for V2V2fromfrom ARIMA,
ARIMA,
ARIMA, 300 -3.09188
-2.52648 3.53768 -.0795616
.0593217
Error for V2NOCON
MOD_3, from ARIMA, 300
300 -3.53200
-2.01865 2.85306
2.83490
2.43056 .0257887 .05546748
.2037248 .05802645 .96072494
.05016107
.05772432 1.005048
.86881529
.99981460
MOD_3, NOCON
MOD_4, NOCON 300 -2.33407 3.63265 -.0090055 .05760986 .99783200
MOD_3, NOCON
Valid
Valid N N (listwise)
N (listwise) 300
300
Valid N (listwise)
300
300
(listwise) 300

Thus, the null hypothesis is


0.2037248  0 not rejected and therefore it
Z stat   0.23  1.96
0.86881529 can be concluded that the
residuals are normally
distributed with mean zero.
• Correlation of Residuals:

Since the residuals are normally distributed


and uncorrelated, they are independent.
Thus, the fitted model is adequate.
Question 6
AR(2)
 Parameter:  1  0.5  2  0. 3
 Time Series Plot:
 Parameter estimates:
Parameter
Parameter
ParameterEstimates
Estimates
Estimates
Parameter Estimates
ParameterEstimates
Parameter Estimates
Estimates
Estimates Std
Estimates StdError
Std Error
Error t tt Approx
Approx
ApproxSig
Sig
Sig
Estimates
Estimates Std
Std Error
Error t t Approx
Approx Sig Sig
Non-Seasonal
Non-Seasonal
Non-Seasonal
Non-Seasonal
AR1
Lags
MA1
AR1
AR1
Estimates
.817
.969
-.433 Std Error
.055
.049
.055 t-7.849 Approx Sig
14.860
19.859 .000
.000
.000
Non-Seasonal
Lags
Lags Lags AR1 .849
.173 .030
.057 28.069
3.030 .003 .000
Non-Seasonal
Lags LagsMA1MA1
AR2
MA2 .620
.415
.304
-.543 .046
.087.055
.049 13.587
4.777
5.523
-11.082 .000
.000
.000
.000
Melard's algorithm was used for estimation.
Melard's
Melard's
Melard's
Melard's
Melard's algorithm
algorithm
algorithm
algorithm
algorithm was
wasused
was
was
was usedforfor
used
used
used forestimation.
for
for es timation.
estimation.
estimation.
estimation.

• Resisual Plot:
• Normality of Residuals:

Descriptive Statistics
Descriptive Statistics
Descriptive
Descriptive Statistics
DescriptiveStatistics
Descriptive Statistics
Statistics
N N Minimum
Minimum Maximum
Maximum Mean
Mean Std.
Std.
Std.
N
N Minimum
Minimum Maximum
Maximum Mean
Mean Std.
Std.
Std.
N
Statistic Minimum
Minimum
Statistic Maximum
Maximum
Statistic StatisticMean
Mean
Std. Error Deviation
Deviation
Statistic
Deviation
Statistic
Statistic
Statistic Statistic
Statistic
Statistic Statistic
Statistic
Statistic Statistic
Statistic
Statistic Std.Error
Std.
Std. Error Deviation
Error Statistic
Deviation
Statistic
Statistic
Deviation
Error Statistic Statistic
Statistic Statistic
Statistic Statistic
Statistic Std.
Std.
Error
Error Statistic
Statistic
Error forfor
for V2V2 from
from ARIMA,
ARIMA,
ARIMA, 300 -3.09188
-2.52648 3.53768 -.0795616
.0593217
Error
Errorfor
forV2
MOD_3, V2 from
from ARIMA,
NOCON ARIMA, 300
300 -3.53200
-2.01865 2.85306
2.83490
2.43056 .0257887 .05546748
.2037248 .05802645 .96072494
.05016107
.05772432 1.005048
.86881529
.99981460
MOD_3, NOCON
MOD_4, NOCON 300 -2.52648
-2.33407 3.53768
3.63265 .0593217
-.0090055 .05546748
.05760986 .96072494
.99783200
MOD_3,
MOD_3, NOCON
NOCON
Valid
Valid N N (listwise)
N (listwise) 300
300
N(listwise)
300
300
Valid
ValidN (listwise)
(listwise) 300

Thus, the null hypothesis is


0.0593217  0 not rejected and therefore it
Z stat   0.06  1.96
0.96072494 can be concluded that the
residuals are normally
distributed with mean zero.
• Correlation of Residuals:

Since the residuals are normally distributed


and uncorrelated, they are independent.
Thus, the fitted model is adequate.
Question 7
MA(1)
 Parameter:  1  0.9
 Time Series Plot:
 Parameter estimates:
Parameter
Parameter Estimates
ParameterEstimates
Estimates
Parameter
Parameter
Parameter Estimates
Estimates
Estimates
Estimates
Estimates Std Error t t Approx Sig
EstimatesStd
Estimates
Estimates
Error
Std
Std
Std Error
Error
Error t t t
Approx
Approx
Approx
Approx
SigSig
SigSig
Non-Seasonal
Non-Seasonal AR1
MA1 Estimates
.817
.969 Std Error
.055
.049 t
14.860
19.859 Approx Sig
.000
.000
Non-Seasonal
Non-Seasonal
Non-Seasonal
Lags Lags
Lags
Lags MA1
AR1
AR1 .849
-.621
.173 .030
.046
.057 28.069
-13.585
3.030 .000
.003 .000
Non-Seasonal
Lags LagsMA1MA1
MA2 .620
.415
-.543 .046
.087
.049 13.587
4.777
-11.082 .000
.000
.000
Melard's
Melard's algorithm
algorithm was
was used
used for
for estimation.
estimation.
Melard's
Melard's
Melard's algorithm
algorithm
algorithm was
was
was used
used
used for
forestimation.
forestimation.
estimation.
Melard's algorithm was used for estimation.

• Resisual Plot:
• Normality of Residuals:

Descriptive Statistics
Descriptive Statistics
Descriptive
Descriptive Statistics
DescriptiveStatistics
Statistics
N N Minimum
Minimum Maximum
Maximum Mean
Mean Std.
Std.
Std.
N
N Minimum
Minimum Maximum
Maximum Mean
Mean Std.
Std.
N
Statistic Minimum
Statistic Maximum
Statistic Statistic Mean
Std. Error Deviation
Deviation
Statistic
Deviation
Statistic
Statistic
Statistic Statistic
Statistic
Statistic Statistic
Statistic
Statistic Statistic
Statistic
Statistic Std.Error
Std.
Std. Error
Error Statistic
Deviation
Statistic
Statistic
Deviation
Error Statistic Statistic Statistic Statistic Std. Error Statistic
Error forfor
for V2V2fromfrom ARIMA,
ARIMA,
ARIMA, 300 -3.09188
-2.52648 3.53768 -.0795616
.0593217
Error for V2NOCON
MOD_3, from ARIMA, 300
300 -3.53200
-2.01865
-1.40878 2.85306
2.83490
3.01216
2.43056 .0257887 .05546748
.2037248
.6481893 .05802645 .96072494
.05016107
.04397057
.05772432 1.005048
.86881529
.76159261
.99981460
MOD_3, NOCON
MOD_4, NOCON 300 -2.33407 3.63265 -.0090055 .05760986 .99783200
MOD_3, NOCON
Valid
Valid N N (listwise)
N (listwise) 300
300
Valid N (listwise)
300
300
(listwise) 300

Thus, the null hypothesis is


0.6481893 0 not rejected and therefore it
Z stat   0.85  1.96
0.76159261 can be concluded that the
residuals are normally
distributed with mean zero.
• Correlation of Residuals:

Since the residuals are normally distributed


and uncorrelated, they are independent.
Thus, the fitted model is adequate.
Question 8
AR(1)
 Parameter:  1  0.6
 Time Series Plot:
 Parameter estimates:
Parameter
ParameterEstimates
Parameter
Parameter Estimates
Estimates
Estimates
ParameterEstimates
Parameter Estimates
Estimates
Estimates
Estimates Std
StdError
Std
Error
Error t t t Approx
Approx
ApproxSig
Sig
Sig
Estimates
Estimates Std
Std Error
Error t t Approx
Approx SigSig
Non-Seasonal
Non-Seasonal
Non-SeasonalLags
Non-Seasonal
AR1
Lags
MA1AR1
AR1
Estimates
.817
.969.849 Std Error
.055.030
.049 t 28.069Approx Sig
14.860
19.859 .000.000
.000
Non-Seasonal
Lags Lags AR1 -.599
.173 .046
.057 -12.923
3.030 .000
.003
Non-Seasonal
Lags Lags MA1MA1
MA2 .620
.415
-.543
Melard's algorithm was used for estimation. .046
.087
.049 13.587
4.777
-11.082 .000
.000
.000
Melard's
Melard's
Melard's algorithm
algorithm
algorithm was
was
was used
used
used for
for
forestimation.
estimation.
estimation.
Melard'salgorithm
Melard's algorithm was
was used
used for for estimation.
estimation.

• Resisual Plot:
• Normality of Residuals:

Descriptive Statistics
Descriptive Statistics
Descriptive
Descriptive Statistics
DescriptiveStatistics
Statistics
N N Minimum
Minimum Maximum
Maximum Mean
Mean Std.
Std.
Std.
N
N Minimum
Minimum Maximum
Maximum Mean
Mean Std.
Std.
Std.
N
N
Statistic Minimum
Minimum
Statistic Maximum
Maximum
Statistic StatisticMean
Mean
Std. Error Deviation
Deviation
Statistic
Deviation
Statistic
Statistic
Statistic Statistic
Statistic
Statistic Statistic
Statistic
Statistic Statistic
Statistic
Statistic Std.Error
Std.
Std. Error Deviation
Error Statistic
Deviation
Statistic
Statistic
Deviation
Error Statistic
Statistic Statistic
Statistic Statistic
Statistic Statistic
Statistic Std.
Std.
Error
Error Statistic
Statistic
Error forfor
for V2V2fromfrom ARIMA,
ARIMA,
ARIMA, 300 -3.09188
-2.52648 3.53768 -.0795616
.0593217
Error for
for V2
MOD_3, V2NOCON
from
from ARIMA,
ARIMA, 300
300 -3.53200
-2.01865 2.85306
2.83490
2.43056 .0257887 .05546748
.2037248 .05802645 .96072494
.05016107
.05772432 1.005048
.86881529
.99981460
MOD_3, NOCON
MOD_4, NOCON 300
300 -2.77026
-2.33407 3.19462
3.63265 .0933737
-.0090055 .05525708
.05760986 .95708073
.99783200
MOD_3,
MOD_3, NOCON
NOCON
Valid
Valid N N (listwise)
N (listwise)
(listwise) 300
300
300
Valid N
N (listwise)
(listwise) 300
300
300

Thus, the null hypothesis is


0.0933737  0 not rejected and therefore it
Z stat   0.10  1.96
0.95708073 can be concluded that the
residuals are normally
distributed with mean zero.
• Correlation of Residuals:

Since the residuals are normally distributed


and uncorrelated, they are independent.
Thus, the fitted model is adequate.
Round 2
Case studies
Case 1: Change in Business Inventories
 Sequence Plot

• No seasonality
• Stationary ?
• Fixed mean
• Constant Variance
ACF and PACF
Autocorrelations

• Box and Jenkins – 60/4


• Decays to insignificant values
• AR (?)-model?
Partial Autocorrelations

• Only 1 significant spike


• Cuts off after lag 1
• AR(1) - model
ARIMA(1,0,0)

Ż t = φ0 + φ1 Ż t-1 + at
φ0 = 6.042 (SE = 1.309)
φ1 = 0.680 (SE = 0.094)
Let φ0 = μ + C = constant term
μ = 6.095
C = μ(1 - φ1 ) = 1.9504
Residual Analysis
ACF and PACF of residuals
Normality of Residuals

Thus, the null hypothesis is


0.0186  0
Z stat   0.006  1.96 not rejected and therefore it
3.329 can be concluded that the
residuals are normally
distributed with mean zero.
Goodness of fit and Forecasting
ARIMA (1,1,0)

(1- φ1 B)(1-B)Ż t = φ0 + at
Ż t = φ0 + (1+ φ1)Ż t-1 - φ1 Ż t-2 + at
Let φ0 = μ + C = constant term
φ0 = 0.055 (SE = .372)
φ1 = -0.251 (SE = 0.133)
μ = 6.095
C = μ(1 - φ1 ) = 7.625
Residual Analysis
ACF and PACF of residuals
Normality of Residuals

Thus, the null hypothesis is


0.006  0 not rejected and therefore it
Z stat   0.002  1.96
3.534 can be concluded that the
residuals are normally
distributed with mean zero.
Goodness of fit and Forecasting
Case 2: Saving Rate
 Sequence Plot
• No seasonality
• Fixed mean
• Constant average
• Drastic changes from 1977
ACF and PACF
Autocorrelation

• Exponential decay
• AR model
• Mixed model
Partial Autocorrelations

• Only one significant spike


• Cuts off after lag 1
• AR(1) - model
ARIMA(1,0,0)

Ż t = φ0 + φ1 Ż t-1 + at
φ0 = 6.055 (SE = 0.358)
φ1 = 0.817 (SE = 0.060)
Let φ0 = μ + C = constant term
μ = 6.21
C = μ(1 - φ1 ) = 1.14
Residual Ananlysis
ACF and PACF of Residuals
Normality of Residuals

Thus, the null hypothesis is


0.009  0 not rejected and therefore it
Z stat   0.013  1.96 can be concluded that the
0.698
residuals are normally
distributed with mean zero.
Goodness of fit and Forecasting
ARIMA(1,0,2)

(1- φ1 B)Ż t = at - θ1 at-1 - θ2 at-2


Ż t = φ0 + φ1Ż t-1 + at - θ1 at-1 - θ2 at-2
Let φ0 = μ + C = constant term
φ0 = 6.048 (SE = 0.353)
φ1 = 0.774 (SE = 0.089)
θ1 = 0.064 (SE = 0.118) Not included
θ2 = -0.328 (SE = 0.110)
Ż t = 6.048 + 0.774Ż t-1 + 0.328 at-2
Residual Analysis
ACF and PACF of Residuals
Normality of Residuals

0.008  0 Thus, the null hypothesis is


Z stat   0.012  1.96 not rejected and therefore it
0.665 can be concluded that the
residuals are normally
distributed with mean zero.
Goodness of fit and Forecasting
And the smartest smartie
in the packet is...

The End

You might also like