0% found this document useful (0 votes)
7 views12 pages

Time Series

Uploaded by

Kumar Shashwat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views12 pages

Time Series

Uploaded by

Kumar Shashwat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Time Series Forecasting

&
Trend Analysis

Report on AR-2 Model

Nifty Pharma
Page | 1
NIFTY PHARMA
Regression Model => Rt = α + β(Cp)
Auto-regression Model => Rt = α0 + α1(Rt-1) + α2(Rt-2)

Rt = Return α1 = Coefficient of Rt-1 Rt-1 = Previous Return


α0 = Constant α2 = Coefficient of Rt-2 Rt-2 = Return of 2 days prior
Cp = Closing Price

Variable Description and Measurement


Closing Price (Cp) The closing price of Nifty Pharma refers to the final price at
which the Nifty Pharma index is traded on a particular day.
Measurement: This price is determined by the market forces
of supply and demand and is influenced by various factors such
as market trends, company performance, and economic
conditions.
Return (Rt) The return on closing price of nifty pharma refers to the return
obtained from the closing price of the Nifty Pharma on a daily
basis.
Measurement: This price is determined by deducting the
previous price from the current price and then dividing the
result with the previous price.

Descriptive Statistics
CP RT The descriptive statistics show that the mean
Mean 13476.84 0.000398 Cp is 13476.84 while the mean day-on-day
Median 13241.95 0.000181 return is 0.0398%. The highest Cp is
Maximum 16860.85 0.041176
Minimum 11514.45 -0.043262
16860.85 while the lowest is 11514.45. The
Std. Dev. 1104.438 0.009942 highest Rt obtained in a day is 4.1176%
Skewness 0.673781 0.150817 while the lowest Rt is -4.3262%. The
Kurtosis 2.837128 4.414852 skewness of Cp and Rt shows that the data
is almost normally distributed. The kurtosis
Jarque-Bera 56.88572 64.61489
Probability 0.000000 0.000000
value shows that Cp is platykurtic while Rt
is leptokurtic. The probability value of
Sum 9986335. 0.294746 Jarque-Bera test shows that the data of Cp
Sum Sq. Dev. 9.03E+08 0.073149 and Rt is not normal.
Observations 741 741

Page | 2
Correlation Matrix
In the image, the correlation coefficient
between CP and RT is 0.102734. There is a
weak positive link between CP and RT, as
indicated by this relatively minor positive
Correlation correlation. Stated differently, RT tends to
Probability CP RT grow somewhat, but not much, as CP
CP 1.000000 increases.
----- The correlation coefficient's p-value is
0.0051. It is generally accepted that a p-value
RT 0.102734 1.000000
0.0051 -----
of less than 0.05 indicates statistical
significance, indicating a statistically
significant positive association between CP
and RT.

Data Normality Tests

1. Jarque-Bera test

100
Series : RT
Sample 1/01/2021 12/29/2023
80 Obs ervations 741

Mean 0.000398
60 Median 0.000181
Maximum 0.041176
40 Minimum -0.043262
Std. Dev. 0.009942
Skewness 0.150817
20 Kurtosis 4.414852

Jarque-Bera 64.61489
0 Probability 0.000000
-0.0375 -0.0250 -0.0125 0.0000 0.0125 0.0250 0.0375
H0 = Data is normally distributed As the probability value of Jarque-Bera is 0.00
H1 = Data is not normally distributed which is less than 0.05, so we will accept H1 which
indicates that data is not normal.

Page | 3
2. Correlogram
Date: 01/12/24 Time: 20:07
Sample (adjusted): 1/04/2021 12/29/2023
Included observations: 741 after adjustments
Autocorrelation Partial Correlation AC PAC Q-Stat Prob

1 0.036 0.036 0.9806 0.322


2 -0.037 -0.038 2.0005 0.368
3 0.039 0.042 3.1183 0.374
4 0.019 0.015 3.3887 0.495
5 -0.064 -0.063 6.4979 0.261
6 0.024 0.029 6.9296 0.327
7 0.006 -0.002 6.9609 0.433
8 -0.007 -0.001 6.9983 0.537
9 -0.006 -0.005 7.0229 0.635
10 -0.043 -0.049 8.4224 0.588
11 -0.010 -0.003 8.4997 0.668
12 0.009 0.007 8.5670 0.739
13 -0.000 0.002 8.5670 0.805
14 -0.035 -0.033 9.4911 0.798
15 -0.019 -0.023 9.7782 0.833
16 0.036 0.037 10.759 0.824
17 0.036 0.036 11.745 0.815
18 0.012 0.014 11.858 0.854
19 0.051 0.046 13.805 0.795
20 0.028 0.018 14.407 0.809
21 0.039 0.045 15.587 0.792
22 0.003 0.002 15.596 0.835
23 -0.023 -0.025 16.002 0.855
24 0.038 0.039 17.119 0.844
25 0.024 0.017 17.565 0.860
26 0.033 0.045 18.411 0.860
27 -0.039 -0.041 19.601 0.847
28 0.038 0.039 20.727 0.837
29 0.027 0.028 21.274 0.849
30 -0.082 -0.076 26.418 0.654
31 -0.075 -0.060 30.834 0.475
32 -0.043 -0.055 32.261 0.454
33 -0.085 -0.079 37.836 0.258
34 -0.047 -0.032 39.524 0.237
35 0.123 0.118 51.238 0.038
36 0.000 -0.008 51.238 0.048

H0 = Data is normal
H1 = Data is not normal
As the probability value of correlogram is more than 0.05, so we will accept H0 which indicates
that there is no autocorrelation and no partial auto-correlation and the data is normally distributed.

Page | 4
3. Augmented Dickey-Fuller Test
Null Hypothesis: RT has a unit root
Exogenous: Constant
Lag Length: 0 (Automatic - based on SIC, maxlag=19)

t-Statistic Prob.*

Augmented Dickey-Fuller test statistic -26.21793 0.0000


Test critical values: 1% level -3.438960
5% level -2.865230
10% level -2.568791

*MacKinnon (1996) one-sided p-values.

Augmented Dickey-Fuller Test Equation


Dependent Variable: D(RT)
Method: Least Squares
Date: 01/12/24 Time: 20:14
Sample (adjusted): 1/05/2021 12/29/2023
Included observations: 740 after adjustments

Variable Coefficient Std. Error t-Statistic Prob.

RT(-1) -0.963693 0.036757 -26.21793 0.0000


C 0.000368 0.000366 1.007266 0.3141

R-squared 0.482243 Mean dependent var -1.77E-05


Adjusted R-squared 0.481542 S.D. dependent var 0.013806
S.E. of regression 0.009941 Akaike info criterion -6.381599
Sum squared resid 0.072932 Schwarz criterion -6.369148
Log likelihood 2363.192 Hannan-Quinn criter. -6.376798
F-statistic 687.3801 Durbin-Watson stat 1.997261
Prob(F-statistic) 0.000000

H0 = Data is not normal


H1 = Data is normal
As the probability value of ADF test is less than 0.05, so we will accept H1 which indicates
that there is no unit root, and the data is normally distributed.

Page | 5
Normality Tests for Error
1. Jarque-Bera Test

100
Series: ERROR
Sample 1/01/2021 12/29/2023
80 Observations 740

Mean -2.27e-19
60 Median -0.000181
Maximum 0.041540
Minimum -0.043767
40 Std. Dev. 0.009934
Skewness 0.178031
Kurtosis 4.485603
20
Jarque-Bera 71.95876
Probability 0.000000
0
-0.0375 -0.0250 -0.0125 0.0000 0.0125 0.0250 0.0375

H0 = Error is normally distributed As the probability value of Jarque-Bera is 0.00


H1 = Error is not normally distributed which is less than 0.05, so we will accept H1
which indicates that error is not normal.

Page | 6
2. Correlogram
Date: 01/10/24 Time: 14:14
Sample (adjusted): 1/05/2021 12/29/2023
Included observations: 740 after adjustments
Autocorrelation Partial Correlation AC PAC Q-Stat Prob

1 0.001 0.001 0.0013 0.971


2 -0.039 -0.039 1.1498 0.563
3 0.040 0.040 2.3548 0.502
4 0.018 0.016 2.5867 0.629
5 -0.068 -0.065 6.0194 0.304
6 0.028 0.028 6.6143 0.358
7 0.007 0.001 6.6538 0.466
8 -0.008 -0.001 6.7065 0.569
9 -0.001 -0.001 6.7078 0.668
10 -0.039 -0.045 7.8273 0.646
11 -0.012 -0.007 7.9281 0.720
12 0.010 0.007 8.0007 0.785
13 0.003 0.004 8.0073 0.843
14 -0.033 -0.030 8.8081 0.843
15 -0.022 -0.028 9.1798 0.868
16 0.039 0.038 10.316 0.850
17 0.036 0.038 11.277 0.842
18 0.012 0.017 11.384 0.877
19 0.050 0.047 13.293 0.823
20 0.022 0.015 13.654 0.848
21 0.034 0.042 14.550 0.845
22 0.003 0.004 14.556 0.881
23 -0.027 -0.028 15.117 0.890
24 0.038 0.039 16.233 0.879
25 0.024 0.017 16.657 0.894
26 0.033 0.045 17.482 0.894
27 -0.042 -0.041 18.856 0.875
28 0.041 0.038 20.124 0.860
29 0.029 0.032 20.763 0.868
30 -0.081 -0.074 25.805 0.685
31 -0.069 -0.059 29.450 0.546
32 -0.036 -0.054 30.480 0.543
33 -0.080 -0.077 35.415 0.355
34 -0.044 -0.036 36.943 0.335
35 0.125 0.116 49.059 0.058
36 -0.004 -0.004 49.071 0.072

H0 = Error is normal
H1 = Error is not normal
As the probability value of correlogram is more than 0.05, so we will accept H0 which
indicates that there is no autocorrelation and no partial autocorrelation and the error is
normally distributed.

Page | 7
3. Augmented Dickey-Fuller Test
Null Hypothesis: ERROR has a unit root
Exogenous: Constant
Lag Length: 0 (Automatic - based on SIC, maxlag=19)

t-Statistic Prob.*

Augmented Dickey-Fuller test statistic -27.11066 0.0000


Test critical values: 1% level -3.438972
5% level -2.865235
10% level -2.568793

*MacKinnon (1996) one-sided p-values.

Augmented Dickey-Fuller Test Equation


Dependent Variable: D(ERROR)
Method: Least Squares
Date: 01/10/24 Time: 14:22
Sample (adjusted): 1/06/2021 12/29/2023
Included observations: 739 after adjustments

Variable Coefficient Std. Error t-Statistic Prob.

ERROR(-1) -0.998676 0.036837 -27.11066 0.0000


C -6.50E-07 0.000366 -0.001777 0.9986

R-squared 0.499317 Mean dependent var -4.08E-06


Adjusted R-squared 0.498637 S.D. dependent var 0.014049
S.E. of regression 0.009948 Akaike info criterion -6.380244
Sum squared resid 0.072931 Schwarz criterion -6.367780
Log likelihood 2359.500 Hannan-Quinn criter. -6.375438
F-statistic 734.9881 Durbin-Watson stat 1.999525
Prob(F-statistic) 0.000000

H0 = Error is not normal


H1 = Error is normal
As the probability value of ADF test is less than 0.05, so we will accept H1 which indicates
that there is no unit root, and the error is normally distributed.

Page | 8
4. Breusch-Godfrey LM Test
Breusch-Godfrey Serial Correlation LM Test:
Null hypothesis: No serial correlation at up to 2 lags

F-statistic 0.788582 Prob. F(2,734) 0.4549


Obs*R-squared 1.584503 Prob. Chi-Square(2) 0.4528

Test Equation:
Dependent Variable: RESID
Method: Least Squares
Date: 01/12/24 Time: 20:32
Sample: 1/06/2021 12/29/2023
Included observations: 739
Presample missing value lagged residuals set to zero.

Variable Coefficient Std. Error t-Statistic Prob.

C 0.000645 0.000692 0.933007 0.3511


RT(-1) -1.393238 1.118116 -1.246058 0.2131
RT(-2) -0.280829 0.624474 -0.449705 0.6531
RESID(-1) 1.394311 1.118172 1.246955 0.2128
RESID(-2) 0.332952 0.646310 0.515158 0.6066

R-squared 0.002144 Mean dependent var 4.30E-19


Adjusted R-squared -0.003294 S.D. dependent var 0.009934
S.E. of regression 0.009950 Akaike info criterion -6.375749
Sum squared resid 0.072668 Schwarz criterion -6.344590
Log likelihood 2360.839 Hannan-Quinn criter. -6.363735
F-statistic 0.394291 Durbin-Watson stat 1.998926
Prob(F-statistic) 0.812809

H0 = Error is normal
H1 = Error is not normal
As the probability value of BGLM is more than 0.05, so we will accept H0 which indicates
that there is no autocorrelation, and the error is normally distributed.

Page | 9
5. Durbin Watson test
Dependent Variable: RT
Method: Least Squares
Date: 01/12/24 Time: 20:01
Sample (adjusted): 1/06/2021 12/29/2023
Included observations: 739 after adjustments

Variable Coefficient Std. Error t-Statistic Prob.

C 0.000382 0.000366 1.042511 0.2975


RT(-1) 0.037647 0.036835 1.022063 0.3071
RT(-2) -0.038459 0.036840 -1.043929 0.2969

R-squared 0.002790 Mean dependent var 0.000382


Adjusted R-squared 0.000080 S.D. dependent var 0.009948
S.E. of regression 0.009947 Akaike info criterion -6.379015
Sum squared resid 0.072824 Schwarz criterion -6.360320
Log likelihood 2360.046 Hannan-Quinn criter. -6.371807
F-statistic 1.029413 Durbin-Watson stat 1.996490
Prob(F-statistic) 0.357730

The value of Durbin Watson in auto-regression model we obtained is 1.996. As we know that
we have 2 independent variables, so the value of k=2. And no. of observations is 739, so the
value of n=739. With the help of k and n we get the value of Dl=1.75, Du=1.79, 4-Dl=2.25,
and 4-Du=2.21. So according to these values our value of DW lies between Du and 2, which
shows there is no autocorrelation.

Page | 10
Heteroskedasticity Test
Heteroskedasticity Test: Breusch-Pagan-Godfrey
Null hypothesis: Homoskedasticity

F-statistic 5.150923 Prob. F(2,736) 0.0060


Obs*R-squared 10.20105 Prob. Chi-Square(2) 0.0061
Scaled explained SS 17.66597 Prob. Chi-Square(2) 0.0001

Test Equation:
Dependent Variable: RESID^2
Method: Least Squares
Date: 01/12/24 Time: 21:14
Sample: 1/06/2021 12/29/2023
Included observations: 739

Variable Coefficient Std. Error t-Statistic Prob.

C 9.94E-05 6.75E-06 14.72945 0.0000


RT(-1) -0.002168 0.000679 -3.195041 0.0015
RT(-2) -0.000128 0.000679 -0.188357 0.8506

R-squared 0.013804 Mean dependent var 9.85E-05


Adjusted R-squared 0.011124 S.D. dependent var 0.000184
S.E. of regression 0.000183 Akaike info criterion -14.36750
Sum squared resid 2.47E-05 Schwarz criterion -14.34880
Log likelihood 5311.789 Hannan-Quinn criter. -14.36029
F-statistic 5.150923 Durbin-Watson stat 1.787553
Prob(F-statistic) 0.006005

H0 = There is Homoskedasticity
H1 = There is Heteroskedasticity
As the probability value of F-stat is less than 0.05, so we will accept H1 which indicates that
there is heteroskedasticity.

Page | 11
Multicollinearity

Coefficient Uncentered Centered


Variable Variance VIF VIF

C 1.34E-07 1.002897 NA
RT(-1) 0.001357 1.002858 1.001350
RT(-2) 0.001357 1.002849 1.001350

Here, the values of centred VIF are 1.001350 for both the previous returns which means that
there is no multicollinearity in returns.

Conclusion
From the above tests for data normality and error normality, we can conclude that the data is
normally distributed, and the errors are normally distributed as well which indicates that the
model is robust.
But the heteroskedasticity test shows that there is heteroskedasticity in the error which
indicates that the model is not robust, and it is spurious.
Multicollinearity test shows that there is no multicollinearity among the current returns and
previous returns.
Overall, the regression model is not robust and is a spurious model.

Page | 12

You might also like