file_list <- list.files(path = "/Users/khunsint/Desktop", pattern = "*.csv", full.names = TRUE)

library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(car)
## Loading required package: carData
## 
## Attaching package: 'car'
## 
## The following object is masked from 'package:dplyr':
## 
##     recode
## 
## The following object is masked from 'package:purrr':
## 
##     some
library(PoEdata)
library(tseries)
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
library(forecast)
library(tidyverse)
library(lmtest)
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## 
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
library(dynlm)
library(sandwich)
library(forecast)
library(Metrics) 
## 
## Attaching package: 'Metrics'
## 
## The following object is masked from 'package:forecast':
## 
##     accuracy
library(vars)
## Loading required package: MASS
## 
## Attaching package: 'MASS'
## 
## The following object is masked from 'package:dplyr':
## 
##     select
## 
## Loading required package: strucchange
## 
## Attaching package: 'strucchange'
## 
## The following object is masked from 'package:stringr':
## 
##     boundary
## 
## Loading required package: urca
all_columns <- unique(unlist(lapply(file_list, function(x) colnames(read.csv(x)))))

df_list <- lapply(file_list, function(file) {
  data <- read.csv(file)
  data[setdiff(all_columns, colnames(data))] <- NA
  data[, all_columns]
})

df <- do.call(rbind, df_list)

head(df)
## NULL
 infy_stock <- read.csv("~/Desktop/R Project/archive/infy_stock.csv")

attach(infy_stock)

Introduction

This project focuses on modeling the National Stock Exchange Data from Indian IT companies in a time series analysis. We are modeling data on the INFY (Infosys is a technology company headquartered in India) stock recorded in 2015. Understanding the different measures of the stock market, it made more logical sense to use Close (Closing Price) and Turnover ( Stock turnover ratio) as response variables (y1 and y2) and Volume (total # of shares traded) and Open (current day opening point) as explanatory variables (independent variables x1 and x2). Using these four variable,s we will show and select different time series models that best fit the data to understand trends in the National Stock Exchange and to draw conclusions about the company.

Descriptive Analysis

Variables we are modeling: Close, Turnover, Volume, and Open

library(tidyverse)
attach(infy_stock)
## The following objects are masked from infy_stock (pos = 3):
## 
##     Close, Date, Deliverable.Volume, High, Last, Low, Open, Prev.Close,
##     Series, Symbol, Trades, Turnover, Volume, VWAP, X.Deliverble

Statistical Summaries

Close <- infy_stock$Close
fivenum(Close)
## [1]  937.500 1085.825 1149.325 2126.425 2324.700
summary(Close)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   937.5  1085.9  1149.3  1548.0  2125.3  2324.7
Turnover <- infy_stock$Turnover
fivenum(Turnover)
## [1] 3.923481e+13 2.843912e+14 3.624709e+14 4.916011e+14 2.285439e+15
summary(Turnover)
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## 3.923e+13 2.847e+14 3.625e+14 4.234e+14 4.915e+14 2.285e+15
Volume <- infy_stock$Volume
fivenum(Volume)
## [1]   353652  1722570  2532474  3575393 19155056
summary(Volume)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##   353652  1722753  2532474  2982072  3567063 19155056
Open <- infy_stock$Open
fivenum(Open)
## [1]  941.000 1088.000 1150.000 2136.375 2328.500
summary(Open)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     941    1088    1150    1551    2136    2328

Histograms:

Histogram for Close is a bimodal distribution since there are two significant ranges with a split in the histogram. One of the clusters in centered around $1000 and another is centered around $2000. The histogram also shows the highest frequency of closing price (significantly higher) from around $1000-$1250.

hist(infy_stock$Close, breaks = "FD", col = "pink", main = "Normal Distr. of Close", xlab = "Close", probability = TRUE)
lines(density(infy_stock$Close))

Histogram for Turnover is a right-skewed distribution meaning that most of the values fall on the lower side. There are a few outlier values that seem to be extreme since they are not near the concentrated area of values. The majority of the observations fall from 0 to 5.0e+14.

hist(infy_stock$Turnover, breaks = "FD", col = "pink", main = "Normal Distr. of Turnover", xlab = "Turnover", probability = TRUE)
lines(density(infy_stock$Turnover))

The histogram for Volume is a right-skewed distribution and most of the values fall on the lower side. There are clearly a few outliers, a few of which are significantly higher than where the data is mostly concentrated around.

hist(infy_stock$Volume, breaks = "FD", col = "pink", main = "Normal Distr. of Volume", xlab = "Volume", probability = TRUE)
lines(density(infy_stock$Volume))

Histogram for Open is also a bimodal distribution where there are two significant clusters of values with a split in the histogram. These clusters are around $1000 and $2000. Between values $1200 to $1800 (approximately) there are no recorded values.

hist(infy_stock$Open, breaks = "FD", col = "pink", main = "Normal Distr. of Open", xlab = "Open", probability = TRUE)
lines(density(infy_stock$Open))

Scatterplots

Scatterplot got Close shows two different ranges in price. One from $1800 to $2400 and another one from $900 to $1100.

data <- infy_stock
plot(infy_stock$Close, col = "red")
title ('Scatter Plot of Close')

Scatterplot for Turnover shows that the values are concentrated around 5.0e+14. The values also seem to be consistently spread across a bounded range. However, there are a few outliers exceeding a lot above 5.0e+14.

data <- infy_stock
plot(infy_stock$Turnover, col = "red")
title ('Scatter Plot of Turnover')

Scatterplot for Volume shows values concentrated around a little less than 5.0e+06 shares and are consistently spread out for a majority of the values. There are a few outliers that exceed this range and the highest point seems to be at 1.5e+07 shares.

data <- infy_stock
plot(infy_stock$Volume, col = "red")
title ('Scatter Plot of Volume')

Scatterplot for Open shows two different ranges similar to the Closing price.

data <- infy_stock
plot(infy_stock$Open, col = "red")
title ('Scatter Plot of Open')

Quantile Plots

The Quantile Plot for close shows that the data doesn’t follow a normal distribution because of how deviated the data is from the reference line (red line). Since there are many deviations on the left side and on the right side, it indicates that there are both lower and higher than expected values.

qqnorm(infy_stock$Close, main = "Q-Q Plot of Close") 
qqline(infy_stock$Close, col = "red")

The quantile plot for Turnover shows that the centered portion of the data aligns well with the reference line, exhibiting a more normal pattern.

qqnorm(infy_stock$Turnover, main = "Q-Q Plot of Turnover") 
qqline(infy_stock$Turnover, col = "red")

Quantile plot for volume hat the centered portion of the data aligns well with the reference line, exhibiting a more normal pattern.

qqnorm(infy_stock$Volume, main = "Q-Q Plot of Volume") 
qqline(infy_stock$Volume, col = "red")

Quantile Plot for Open shows that the data doesn’t follow a normal distribution because of how deviated the data is from the reference line (red line). Since there are many deviations on the left side and on the right side, it indicates that there are both lower and higher than expected values.

qqnorm(infy_stock$Open, main = "Q-Q Plot of Open") 
qqline(infy_stock$Open, col = "red")

Box Plots

Box Plot for Close shows the median is in the lower quartile, and shows a large interquartile range. Therefore the prices (closing price) could be widely spread.

boxplot(infy_stock$Close, ylab="Close")

Box Plot for Turnover shows the interquartile range being significantly smaller than the range of the data meaning there isn’t a widespread consistency in the data but rather a concentration in one area. The Median line indicates that the data isn’t symmetrically distributed.

boxplot(infy_stock$Turnover, ylab="Turnover")

The box Plot for Volume shows many outlier values, and the interquartile range shows that many values are clustered around a certain value so it is not widely spread. Median line is towards the lower end of the p=Turnover values.

boxplot(infy_stock$Volume, ylab="Volume")

The Box Plot for Open shows a large interqaurtile range like Close and the median line is in the lower quartile which means that the data could be rightly skewed. There are no significant outliers.

boxplot(infy_stock$Open, ylab="Open")

Scatterplot Matrix

The scatter plot for close vs open shows a strong positive correlation, and the narrow band exhibits a smaller confidence interval. This means that as the opening price gets higher, the closing price also increases (The opening and closing price of a stock for a specific day will not have much variation).

scatterplot(Close~Open, data = infy_stock, col="red", main = "Scatter Plot for Close vs Open")

The Scatter Plot for Close vs. volume shows a negative relationship. This means that as volume (total number of shares traded) increases per day, closing prices tend to be lower. The band (confidence interval) shows that at lower volume the interval is tighter and at higher volumes the interval expands.

scatterplot(Close~Volume, data = infy_stock, col="red", main = "Scatter Plot for Close vs Volume")

The scatterplot for Turnover vs. Open shows neither a positive nor negative relationship but a non-linear correlation since the line is flat. This means the correlation is weak. The band shows a wide confidence interval between observations.

scatterplot(Turnover~Open, data = infy_stock, col="red", main = "Scatter Plot for Turnover vs Open")

The scatterplot for Turnover vs Volume shows a strong positive correlation, and the band for the confidence interval starts out narrow and continues to get wider as Volume increases.

scatterplot(Turnover~Volume, data = infy_stock, col="red", main = "Scatter Plot for Turnover vs Volume")

The tsdisplay plot for each variables

infy_stock.ts <- ts(infy_stock,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)

Close.ts <- infy_stock.ts[,"Close"]
Turnover.ts <- infy_stock.ts[,"Turnover"]
Volume.ts <- infy_stock.ts[,"Volume"]
Open.ts <- infy_stock.ts[,"Open"]
tsdisplay(Close.ts)

tsdisplay(Turnover.ts)

tsdisplay(Volume.ts)

tsdisplay(Open.ts)

The variables Close and Open are not stationary as they don’t seem mean-reverting and therefore not stationary

Open.ts.diff <- diff(Open.ts)
tsdisplay(Open.ts.diff)

Close.ts.diff <- diff(Close.ts)
tsdisplay(Close.ts.diff)

Commenting on the stationarity, ACF and PACF results

Close Variable

According to the ACF and PACF of the Close variable, we can see that the variable is not stationary, since the distribution shows a strong disconnect from 2015.3 to 2015.7. Therefore, the variable is not mean-reverting. To transform this variable into a stationary variable, we take the difference of the Close (close price) by doing Close.ts.diff <- diff(Close.ts), and the result is shown in tsdisplay(Close.ts.diff). The transform Close.ts.diff seems mean-reverting and has constant variance with three outliers. Since the outliers are rare, we can conclude that the transformed variable is stationary enough for analysis. After transformation, the ACF shows no strong autocorrelation beyond lag 0. Most autocorrelations are within the blue significance bounds, meaning they are not statistically significant. The PACF also shows no significant spikes beyond lag 0. The few spikes that appear are not systematically cutting off at a specific lag, reinforcing that this is likely white noise.

Open Variable

According to the ACF and PACF of the Open variable, we can see that the variable is not stationary, since the distribution shows a strong disconnect from 2015.3 to 2015.7(same as the close variable). Therefore, the variable is not mean-reverting. To transform this variable into a stationary variable, we take the difference of Open (open price) by doing Open.ts.diff <- diff(Open.ts), and the result is shown in tsdisplay(Open.ts.diff). The transform Open.ts.diff seems mean-reverting and has constant variance, with three outliers. Since the outliers are rare, we can conclude that the transformed variable is stationary enough for analysis. After transformationThe ACF shows no strong autocorrelation beyond lag 0. Most autocorrelations are within the blue significance bounds, meaning they are not statistically significant. The PACF also shows no significant spikes beyond lag 0. The few spikes that appear are not systematically cutting off at a specific lag, reinforcing that this is likely white noise.

Volume Variable

The distribution seems mostly mean-reverting, with 8 outliers scattered. The variable also has constant variance. SInce we have more than 300 observations, we can conclude that the outliers are not significant and the variable is mostly stationary. The ACF does not remain high for many lags (which would indicate a unit root). Instead, it gradually declines, which can still work for AR modeling. A very slow decay (approaching 1 at high lags) would strongly suggest non-stationarity, but here the decay is moderate. The PACF cuts off after lag 1, which is a classic sign of an AR process. This suggests that an autoregressive (AR) model is appropriate.

Turnover Variable

The distribution seems mostly mean-reverting, with 8 outliers scattered. The variable also has constant variance. SInce we have more than 300 observations, we can conclude that the outliers are not significant and the variable is mostly stationary. The ACF does not remain high for many lags (which would indicate a unit root). Instead, it gradually declines, which can still work for AR modeling. A very slow decay (approaching 1 at high lags) would strongly suggest non-stationarity, but here the decay is moderate. The PACF cuts off after lag 1, which is a classic sign of an AR process. This suggests that an autoregressive (AR) model is appropriate.

AR Model for CLOSE (diff) (based on ACF and PACF graphs, the two lags models to use would be from 1-110 and only 110)

AR.Close.ts.diff.lag110 <- dynlm(Close.ts.diff~L(Close.ts.diff,110))
summary(AR.Close.ts.diff.lag110)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Close.ts.diff ~ L(Close.ts.diff, 110))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -978.86  -12.09    4.97   19.11  872.23 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)
## (Intercept)           -3.72438    6.67589  -0.558    0.577
## L(Close.ts.diff, 110) -0.05206    0.07709  -0.675    0.500
## 
## Residual standard error: 106.4 on 252 degrees of freedom
## Multiple R-squared:  0.001806,   Adjusted R-squared:  -0.002155 
## F-statistic: 0.456 on 1 and 252 DF,  p-value: 0.5001
AR.Close.ts.diff.lag1.110 <- dynlm(Close.ts.diff~L(Close.ts.diff,1:110))
summary(AR.Close.ts.diff.lag1.110)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Close.ts.diff ~ L(Close.ts.diff, 1:110))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -864.84  -19.97    5.33   27.12  852.50 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)
## (Intercept)                -3.2418672  8.3786908  -0.387    0.699
## L(Close.ts.diff, 1:110)1    0.0159777  0.0836037   0.191    0.849
## L(Close.ts.diff, 1:110)2    0.0226932  0.0835975   0.271    0.786
## L(Close.ts.diff, 1:110)3   -0.0338749  0.0836433  -0.405    0.686
## L(Close.ts.diff, 1:110)4    0.0223533  0.0836930   0.267    0.790
## L(Close.ts.diff, 1:110)5   -0.0092028  0.0837563  -0.110    0.913
## L(Close.ts.diff, 1:110)6    0.0884463  0.1010973   0.875    0.383
## L(Close.ts.diff, 1:110)7    0.0069257  0.1013506   0.068    0.946
## L(Close.ts.diff, 1:110)8   -0.0274712  0.1013067  -0.271    0.787
## L(Close.ts.diff, 1:110)9    0.0398144  0.1012823   0.393    0.695
## L(Close.ts.diff, 1:110)10  -0.0218935  0.1013141  -0.216    0.829
## L(Close.ts.diff, 1:110)11   0.0058744  0.1013472   0.058    0.954
## L(Close.ts.diff, 1:110)12  -0.0570005  0.1013255  -0.563    0.575
## L(Close.ts.diff, 1:110)13   0.0597780  0.1013998   0.590    0.556
## L(Close.ts.diff, 1:110)14   0.0357480  0.1014407   0.352    0.725
## L(Close.ts.diff, 1:110)15   0.0498519  0.1014621   0.491    0.624
## L(Close.ts.diff, 1:110)16   0.0038393  0.1015560   0.038    0.970
## L(Close.ts.diff, 1:110)17  -0.0294803  0.1013645  -0.291    0.772
## L(Close.ts.diff, 1:110)18  -0.0147365  0.1013580  -0.145    0.885
## L(Close.ts.diff, 1:110)19  -0.0206962  0.1013525  -0.204    0.838
## L(Close.ts.diff, 1:110)20  -0.0559949  0.1012260  -0.553    0.581
## L(Close.ts.diff, 1:110)21  -0.0430001  0.1013242  -0.424    0.672
## L(Close.ts.diff, 1:110)22   0.0055223  0.1013444   0.054    0.957
## L(Close.ts.diff, 1:110)23   0.0106073  0.1013348   0.105    0.917
## L(Close.ts.diff, 1:110)24   0.0648144  0.1010454   0.641    0.522
## L(Close.ts.diff, 1:110)25  -0.0139403  0.1011627  -0.138    0.891
## L(Close.ts.diff, 1:110)26  -0.0812167  0.1011572  -0.803    0.423
## L(Close.ts.diff, 1:110)27   0.0114422  0.1013671   0.113    0.910
## L(Close.ts.diff, 1:110)28   0.0440350  0.1013496   0.434    0.665
## L(Close.ts.diff, 1:110)29   0.0371217  0.1014123   0.366    0.715
## L(Close.ts.diff, 1:110)30  -0.0723102  0.1013736  -0.713    0.477
## L(Close.ts.diff, 1:110)31   0.0039553  0.1015621   0.039    0.969
## L(Close.ts.diff, 1:110)32   0.0056048  0.1015763   0.055    0.956
## L(Close.ts.diff, 1:110)33   0.0245252  0.1015922   0.241    0.810
## L(Close.ts.diff, 1:110)34  -0.0061197  0.1016102  -0.060    0.952
## L(Close.ts.diff, 1:110)35   0.0928452  0.1011359   0.918    0.360
## L(Close.ts.diff, 1:110)36   0.0424102  0.1013987   0.418    0.676
## L(Close.ts.diff, 1:110)37   0.0091770  0.1014057   0.090    0.928
## L(Close.ts.diff, 1:110)38  -0.0384362  0.1012522  -0.380    0.705
## L(Close.ts.diff, 1:110)39   0.0503154  0.1011587   0.497    0.620
## L(Close.ts.diff, 1:110)40   0.0399346  0.1012265   0.395    0.694
## L(Close.ts.diff, 1:110)41  -0.0189568  0.1014365  -0.187    0.852
## L(Close.ts.diff, 1:110)42  -0.0145250  0.1014390  -0.143    0.886
## L(Close.ts.diff, 1:110)43  -0.0352909  0.1014361  -0.348    0.728
## L(Close.ts.diff, 1:110)44  -0.0384279  0.1014462  -0.379    0.705
## L(Close.ts.diff, 1:110)45  -0.0173849  0.1014600  -0.171    0.864
## L(Close.ts.diff, 1:110)46  -0.0683404  0.1014104  -0.674    0.501
## L(Close.ts.diff, 1:110)47   0.0236919  0.1014716   0.233    0.816
## L(Close.ts.diff, 1:110)48   0.0401431  0.1014935   0.396    0.693
## L(Close.ts.diff, 1:110)49   0.0413050  0.1015298   0.407    0.685
## L(Close.ts.diff, 1:110)50   0.0649748  0.1015575   0.640    0.523
## L(Close.ts.diff, 1:110)51  -0.0312912  0.1016223  -0.308    0.759
## L(Close.ts.diff, 1:110)52  -0.0420572  0.1015429  -0.414    0.679
## L(Close.ts.diff, 1:110)53   0.0665238  0.1014135   0.656    0.513
## L(Close.ts.diff, 1:110)54  -0.0286601  0.1015852  -0.282    0.778
## L(Close.ts.diff, 1:110)55  -0.0024781  0.1015848  -0.024    0.981
## L(Close.ts.diff, 1:110)56   0.0317418  0.1015843   0.312    0.755
## L(Close.ts.diff, 1:110)57  -0.0246884  0.1015788  -0.243    0.808
## L(Close.ts.diff, 1:110)58  -0.0434951  0.1015490  -0.428    0.669
## L(Close.ts.diff, 1:110)59   0.0308901  0.1016062   0.304    0.762
## L(Close.ts.diff, 1:110)60   0.0488192  0.1016090   0.480    0.632
## L(Close.ts.diff, 1:110)61  -0.0421448  0.1015130  -0.415    0.679
## L(Close.ts.diff, 1:110)62  -0.0244018  0.1015429  -0.240    0.810
## L(Close.ts.diff, 1:110)63  -0.0375576  0.1014241  -0.370    0.712
## L(Close.ts.diff, 1:110)64  -0.0388429  0.1015070  -0.383    0.703
## L(Close.ts.diff, 1:110)65   0.0311338  0.1014450   0.307    0.759
## L(Close.ts.diff, 1:110)66   0.0567100  0.1014134   0.559    0.577
## L(Close.ts.diff, 1:110)67   0.0277998  0.1014939   0.274    0.785
## L(Close.ts.diff, 1:110)68   0.0257939  0.1014602   0.254    0.800
## L(Close.ts.diff, 1:110)69  -0.0086599  0.1014762  -0.085    0.932
## L(Close.ts.diff, 1:110)70   0.0072461  0.1014847   0.071    0.943
## L(Close.ts.diff, 1:110)71  -0.0432676  0.1013738  -0.427    0.670
## L(Close.ts.diff, 1:110)72  -0.0415484  0.1014075  -0.410    0.683
## L(Close.ts.diff, 1:110)73   0.0910813  0.1012589   0.899    0.370
## L(Close.ts.diff, 1:110)74  -0.0625441  0.1014783  -0.616    0.539
## L(Close.ts.diff, 1:110)75  -0.0294626  0.1015561  -0.290    0.772
## L(Close.ts.diff, 1:110)76  -0.0320286  0.1015134  -0.316    0.753
## L(Close.ts.diff, 1:110)77   0.0249377  0.1014821   0.246    0.806
## L(Close.ts.diff, 1:110)78  -0.0236800  0.1014784  -0.233    0.816
## L(Close.ts.diff, 1:110)79  -0.0226653  0.1014869  -0.223    0.824
## L(Close.ts.diff, 1:110)80   0.0305778  0.1014822   0.301    0.764
## L(Close.ts.diff, 1:110)81   0.0123753  0.1014071   0.122    0.903
## L(Close.ts.diff, 1:110)82  -0.0247163  0.1014219  -0.244    0.808
## L(Close.ts.diff, 1:110)83   0.0056352  0.1014384   0.056    0.956
## L(Close.ts.diff, 1:110)84  -0.0310366  0.1013726  -0.306    0.760
## L(Close.ts.diff, 1:110)85  -0.0020362  0.1011613  -0.020    0.984
## L(Close.ts.diff, 1:110)86  -0.0126342  0.1011472  -0.125    0.901
## L(Close.ts.diff, 1:110)87  -0.0918818  0.1010208  -0.910    0.365
## L(Close.ts.diff, 1:110)88  -0.0349886  0.1012829  -0.345    0.730
## L(Close.ts.diff, 1:110)89  -0.0156798  0.1013276  -0.155    0.877
## L(Close.ts.diff, 1:110)90   0.0041301  0.1012953   0.041    0.968
## L(Close.ts.diff, 1:110)91   0.0501664  0.1012378   0.496    0.621
## L(Close.ts.diff, 1:110)92   0.0161658  0.1013289   0.160    0.873
## L(Close.ts.diff, 1:110)93   0.0122805  0.1013494   0.121    0.904
## L(Close.ts.diff, 1:110)94   0.0971465  0.1011898   0.960    0.339
## L(Close.ts.diff, 1:110)95  -0.0175875  0.1015111  -0.173    0.863
## L(Close.ts.diff, 1:110)96  -0.0195728  0.1014529  -0.193    0.847
## L(Close.ts.diff, 1:110)97  -0.0590493  0.1013925  -0.582    0.561
## L(Close.ts.diff, 1:110)98  -0.0216744  0.1014251  -0.214    0.831
## L(Close.ts.diff, 1:110)99   0.0490977  0.1013339   0.485    0.629
## L(Close.ts.diff, 1:110)100  0.0125655  0.1014184   0.124    0.902
## L(Close.ts.diff, 1:110)101 -0.0137678  0.1014420  -0.136    0.892
## L(Close.ts.diff, 1:110)102 -0.0359516  0.1013823  -0.355    0.723
## L(Close.ts.diff, 1:110)103  0.0471292  0.1013844   0.465    0.643
## L(Close.ts.diff, 1:110)104 -0.0358237  0.1014073  -0.353    0.724
## L(Close.ts.diff, 1:110)105 -0.0950821  0.1008008  -0.943    0.347
## L(Close.ts.diff, 1:110)106 -0.0008114  0.1011113  -0.008    0.994
## L(Close.ts.diff, 1:110)107 -0.0105709  0.1010718  -0.105    0.917
## L(Close.ts.diff, 1:110)108  0.0129233  0.1009916   0.128    0.898
## L(Close.ts.diff, 1:110)109 -0.0157170  0.1009892  -0.156    0.877
## L(Close.ts.diff, 1:110)110 -0.0322934  0.1009697  -0.320    0.750
## 
## Residual standard error: 133 on 143 degrees of freedom
## Multiple R-squared:  0.1144, Adjusted R-squared:  -0.5669 
## F-statistic: 0.1679 on 110 and 143 DF,  p-value: 1

AR model for Turnover (based on ACF and PACF graphs, the two lags models to use would be from 1-4 and only lags 2,61,70 and 117)

AR.Turnover.ts.lag1.4 <- dynlm(Turnover.ts~L(Turnover.ts,1:4))
summary(AR.Turnover.ts.lag1.4)
## 
## Time series regression with "ts" data:
## Start = 2015(5), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 1:4))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.822e+14 -1.147e+14 -5.190e+13  5.935e+13  1.771e+15 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           2.487e+14  3.619e+13   6.872 2.85e-11 ***
## L(Turnover.ts, 1:4)1  3.297e-01  5.279e-02   6.245 1.21e-09 ***
## L(Turnover.ts, 1:4)2  1.731e-02  5.559e-02   0.311   0.7558    
## L(Turnover.ts, 1:4)3 -1.393e-02  5.564e-02  -0.250   0.8025    
## L(Turnover.ts, 1:4)4  9.132e-02  5.274e-02   1.732   0.0842 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.608e+14 on 356 degrees of freedom
## Multiple R-squared:  0.1235, Adjusted R-squared:  0.1136 
## F-statistic: 12.54 on 4 and 356 DF,  p-value: 1.491e-09
AR.Turnover.ts.lag2n61n70n117 <- dynlm(Turnover.ts~L(Turnover.ts,2) + L(Turnover.ts,61) + L(Turnover.ts,70) + L(Turnover.ts, 117))
summary(AR.Turnover.ts.lag2n61n70n117)
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts, 
##     61) + L(Turnover.ts, 70) + L(Turnover.ts, 117))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -6.092e+14 -1.365e+14 -1.708e+13  9.426e+13  1.448e+15 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)         1.793e+13  5.028e+13   0.357  0.72167    
## L(Turnover.ts, 2)   1.670e-01  5.593e-02   2.985  0.00312 ** 
## L(Turnover.ts, 61)  2.776e-01  5.620e-02   4.940 1.46e-06 ***
## L(Turnover.ts, 70)  2.038e-01  5.620e-02   3.626  0.00035 ***
## L(Turnover.ts, 117) 3.092e-01  5.664e-02   5.460 1.18e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.377e+14 on 243 degrees of freedom
## Multiple R-squared:  0.2423, Adjusted R-squared:  0.2298 
## F-statistic: 19.43 on 4 and 243 DF,  p-value: 6.967e-14

AR models for Volume (based on ACF and PACF graphs, the two lags models to use would be from 1-32, and 1-32 AND 91-122 together)

AR.Volume.ts.lag1.32 <- dynlm(Volume.ts~L(Volume.ts,1:32))
summary(AR.Volume.ts.lag1.32)
## 
## Time series regression with "ts" data:
## Start = 2015(33), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2560268  -738320  -215103   323411 16655993 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           4.598e+05  3.067e+05   1.499   0.1349    
## L(Volume.ts, 1:32)1   3.378e-01  5.769e-02   5.856 1.25e-08 ***
## L(Volume.ts, 1:32)2   5.810e-02  6.088e-02   0.954   0.3406    
## L(Volume.ts, 1:32)3  -4.009e-02  6.099e-02  -0.657   0.5115    
## L(Volume.ts, 1:32)4   1.130e-01  6.073e-02   1.861   0.0637 .  
## L(Volume.ts, 1:32)5   6.020e-03  6.088e-02   0.099   0.9213    
## L(Volume.ts, 1:32)6   4.992e-02  6.087e-02   0.820   0.4127    
## L(Volume.ts, 1:32)7   1.153e-01  6.090e-02   1.894   0.0592 .  
## L(Volume.ts, 1:32)8  -1.452e-02  6.124e-02  -0.237   0.8128    
## L(Volume.ts, 1:32)9  -8.593e-03  6.103e-02  -0.141   0.8881    
## L(Volume.ts, 1:32)10  4.911e-02  6.103e-02   0.805   0.4216    
## L(Volume.ts, 1:32)11 -6.167e-02  6.109e-02  -1.010   0.3135    
## L(Volume.ts, 1:32)12  1.838e-02  6.117e-02   0.300   0.7641    
## L(Volume.ts, 1:32)13 -3.072e-02  6.109e-02  -0.503   0.6154    
## L(Volume.ts, 1:32)14 -3.234e-02  6.107e-02  -0.530   0.5968    
## L(Volume.ts, 1:32)15  7.948e-02  6.091e-02   1.305   0.1930    
## L(Volume.ts, 1:32)16 -3.868e-02  6.112e-02  -0.633   0.5273    
## L(Volume.ts, 1:32)17 -2.775e-03  6.138e-02  -0.045   0.9640    
## L(Volume.ts, 1:32)18  6.720e-02  6.125e-02   1.097   0.2735    
## L(Volume.ts, 1:32)19 -3.024e-02  6.128e-02  -0.493   0.6221    
## L(Volume.ts, 1:32)20  6.718e-03  6.125e-02   0.110   0.9127    
## L(Volume.ts, 1:32)21 -3.728e-02  6.125e-02  -0.609   0.5432    
## L(Volume.ts, 1:32)22  2.437e-02  6.119e-02   0.398   0.6908    
## L(Volume.ts, 1:32)23  3.722e-03  6.114e-02   0.061   0.9515    
## L(Volume.ts, 1:32)24  8.983e-02  6.118e-02   1.468   0.1431    
## L(Volume.ts, 1:32)25  1.275e-02  6.135e-02   0.208   0.8355    
## L(Volume.ts, 1:32)26  2.689e-02  5.834e-02   0.461   0.6451    
## L(Volume.ts, 1:32)27  1.397e-02  5.831e-02   0.240   0.8108    
## L(Volume.ts, 1:32)28 -7.804e-02  5.828e-02  -1.339   0.1816    
## L(Volume.ts, 1:32)29  1.029e-01  5.817e-02   1.769   0.0779 .  
## L(Volume.ts, 1:32)30 -3.212e-02  5.845e-02  -0.549   0.5831    
## L(Volume.ts, 1:32)31  3.529e-02  5.844e-02   0.604   0.5464    
## L(Volume.ts, 1:32)32  3.051e-02  5.529e-02   0.552   0.5814    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1702000 on 300 degrees of freedom
## Multiple R-squared:  0.2808, Adjusted R-squared:  0.204 
## F-statistic:  3.66 on 32 and 300 DF,  p-value: 1.741e-09
AR.Volume.ts.lag1.32n90.122 <- dynlm(Volume.ts~L(Volume.ts,1:32) + L(Volume.ts,91:122))
summary(AR.Volume.ts.lag1.32n90.122)
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 
##     91:122))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3164619  -845564  -196953   515577 15844439 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              2.064e+06  9.492e+05   2.175  0.03099 *  
## L(Volume.ts, 1:32)1      3.077e-01  7.471e-02   4.118 5.83e-05 ***
## L(Volume.ts, 1:32)2      8.579e-02  7.829e-02   1.096  0.27463    
## L(Volume.ts, 1:32)3     -6.947e-02  7.932e-02  -0.876  0.38232    
## L(Volume.ts, 1:32)4      4.361e-02  7.959e-02   0.548  0.58440    
## L(Volume.ts, 1:32)5      2.659e-02  7.886e-02   0.337  0.73641    
## L(Volume.ts, 1:32)6      4.105e-02  7.681e-02   0.534  0.59372    
## L(Volume.ts, 1:32)7      9.857e-02  7.663e-02   1.286  0.19997    
## L(Volume.ts, 1:32)8     -1.161e-02  7.667e-02  -0.151  0.87981    
## L(Volume.ts, 1:32)9      6.843e-03  7.620e-02   0.090  0.92855    
## L(Volume.ts, 1:32)10     5.843e-02  7.618e-02   0.767  0.44405    
## L(Volume.ts, 1:32)11    -1.063e-01  7.655e-02  -1.389  0.16652    
## L(Volume.ts, 1:32)12     3.302e-02  7.687e-02   0.429  0.66810    
## L(Volume.ts, 1:32)13    -7.062e-02  7.702e-02  -0.917  0.36045    
## L(Volume.ts, 1:32)14    -3.136e-02  7.714e-02  -0.407  0.68481    
## L(Volume.ts, 1:32)15     5.747e-02  7.702e-02   0.746  0.45655    
## L(Volume.ts, 1:32)16    -3.637e-02  7.736e-02  -0.470  0.63885    
## L(Volume.ts, 1:32)17    -3.175e-02  7.756e-02  -0.409  0.68280    
## L(Volume.ts, 1:32)18     1.843e-02  7.722e-02   0.239  0.81170    
## L(Volume.ts, 1:32)19     5.873e-03  7.721e-02   0.076  0.93945    
## L(Volume.ts, 1:32)20     1.127e-02  7.712e-02   0.146  0.88401    
## L(Volume.ts, 1:32)21    -2.263e-02  7.748e-02  -0.292  0.77054    
## L(Volume.ts, 1:32)22     1.163e-02  7.775e-02   0.150  0.88127    
## L(Volume.ts, 1:32)23     3.839e-03  7.755e-02   0.050  0.96057    
## L(Volume.ts, 1:32)24     5.412e-02  7.717e-02   0.701  0.48405    
## L(Volume.ts, 1:32)25     3.788e-02  7.704e-02   0.492  0.62352    
## L(Volume.ts, 1:32)26     3.157e-02  7.651e-02   0.413  0.68037    
## L(Volume.ts, 1:32)27     3.416e-02  7.646e-02   0.447  0.65558    
## L(Volume.ts, 1:32)28    -7.903e-02  7.629e-02  -1.036  0.30161    
## L(Volume.ts, 1:32)29     6.674e-02  7.627e-02   0.875  0.38271    
## L(Volume.ts, 1:32)30     3.846e-02  8.024e-02   0.479  0.63226    
## L(Volume.ts, 1:32)31    -5.077e-03  8.045e-02  -0.063  0.94975    
## L(Volume.ts, 1:32)32     5.654e-02  7.618e-02   0.742  0.45890    
## L(Volume.ts, 91:122)91  -6.263e-02  7.620e-02  -0.822  0.41227    
## L(Volume.ts, 91:122)92   4.249e-02  8.054e-02   0.528  0.59846    
## L(Volume.ts, 91:122)93  -2.407e-02  8.048e-02  -0.299  0.76525    
## L(Volume.ts, 91:122)94   8.727e-03  7.642e-02   0.114  0.90921    
## L(Volume.ts, 91:122)95  -5.595e-02  7.639e-02  -0.732  0.46484    
## L(Volume.ts, 91:122)96  -1.775e-02  7.651e-02  -0.232  0.81675    
## L(Volume.ts, 91:122)97  -4.687e-02  7.657e-02  -0.612  0.54124    
## L(Volume.ts, 91:122)98  -8.249e-02  7.719e-02  -1.069  0.28665    
## L(Volume.ts, 91:122)99   9.428e-02  7.730e-02   1.220  0.22419    
## L(Volume.ts, 91:122)100 -6.422e-02  7.788e-02  -0.825  0.41074    
## L(Volume.ts, 91:122)101  3.421e-02  7.823e-02   0.437  0.66238    
## L(Volume.ts, 91:122)102  1.586e-03  7.744e-02   0.020  0.98368    
## L(Volume.ts, 91:122)103 -1.118e-02  7.695e-02  -0.145  0.88463    
## L(Volume.ts, 91:122)104  1.170e-02  7.716e-02   0.152  0.87971    
## L(Volume.ts, 91:122)105  2.485e-02  7.736e-02   0.321  0.74837    
## L(Volume.ts, 91:122)106 -5.351e-02  7.745e-02  -0.691  0.49059    
## L(Volume.ts, 91:122)107  4.020e-02  7.751e-02   0.519  0.60467    
## L(Volume.ts, 91:122)108 -4.865e-02  7.724e-02  -0.630  0.52960    
## L(Volume.ts, 91:122)109 -5.240e-02  7.723e-02  -0.679  0.49832    
## L(Volume.ts, 91:122)110  3.850e-02  7.691e-02   0.501  0.61723    
## L(Volume.ts, 91:122)111 -1.401e-01  8.108e-02  -1.727  0.08583 .  
## L(Volume.ts, 91:122)112  1.512e-02  8.127e-02   0.186  0.85256    
## L(Volume.ts, 91:122)113  9.254e-02  8.095e-02   1.143  0.25454    
## L(Volume.ts, 91:122)114 -1.000e-01  8.111e-02  -1.233  0.21911    
## L(Volume.ts, 91:122)115 -8.880e-02  8.156e-02  -1.089  0.27776    
## L(Volume.ts, 91:122)116  6.094e-02  7.674e-02   0.794  0.42824    
## L(Volume.ts, 91:122)117  2.543e-01  7.719e-02   3.295  0.00119 ** 
## L(Volume.ts, 91:122)118 -1.304e-01  7.928e-02  -1.645  0.10174    
## L(Volume.ts, 91:122)119 -6.994e-02  7.984e-02  -0.876  0.38225    
## L(Volume.ts, 91:122)120  5.097e-02  7.952e-02   0.641  0.52234    
## L(Volume.ts, 91:122)121 -2.489e-02  7.845e-02  -0.317  0.75142    
## L(Volume.ts, 91:122)122 -5.783e-02  7.478e-02  -0.773  0.44037    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1885000 on 178 degrees of freedom
## Multiple R-squared:  0.3863, Adjusted R-squared:  0.1656 
## F-statistic:  1.75 on 64 and 178 DF,  p-value: 0.002182

AR models for Open (diff) (based on ACF and PACF graphs, the two lags models to use would be 110 only and 35 and 110 together)

AR.Open.ts.diff.lag110 <- dynlm(Open.ts.diff~L(Open.ts.diff,110))
summary(AR.Open.ts.diff.lag110)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Open.ts.diff ~ L(Open.ts.diff, 110))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1024.16    -8.63     3.62    19.65   881.60 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)
## (Intercept)          -3.93811    6.88904  -0.572    0.568
## L(Open.ts.diff, 110)  0.01621    0.07788   0.208    0.835
## 
## Residual standard error: 109.8 on 252 degrees of freedom
## Multiple R-squared:  0.0001718,  Adjusted R-squared:  -0.003796 
## F-statistic: 0.0433 on 1 and 252 DF,  p-value: 0.8353
AR.Open.ts.diff.lag35n110 <- dynlm(Open.ts.diff ~ L(Open.ts.diff, 35) + L(Close.ts.diff, 110))
summary(AR.Open.ts.diff.lag35n110)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Open.ts.diff ~ L(Open.ts.diff, 35) + L(Close.ts.diff, 
##     110))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1021.73    -8.74     3.90    18.31   882.11 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)
## (Intercept)           -3.911070   6.895541  -0.567    0.571
## L(Open.ts.diff, 35)    0.003046   0.077637   0.039    0.969
## L(Close.ts.diff, 110) -0.061089   0.079631  -0.767    0.444
## 
## Residual standard error: 109.9 on 251 degrees of freedom
## Multiple R-squared:  0.002349,   Adjusted R-squared:  -0.0056 
## F-statistic: 0.2955 on 2 and 251 DF,  p-value: 0.7444

## Analyzing AR Residuals with ACF and PACF


``` r
library(dynlm)
library(forecast)

plot_acf_pacf <- function(model_residuals, model_name) {
  par(mfrow = c(1, 2))  # Set up a 1x2 plotting area
  acf(model_residuals, main = paste("ACF of Residuals:", model_name))
  pacf(model_residuals, main = paste("PACF of Residuals:", model_name))
}

Close AR Model

The ACF of the residuals shows that the first lag (0) has a strong autocorrelation (usual for all models). All other lags do not cross the blue line (within the confidence bounds) exhibiting that the residuals are uncorrelated. The PACF, though having a few spikes, is centered around 0, thus showing no significant partial autocorrelation.

AR.Close.ts.diff.lag110 <- dynlm(Close.ts.diff ~ L(Close.ts.diff, 110))
summary(AR.Close.ts.diff.lag110)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Close.ts.diff ~ L(Close.ts.diff, 110))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -978.86  -12.09    4.97   19.11  872.23 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)
## (Intercept)           -3.72438    6.67589  -0.558    0.577
## L(Close.ts.diff, 110) -0.05206    0.07709  -0.675    0.500
## 
## Residual standard error: 106.4 on 252 degrees of freedom
## Multiple R-squared:  0.001806,   Adjusted R-squared:  -0.002155 
## F-statistic: 0.456 on 1 and 252 DF,  p-value: 0.5001
plot_acf_pacf(residuals(AR.Close.ts.diff.lag110), "AR.Close.ts.diff.lag110")

The ACF of the residuals shows that the first lag (0) has a strong autocorrelation (usual for all models). All other lags do not cross the blue line (within the confidence bounds) exhibiting that the residuals are uncorrelated. The PACF, though having a few spikes, is centered around 0, thus showing no significant partial autocorrelation.

AR.Close.ts.diff.lag1to110 <- dynlm(Close.ts.diff ~ L(Close.ts.diff, 1:110))
summary(AR.Close.ts.diff.lag1to110)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Close.ts.diff ~ L(Close.ts.diff, 1:110))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -864.84  -19.97    5.33   27.12  852.50 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)
## (Intercept)                -3.2418672  8.3786908  -0.387    0.699
## L(Close.ts.diff, 1:110)1    0.0159777  0.0836037   0.191    0.849
## L(Close.ts.diff, 1:110)2    0.0226932  0.0835975   0.271    0.786
## L(Close.ts.diff, 1:110)3   -0.0338749  0.0836433  -0.405    0.686
## L(Close.ts.diff, 1:110)4    0.0223533  0.0836930   0.267    0.790
## L(Close.ts.diff, 1:110)5   -0.0092028  0.0837563  -0.110    0.913
## L(Close.ts.diff, 1:110)6    0.0884463  0.1010973   0.875    0.383
## L(Close.ts.diff, 1:110)7    0.0069257  0.1013506   0.068    0.946
## L(Close.ts.diff, 1:110)8   -0.0274712  0.1013067  -0.271    0.787
## L(Close.ts.diff, 1:110)9    0.0398144  0.1012823   0.393    0.695
## L(Close.ts.diff, 1:110)10  -0.0218935  0.1013141  -0.216    0.829
## L(Close.ts.diff, 1:110)11   0.0058744  0.1013472   0.058    0.954
## L(Close.ts.diff, 1:110)12  -0.0570005  0.1013255  -0.563    0.575
## L(Close.ts.diff, 1:110)13   0.0597780  0.1013998   0.590    0.556
## L(Close.ts.diff, 1:110)14   0.0357480  0.1014407   0.352    0.725
## L(Close.ts.diff, 1:110)15   0.0498519  0.1014621   0.491    0.624
## L(Close.ts.diff, 1:110)16   0.0038393  0.1015560   0.038    0.970
## L(Close.ts.diff, 1:110)17  -0.0294803  0.1013645  -0.291    0.772
## L(Close.ts.diff, 1:110)18  -0.0147365  0.1013580  -0.145    0.885
## L(Close.ts.diff, 1:110)19  -0.0206962  0.1013525  -0.204    0.838
## L(Close.ts.diff, 1:110)20  -0.0559949  0.1012260  -0.553    0.581
## L(Close.ts.diff, 1:110)21  -0.0430001  0.1013242  -0.424    0.672
## L(Close.ts.diff, 1:110)22   0.0055223  0.1013444   0.054    0.957
## L(Close.ts.diff, 1:110)23   0.0106073  0.1013348   0.105    0.917
## L(Close.ts.diff, 1:110)24   0.0648144  0.1010454   0.641    0.522
## L(Close.ts.diff, 1:110)25  -0.0139403  0.1011627  -0.138    0.891
## L(Close.ts.diff, 1:110)26  -0.0812167  0.1011572  -0.803    0.423
## L(Close.ts.diff, 1:110)27   0.0114422  0.1013671   0.113    0.910
## L(Close.ts.diff, 1:110)28   0.0440350  0.1013496   0.434    0.665
## L(Close.ts.diff, 1:110)29   0.0371217  0.1014123   0.366    0.715
## L(Close.ts.diff, 1:110)30  -0.0723102  0.1013736  -0.713    0.477
## L(Close.ts.diff, 1:110)31   0.0039553  0.1015621   0.039    0.969
## L(Close.ts.diff, 1:110)32   0.0056048  0.1015763   0.055    0.956
## L(Close.ts.diff, 1:110)33   0.0245252  0.1015922   0.241    0.810
## L(Close.ts.diff, 1:110)34  -0.0061197  0.1016102  -0.060    0.952
## L(Close.ts.diff, 1:110)35   0.0928452  0.1011359   0.918    0.360
## L(Close.ts.diff, 1:110)36   0.0424102  0.1013987   0.418    0.676
## L(Close.ts.diff, 1:110)37   0.0091770  0.1014057   0.090    0.928
## L(Close.ts.diff, 1:110)38  -0.0384362  0.1012522  -0.380    0.705
## L(Close.ts.diff, 1:110)39   0.0503154  0.1011587   0.497    0.620
## L(Close.ts.diff, 1:110)40   0.0399346  0.1012265   0.395    0.694
## L(Close.ts.diff, 1:110)41  -0.0189568  0.1014365  -0.187    0.852
## L(Close.ts.diff, 1:110)42  -0.0145250  0.1014390  -0.143    0.886
## L(Close.ts.diff, 1:110)43  -0.0352909  0.1014361  -0.348    0.728
## L(Close.ts.diff, 1:110)44  -0.0384279  0.1014462  -0.379    0.705
## L(Close.ts.diff, 1:110)45  -0.0173849  0.1014600  -0.171    0.864
## L(Close.ts.diff, 1:110)46  -0.0683404  0.1014104  -0.674    0.501
## L(Close.ts.diff, 1:110)47   0.0236919  0.1014716   0.233    0.816
## L(Close.ts.diff, 1:110)48   0.0401431  0.1014935   0.396    0.693
## L(Close.ts.diff, 1:110)49   0.0413050  0.1015298   0.407    0.685
## L(Close.ts.diff, 1:110)50   0.0649748  0.1015575   0.640    0.523
## L(Close.ts.diff, 1:110)51  -0.0312912  0.1016223  -0.308    0.759
## L(Close.ts.diff, 1:110)52  -0.0420572  0.1015429  -0.414    0.679
## L(Close.ts.diff, 1:110)53   0.0665238  0.1014135   0.656    0.513
## L(Close.ts.diff, 1:110)54  -0.0286601  0.1015852  -0.282    0.778
## L(Close.ts.diff, 1:110)55  -0.0024781  0.1015848  -0.024    0.981
## L(Close.ts.diff, 1:110)56   0.0317418  0.1015843   0.312    0.755
## L(Close.ts.diff, 1:110)57  -0.0246884  0.1015788  -0.243    0.808
## L(Close.ts.diff, 1:110)58  -0.0434951  0.1015490  -0.428    0.669
## L(Close.ts.diff, 1:110)59   0.0308901  0.1016062   0.304    0.762
## L(Close.ts.diff, 1:110)60   0.0488192  0.1016090   0.480    0.632
## L(Close.ts.diff, 1:110)61  -0.0421448  0.1015130  -0.415    0.679
## L(Close.ts.diff, 1:110)62  -0.0244018  0.1015429  -0.240    0.810
## L(Close.ts.diff, 1:110)63  -0.0375576  0.1014241  -0.370    0.712
## L(Close.ts.diff, 1:110)64  -0.0388429  0.1015070  -0.383    0.703
## L(Close.ts.diff, 1:110)65   0.0311338  0.1014450   0.307    0.759
## L(Close.ts.diff, 1:110)66   0.0567100  0.1014134   0.559    0.577
## L(Close.ts.diff, 1:110)67   0.0277998  0.1014939   0.274    0.785
## L(Close.ts.diff, 1:110)68   0.0257939  0.1014602   0.254    0.800
## L(Close.ts.diff, 1:110)69  -0.0086599  0.1014762  -0.085    0.932
## L(Close.ts.diff, 1:110)70   0.0072461  0.1014847   0.071    0.943
## L(Close.ts.diff, 1:110)71  -0.0432676  0.1013738  -0.427    0.670
## L(Close.ts.diff, 1:110)72  -0.0415484  0.1014075  -0.410    0.683
## L(Close.ts.diff, 1:110)73   0.0910813  0.1012589   0.899    0.370
## L(Close.ts.diff, 1:110)74  -0.0625441  0.1014783  -0.616    0.539
## L(Close.ts.diff, 1:110)75  -0.0294626  0.1015561  -0.290    0.772
## L(Close.ts.diff, 1:110)76  -0.0320286  0.1015134  -0.316    0.753
## L(Close.ts.diff, 1:110)77   0.0249377  0.1014821   0.246    0.806
## L(Close.ts.diff, 1:110)78  -0.0236800  0.1014784  -0.233    0.816
## L(Close.ts.diff, 1:110)79  -0.0226653  0.1014869  -0.223    0.824
## L(Close.ts.diff, 1:110)80   0.0305778  0.1014822   0.301    0.764
## L(Close.ts.diff, 1:110)81   0.0123753  0.1014071   0.122    0.903
## L(Close.ts.diff, 1:110)82  -0.0247163  0.1014219  -0.244    0.808
## L(Close.ts.diff, 1:110)83   0.0056352  0.1014384   0.056    0.956
## L(Close.ts.diff, 1:110)84  -0.0310366  0.1013726  -0.306    0.760
## L(Close.ts.diff, 1:110)85  -0.0020362  0.1011613  -0.020    0.984
## L(Close.ts.diff, 1:110)86  -0.0126342  0.1011472  -0.125    0.901
## L(Close.ts.diff, 1:110)87  -0.0918818  0.1010208  -0.910    0.365
## L(Close.ts.diff, 1:110)88  -0.0349886  0.1012829  -0.345    0.730
## L(Close.ts.diff, 1:110)89  -0.0156798  0.1013276  -0.155    0.877
## L(Close.ts.diff, 1:110)90   0.0041301  0.1012953   0.041    0.968
## L(Close.ts.diff, 1:110)91   0.0501664  0.1012378   0.496    0.621
## L(Close.ts.diff, 1:110)92   0.0161658  0.1013289   0.160    0.873
## L(Close.ts.diff, 1:110)93   0.0122805  0.1013494   0.121    0.904
## L(Close.ts.diff, 1:110)94   0.0971465  0.1011898   0.960    0.339
## L(Close.ts.diff, 1:110)95  -0.0175875  0.1015111  -0.173    0.863
## L(Close.ts.diff, 1:110)96  -0.0195728  0.1014529  -0.193    0.847
## L(Close.ts.diff, 1:110)97  -0.0590493  0.1013925  -0.582    0.561
## L(Close.ts.diff, 1:110)98  -0.0216744  0.1014251  -0.214    0.831
## L(Close.ts.diff, 1:110)99   0.0490977  0.1013339   0.485    0.629
## L(Close.ts.diff, 1:110)100  0.0125655  0.1014184   0.124    0.902
## L(Close.ts.diff, 1:110)101 -0.0137678  0.1014420  -0.136    0.892
## L(Close.ts.diff, 1:110)102 -0.0359516  0.1013823  -0.355    0.723
## L(Close.ts.diff, 1:110)103  0.0471292  0.1013844   0.465    0.643
## L(Close.ts.diff, 1:110)104 -0.0358237  0.1014073  -0.353    0.724
## L(Close.ts.diff, 1:110)105 -0.0950821  0.1008008  -0.943    0.347
## L(Close.ts.diff, 1:110)106 -0.0008114  0.1011113  -0.008    0.994
## L(Close.ts.diff, 1:110)107 -0.0105709  0.1010718  -0.105    0.917
## L(Close.ts.diff, 1:110)108  0.0129233  0.1009916   0.128    0.898
## L(Close.ts.diff, 1:110)109 -0.0157170  0.1009892  -0.156    0.877
## L(Close.ts.diff, 1:110)110 -0.0322934  0.1009697  -0.320    0.750
## 
## Residual standard error: 133 on 143 degrees of freedom
## Multiple R-squared:  0.1144, Adjusted R-squared:  -0.5669 
## F-statistic: 0.1679 on 110 and 143 DF,  p-value: 1
plot_acf_pacf(residuals(AR.Close.ts.diff.lag1to110), "AR.Close.ts.diff.lag1to110")

BOTH MODELS FOR CLOSE, SHOW THAT THE RESIDUALS FOR ACF AND PACF ARE CENTERED AROUND 0, meaning that the models both properly capture the patterns in the data. Therefore no misspecification is present in the model. 

Open AR Model

The ACF of the residuals shows that the first lag (0) has a strong autocorrelation (usual for all models). All other lags do not cross the blue line (within the confidence bounds) exhibiting that the residuals are uncorrelated. The PACF, though having a few spikes, is centered around 0, thus showing no significant partial autocorrelation.

AR.Open.ts.diff.lag110 <- dynlm(Open.ts.diff ~ L(Open.ts.diff, 110))
summary(AR.Open.ts.diff.lag110)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Open.ts.diff ~ L(Open.ts.diff, 110))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1024.16    -8.63     3.62    19.65   881.60 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)
## (Intercept)          -3.93811    6.88904  -0.572    0.568
## L(Open.ts.diff, 110)  0.01621    0.07788   0.208    0.835
## 
## Residual standard error: 109.8 on 252 degrees of freedom
## Multiple R-squared:  0.0001718,  Adjusted R-squared:  -0.003796 
## F-statistic: 0.0433 on 1 and 252 DF,  p-value: 0.8353
plot_acf_pacf(residuals(AR.Open.ts.diff.lag110), "AR.Open.ts.diff.lag110")

The ACF of the residuals shows that the first lag (0) has a strong autocorrelation (usual for all models). All other lags do not cross the blue line (within the confidence bounds) exhibiting that the residuals are uncorrelated. The PACF, though having a few spikes, is centered around 0, thus showing no significant partial autocorrelation.

AR.Open.ts.diff.lag35n110 <- dynlm(Open.ts.diff ~ L(Open.ts.diff, 35) + L(Open.ts.diff, 110))
summary(AR.Open.ts.diff.lag35n110)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Open.ts.diff ~ L(Open.ts.diff, 35) + L(Open.ts.diff, 
##     110))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1024.12    -8.73     3.55    19.65   881.57 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)
## (Intercept)          -3.935308   6.902962  -0.570    0.569
## L(Open.ts.diff, 35)   0.003764   0.077716   0.048    0.961
## L(Open.ts.diff, 110)  0.016177   0.078032   0.207    0.836
## 
## Residual standard error: 110 on 251 degrees of freedom
## Multiple R-squared:  0.0001811,  Adjusted R-squared:  -0.007786 
## F-statistic: 0.02274 on 2 and 251 DF,  p-value: 0.9775
plot_acf_pacf(residuals(AR.Open.ts.diff.lag35n110), "AR.Open.ts.diff.lag35n110")

BOTH MODELS FOR CLOSE, SHOW THAT THE RESIDUALS FOR ACF AND PACF ARE CENTERED AROUND 0, meaning that the models both properly capture the patterns in the data. Therefore no misspecification is present in the model. 

Turnover AR Model

The ACF of the residuals shows autocorrelation at lag 0.05, and partial autocorrelation at lag 0.05. The spikes in the PACF graph, though within the confidence bounds, are significantly larger than the Open and Close AR Model’s. This suggests that there is some misspecification in the model.

AR.Turnover.ts.lag1.4 <- dynlm(Turnover.ts ~ L(Turnover.ts, 1:4))
summary(AR.Turnover.ts.lag1.4)
## 
## Time series regression with "ts" data:
## Start = 2015(5), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 1:4))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.822e+14 -1.147e+14 -5.190e+13  5.935e+13  1.771e+15 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           2.487e+14  3.619e+13   6.872 2.85e-11 ***
## L(Turnover.ts, 1:4)1  3.297e-01  5.279e-02   6.245 1.21e-09 ***
## L(Turnover.ts, 1:4)2  1.731e-02  5.559e-02   0.311   0.7558    
## L(Turnover.ts, 1:4)3 -1.393e-02  5.564e-02  -0.250   0.8025    
## L(Turnover.ts, 1:4)4  9.132e-02  5.274e-02   1.732   0.0842 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.608e+14 on 356 degrees of freedom
## Multiple R-squared:  0.1235, Adjusted R-squared:  0.1136 
## F-statistic: 12.54 on 4 and 356 DF,  p-value: 1.491e-09
plot_acf_pacf(residuals(AR.Turnover.ts.lag1.4), "AR.Turnover.ts.lag1.4")

The ACF and PACF of the residuals show autocorrelation and partial autocorrelation at lags 0.025, around 0.02, and around 0.04. This suggests that the model could be misspecified and the model is not white noise.

AR.Turnover.ts.lag2n61n70n117 <- dynlm(Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts, 61) + L(Turnover.ts, 70) + L(Turnover.ts, 117))
summary(AR.Turnover.ts.lag2n61n70n117)
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts, 
##     61) + L(Turnover.ts, 70) + L(Turnover.ts, 117))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -6.092e+14 -1.365e+14 -1.708e+13  9.426e+13  1.448e+15 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)         1.793e+13  5.028e+13   0.357  0.72167    
## L(Turnover.ts, 2)   1.670e-01  5.593e-02   2.985  0.00312 ** 
## L(Turnover.ts, 61)  2.776e-01  5.620e-02   4.940 1.46e-06 ***
## L(Turnover.ts, 70)  2.038e-01  5.620e-02   3.626  0.00035 ***
## L(Turnover.ts, 117) 3.092e-01  5.664e-02   5.460 1.18e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.377e+14 on 243 degrees of freedom
## Multiple R-squared:  0.2423, Adjusted R-squared:  0.2298 
## F-statistic: 19.43 on 4 and 243 DF,  p-value: 6.967e-14
plot_acf_pacf(residuals(AR.Turnover.ts.lag2n61n70n117), "AR.Turnover.ts.lag2n61n70n117")

BOTH MODELS SHOW SOME AUTOCORRELATION AND PARTIAL AUTOCORRELATION. HOWEVER THE FIRST MOFEL FOR TURNOVER IS BETTER THAN THE SECOND.

Volume AR Model

The ACF of the residuals shows that the first lag (0) has a strong autocorrelation (usual for all models). All other lags do not cross the blue line (within the confidence bounds) exhibiting that the residuals are uncorrelated. The PACF, though having a few spikes, is centered around 0, thus showing no significant partial autocorrelation.

AR.Volume.ts.lag1.32 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32))
summary(AR.Volume.ts.lag1.32)
## 
## Time series regression with "ts" data:
## Start = 2015(33), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2560268  -738320  -215103   323411 16655993 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           4.598e+05  3.067e+05   1.499   0.1349    
## L(Volume.ts, 1:32)1   3.378e-01  5.769e-02   5.856 1.25e-08 ***
## L(Volume.ts, 1:32)2   5.810e-02  6.088e-02   0.954   0.3406    
## L(Volume.ts, 1:32)3  -4.009e-02  6.099e-02  -0.657   0.5115    
## L(Volume.ts, 1:32)4   1.130e-01  6.073e-02   1.861   0.0637 .  
## L(Volume.ts, 1:32)5   6.020e-03  6.088e-02   0.099   0.9213    
## L(Volume.ts, 1:32)6   4.992e-02  6.087e-02   0.820   0.4127    
## L(Volume.ts, 1:32)7   1.153e-01  6.090e-02   1.894   0.0592 .  
## L(Volume.ts, 1:32)8  -1.452e-02  6.124e-02  -0.237   0.8128    
## L(Volume.ts, 1:32)9  -8.593e-03  6.103e-02  -0.141   0.8881    
## L(Volume.ts, 1:32)10  4.911e-02  6.103e-02   0.805   0.4216    
## L(Volume.ts, 1:32)11 -6.167e-02  6.109e-02  -1.010   0.3135    
## L(Volume.ts, 1:32)12  1.838e-02  6.117e-02   0.300   0.7641    
## L(Volume.ts, 1:32)13 -3.072e-02  6.109e-02  -0.503   0.6154    
## L(Volume.ts, 1:32)14 -3.234e-02  6.107e-02  -0.530   0.5968    
## L(Volume.ts, 1:32)15  7.948e-02  6.091e-02   1.305   0.1930    
## L(Volume.ts, 1:32)16 -3.868e-02  6.112e-02  -0.633   0.5273    
## L(Volume.ts, 1:32)17 -2.775e-03  6.138e-02  -0.045   0.9640    
## L(Volume.ts, 1:32)18  6.720e-02  6.125e-02   1.097   0.2735    
## L(Volume.ts, 1:32)19 -3.024e-02  6.128e-02  -0.493   0.6221    
## L(Volume.ts, 1:32)20  6.718e-03  6.125e-02   0.110   0.9127    
## L(Volume.ts, 1:32)21 -3.728e-02  6.125e-02  -0.609   0.5432    
## L(Volume.ts, 1:32)22  2.437e-02  6.119e-02   0.398   0.6908    
## L(Volume.ts, 1:32)23  3.722e-03  6.114e-02   0.061   0.9515    
## L(Volume.ts, 1:32)24  8.983e-02  6.118e-02   1.468   0.1431    
## L(Volume.ts, 1:32)25  1.275e-02  6.135e-02   0.208   0.8355    
## L(Volume.ts, 1:32)26  2.689e-02  5.834e-02   0.461   0.6451    
## L(Volume.ts, 1:32)27  1.397e-02  5.831e-02   0.240   0.8108    
## L(Volume.ts, 1:32)28 -7.804e-02  5.828e-02  -1.339   0.1816    
## L(Volume.ts, 1:32)29  1.029e-01  5.817e-02   1.769   0.0779 .  
## L(Volume.ts, 1:32)30 -3.212e-02  5.845e-02  -0.549   0.5831    
## L(Volume.ts, 1:32)31  3.529e-02  5.844e-02   0.604   0.5464    
## L(Volume.ts, 1:32)32  3.051e-02  5.529e-02   0.552   0.5814    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1702000 on 300 degrees of freedom
## Multiple R-squared:  0.2808, Adjusted R-squared:  0.204 
## F-statistic:  3.66 on 32 and 300 DF,  p-value: 1.741e-09
plot_acf_pacf(residuals(AR.Volume.ts.lag1.32), "AR.Volume.ts.lag1.32")

The ACF of the residuals shows that the first lag (0) has a strong autocorrelation (usual for all models). All other lags do not cross the blue line (within the confidence bounds) exhibiting that the residuals are uncorrelated. The PACF has spikes that are significaly longer than the previous model, but are stil within the confidence bounds.

AR.Volume.ts.lag1.32n90.122 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 91:122))
summary(AR.Volume.ts.lag1.32n90.122)
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 
##     91:122))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3164619  -845564  -196953   515577 15844439 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              2.064e+06  9.492e+05   2.175  0.03099 *  
## L(Volume.ts, 1:32)1      3.077e-01  7.471e-02   4.118 5.83e-05 ***
## L(Volume.ts, 1:32)2      8.579e-02  7.829e-02   1.096  0.27463    
## L(Volume.ts, 1:32)3     -6.947e-02  7.932e-02  -0.876  0.38232    
## L(Volume.ts, 1:32)4      4.361e-02  7.959e-02   0.548  0.58440    
## L(Volume.ts, 1:32)5      2.659e-02  7.886e-02   0.337  0.73641    
## L(Volume.ts, 1:32)6      4.105e-02  7.681e-02   0.534  0.59372    
## L(Volume.ts, 1:32)7      9.857e-02  7.663e-02   1.286  0.19997    
## L(Volume.ts, 1:32)8     -1.161e-02  7.667e-02  -0.151  0.87981    
## L(Volume.ts, 1:32)9      6.843e-03  7.620e-02   0.090  0.92855    
## L(Volume.ts, 1:32)10     5.843e-02  7.618e-02   0.767  0.44405    
## L(Volume.ts, 1:32)11    -1.063e-01  7.655e-02  -1.389  0.16652    
## L(Volume.ts, 1:32)12     3.302e-02  7.687e-02   0.429  0.66810    
## L(Volume.ts, 1:32)13    -7.062e-02  7.702e-02  -0.917  0.36045    
## L(Volume.ts, 1:32)14    -3.136e-02  7.714e-02  -0.407  0.68481    
## L(Volume.ts, 1:32)15     5.747e-02  7.702e-02   0.746  0.45655    
## L(Volume.ts, 1:32)16    -3.637e-02  7.736e-02  -0.470  0.63885    
## L(Volume.ts, 1:32)17    -3.175e-02  7.756e-02  -0.409  0.68280    
## L(Volume.ts, 1:32)18     1.843e-02  7.722e-02   0.239  0.81170    
## L(Volume.ts, 1:32)19     5.873e-03  7.721e-02   0.076  0.93945    
## L(Volume.ts, 1:32)20     1.127e-02  7.712e-02   0.146  0.88401    
## L(Volume.ts, 1:32)21    -2.263e-02  7.748e-02  -0.292  0.77054    
## L(Volume.ts, 1:32)22     1.163e-02  7.775e-02   0.150  0.88127    
## L(Volume.ts, 1:32)23     3.839e-03  7.755e-02   0.050  0.96057    
## L(Volume.ts, 1:32)24     5.412e-02  7.717e-02   0.701  0.48405    
## L(Volume.ts, 1:32)25     3.788e-02  7.704e-02   0.492  0.62352    
## L(Volume.ts, 1:32)26     3.157e-02  7.651e-02   0.413  0.68037    
## L(Volume.ts, 1:32)27     3.416e-02  7.646e-02   0.447  0.65558    
## L(Volume.ts, 1:32)28    -7.903e-02  7.629e-02  -1.036  0.30161    
## L(Volume.ts, 1:32)29     6.674e-02  7.627e-02   0.875  0.38271    
## L(Volume.ts, 1:32)30     3.846e-02  8.024e-02   0.479  0.63226    
## L(Volume.ts, 1:32)31    -5.077e-03  8.045e-02  -0.063  0.94975    
## L(Volume.ts, 1:32)32     5.654e-02  7.618e-02   0.742  0.45890    
## L(Volume.ts, 91:122)91  -6.263e-02  7.620e-02  -0.822  0.41227    
## L(Volume.ts, 91:122)92   4.249e-02  8.054e-02   0.528  0.59846    
## L(Volume.ts, 91:122)93  -2.407e-02  8.048e-02  -0.299  0.76525    
## L(Volume.ts, 91:122)94   8.727e-03  7.642e-02   0.114  0.90921    
## L(Volume.ts, 91:122)95  -5.595e-02  7.639e-02  -0.732  0.46484    
## L(Volume.ts, 91:122)96  -1.775e-02  7.651e-02  -0.232  0.81675    
## L(Volume.ts, 91:122)97  -4.687e-02  7.657e-02  -0.612  0.54124    
## L(Volume.ts, 91:122)98  -8.249e-02  7.719e-02  -1.069  0.28665    
## L(Volume.ts, 91:122)99   9.428e-02  7.730e-02   1.220  0.22419    
## L(Volume.ts, 91:122)100 -6.422e-02  7.788e-02  -0.825  0.41074    
## L(Volume.ts, 91:122)101  3.421e-02  7.823e-02   0.437  0.66238    
## L(Volume.ts, 91:122)102  1.586e-03  7.744e-02   0.020  0.98368    
## L(Volume.ts, 91:122)103 -1.118e-02  7.695e-02  -0.145  0.88463    
## L(Volume.ts, 91:122)104  1.170e-02  7.716e-02   0.152  0.87971    
## L(Volume.ts, 91:122)105  2.485e-02  7.736e-02   0.321  0.74837    
## L(Volume.ts, 91:122)106 -5.351e-02  7.745e-02  -0.691  0.49059    
## L(Volume.ts, 91:122)107  4.020e-02  7.751e-02   0.519  0.60467    
## L(Volume.ts, 91:122)108 -4.865e-02  7.724e-02  -0.630  0.52960    
## L(Volume.ts, 91:122)109 -5.240e-02  7.723e-02  -0.679  0.49832    
## L(Volume.ts, 91:122)110  3.850e-02  7.691e-02   0.501  0.61723    
## L(Volume.ts, 91:122)111 -1.401e-01  8.108e-02  -1.727  0.08583 .  
## L(Volume.ts, 91:122)112  1.512e-02  8.127e-02   0.186  0.85256    
## L(Volume.ts, 91:122)113  9.254e-02  8.095e-02   1.143  0.25454    
## L(Volume.ts, 91:122)114 -1.000e-01  8.111e-02  -1.233  0.21911    
## L(Volume.ts, 91:122)115 -8.880e-02  8.156e-02  -1.089  0.27776    
## L(Volume.ts, 91:122)116  6.094e-02  7.674e-02   0.794  0.42824    
## L(Volume.ts, 91:122)117  2.543e-01  7.719e-02   3.295  0.00119 ** 
## L(Volume.ts, 91:122)118 -1.304e-01  7.928e-02  -1.645  0.10174    
## L(Volume.ts, 91:122)119 -6.994e-02  7.984e-02  -0.876  0.38225    
## L(Volume.ts, 91:122)120  5.097e-02  7.952e-02   0.641  0.52234    
## L(Volume.ts, 91:122)121 -2.489e-02  7.845e-02  -0.317  0.75142    
## L(Volume.ts, 91:122)122 -5.783e-02  7.478e-02  -0.773  0.44037    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1885000 on 178 degrees of freedom
## Multiple R-squared:  0.3863, Adjusted R-squared:  0.1656 
## F-statistic:  1.75 on 64 and 178 DF,  p-value: 0.002182
plot_acf_pacf(residuals(AR.Volume.ts.lag1.32n90.122), "AR.Volume.ts.lag1.32n90.122")

BOTH MODELS FOR CLOSE, SHOW THAT THE RESIDUALS FOR ACF AND PACF ARE CENTERED AROUND 0, meaning that the models both properly capture the patterns in the data. Therefore no misspecification is present in the model. However Model 1 is a better representation for Volume since the ACF ANF PACF graphs show residuals with very short spikes.

Testing AR Models

Open Diff with 35th and 110th lags training & testing

train_size.Open.diff <- floor(2/3 * length(Open.ts.diff))
train_data.Open.diff <- Open.ts.diff[1:train_size.Open.diff]  
train_data.Open.diff = ts(train_data.Open.diff,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
test_data.Open.diff <- Open.ts.diff[(train_size.Open.diff + 1):length(Open.ts.diff)] 
test_data.Open.diff = ts(test_data.Open.diff,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
length(train_data.Open.diff)  
## [1] 365
length(test_data.Open.diff) 
## [1] 365
Open.diff.training.AR35n110 <- dynlm(train_data.Open.diff ~ L(train_data.Open.diff, 35) + L(train_data.Open.diff, 110))
summary(Open.diff.training.AR35n110) 
## 
## Time series regression with "ts" data:
## Start = 2015(111), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Open.diff ~ L(train_data.Open.diff, 
##     35) + L(train_data.Open.diff, 110))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1020.50    -5.62     6.87    22.59   119.40 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)
## (Intercept)                  -7.336809   5.941263  -1.235    0.218
## L(train_data.Open.diff, 35)   0.016812   0.085120   0.198    0.844
## L(train_data.Open.diff, 110)  0.001373   0.085385   0.016    0.987
## 
## Residual standard error: 94.62 on 252 degrees of freedom
## Multiple R-squared:  0.0001555,  Adjusted R-squared:  -0.00778 
## F-statistic: 0.0196 on 2 and 252 DF,  p-value: 0.9806
Open.diff.testing.AR35n110 <- predict(object=Open.diff.training.AR35n110, n.ahead = length(test_data.Open.diff))
fitted_training.Open.AR35n110 <- fitted(Open.diff.training.AR35n110)
Open.diff.35n110.training.mse_value <- mse(train_data.Open.diff, fitted_training.Open.AR35n110)
Open.diff.35n110.training.rmse_value <- rmse(train_data.Open.diff, fitted_training.Open.AR35n110)
Open.diff.35n110.testing.mse_value <- mse(test_data.Open.diff, Open.diff.testing.AR35n110)
Open.diff.35n110.testing.rmse_value <- rmse(test_data.Open.diff, Open.diff.testing.AR35n110)
cat("Training Model MSE:", Open.diff.35n110.training.mse_value, "\n Training Model RMSE:", Open.diff.35n110.training.rmse_value , "\n Testing Model MSE:", Open.diff.35n110.testing.mse_value, "\n Testing Model RMSE:", Open.diff.35n110.testing.rmse_value , "\n")
## Training Model MSE: 8847.17 
##  Training Model RMSE: 94.0594 
##  Testing Model MSE: 15974.65 
##  Testing Model RMSE: 126.3909
cat("AIC:", AIC(Open.diff.training.AR35n110), "\nBIC:", BIC(Open.diff.training.AR35n110), "\n")
## AIC: 3049.061 
## BIC: 3063.226

The AR(35,110) model of variable Open.diff is not a good fit. To start with, the training model has a R^2 of 0.0001555, suggesting that the model can not well explain the relation between the lags and the response variable. The MSE and RMSE can also confirm this as we obtain a large number for both the MSE (8847.17) and RMSE (94.0594) for the training model. Upon testing the model using the last ⅓ of the dataset, we obtain a MSE and RMSE of 15974.65 and 126.3909 for the testing results, which are also large values.

Open Diff with 110th lags training & testing

train_size.Open.diff <- floor(2/3 * length(Open.ts.diff))
train_data.Open.diff <- Open.ts.diff[1:train_size.Open.diff]  
train_data.Open.diff = ts(train_data.Open.diff,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
test_data.Open.diff <- Open.ts.diff[(train_size.Open.diff + 1):length(Open.ts.diff)] 
test_data.Open.diff = ts(test_data.Open.diff,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
length(train_data.Open.diff)  
## [1] 365
length(test_data.Open.diff) 
## [1] 365
Open.diff.training.AR110 <- dynlm(train_data.Open.diff ~  L(train_data.Open.diff, 110))
summary(Open.diff.training.AR110) 
## 
## Time series regression with "ts" data:
## Start = 2015(111), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Open.diff ~ L(train_data.Open.diff, 
##     110))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1020.65    -5.49     6.90    22.57   119.31 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)
## (Intercept)                  -7.408048   5.919032  -1.252    0.212
## L(train_data.Open.diff, 110)  0.001152   0.085216   0.014    0.989
## 
## Residual standard error: 94.44 on 253 degrees of freedom
## Multiple R-squared:  7.224e-07,  Adjusted R-squared:  -0.003952 
## F-statistic: 0.0001828 on 1 and 253 DF,  p-value: 0.9892
Open.diff.testing.AR110 <- predict(object=Open.diff.training.AR110, n.ahead = length(test_data.Open.diff))
fitted_training.Open.AR110 <- fitted(Open.diff.training.AR110)
Open.diff.110.training.mse_value <- mse(train_data.Open.diff, fitted_training.Open.AR110)
Open.diff.110.training.rmse_value <- rmse(train_data.Open.diff, fitted_training.Open.AR110)
Open.diff.110.testing.mse_value <- mse(test_data.Open.diff, Open.diff.testing.AR110)
Open.diff.110.testing.rmse_value <- rmse(test_data.Open.diff, Open.diff.testing.AR110)
cat("Training Model MSE:", Open.diff.110.training.mse_value, "\n Training Model RMSE:", Open.diff.110.training.rmse_value , "\n Testing Model MSE:", Open.diff.110.testing.mse_value, "\n Testing Model RMSE:", Open.diff.110.testing.rmse_value , "\n")
## Training Model MSE: 8848.54 
##  Training Model RMSE: 94.06668 
##  Testing Model MSE: 15960.31 
##  Testing Model RMSE: 126.3341
cat("AIC:", AIC(Open.diff.training.AR110), "\nBIC:", BIC(Open.diff.training.AR110), "\n")
## AIC: 3047.101 
## BIC: 3057.724

The AR(35,110) model of variable Open.diff is not a good fit. To start with, the training model has a R^2 close to 0, suggesting that the model can not explain the relation between the lags and the response variable. The MSE and RMSE can also confirm this as we obtain a large number for both the MSE (8848.54) and RMSE (94.06668) for the training model. Upon testing the model using the last ⅓ of the dataset, we obtain a MSE and RMSE of 15960.31 and 126.3341 for the testing results, which are also large values.

Comparing the MSE and RMSE of the testing results of the two AR models for Open.diff. We can conclude that the second AR mode AR(110) is slightly better by a small margin as it has smaller MSE and RMSE. Based on the AIC and BIC results, AR(35,110) has a bigger AIC and BIC than AR(110), which is consistent with the conclusion we draw from comparing MSE and RMSE. However, none of the AR models are good fit, so we conclude that although one is slightly better than the other, we wouldn’t use them as they don’t capture serial correlation. This is consistent with the ACF and PACF we did for Open.diff, which exhibits what seems to be white noise and no serial correlation. The conclusion is that we won’t use AR models for Open.diff.

Close Diff with 110th lags training & testing

train_size.Close.diff <- floor(2/3 * length(Close.ts.diff))
train_data.Close.diff <- Close.ts.diff[1:train_size.Close.diff]  
train_data.Close.diff = ts(train_data.Close.diff,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
test_data.Close.diff <- Close.ts.diff[(train_size.Close.diff + 1):length(Close.ts.diff)] 
test_data.Close.diff = ts(test_data.Close.diff,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
length(train_data.Close.diff)  
## [1] 365
length(test_data.Close.diff) 
## [1] 365
Close.diff.training.AR110 <- dynlm(train_data.Close.diff ~  L(train_data.Close.diff, 110))
summary(Close.diff.training.AR110) 
## 
## Time series regression with "ts" data:
## Start = 2015(111), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Close.diff ~ L(train_data.Close.diff, 
##     110))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -974.45   -8.48    8.22   22.66  120.90 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)
## (Intercept)                   -7.45689    5.69355  -1.310    0.191
## L(train_data.Close.diff, 110) -0.06951    0.08464  -0.821    0.412
## 
## Residual standard error: 90.84 on 253 degrees of freedom
## Multiple R-squared:  0.002659,   Adjusted R-squared:  -0.001283 
## F-statistic: 0.6744 on 1 and 253 DF,  p-value: 0.4123
Close.diff.testing.AR110 <- predict(object=Close.diff.training.AR110, n.ahead = length(test_data.Close.diff))
fitted_training.Close.AR110 <- fitted(Close.diff.training.AR110)
Close.diff.110.training.mse_value <- mse(train_data.Close.diff, fitted_training.Close.AR110)
Close.diff.110.training.rmse_value <- rmse(train_data.Close.diff, fitted_training.Close.AR110)
Close.diff.110.testing.mse_value <- mse(test_data.Close.diff, Close.diff.testing.AR110)
Close.diff.110.testing.rmse_value <- rmse(test_data.Close.diff, Close.diff.testing.AR110)
cat("Training Model MSE:", Close.diff.110.training.mse_value, "\n Training Model RMSE:", Close.diff.110.training.rmse_value , "\n Testing Model MSE:", Close.diff.110.testing.mse_value, "\n Testing Model RMSE:", Close.diff.110.testing.rmse_value , "\n")
## Training Model MSE: 8186.789 
##  Training Model RMSE: 90.48088 
##  Testing Model MSE: 15231.04 
##  Testing Model RMSE: 123.4141
cat("AIC:", AIC(Close.diff.training.AR110), "\nBIC:", BIC(Close.diff.training.AR110), "\n")
## AIC: 3027.279 
## BIC: 3037.903

The AR(110) model of variable Close.diff is not a good fit. To start with, the training model has a R^2 of 0.002659, suggesting that the model can not explain the relation between the lags and the response variable (only 0.02%) of it. The MSE and RMSE can also confirm this as we obtain a large number for both the MSE (8186.789) and RMSE (90.48088) for the training model. Upon testing the model using the last ⅓ of the dataset, we obtain a MSE and RMSE of 15231.04 and 123.4141 for the testing results, which are also large values.

Close Diff with 1st to 110th lags training & testing

train_size.Close.diff <- floor(2/3 * length(Close.ts.diff))
train_data.Close.diff <- Close.ts.diff[1:train_size.Close.diff]  
train_data.Close.diff = ts(train_data.Close.diff,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
test_data.Close.diff <- Close.ts.diff[(train_size.Close.diff + 1):length(Close.ts.diff)] 
test_data.Close.diff = ts(test_data.Close.diff,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
length(train_data.Close.diff)  
## [1] 365
length(test_data.Close.diff) 
## [1] 365
Close.diff.AR1to110.formula <- paste("train_data.Close.diff ~", 
                                     paste(sprintf("L(train_data.Close.diff, %d)", 1:110), 
                                           collapse = " + "))
Close.diff.training.AR1to110 <- dynlm(as.formula(Close.diff.AR1to110.formula))
summary(Close.diff.training.AR1to110) 
## 
## Time series regression with "ts" data:
## Start = 2015(111), End = 2015(365)
## 
## Call:
## dynlm(formula = as.formula(Close.diff.AR1to110.formula))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -803.56  -19.06   10.62   30.51  177.54 
## 
## Coefficients:
##                                 Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                   -10.511347   8.377472  -1.255   0.2116  
## L(train_data.Close.diff, 1)    -0.007501   0.083379  -0.090   0.9284  
## L(train_data.Close.diff, 2)     0.041188   0.083362   0.494   0.6220  
## L(train_data.Close.diff, 3)    -0.038139   0.083439  -0.457   0.6483  
## L(train_data.Close.diff, 4)     0.001852   0.083549   0.022   0.9823  
## L(train_data.Close.diff, 5)    -0.025632   0.083539  -0.307   0.7594  
## L(train_data.Close.diff, 6)     0.019272   0.082908   0.232   0.8165  
## L(train_data.Close.diff, 7)    -0.026477   0.082778  -0.320   0.7495  
## L(train_data.Close.diff, 8)    -0.002266   0.082722  -0.027   0.9782  
## L(train_data.Close.diff, 9)     0.023295   0.082665   0.282   0.7785  
## L(train_data.Close.diff, 10)   -0.011063   0.082703  -0.134   0.8938  
## L(train_data.Close.diff, 11)   -0.007062   0.082719  -0.085   0.9321  
## L(train_data.Close.diff, 12)   -0.061292   0.082629  -0.742   0.4594  
## L(train_data.Close.diff, 13)    0.091695   0.109141   0.840   0.4022  
## L(train_data.Close.diff, 14)    0.005108   0.109276   0.047   0.9628  
## L(train_data.Close.diff, 15)    0.042573   0.109253   0.390   0.6974  
## L(train_data.Close.diff, 16)   -0.007293   0.109234  -0.067   0.9469  
## L(train_data.Close.diff, 17)   -0.006878   0.109006  -0.063   0.9498  
## L(train_data.Close.diff, 18)   -0.041088   0.108939  -0.377   0.7066  
## L(train_data.Close.diff, 19)   -0.039715   0.108957  -0.365   0.7160  
## L(train_data.Close.diff, 20)   -0.094406   0.108884  -0.867   0.3874  
## L(train_data.Close.diff, 21)   -0.075505   0.109107  -0.692   0.4900  
## L(train_data.Close.diff, 22)    0.015008   0.109274   0.137   0.8910  
## L(train_data.Close.diff, 23)   -0.010918   0.109067  -0.100   0.9204  
## L(train_data.Close.diff, 24)    0.044268   0.108938   0.406   0.6851  
## L(train_data.Close.diff, 25)   -0.065667   0.108894  -0.603   0.5474  
## L(train_data.Close.diff, 26)   -0.171040   0.108968  -1.570   0.1187  
## L(train_data.Close.diff, 27)   -0.004296   0.109795  -0.039   0.9688  
## L(train_data.Close.diff, 28)    0.076590   0.109712   0.698   0.4862  
## L(train_data.Close.diff, 29)    0.059980   0.109853   0.546   0.5859  
## L(train_data.Close.diff, 30)   -0.092376   0.109696  -0.842   0.4011  
## L(train_data.Close.diff, 31)    0.016926   0.109933   0.154   0.8779  
## L(train_data.Close.diff, 32)   -0.010943   0.109941  -0.100   0.9209  
## L(train_data.Close.diff, 33)    0.026137   0.109939   0.238   0.8124  
## L(train_data.Close.diff, 34)    0.035286   0.109953   0.321   0.7487  
## L(train_data.Close.diff, 35)    0.188784   0.109371   1.726   0.0865 .
## L(train_data.Close.diff, 36)    0.046130   0.110366   0.418   0.6766  
## L(train_data.Close.diff, 37)   -0.066054   0.110219  -0.599   0.5499  
## L(train_data.Close.diff, 38)   -0.021304   0.110028  -0.194   0.8467  
## L(train_data.Close.diff, 39)    0.078617   0.110061   0.714   0.4762  
## L(train_data.Close.diff, 40)    0.030304   0.110203   0.275   0.7837  
## L(train_data.Close.diff, 41)   -0.008997   0.110226  -0.082   0.9351  
## L(train_data.Close.diff, 42)   -0.015400   0.110197  -0.140   0.8891  
## L(train_data.Close.diff, 43)   -0.033732   0.110213  -0.306   0.7600  
## L(train_data.Close.diff, 44)   -0.057258   0.110169  -0.520   0.6041  
## L(train_data.Close.diff, 45)   -0.016206   0.110126  -0.147   0.8832  
## L(train_data.Close.diff, 46)   -0.099905   0.110076  -0.908   0.3656  
## L(train_data.Close.diff, 47)    0.030797   0.110310   0.279   0.7805  
## L(train_data.Close.diff, 48)    0.012219   0.110141   0.111   0.9118  
## L(train_data.Close.diff, 49)    0.035732   0.109965   0.325   0.7457  
## L(train_data.Close.diff, 50)    0.060164   0.109993   0.547   0.5852  
## L(train_data.Close.diff, 51)   -0.055228   0.109948  -0.502   0.6162  
## L(train_data.Close.diff, 52)   -0.079832   0.109837  -0.727   0.4685  
## L(train_data.Close.diff, 53)    0.103177   0.109835   0.939   0.3491  
## L(train_data.Close.diff, 54)   -0.012070   0.110107  -0.110   0.9129  
## L(train_data.Close.diff, 55)    0.066254   0.110084   0.602   0.5482  
## L(train_data.Close.diff, 56)    0.035761   0.110107   0.325   0.7458  
## L(train_data.Close.diff, 57)   -0.049543   0.110107  -0.450   0.6534  
## L(train_data.Close.diff, 58)   -0.037715   0.110020  -0.343   0.7322  
## L(train_data.Close.diff, 59)    0.043490   0.109989   0.395   0.6931  
## L(train_data.Close.diff, 60)    0.067036   0.109988   0.609   0.5432  
## L(train_data.Close.diff, 61)   -0.038189   0.109991  -0.347   0.7289  
## L(train_data.Close.diff, 62)   -0.067399   0.110027  -0.613   0.5411  
## L(train_data.Close.diff, 63)   -0.101175   0.110072  -0.919   0.3595  
## L(train_data.Close.diff, 64)   -0.033343   0.110385  -0.302   0.7630  
## L(train_data.Close.diff, 65)    0.016964   0.110171   0.154   0.8778  
## L(train_data.Close.diff, 66)    0.084395   0.110096   0.767   0.4446  
## L(train_data.Close.diff, 67)    0.023364   0.110291   0.212   0.8325  
## L(train_data.Close.diff, 68)    0.010519   0.110261   0.095   0.9241  
## L(train_data.Close.diff, 69)   -0.024029   0.110230  -0.218   0.8277  
## L(train_data.Close.diff, 70)   -0.006278   0.110248  -0.057   0.9547  
## L(train_data.Close.diff, 71)   -0.066001   0.110153  -0.599   0.5500  
## L(train_data.Close.diff, 72)   -0.046245   0.110240  -0.419   0.6755  
## L(train_data.Close.diff, 73)    0.126722   0.110122   1.151   0.2517  
## L(train_data.Close.diff, 74)   -0.097027   0.110378  -0.879   0.3808  
## L(train_data.Close.diff, 75)   -0.062845   0.110623  -0.568   0.5709  
## L(train_data.Close.diff, 76)    0.032824   0.110186   0.298   0.7662  
## L(train_data.Close.diff, 77)    0.033901   0.110147   0.308   0.7587  
## L(train_data.Close.diff, 78)   -0.031865   0.110110  -0.289   0.7727  
## L(train_data.Close.diff, 79)   -0.024364   0.110095  -0.221   0.8252  
## L(train_data.Close.diff, 80)    0.059515   0.110067   0.541   0.5895  
## L(train_data.Close.diff, 81)   -0.036162   0.110085  -0.328   0.7430  
## L(train_data.Close.diff, 82)   -0.037144   0.110001  -0.338   0.7361  
## L(train_data.Close.diff, 83)   -0.008532   0.109908  -0.078   0.9382  
## L(train_data.Close.diff, 84)   -0.074600   0.109811  -0.679   0.4980  
## L(train_data.Close.diff, 85)   -0.006336   0.108910  -0.058   0.9537  
## L(train_data.Close.diff, 86)   -0.053183   0.108802  -0.489   0.6257  
## L(train_data.Close.diff, 87)   -0.068343   0.108813  -0.628   0.5309  
## L(train_data.Close.diff, 88)   -0.095134   0.108889  -0.874   0.3838  
## L(train_data.Close.diff, 89)   -0.012948   0.109180  -0.119   0.9058  
## L(train_data.Close.diff, 90)   -0.028815   0.109056  -0.264   0.7920  
## L(train_data.Close.diff, 91)    0.013711   0.108933   0.126   0.9000  
## L(train_data.Close.diff, 92)    0.022516   0.108926   0.207   0.8365  
## L(train_data.Close.diff, 93)   -0.012920   0.108940  -0.119   0.9058  
## L(train_data.Close.diff, 94)    0.107412   0.108855   0.987   0.3254  
## L(train_data.Close.diff, 95)   -0.072731   0.109184  -0.666   0.5064  
## L(train_data.Close.diff, 96)   -0.022746   0.109329  -0.208   0.8355  
## L(train_data.Close.diff, 97)   -0.078072   0.109283  -0.714   0.4761  
## L(train_data.Close.diff, 98)   -0.017354   0.109254  -0.159   0.8740  
## L(train_data.Close.diff, 99)    0.059257   0.109026   0.544   0.5876  
## L(train_data.Close.diff, 100)  -0.023475   0.109138  -0.215   0.8300  
## L(train_data.Close.diff, 101)  -0.033646   0.109120  -0.308   0.7583  
## L(train_data.Close.diff, 102)  -0.047813   0.109021  -0.439   0.6616  
## L(train_data.Close.diff, 103)   0.061128   0.109048   0.561   0.5760  
## L(train_data.Close.diff, 104)  -0.069370   0.109057  -0.636   0.5257  
## L(train_data.Close.diff, 105)  -0.164604   0.108596  -1.516   0.1318  
## L(train_data.Close.diff, 106)   0.022748   0.109424   0.208   0.8356  
## L(train_data.Close.diff, 107)  -0.021125   0.109398  -0.193   0.8472  
## L(train_data.Close.diff, 108)  -0.029624   0.109313  -0.271   0.7868  
## L(train_data.Close.diff, 109)   0.001705   0.109251   0.016   0.9876  
## L(train_data.Close.diff, 110)  -0.020012   0.109243  -0.183   0.8549  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 109 on 144 degrees of freedom
## Multiple R-squared:  0.1832, Adjusted R-squared:  -0.4407 
## F-statistic: 0.2937 on 110 and 144 DF,  p-value: 1
Close.diff.testing.AR1to110 <- predict(object=Close.diff.training.AR1to110, n.ahead = length(test_data.Close.diff))
fitted_training.Close.AR1to110 <- fitted(Close.diff.training.AR1to110)
Close.diff.1to110.training.mse_value <- mse(train_data.Close.diff, fitted_training.Close.AR1to110)
Close.diff.1to110.training.rmse_value <- rmse(train_data.Close.diff, fitted_training.Close.AR1to110)
Close.diff.1to110.testing.mse_value <- mse(test_data.Close.diff, Close.diff.testing.AR1to110)
Close.diff.1to110.testing.rmse_value <- rmse(test_data.Close.diff, Close.diff.testing.AR1to110)
cat("Training Model MSE:", Close.diff.1to110.training.mse_value, "\n Training Model RMSE:", Close.diff.1to110.training.rmse_value , "\n Testing Model MSE:", Close.diff.1to110.testing.mse_value, "\n Testing Model RMSE:", Close.diff.1to110.testing.rmse_value, "\n")
## Training Model MSE: 6704.575 
##  Training Model RMSE: 81.88147 
##  Testing Model MSE: 17704.15 
##  Testing Model RMSE: 133.0569
cat(" Training Model AIC:", AIC(Close.diff.training.AR1to110), "\n Training Model BIC:", BIC(Close.diff.training.AR1to110), "\n")
##  Training Model AIC: 3194.348 
##  Training Model BIC: 3590.969

The AR(1:110) model of variable Close.diff is not a good fit. To start with, the training model has a R^2 of 0.1832, suggesting that the model can not well explain the relation between the lags and the response variable (only 18%) of it. The MSE and RMSE can also confirm this as we obtain a large number for both the MSE (6704.575) and RMSE (81.88147) for the training model. Upon testing the model using the last ⅓ of the dataset, we obtain a MSE and RMSE of 17704.15 and 133.0569 for the testing results, which are also large values.

Comparing the MSE and RMSE of the testing results of the two AR models for Close.diff. We can conclude that the second AR mode AR(1:110) is slightly better than AR(110) by a small margin as it has smaller MSE and RMSE. Based on the AIC and BIC results, AR(110) has a smaller AIC 3027.279, BIC: 3037.903 than AR(1:110): 3194.348, BIC: 3590.969, which is consistent with the conclusion we draw from comparing MSE and RMSE of the tests results. While the MSE and RMSE of the training set suggests that we should choose AR(1:110) over AR(110), the testing sets suggest otherwise. In this case, we would choose AR(110) since we want the model to more accurately predict future value (that is, to have better test results), so we go with the MSE and RMS for test results. And this result is also consistent with AIC and BIC results. However, none of the AR models are good fit, so we conclude that although one is slightly better than the other, we wouldn’t use them as they don’t have good fit. This is consistent with the ACF and PACF we did for Close.diff, which exhibits what seems to be white noise and no serial correlation. The conclusion is that we won’t use AR models for Close.diff.

Turnover with 1st to 4th lags training & testing

train_size.Turnover <- floor(2/3 * length(Turnover.ts))
train_data.Turnover <- Turnover.ts[1:train_size.Turnover]  
train_data.Turnover = ts(train_data.Turnover,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
test_data.Turnover <- Turnover.ts[(train_size.Turnover + 1):length(Turnover.ts)] 
test_data.Turnover = ts(test_data.Turnover,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
length(train_data.Turnover)  
## [1] 365
length(test_data.Turnover) 
## [1] 365
Turnover.training.AR1to4 <- dynlm(train_data.Turnover ~  L(train_data.Turnover, 1) + L(train_data.Turnover, 2) +  L(train_data.Turnover, 3) + L(train_data.Turnover, 4))
summary(Turnover.training.AR1to4) 
## 
## Time series regression with "ts" data:
## Start = 2015(5), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Turnover ~ L(train_data.Turnover, 
##     1) + L(train_data.Turnover, 2) + L(train_data.Turnover, 3) + 
##     L(train_data.Turnover, 4))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.861e+14 -1.157e+14 -4.990e+13  5.611e+13  1.770e+15 
## 
## Coefficients:
##                             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                2.513e+14  3.629e+13   6.926 2.04e-11 ***
## L(train_data.Turnover, 1)  3.315e-01  5.278e-02   6.281 9.82e-10 ***
## L(train_data.Turnover, 2)  1.511e-02  5.562e-02   0.272   0.7861    
## L(train_data.Turnover, 3) -1.913e-02  5.563e-02  -0.344   0.7311    
## L(train_data.Turnover, 4)  9.199e-02  5.269e-02   1.746   0.0817 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.6e+14 on 356 degrees of freedom
## Multiple R-squared:  0.1233, Adjusted R-squared:  0.1134 
## F-statistic: 12.51 on 4 and 356 DF,  p-value: 1.556e-09
Turnover.testing.AR1to4 <- predict(object=Turnover.training.AR1to4, n.ahead = length(test_data.Turnover))
fitted_training.Turnover.AR1to4 <- fitted(Turnover.training.AR1to4)
Turnover.AR1to4.training.mse_value <- mse(train_data.Turnover, fitted_training.Turnover.AR1to4)
Turnover.AR1to4.training.rmse_value <- rmse(train_data.Turnover, fitted_training.Turnover.AR1to4)
Turnover.AR1to4.testing.mse_value <- mse(test_data.Turnover, Turnover.testing.AR1to4)
Turnover.AR1to4.testing.rmse_value <- rmse(test_data.Turnover, Turnover.testing.AR1to4)
cat("Training Model MSE:", Turnover.AR1to4.training.mse_value, "\n Training Model RMSE:", Turnover.AR1to4.training.rmse_value, "\n Testing Model MSE:", Turnover.AR1to4.testing.mse_value, "\n Testing Model RMSE:", Turnover.AR1to4.testing.rmse_value, "\n")
## Training Model MSE: 6.667361e+28 
##  Training Model RMSE: 2.582123e+14 
##  Testing Model MSE: 9.427846e+28 
##  Testing Model RMSE: 3.07048e+14
cat(" Training Model AIC:", AIC(Turnover.training.AR1to4), "\n Training Model BIC:", BIC(Turnover.training.AR1to4), "\n")
##  Training Model AIC: 24995.9 
##  Training Model BIC: 25019.23

The AR(1:4) model of variable Turnover is not a good fit. To start with, the training model has a R^2 of 0.1233, suggesting that the model can not explain the relation between the lags and the response variable (only 12%) of it. The MSE and RMSE can also confirm this as we obtain a large number for both the MSE (6.667361e+28) and RMSE (2.582123e+14) for the training model. Upon testing the model using the last ⅓ of the dataset, we obtain a MSE and RMSE of 9.427846e+28 and 3.07048e+14 for the testing results, which are also large values.

Turnover with 2nd, 61st, 75th, and 117th lags training & testing

train_size.Turnover <- floor(2/3 * length(Turnover.ts))
train_data.Turnover <- Turnover.ts[1:train_size.Turnover]  
train_data.Turnover = ts(train_data.Turnover,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
test_data.Turnover <- Turnover.ts[(train_size.Turnover + 1):length(Turnover.ts)] 
test_data.Turnover = ts(test_data.Turnover,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
length(train_data.Turnover)  
## [1] 365
length(test_data.Turnover) 
## [1] 365
Turnover.training.AR2n61n75n117 <- dynlm(train_data.Turnover ~  L(train_data.Turnover, 2) + L(train_data.Turnover, 61) +  L(train_data.Turnover, 75) + L(train_data.Turnover, 117))
summary(Turnover.training.AR2n61n75n117 ) 
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Turnover ~ L(train_data.Turnover, 
##     2) + L(train_data.Turnover, 61) + L(train_data.Turnover, 
##     75) + L(train_data.Turnover, 117))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -4.276e+14 -1.330e+14 -4.577e+13  7.619e+13  1.888e+15 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 2.591e+14  5.480e+13   4.728 3.84e-06 ***
## L(train_data.Turnover, 2)   1.458e-01  6.243e-02   2.336   0.0203 *  
## L(train_data.Turnover, 61)  1.462e-01  6.440e-02   2.270   0.0241 *  
## L(train_data.Turnover, 75)  1.223e-02  6.252e-02   0.196   0.8451    
## L(train_data.Turnover, 117) 8.440e-02  6.466e-02   1.305   0.1930    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.641e+14 on 243 degrees of freedom
## Multiple R-squared:  0.05643,    Adjusted R-squared:  0.04089 
## F-statistic: 3.633 on 4 and 243 DF,  p-value: 0.006769
Turnover.testing.AR2n61n75n117  <- predict(object=Turnover.training.AR2n61n75n117, n.ahead = length(test_data.Turnover))
fitted_training.Turnover.AR2n61n75n117 <- fitted(Turnover.training.AR2n61n75n117)
Turnover.AR2n61n75n117.training.mse_value <- mse(train_data.Turnover, fitted_training.Turnover.AR2n61n75n117)
Turnover.AR2n61n75n117.training.rmse_value <- rmse(train_data.Turnover, fitted_training.Turnover.AR2n61n75n117)
Turnover.AR2n61n75n117.testing.mse_value <- mse(test_data.Turnover, Turnover.testing.AR2n61n75n117)
Turnover.AR2n61n75n117.testing.rmse_value <- rmse(test_data.Turnover, Turnover.testing.AR2n61n75n117)
cat("Training Model MSE:", Turnover.AR2n61n75n117.training.mse_value, "\n Training Model RMSE:", Turnover.AR2n61n75n117.training.rmse_value, "\n Testing Model MSE:", Turnover.AR2n61n75n117.testing.mse_value, "\n Testing Model RMSE:", Turnover.AR2n61n75n117.testing.rmse_value, "\n")
## Training Model MSE: 6.832895e+28 
##  Training Model RMSE: 2.613981e+14 
##  Testing Model MSE: 7.537423e+28 
##  Testing Model RMSE: 2.745437e+14
cat(" Training Model AIC:", AIC(Turnover.training.AR2n61n75n117), "\n Training Model BIC:", BIC(Turnover.training.AR2n61n75n117), "\n")
##  Training Model AIC: 17181.54 
##  Training Model BIC: 17202.62

The AR(2,6,75,117) model of variable Turnover is not a good fit. To start with, the training model has a R^2 of 0.05643, suggesting that the model can not explain the relation between the lags and the response variable . The MSE and RMSE can also confirm this as we obtain a large number for both the MSE (6.832895e+28) and RMSE (2.613981e+14) for the training model. Upon testing the model using the last ⅓ of the dataset, we obtain a MSE and RMSE of 7.537423e+28 and 2.745437e+14 for the testing results, which are also large values.

Comparing the MSE and RMSE of the testing results of the two AR models for Turnover. We can conclude that the first AR mode AR(1:4) is slightly better than AR(2,6,75,117) by a small margin as it has smaller MSE and RMSE, especially for the testing results. Based on the AIC and BIC results, AR(1:4) has a bigger AIC 24995.9, BIC: 25019.23 than AR(2,6,75,117): 17181.54, BIC: 17202.62, which is consistent with the conclusion we draw from comparing MSE and RMSE of the tests results. While the MSE and RMSE of the training set suggests that we should choose AR(1:4) over AR(2,6,75,117), the testing sets and AIC suggest otherwise. In this case, we would choose AR(2,6,75,117) since we want the model to more accurately predict future value (that is, to have better test results), so we go with the MSE and RMS for test results. And this result is also consistent with AIC and BIC results. However, none of the AR models are good fit, so we conclude that although one is slightly better than the other, we wouldn’t use them as they don’t have good fit.

Volume with 1st to 32th lags

train_size.Volume <- floor(2/3 * length(Volume.ts))
train_data.Volume <- Volume.ts [1:train_size.Volume]  
train_data.Volume = ts(train_data.Volume,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
test_data.Volume <- Volume.ts[(train_size.Volume + 1):length(Volume.ts)] 
test_data.Volume = ts(test_data.Volume,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
length(train_data.Volume)  
## [1] 365
length(test_data.Volume)
## [1] 365
Volume.AR1to32.formula <- paste("train_data.Volume ~", 
                                     paste(sprintf("L(train_data.Volume, %d)", 1:32), 
                                           collapse = " + "))
Volume.training.AR1to32 <- dynlm(as.formula(Volume.AR1to32.formula))
summary(Volume.training.AR1to32) 
## 
## Time series regression with "ts" data:
## Start = 2015(33), End = 2015(365)
## 
## Call:
## dynlm(formula = as.formula(Volume.AR1to32.formula))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2352306  -794523  -208019   319236 16681306 
## 
## Coefficients:
##                            Estimate Std. Error t value Pr(>|t|)    
## (Intercept)               4.800e+05  3.027e+05   1.586   0.1139    
## L(train_data.Volume, 1)   3.399e-01  5.767e-02   5.895 1.01e-08 ***
## L(train_data.Volume, 2)   6.409e-02  6.082e-02   1.054   0.2929    
## L(train_data.Volume, 3)  -4.166e-02  6.095e-02  -0.684   0.4948    
## L(train_data.Volume, 4)   1.250e-01  6.089e-02   2.053   0.0410 *  
## L(train_data.Volume, 5)   4.791e-03  6.101e-02   0.079   0.9375    
## L(train_data.Volume, 6)   4.156e-02  6.099e-02   0.681   0.4962    
## L(train_data.Volume, 7)   9.116e-02  6.100e-02   1.495   0.1361    
## L(train_data.Volume, 8)  -1.608e-02  6.119e-02  -0.263   0.7929    
## L(train_data.Volume, 9)  -1.512e-03  6.061e-02  -0.025   0.9801    
## L(train_data.Volume, 10)  5.109e-02  6.058e-02   0.843   0.3997    
## L(train_data.Volume, 11) -3.909e-02  6.065e-02  -0.645   0.5197    
## L(train_data.Volume, 12)  1.765e-02  6.065e-02   0.291   0.7713    
## L(train_data.Volume, 13) -2.898e-02  6.056e-02  -0.479   0.6326    
## L(train_data.Volume, 14) -2.699e-02  6.053e-02  -0.446   0.6560    
## L(train_data.Volume, 15)  5.817e-02  6.043e-02   0.963   0.3365    
## L(train_data.Volume, 16) -3.923e-02  6.053e-02  -0.648   0.5174    
## L(train_data.Volume, 17)  4.118e-03  6.053e-02   0.068   0.9458    
## L(train_data.Volume, 18)  4.640e-02  6.046e-02   0.767   0.4434    
## L(train_data.Volume, 19) -3.791e-02  6.046e-02  -0.627   0.5311    
## L(train_data.Volume, 20)  2.620e-02  6.045e-02   0.433   0.6650    
## L(train_data.Volume, 21) -4.637e-02  6.050e-02  -0.766   0.4440    
## L(train_data.Volume, 22)  8.681e-03  6.080e-02   0.143   0.8866    
## L(train_data.Volume, 23)  2.787e-02  6.071e-02   0.459   0.6466    
## L(train_data.Volume, 24)  1.564e-01  6.071e-02   2.576   0.0105 *  
## L(train_data.Volume, 25) -3.498e-02  6.130e-02  -0.571   0.5687    
## L(train_data.Volume, 26)  4.326e-02  5.841e-02   0.741   0.4595    
## L(train_data.Volume, 27)  1.127e-02  5.841e-02   0.193   0.8471    
## L(train_data.Volume, 28) -1.014e-01  5.839e-02  -1.737   0.0835 .  
## L(train_data.Volume, 29)  5.428e-02  5.838e-02   0.930   0.3532    
## L(train_data.Volume, 30)  2.273e-03  5.845e-02   0.039   0.9690    
## L(train_data.Volume, 31)  2.278e-02  5.838e-02   0.390   0.6967    
## L(train_data.Volume, 32)  4.790e-02  5.520e-02   0.868   0.3863    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1688000 on 300 degrees of freedom
## Multiple R-squared:  0.2892, Adjusted R-squared:  0.2134 
## F-statistic: 3.814 on 32 and 300 DF,  p-value: 4.581e-10
Volume.testing.AR1to32 <- predict(object=Volume.training.AR1to32, n.ahead = length(test_data.Volume))
fitted_training.Volume.AR1to32 <- fitted(Volume.training.AR1to32)
Volume.1to32.training.mse_value <- mse(train_data.Volume, fitted_training.Volume.AR1to32)
Volume.1to32.training.rmse_value <- rmse(train_data.Volume, fitted_training.Volume.AR1to32)
Volume.1to32.testing.mse_value <- mse(test_data.Volume, Volume.testing.AR1to32)
Volume.1to32.testing.rmse_value <- rmse(test_data.Volume, Volume.testing.AR1to32)
cat("Training Model MSE:", Volume.1to32.training.mse_value, "\n Training Model RMSE:", Volume.1to32.training.rmse_value , "\n Testing Model MSE:", Volume.1to32.testing.mse_value, "\n Testing Model RMSE:", Volume.1to32.testing.rmse_value, "\n")
## Training Model MSE: 2.566267e+12 
##  Training Model RMSE: 1601957 
##  Testing Model MSE: 3.385563e+12 
##  Testing Model RMSE: 1839990
cat(" Training Model AIC:", AIC(Volume.training.AR1to32), "\n Training Model BIC:", BIC(Volume.training.AR1to32), "\n")
##  Training Model AIC: 10527.98 
##  Training Model BIC: 10657.46

The AR(1:32) model of variable Volume is not a good fit. To start with, the training model has a R^2 of 0.2892, suggesting that the model can not well explain the relation between the lags and the response variable . We obtained MSE (2.566267e+12) and RMSE (1601957) for the training model. Upon testing the model using the last ⅓ of the dataset, we obtain a MSE and RMSE of 3.385563e+12 and 1839990 for the testing results, which are also large values.

Volume with 1st to 32th lags and 91th to 122th lags

train_size.Volume <- floor(2/3 * length(Volume.ts))
train_data.Volume <- Volume.ts[1:train_size.Volume]  
train_data.Volume = ts(train_data.Volume,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
test_data.Volume <- Volume.ts[(train_size.Volume + 1):length(Volume.ts)] 
test_data.Volume = ts(test_data.Volume,
                       start=c(2015,1),
                       end=c(2015,365),
                       frequency=365)
length(train_data.Volume)  
## [1] 365
length(test_data.Volume)
## [1] 365
Volume.AR1to32and91to122.formula <- paste("train_data.Volume ~", 
                                          paste(c(sprintf("L(train_data.Volume, %d)", 1:32), 
                                                  sprintf("L(train_data.Volume, %d)", 91:122)), 
                                                collapse = " + "))
Volume.training.AR1to32and91to122 <- dynlm(as.formula(Volume.AR1to32and91to122.formula))
summary(Volume.training.AR1to32and91to122) 
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = as.formula(Volume.AR1to32and91to122.formula))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2747977  -852049  -152678   513522 16174356 
## 
## Coefficients:
##                             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                2.496e+06  1.019e+06   2.451   0.0152 *  
## L(train_data.Volume, 1)    3.026e-01  7.483e-02   4.045  7.8e-05 ***
## L(train_data.Volume, 2)    4.140e-02  7.812e-02   0.530   0.5968    
## L(train_data.Volume, 3)   -3.732e-02  7.888e-02  -0.473   0.6367    
## L(train_data.Volume, 4)    6.439e-02  7.871e-02   0.818   0.4144    
## L(train_data.Volume, 5)   -1.632e-02  7.873e-02  -0.207   0.8361    
## L(train_data.Volume, 6)    2.431e-02  7.851e-02   0.310   0.7572    
## L(train_data.Volume, 7)    1.087e-01  7.844e-02   1.386   0.1675    
## L(train_data.Volume, 8)   -3.515e-02  7.897e-02  -0.445   0.6568    
## L(train_data.Volume, 9)   -1.787e-03  7.854e-02  -0.023   0.9819    
## L(train_data.Volume, 10)   5.795e-02  7.844e-02   0.739   0.4610    
## L(train_data.Volume, 11)  -7.501e-02  7.791e-02  -0.963   0.3370    
## L(train_data.Volume, 12)   4.898e-02  7.817e-02   0.627   0.5318    
## L(train_data.Volume, 13)  -9.087e-02  7.831e-02  -1.160   0.2474    
## L(train_data.Volume, 14)  -2.186e-03  7.876e-02  -0.028   0.9779    
## L(train_data.Volume, 15)   1.175e-02  7.875e-02   0.149   0.8815    
## L(train_data.Volume, 16)  -4.150e-02  7.866e-02  -0.528   0.5985    
## L(train_data.Volume, 17)  -7.238e-03  7.842e-02  -0.092   0.9266    
## L(train_data.Volume, 18)  -3.403e-03  7.843e-02  -0.043   0.9654    
## L(train_data.Volume, 19)  -2.458e-02  7.834e-02  -0.314   0.7541    
## L(train_data.Volume, 20)   2.886e-02  7.823e-02   0.369   0.7126    
## L(train_data.Volume, 21)  -3.565e-02  7.884e-02  -0.452   0.6517    
## L(train_data.Volume, 22)   4.727e-03  7.951e-02   0.059   0.9527    
## L(train_data.Volume, 23)   3.427e-02  7.930e-02   0.432   0.6661    
## L(train_data.Volume, 24)   9.331e-02  7.921e-02   1.178   0.2404    
## L(train_data.Volume, 25)   3.548e-02  7.953e-02   0.446   0.6560    
## L(train_data.Volume, 26)   1.835e-02  7.926e-02   0.232   0.8172    
## L(train_data.Volume, 27)   3.886e-02  7.925e-02   0.490   0.6245    
## L(train_data.Volume, 28)  -1.143e-01  7.923e-02  -1.442   0.1510    
## L(train_data.Volume, 29)   3.922e-02  7.916e-02   0.495   0.6209    
## L(train_data.Volume, 30)   5.443e-02  7.979e-02   0.682   0.4961    
## L(train_data.Volume, 31)   8.862e-03  8.012e-02   0.111   0.9120    
## L(train_data.Volume, 32)   7.218e-02  7.536e-02   0.958   0.3394    
## L(train_data.Volume, 91)  -7.935e-02  7.536e-02  -1.053   0.2938    
## L(train_data.Volume, 92)   1.477e-02  8.012e-02   0.184   0.8539    
## L(train_data.Volume, 93)  -1.156e-01  7.979e-02  -1.448   0.1493    
## L(train_data.Volume, 94)   8.855e-02  7.916e-02   1.119   0.2648    
## L(train_data.Volume, 95)  -5.780e-02  7.923e-02  -0.729   0.4667    
## L(train_data.Volume, 96)   1.655e-02  7.925e-02   0.209   0.8349    
## L(train_data.Volume, 97)  -3.889e-02  7.926e-02  -0.491   0.6243    
## L(train_data.Volume, 98)  -2.589e-02  7.953e-02  -0.326   0.7452    
## L(train_data.Volume, 99)   5.621e-02  7.921e-02   0.710   0.4789    
## L(train_data.Volume, 100) -5.450e-02  7.930e-02  -0.687   0.4928    
## L(train_data.Volume, 101)  1.154e-02  7.951e-02   0.145   0.8847    
## L(train_data.Volume, 102) -2.835e-03  7.884e-02  -0.036   0.9714    
## L(train_data.Volume, 103)  9.399e-03  7.823e-02   0.120   0.9045    
## L(train_data.Volume, 104) -5.236e-02  7.834e-02  -0.668   0.5048    
## L(train_data.Volume, 105) -1.545e-02  7.843e-02  -0.197   0.8441    
## L(train_data.Volume, 106) -9.298e-02  7.842e-02  -1.186   0.2373    
## L(train_data.Volume, 107)  5.782e-02  7.866e-02   0.735   0.4632    
## L(train_data.Volume, 108) -3.582e-02  7.875e-02  -0.455   0.6498    
## L(train_data.Volume, 109) -3.773e-02  7.876e-02  -0.479   0.6325    
## L(train_data.Volume, 110) -4.380e-02  7.831e-02  -0.559   0.5766    
## L(train_data.Volume, 111) -2.899e-02  7.817e-02  -0.371   0.7112    
## L(train_data.Volume, 112)  1.577e-01  7.791e-02   2.024   0.0445 *  
## L(train_data.Volume, 113) -7.961e-02  7.844e-02  -1.015   0.3115    
## L(train_data.Volume, 114) -5.643e-02  7.854e-02  -0.718   0.4735    
## L(train_data.Volume, 115) -5.065e-03  7.897e-02  -0.064   0.9489    
## L(train_data.Volume, 116)  1.731e-02  7.844e-02   0.221   0.8256    
## L(train_data.Volume, 117)  8.516e-02  7.851e-02   1.085   0.2795    
## L(train_data.Volume, 118) -3.027e-02  7.873e-02  -0.384   0.7011    
## L(train_data.Volume, 119) -1.051e-01  7.871e-02  -1.336   0.1833    
## L(train_data.Volume, 120)  6.780e-02  7.888e-02   0.860   0.3912    
## L(train_data.Volume, 121) -4.937e-02  7.812e-02  -0.632   0.5282    
## L(train_data.Volume, 122) -1.172e-02  7.483e-02  -0.157   0.8757    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1928000 on 178 degrees of freedom
## Multiple R-squared:  0.3531, Adjusted R-squared:  0.1204 
## F-statistic: 1.518 on 64 and 178 DF,  p-value: 0.01726
Volume.testing.AR1to32and91to122 <- predict(object=Volume.training.AR1to32and91to122, n.ahead = length(test_data.Volume))
fitted_training.Volume.AR1to32and91to122 <- fitted(Volume.training.AR1to32and91to122)
Volume.1to32and91to122.training.mse_value <- mse(train_data.Volume, fitted_training.Volume.AR1to32and91to122)
Volume.1to32and91to122.training.rmse_value <- rmse(train_data.Volume, fitted_training.Volume.AR1to32and91to122)
Volume.1to32and91to122.testing.mse_value <- mse(test_data.Volume, Volume.testing.AR1to32and91to122)
Volume.1to32and91to122.testing.rmse_value <- rmse(test_data.Volume, Volume.testing.AR1to32and91to122)
cat("Training Model MSE:", Volume.1to32and91to122.training.mse_value, "\n Training Model RMSE:", Volume.1to32and91to122.training.rmse_value, "\n Testing Model MSE:", Volume.1to32and91to122.testing.mse_value, "\n Testing Model RMSE:", Volume.1to32and91to122.testing.rmse_value, "\n")
## Training Model MSE: 2.723629e+12 
##  Training Model RMSE: 1650342 
##  Testing Model MSE: 4.663293e+12 
##  Testing Model RMSE: 2159466
cat(" Training Model AIC:", AIC(Volume.training.AR1to32and91to122), "\n Training Model BIC:", BIC(Volume.training.AR1to32and91to122), "\n")
##  Training Model AIC: 7779.42 
##  Training Model BIC: 8009.962

The AR(1:32,91:122) model of variable Volume is not a good fit. To start with, the training model has a R^2 of 0.3531, and adjusted R^2 0.1204, suggesting that the model can not well explain the relation between the lags and the response variable . We obtained MSE (2.723629e+12) and RMSE (1650342) for the training model. Upon testing the model using the last ⅓ of the dataset, we obtain a MSE and RMSE of 4.663293e+12 and 2159466 for the testing results, which are also large values.

Comparing the MSE and RMSE of the testing results of the two AR models for Volume. We can conclude that the first AR mode AR(1:32) is slightly better than AR(1:32,91:122) as it has smaller MSE and RMSE for the testing results. However, the latter has a bigger MSE and RMSE for the training set. Based on the AIC and BIC results, AR(1:32,91:122) has a smaller AIC 7779.42, BIC: 8009.962 than AR(1:32): 10527.98, BIC:10657.46, which is NOT consistent with the conclusion we draw from comparing MSE and RMSE of the tests results. While the MSE and RMSE of the testing set suggest that we should choose AR(1:32) over AR(1:32,91:122), the training sets MSE and RMSE, as well as AIC and BIC, suggest otherwise. In this case, we would choose AR(1:32) since we want the model to more accurately predict future value (that is, to have better test results) and therefore perform better with small testing result MSE and RMSE, so we go with the MSE and RMS for test results. This result is not consistent with AIC and BIC results. However, none of the AR models are good fit, so we conclude that although one is slightly better than the other, we wouldn’t use them as none of them have good fit.

AR Models Forecasting

Computation and Plot of 10 steps ahead forecast for Open.ts.diff with lag 35 and 110

Open.forecast.AR35n110 <- predict(AR.Open.ts.diff.lag35n110, n.ahead = 10)
Open.forecast.AR35n110 <- ts(Open.forecast.AR35n110, start = end(Open.ts.diff)[1] + 1, frequency = frequency(Open.ts.diff))
ts.plot(Open.ts.diff, Open.forecast.AR35n110, col = c("black", "red"), lty = c(1, 2), xlab = "Time", ylab = "Open.ts.diff")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Open.forecast.AR35n110)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 254) 
## Frequency = 365 
##   2015(112)   2015(113)   2015(114)   2015(115)   2015(116)   2015(117) 
##  -3.9341445  -3.8336935  -4.4867623  -4.2573869  -3.6054409  -4.0261658 
##   2015(118)   2015(119)   2015(120)   2015(121)   2015(122)   2015(123) 
##  -1.9726189  -3.7738016  -4.2852429  -3.2060978  -3.7018901  -4.2804409 
##   2015(124)   2015(125)   2015(126)   2015(127)   2015(128)   2015(129) 
##  -4.3033205  -3.5079096  -3.3289227  -3.3959020  -3.5304675  -4.8855487 
##   2015(130)   2015(131)   2015(132)   2015(133)   2015(134)   2015(135) 
##  -3.9826967  -3.6868237  -4.2343912  -4.1253310  -3.9348972  -3.8786652 
##   2015(136)   2015(137)   2015(138)   2015(139)   2015(140)   2015(141) 
##  -2.9468936  -3.9109951  -3.1820922  -3.4411947  -3.8504509  -3.6667630 
##   2015(142)   2015(143)   2015(144)   2015(145)   2015(146)   2015(147) 
##  -4.2851708  -3.8306524  -3.9312492  -3.2042377  -4.5128560  -8.1444765 
##   2015(148)   2015(149)   2015(150)   2015(151)   2015(152)   2015(153) 
##  -3.7096604  -3.5717398  -4.4830166  -3.9200445  -3.4986210  -4.0699608 
##   2015(154)   2015(155)   2015(156)   2015(157)   2015(158)   2015(159) 
##  -3.8111726  -4.5278229  -4.0662890  -4.9656790  -3.9887261  -4.1833509 
##   2015(160)   2015(161)   2015(162)   2015(163)   2015(164)   2015(165) 
##  -3.1535084  -4.2104742  -3.0390468  -4.1318637  -4.2798218  -3.9126958 
##   2015(166)   2015(167)   2015(168)   2015(169)   2015(170)   2015(171) 
##  -3.7765595  -4.2548427  -4.0767429  -4.1198936  -4.5804938  -3.2499069 
##   2015(172)   2015(173)   2015(174)   2015(175)   2015(176)   2015(177) 
##  -3.2587738  -4.5546209  -3.9937680  -4.0039698  -3.8455940  -3.5003383 
##   2015(178)   2015(179)   2015(180)   2015(181)   2015(182)   2015(183) 
##  -4.0239761  -3.4648747  -3.8993523  -4.2129769  -4.6160207  -4.0008266 
##   2015(184)   2015(185)   2015(186)   2015(187)   2015(188)   2015(189) 
##  -4.4484975  -3.7655233  -4.0279011  -4.0727475  -6.1308075  -4.1655269 
##   2015(190)   2015(191)   2015(192)   2015(193)   2015(194)   2015(195) 
##  -4.1562078  -3.8821182  -3.9998548  -3.2801228  -4.2644661  -4.8341135 
##   2015(196)   2015(197)   2015(198)   2015(199)   2015(200)   2015(201) 
##  -3.4210472  -3.9385579  -3.5092757  -4.6515331  -3.8086194  -4.2885548 
##   2015(202)   2015(203)   2015(204)   2015(205)   2015(206)   2015(207) 
##  -3.2439501  -3.8242482  -3.0526475  -3.7455981  -4.0414891  -3.8980927 
##   2015(208)   2015(209)   2015(210)   2015(211)   2015(212)   2015(213) 
##  -4.5150999  -4.0511414  -4.4580303  -3.4306181  -3.4551086  -3.6862881 
##   2015(214)   2015(215)   2015(216)   2015(217)   2015(218)   2015(219) 
##  -4.3866435  -3.7301119  -3.9797217  -4.0406242  -4.2266082  -4.1349761 
##   2015(220)   2015(221)   2015(222)   2015(223)   2015(224)   2015(225) 
##  -3.0924017  -4.5788378 -20.4445487  -3.5202038  -3.6542862  -3.9697838 
##   2015(226)   2015(227)   2015(228)   2015(229)   2015(230)   2015(231) 
##  -3.9761423  -4.0964379  -3.6116476  -3.8599586  -4.5354932  -3.9987654 
##   2015(232)   2015(233)   2015(234)   2015(235)   2015(236)   2015(237) 
##  -4.0976324  -3.8901633  -3.9401939  -3.7321314  -4.0680932  -3.9206074 
##   2015(238)   2015(239)   2015(240)   2015(241)   2015(242)   2015(243) 
##  -3.8893889  -4.0474280  -4.3038237  -4.0550065  -4.0806550  -3.7652823 
##   2015(244)   2015(245)   2015(246)   2015(247)   2015(248)   2015(249) 
##  -3.6798497  -3.5861113  -3.9088343  -3.8421521  -3.4030386  -2.7746602 
##   2015(250)   2015(251)   2015(252)   2015(253)   2015(254)   2015(255) 
##  -3.9880511  -4.1391361  -4.1365937  -4.2467106  -3.9931231  -3.7169310 
##   2015(256)   2015(257)   2015(258)   2015(259)   2015(260)   2015(261) 
##  -4.0537308  -3.9366779  -3.9353081  -4.2282097  -3.3534569  -4.1247142 
##   2015(262)   2015(263)   2015(264)   2015(265)   2015(266)   2015(267) 
##  -3.5682763  -3.9526653  -3.7445593  -3.4627973  -3.6204023  -4.2165489 
##   2015(268)   2015(269)   2015(270)   2015(271)   2015(272)   2015(273) 
##  -3.9430240  -3.6358486  -4.0477684  -4.2450567  -4.3466072  -4.0580701 
##   2015(274)   2015(275)   2015(276)   2015(277)   2015(278)   2015(279) 
##  -4.0378375  -3.9516303  -3.8146613  -3.3204380  -4.6698984  -3.7795417 
##   2015(280)   2015(281)   2015(282)   2015(283)   2015(284)   2015(285) 
##  -3.7841071  -4.0086331  -4.2278750  -4.3477941  -0.2215693  -3.9594186 
##   2015(286)   2015(287)   2015(288)   2015(289)   2015(290)   2015(291) 
##  -3.6850778  -3.9273260  -3.9852951  -3.7186467  -3.8945352  -3.7050249 
##   2015(292)   2015(293)   2015(294)   2015(295)   2015(296)   2015(297) 
##  -3.6331778  -4.0924515  -3.6993008  -3.4592380  -4.6546292  -3.4600902 
##   2015(298)   2015(299)   2015(300)   2015(301)   2015(302)   2015(303) 
##  -3.2687952  -3.7221827  -3.6131660  -4.3585756  -4.5196199  -3.9605984 
##   2015(304)   2015(305)   2015(306)   2015(307)   2015(308)   2015(309) 
##  -2.8540273  -5.4916276  -4.2116487  -3.7871292  -3.9088416  -3.6827743 
##   2015(310)   2015(311)   2015(312)   2015(313)   2015(314)   2015(315) 
##  -3.7761759  -3.5793329  -3.5223826  -3.7285340  -3.9375376  -4.0969265 
##   2015(316)   2015(317)   2015(318)   2015(319)   2015(320)   2015(321) 
##  -3.7576027  -4.0533598  -4.0481159  -3.9875751  -3.7441865  -4.0137143 
##   2015(322)   2015(323)   2015(324)   2015(325)   2015(326)   2015(327) 
##  -4.1880396  -4.1065424  -3.8145421  -3.9826643  -4.2762407  -4.1613613 
##   2015(328)   2015(329)   2015(330)   2015(331)   2015(332)   2015(333) 
##  -4.1183750  -4.5965263  -4.3384347  -3.6632145  -3.9597876  -3.7621702 
##   2015(334)   2015(335)   2015(336)   2015(337)   2015(338)   2015(339) 
##  -4.1361015  -3.4483303  -3.7869101  -3.7190156  -4.0414475  -4.1967037 
##   2015(340)   2015(341)   2015(342)   2015(343)   2015(344)   2015(345) 
##  -4.1975630  -3.8785568  -4.1572082  -4.1340819  -3.8822667  -3.5055248 
##   2015(346)   2015(347)   2015(348)   2015(349)   2015(350)   2015(351) 
##  -4.1816207  -3.6259955  -3.7861628  -3.6385340  -3.7715291  -4.3669084 
##   2015(352)   2015(353)   2015(354)   2015(355)   2015(356)   2015(357) 
##  -3.4998445  -3.9797797  -3.8766423  -4.2881401  -3.7685558  -4.0431230 
##   2015(358)   2015(359)   2015(360)   2015(361)   2015(362)   2015(363) 
##  -4.1009710  10.2725577  -3.9341445  -3.8336935  -4.4867623  -4.2573869 
##   2015(364)   2015(365) 
##  -3.6054409  -4.0261658

Computation and Plot of 10 steps ahead forecast for Open.ts.diff with lag 110

Open.forecast.AR110 <- predict(AR.Open.ts.diff.lag110, n.ahead = 10)
Open.forecast.AR110 <- ts(Open.forecast.AR110, start = end(Open.ts.diff)[1] + 1, frequency = frequency(Open.ts.diff))
ts.plot(Open.ts.diff, Open.forecast.AR110, col = c("black", "red"), lty = c(1, 2), xlab = "Time", ylab = "Open.ts.diff")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Open.forecast.AR110)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 254) 
## Frequency = 365 
##  2015(112)  2015(113)  2015(114)  2015(115)  2015(116)  2015(117)  2015(118) 
##  -3.888687  -3.323938  -4.422646  -4.181190  -3.604287  -4.027241  -2.124759 
##  2015(119)  2015(120)  2015(121)  2015(122)  2015(123)  2015(124)  2015(125) 
##  -3.682072  -4.088821  -3.343385  -3.730687  -4.391857  -4.148780  -3.541087 
##  2015(126)  2015(127)  2015(128)  2015(129)  2015(130)  2015(131)  2015(132) 
##  -3.236431  -3.529744  -3.597805  -5.088677  -4.019139  -3.670728  -4.262216 
##  2015(133)  2015(134)  2015(135)  2015(136)  2015(137)  2015(138)  2015(139) 
##  -4.013467  -3.888687  -3.761477  -3.059795  -4.019139  -3.241292  -3.330421 
##  2015(140)  2015(141)  2015(142)  2015(143)  2015(144)  2015(145)  2015(146) 
##  -3.897600  -3.669108  -4.250872  -3.772010  -3.882205  -3.379036  -4.399959 
##  2015(147)  2015(148)  2015(149)  2015(150)  2015(151)  2015(152)  2015(153) 
##  -4.278421  -3.777682  -3.636697  -4.466400  -3.940544  -3.480318  -4.148780 
##  2015(154)  2015(155)  2015(156)  2015(157)  2015(158)  2015(159)  2015(160) 
##  -3.776062  -4.472072  -4.068564  -4.925005  -4.002933  -4.182810  -3.192677 
##  2015(161)  2015(162)  2015(163)  2015(164)  2015(165)  2015(166)  2015(167) 
##  -4.172277  -3.029005  -4.135005  -4.260595  -3.834400  -3.743651  -4.231426 
##  2015(168)  2015(169)  2015(170)  2015(171)  2015(172)  2015(173)  2015(174) 
##  -4.132575  -4.179569  -4.651139  -3.263979  -3.299631  -4.685170  -4.260595 
##  2015(175)  2015(176)  2015(177)  2015(178)  2015(179)  2015(180)  2015(181) 
##  -4.002933  -3.816574  -3.469785  -3.957559  -3.487610  -3.962421  -4.173087 
##  2015(182)  2015(183)  2015(184)  2015(185)  2015(186)  2015(187)  2015(188) 
##  -4.617918  -4.003744  -4.391857  -3.888687  -3.976195  -4.145539  -6.140390 
##  2015(189)  2015(190)  2015(191)  2015(192)  2015(193)  2015(194)  2015(195) 
##  -4.229805  -4.280041  -3.952698  -3.946216  -3.281805  -4.343241  -4.796985 
##  2015(196)  2015(197)  2015(198)  2015(199)  2015(200)  2015(201)  2015(202) 
##  -3.354728  -3.824677  -3.473836  -4.617108  -3.804421  -4.343241  -3.370933 
##  2015(203)  2015(204)  2015(205)  2015(206)  2015(207)  2015(208)  2015(209) 
##  -3.657764  -3.084103  -3.793887  -4.017518  -3.832780  -4.432369  -4.148780 
##  2015(210)  2015(211)  2015(212)  2015(213)  2015(214)  2015(215)  2015(216) 
##  -4.453436  -3.457631  -3.485180  -3.690174  -4.422646  -3.746892  -3.938113 
##  2015(217)  2015(218)  2015(219)  2015(220)  2015(221)  2015(222)  2015(223) 
##  -4.100164  -4.201446  -4.160934  -3.193487  -4.439662 -20.597798  -3.656144 
##  2015(224)  2015(225)  2015(226)  2015(227)  2015(228)  2015(229)  2015(230) 
##  -3.668298  -4.025621  -3.861949  -4.025621  -3.612390  -4.100164  -4.194154 
##  2015(231)  2015(232)  2015(233)  2015(234)  2015(235)  2015(236)  2015(237) 
##  -3.941354  -4.132575  -3.889498  -3.954318  -3.776062  -4.116369  -3.986728 
##  2015(238)  2015(239)  2015(240)  2015(241)  2015(242)  2015(243)  2015(244) 
##  -3.938113  -4.035344  -4.286523  -4.090441  -4.053169  -3.711241  -3.695036 
##  2015(245)  2015(246)  2015(247)  2015(248)  2015(249)  2015(250)  2015(251) 
##  -3.651282  -3.884636  -3.769580  -3.393621  -2.803754  -3.955128  -4.074236 
##  2015(252)  2015(253)  2015(254)  2015(255)  2015(256)  2015(257)  2015(258) 
##  -4.078287  -4.236287  -3.848985  -3.678831  -4.123662  -3.947026  -3.938113 
##  2015(259)  2015(260)  2015(261)  2015(262)  2015(263)  2015(264)  2015(265) 
##  -4.197395  -3.419549  -4.173087  -3.638318  -3.925149  -3.675590  -3.419549 
##  2015(266)  2015(267)  2015(268)  2015(269)  2015(270)  2015(271)  2015(272) 
##  -3.646421  -4.181190  -3.938113  -3.614010  -4.116369  -4.231426  -4.439662 
##  2015(273)  2015(274)  2015(275)  2015(276)  2015(277)  2015(278)  2015(279) 
##  -4.099354  -4.103405  -3.967282  -3.717723  -3.399292  -4.664913  -3.808472 
##  2015(280)  2015(281)  2015(282)  2015(283)  2015(284)  2015(285)  2015(286) 
##  -3.741221  -4.053980  -4.230616  -4.310021  -3.531364  -3.973764  -3.830349 
##  2015(287)  2015(288)  2015(289)  2015(290)  2015(291)  2015(292)  2015(293) 
##  -3.817385  -3.931631  -3.798749  -3.876533  -4.129333  -3.695036  -4.060462 
##  2015(294)  2015(295)  2015(296)  2015(297)  2015(298)  2015(299)  2015(300) 
##  -3.840072  -3.509487  -4.553098  -3.413067  -3.362831  -3.887877  -3.710431 
##  2015(301)  2015(302)  2015(303)  2015(304)  2015(305)  2015(306)  2015(307) 
##  -4.441282  -4.255734  -3.944595  -2.917190  -5.421693  -4.197395  -3.801180 
##  2015(308)  2015(309)  2015(310)  2015(311)  2015(312)  2015(313)  2015(314) 
##  -3.952698  -3.889498  -3.759856  -3.743651  -3.665867  -3.740410  -4.002933 
##  2015(315)  2015(316)  2015(317)  2015(318)  2015(319)  2015(320)  2015(321) 
##  -4.027241  -3.798749  -4.069375  -4.181190  -3.883015  -3.667487  -4.053980 
##  2015(322)  2015(323)  2015(324)  2015(325)  2015(326)  2015(327)  2015(328) 
##  -4.261405  -3.986728  -3.816574  -4.092062  -4.230616  -4.202257  -3.997262 
##  2015(329)  2015(330)  2015(331)  2015(332)  2015(333)  2015(334)  2015(335) 
##  -4.570113  -4.112318  -3.650472  -3.905703  -3.938113  -4.084769  -3.661815 
##  2015(336)  2015(337)  2015(338)  2015(339)  2015(340)  2015(341)  2015(342) 
##  -3.743651  -3.646421  -4.068564  -4.245200  -4.132575  -3.836021  -4.104216 
##  2015(343)  2015(344)  2015(345)  2015(346)  2015(347)  2015(348)  2015(349) 
##  -3.971333  -4.041826  -3.656144  -4.011036  -3.553241  -3.773631  -3.669108 
##  2015(350)  2015(351)  2015(352)  2015(353)  2015(354)  2015(355)  2015(356) 
##  -3.883015  -4.365928  -3.606718  -3.977005  -3.824677  -4.133385  -3.755805 
##  2015(357)  2015(358)  2015(359)  2015(360)  2015(361)  2015(362)  2015(363) 
##  -3.940544  -4.115559  10.302957  -3.888687  -3.323938  -4.422646  -4.181190 
##  2015(364)  2015(365) 
##  -3.604287  -4.027241

Computation and Plot of 10 steps ahead forecast for Close.ts.diff with lag 110

Close.forecast.AR110 <- predict(AR.Close.ts.diff.lag110, n.ahead = 10)
Close.forecast.AR110 <- ts(Close.forecast.AR110, start = end(Close.ts.diff)[1] + 1, frequency = frequency(Close.ts.diff))
ts.plot(Close.ts.diff, Close.forecast.AR110, col = c("black", "red"), lty = c(1, 2), xlab = "Time", ylab = "Close.ts.diff")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Close.forecast.AR110)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 254) 
## Frequency = 365 
##    2015(112)    2015(113)    2015(114)    2015(115)    2015(116)    2015(117) 
##  -5.74419933  -2.82378561  -1.55358784  -4.21111227  -4.23974378  -8.98216249 
##    2015(118)    2015(119)    2015(120)    2015(121)    2015(122)    2015(123) 
##  -5.88475400  -2.31622707  -5.79365375  -4.01589745  -2.89406294  -2.90187154 
##    2015(124)    2015(125)    2015(126)    2015(127)    2015(128)    2015(129) 
##  -4.85401975  -6.10339460  -5.10649758  -4.69264216   0.36472314  -4.14343780 
##    2015(130)    2015(131)    2015(132)    2015(133)    2015(134)    2015(135) 
##  -3.77383107  -3.53697042  -3.46148736  -2.89406294  -4.86703407  -6.37669535 
##    2015(136)    2015(137)    2015(138)    2015(139)    2015(140)    2015(141) 
##  -5.63487903  -4.68223070  -5.25486084  -4.06535187  -5.09608612  -2.93831164 
##    2015(142)    2015(143)    2015(144)    2015(145)    2015(146)    2015(147) 
##  -2.82118274  -4.64839347  -5.19239210  -1.55879357  -2.81337415  -4.09918910 
##    2015(148)    2015(149)    2015(150)    2015(151)    2015(152)    2015(153) 
##  -6.05654304  -0.62696815  -4.12261488  -5.32253532  -3.47710454  -4.04452895 
##    2015(154)    2015(155)    2015(156)    2015(157)    2015(158)    2015(159) 
##  -2.51664762  -2.31622707  -0.72847986  -4.13823207  -2.90187154  -5.60364466 
##    2015(160)    2015(161)    2015(162)    2015(163)    2015(164)    2015(165) 
##  -3.83369695  -6.13202611  -2.36307863  -3.15174651  -3.77383107  -5.12992336 
##    2015(166)    2015(167)    2015(168)    2015(169)    2015(170)    2015(171) 
##  -2.47500179  -2.57911636  -4.12261488   0.06279088  -6.62917319  -5.07005748 
##    2015(172)    2015(173)    2015(174)    2015(175)    2015(176)    2015(177) 
##  -3.22202384  -1.41303317  -3.94562011  -2.75090541  -5.86132822  -4.47660443 
##    2015(178)    2015(179)    2015(180)    2015(181)    2015(182)    2015(183) 
##  -4.71086221  -3.97685448  -2.41773878  -2.73268536  -2.92269445  -1.27247850 
##    2015(184)    2015(185)    2015(186)    2015(187)    2015(188)    2015(189) 
##  -4.26837528  -3.46929595  -2.90707726   2.87648717  -3.17517228  -2.48801611 
##    2015(190)    2015(191)    2015(192)    2015(193)    2015(194)    2015(195) 
##  -3.73739097  -2.74049395  -6.37148962  -2.14443803  -1.60564512  -4.86703407 
##    2015(196)    2015(197)    2015(198)    2015(199)    2015(200)    2015(201) 
##  -4.45057578  -5.58282174  -1.30111000  -4.22412659  -2.58432209  -5.12732050 
##    2015(202)    2015(203)    2015(204)    2015(205)    2015(206)    2015(207) 
##  -5.35376969  -5.24965512  -5.02320592  -3.78424253  -3.62026208  -2.18087813 
##    2015(208)    2015(209)    2015(210)    2015(211)    2015(212)    2015(213) 
##  -3.22983243  -1.70455397  -6.22833209  -4.06535187  -5.00758874  -1.68633392 
##    2015(214)    2015(215)    2015(216)    2015(217)    2015(218)    2015(219) 
##  -4.36207840  -4.09658624  -2.87063716  -3.12051213  -3.31052123  -5.51514727 
##    2015(220)    2015(221)    2015(222)    2015(223)    2015(224)    2015(225) 
##  -2.22252396  -2.54788199  47.53122677  -4.18768649  -3.53436756  -4.04973468 
##    2015(226)    2015(227)    2015(228)    2015(229)    2015(230)    2015(231) 
##  -3.38079856  -5.20800929  -2.50363330  -3.44847303  -3.48231027  -4.49482447 
##    2015(232)    2015(233)    2015(234)    2015(235)    2015(236)    2015(237) 
##  -2.93831164  -3.42244439  -4.40372423  -3.23503816  -3.84410840  -3.35997565 
##    2015(238)    2015(239)    2015(240)    2015(241)    2015(242)    2015(243) 
##  -3.57861625  -2.52705908  -2.70925958  -3.69834801  -4.38290131  -4.82278537 
##    2015(244)    2015(245)    2015(246)    2015(247)    2015(248)    2015(249) 
##  -4.38810704  -3.98726594  -4.39070990  -3.69314228  -9.52355827  -3.22983243 
##    2015(250)    2015(251)    2015(252)    2015(253)    2015(254)    2015(255) 
##  -3.45628163  -3.18298088  -2.56349918  -3.59683630  -4.89826844  -2.92269445 
##    2015(256)    2015(257)    2015(258)    2015(259)    2015(260)    2015(261) 
##  -4.09138051  -3.82328549  -2.59473355  -5.23924366  -3.75561102  -4.17467217 
##    2015(262)    2015(263)    2015(264)    2015(265)    2015(266)    2015(267) 
##  -3.22462671  -4.92950281  -5.55939597  -4.43235573  -3.26887540  -3.35476992 
##    2015(268)    2015(269)    2015(270)    2015(271)    2015(272)    2015(273) 
##  -4.88004839  -4.30741825  -1.59002794  -4.52345598  -0.71286268  -3.39121002 
##    2015(274)    2015(275)    2015(276)    2015(277)    2015(278)    2015(279) 
##  -2.62857079  -4.67181925  -5.19499497  -2.85762284  -3.44326731  -4.26837528 
##    2015(280)    2015(281)    2015(282)    2015(283)    2015(284)    2015(285) 
##  -3.71917092  -2.40212159  -2.93310591  -3.72697951  -5.28088949  -3.29490404 
##    2015(286)    2015(287)    2015(288)    2015(289)    2015(290)    2015(291) 
##  -4.26056669  -4.19289222  -3.69574514  -3.85191700  -3.87013705  -3.73478811 
##    2015(292)    2015(293)    2015(294)    2015(295)    2015(296)    2015(297) 
##  -3.87013705  -4.18248076  -4.98936869  -1.90237165  -4.57291040  -5.81187380 
##    2015(298)    2015(299)    2015(300)    2015(301)    2015(302)    2015(303) 
##  -4.30221252  -4.17727503  -2.31102134  -2.61035074  -3.66971650  -5.55939597 
##    2015(304)    2015(305)    2015(306)    2015(307)    2015(308)    2015(309) 
##  -1.40782744  -2.50103044  -3.63067353  -3.71136233  -3.59683630  -4.61195337 
##    2015(310)    2015(311)    2015(312)    2015(313)    2015(314)    2015(315) 
##  -4.45317865  -4.37248985  -4.32303543  -3.84150554  -3.58121911  -3.92219433 
##    2015(316)    2015(317)    2015(318)    2015(319)    2015(320)    2015(321) 
##  -3.30010977  -3.22462671  -3.50313318  -4.46879583  -3.27147826  -3.00078038 
##    2015(322)    2015(323)    2015(324)    2015(325)    2015(326)    2015(327) 
##  -4.52605885  -3.53176469  -2.12361512  -3.91959147  -3.37038711  -2.65199656 
##    2015(328)    2015(329)    2015(330)    2015(331)    2015(332)    2015(333) 
##  -2.75090541  -1.56399930  -5.17156919  -3.96384016  -3.79205112  -3.07105771 
##    2015(334)    2015(335)    2015(336)    2015(337)    2015(338)    2015(339) 
##  -4.31002111  -4.45057578  -4.84621115  -3.26106681  -2.77172832  -3.57080766 
##    2015(340)    2015(341)    2015(342)    2015(343)    2015(344)    2015(345) 
##  -3.27147826  -3.57861625  -3.62807067  -2.88104862  -4.72127367  -4.00808885 
##    2015(346)    2015(347)    2015(348)    2015(349)    2015(350)    2015(351) 
##  -4.59373332  -4.14343780  -4.67702497  -4.31002111  -2.47760466  -4.78113955 
##    2015(352)    2015(353)    2015(354)    2015(355)    2015(356)    2015(357) 
##  -2.69884812  -4.61455623  -3.49011886  -4.16165785  -3.72177378  -2.76652259 
##    2015(358)    2015(359)    2015(360)    2015(361)    2015(362)    2015(363) 
##  -4.71867080 -48.96215784  -5.74419933  -2.82378561  -1.55358784  -4.21111227 
##    2015(364)    2015(365) 
##  -4.23974378  -8.98216249

Computation and Plot of 10 steps ahead forecast for Close.ts.diff with lags 1 to 110

Close.forecast.AR1to110 <- predict(AR.Close.ts.diff.lag1to110, n.ahead = 10)
Close.forecast.AR1to110 <- ts(Close.forecast.AR1to110, start = end(Close.ts.diff)[1] + 1, frequency = frequency(Close.ts.diff))
ts.plot(Close.ts.diff, Close.forecast.AR1to110, col = c("black", "red"), lty = c(1, 2), xlab = "Time", ylab = "Close.ts.diff")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Close.forecast.AR1to110)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 254) 
## Frequency = 365 
##     2015(112)     2015(113)     2015(114)     2015(115)     2015(116) 
## -119.75580844  -34.33421570  -14.63715766   47.10859309  -27.83906279 
##     2015(117)     2015(118)     2015(119)     2015(120)     2015(121) 
##    2.24071865  -81.37420041  -10.50944205   33.05919185  -46.10908511 
##     2015(122)     2015(123)     2015(124)     2015(125)     2015(126) 
##   31.32269232   -4.52721425   55.19809930  -83.49929277  -46.33796439 
##     2015(127)     2015(128)     2015(129)     2015(130)     2015(131) 
##  -52.30084756   13.41684331   23.15837461   -5.58802356   18.23840048 
##     2015(132)     2015(133)     2015(134)     2015(135)     2015(136) 
##   51.61529851   46.91581776   -4.32132558   -9.70071455  -81.02986881 
##     2015(137)     2015(138)     2015(139)     2015(140)     2015(141) 
##    9.03543417   50.38784010  -22.00664918  -31.43541408  -10.84682694 
##     2015(142)     2015(143)     2015(144)     2015(145)     2015(146) 
##   72.15007521  -25.24360438    3.25501770  -27.94898571   -7.46706289 
##     2015(147)     2015(148)     2015(149)     2015(150)     2015(151) 
##  -96.60231428  -38.40904290    5.28964543   23.13399642  -35.75696269 
##     2015(152)     2015(153)     2015(154)     2015(155)     2015(156) 
##  -29.40303725   15.50191552    4.51664306   38.98791433   21.56992968 
##     2015(157)     2015(158)     2015(159)     2015(160)     2015(161) 
##    8.61265052   55.55528998  -15.75407122  -13.70948269  -41.78839059 
##     2015(162)     2015(163)     2015(164)     2015(165)     2015(166) 
##  -55.05448015   18.04693893   36.33573800  -70.08177519   22.79951342 
##     2015(167)     2015(168)     2015(169)     2015(170)     2015(171) 
##   11.16558379  -33.73896983   15.06336189   33.53141280  -47.75902163 
##     2015(172)     2015(173)     2015(174)     2015(175)     2015(176) 
##  -47.49490847   53.16677320   33.38813541   36.39144800   15.43057058 
##     2015(177)     2015(178)     2015(179)     2015(180)     2015(181) 
##  -32.63196370  -62.50338717  -38.55389795  -35.94399660   17.27478945 
##     2015(182)     2015(183)     2015(184)     2015(185)     2015(186) 
##    7.17751839   47.21735384   25.64721844  -74.74346271   77.51073945 
##     2015(187)     2015(188)     2015(189)     2015(190)     2015(191) 
##   23.98135258   43.15691450  -30.11316082   26.74657149    7.49680725 
##     2015(192)     2015(193)     2015(194)     2015(195)     2015(196) 
##  -35.67953268    1.57002225   44.25047134  -27.67995669    3.42790249 
##     2015(197)     2015(198)     2015(199)     2015(200)     2015(201) 
##   -5.72177514   10.41958754   78.07364248   26.45798733   11.22464226 
##     2015(202)     2015(203)     2015(204)     2015(205)     2015(206) 
##   -7.34134084  -40.58852034  -16.96422481  -14.01070722  -90.39894482 
##     2015(207)     2015(208)     2015(209)     2015(210)     2015(211) 
##    6.76899598   25.36472640   46.98506024    1.92976743  -34.64342694 
##     2015(212)     2015(213)     2015(214)     2015(215)     2015(216) 
##  -27.47068929    5.96273668   33.01414459  -35.84795312   40.89933873 
##     2015(217)     2015(218)     2015(219)     2015(220)     2015(221) 
##   91.72712617   -6.58883296    3.25602563  -24.77490413    8.69594629 
##     2015(222)     2015(223)     2015(224)     2015(225)     2015(226) 
##   24.50691029   -6.47767031    3.65715705  -20.01109850    3.25302427 
##     2015(227)     2015(228)     2015(229)     2015(230)     2015(231) 
##    0.97795137   -6.56936646   -6.20658609  -14.50252430   -1.08686989 
##     2015(232)     2015(233)     2015(234)     2015(235)     2015(236) 
##    7.34828208  -11.01752370    3.58301469   -5.89348704    6.21251875 
##     2015(237)     2015(238)     2015(239)     2015(240)     2015(241) 
##    2.37715061   -2.86807109   -2.42810764   -0.08656215   -8.77602682 
##     2015(242)     2015(243)     2015(244)     2015(245)     2015(246) 
##  -12.84284772  -10.87715196   -5.04467107   -8.53698676   -7.01307242 
##     2015(247)     2015(248)     2015(249)     2015(250)     2015(251) 
##    4.19478734   -3.72408198   16.50271591    7.52658247    4.20380997 
##     2015(252)     2015(253)     2015(254)     2015(255)     2015(256) 
##  -21.12953647   10.95827754  -17.08439784   69.13198608   -5.09492002 
##     2015(257)     2015(258)     2015(259)     2015(260)     2015(261) 
##  -16.11929674   15.06586064  -11.56590435   10.19521365  -50.01093144 
##     2015(262)     2015(263)     2015(264)     2015(265)     2015(266) 
##   48.46682876   12.02700598   43.30843365    7.33613406  -33.86478226 
##     2015(267)     2015(268)     2015(269)     2015(270)     2015(271) 
##  -28.47869130  -13.31408326  -28.50027153  -39.97285776   -2.83139780 
##     2015(272)     2015(273)     2015(274)     2015(275)     2015(276) 
##    8.01404463   61.32313600  -13.91965694  -93.80565739   -0.82006837 
##     2015(277)     2015(278)     2015(279)     2015(280)     2015(281) 
##   45.98196818   51.18778625  -66.47215042   -2.20635678   -8.91349672 
##     2015(282)     2015(283)     2015(284)     2015(285)     2015(286) 
##   28.45917582   -4.08931823   61.29767169   24.04026070   10.89386747 
##     2015(287)     2015(288)     2015(289)     2015(290)     2015(291) 
##  -21.88864702   35.78233056   20.79883170   -7.96746440    1.76150495 
##     2015(292)     2015(293)     2015(294)     2015(295)     2015(296) 
##  -24.55853107  -46.81053028  -26.80009015  -50.59567001   14.15220924 
##     2015(297)     2015(298)     2015(299)     2015(300)     2015(301) 
##   32.99031647   29.19675976   50.89271301  -38.51076680  -48.03151763 
##     2015(302)     2015(303)     2015(304)     2015(305)     2015(306) 
##   46.65706875   -8.11161218   12.18647767   31.36882649  -28.04251579 
##     2015(307)     2015(308)     2015(309)     2015(310)     2015(311) 
##  -60.23375724   22.12240094   42.61717880  -35.06530497  -26.22304628 
##     2015(312)     2015(313)     2015(314)     2015(315)     2015(316) 
##  -22.90938884  -38.54126913   40.96602760   55.68762655   10.58279435 
##     2015(317)     2015(318)     2015(319)     2015(320)     2015(321) 
##   12.51335619  -15.85158396  -17.55988855  -49.30435918  -21.19635518 
##     2015(322)     2015(323)     2015(324)     2015(325)     2015(326) 
##   68.83825126  -36.20553465  -21.80161284  -39.56228329    9.56414771 
##     2015(327)     2015(328)     2015(329)     2015(330)     2015(331) 
##  -38.11111812   -5.31592699   14.81729951    9.44106934  -34.38462433 
##     2015(332)     2015(333)     2015(334)     2015(335)     2015(336) 
##    1.78362045  -37.40856240  -27.11864399  -16.65054321  -85.58754510 
##     2015(337)     2015(338)     2015(339)     2015(340)     2015(341) 
##  -22.34094757  -16.34573746    1.66238616   22.46974695   20.82592788 
##     2015(342)     2015(343)     2015(344)     2015(345)     2015(346) 
##   -8.00840157   65.21741292   -7.86221560  -13.37697619  -55.20023582 
##     2015(347)     2015(348)     2015(349)     2015(350)     2015(351) 
##  -25.64894616   56.44677233   13.08759342  -15.21812342  -38.11503738 
##     2015(352)     2015(353)     2015(354)     2015(355)     2015(356) 
##   26.30498644  -44.53909484  -80.38067796    7.93799246  -14.05860128 
##     2015(357)     2015(358)     2015(359)     2015(360)     2015(361) 
##   16.08879258   -6.36611388  -28.07210689 -119.75580844  -34.33421570 
##     2015(362)     2015(363)     2015(364)     2015(365) 
##  -14.63715766   47.10859309  -27.83906279    2.24071865

Computation and Plot of 10 steps ahead forecast for Turnover.ts with lag 1 to 4

Turnover.forecast.AR1to4 <- predict(AR.Turnover.ts.lag1.4, n.ahead = 10)
Turnover.forecast.AR1to4 <- ts(Turnover.forecast.AR1to4,  start = end(Turnover.ts)[1] + 1, frequency = frequency(Turnover.ts))
ts.plot(Turnover.ts, Turnover.forecast.AR1to4, col = c("black", "red"), lty = c(1, 2), xlab = "Time", ylab = "Turnover.ts")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Turnover.forecast.AR1to4)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 361) 
## Frequency = 365 
##      2015(5)      2015(6)      2015(7)      2015(8)      2015(9)     2015(10) 
## 4.173194e+14 3.981731e+14 5.142750e+14 1.051896e+15 5.321496e+14 4.410827e+14 
##     2015(11)     2015(12)     2015(13)     2015(14)     2015(15)     2015(16) 
## 6.286097e+14 4.594398e+14 4.082961e+14 3.673217e+14 4.069317e+14 4.347932e+14 
##     2015(17)     2015(18)     2015(19)     2015(20)     2015(21)     2015(22) 
## 4.511817e+14 4.562459e+14 5.348038e+14 5.361617e+14 5.694032e+14 5.119074e+14 
##     2015(23)     2015(24)     2015(25)     2015(26)     2015(27)     2015(28) 
## 4.652462e+14 4.157098e+14 3.911681e+14 5.064567e+14 4.184888e+14 3.926568e+14 
##     2015(29)     2015(30)     2015(31)     2015(32)     2015(33)     2015(34) 
## 4.679810e+14 3.987982e+14 4.003290e+14 4.019037e+14 3.969224e+14 4.453610e+14 
##     2015(35)     2015(36)     2015(37)     2015(38)     2015(39)     2015(40) 
## 4.671062e+14 4.161296e+14 3.885392e+14 4.204360e+14 4.029707e+14 3.968468e+14 
##     2015(41)     2015(42)     2015(43)     2015(44)     2015(45)     2015(46) 
## 4.295118e+14 3.433033e+14 4.119763e+14 3.862262e+14 3.470047e+14 3.916580e+14 
##     2015(47)     2015(48)     2015(49)     2015(50)     2015(51)     2015(52) 
## 4.212833e+14 3.892615e+14 4.011978e+14 3.940081e+14 3.933924e+14 4.111771e+14 
##     2015(53)     2015(54)     2015(55)     2015(56)     2015(57)     2015(58) 
## 3.817288e+14 3.704150e+14 4.109733e+14 3.994101e+14 3.686132e+14 4.071537e+14 
##     2015(59)     2015(60)     2015(61)     2015(62)     2015(63)     2015(64) 
## 3.969114e+14 5.552088e+14 4.757532e+14 3.621194e+14 4.696944e+14 4.240583e+14 
##     2015(65)     2015(66)     2015(67)     2015(68)     2015(69)     2015(70) 
## 4.107290e+14 4.436468e+14 4.681624e+14 4.823926e+14 4.240415e+14 3.881558e+14 
##     2015(71)     2015(72)     2015(73)     2015(74)     2015(75)     2015(76) 
## 4.148947e+14 4.492178e+14 3.929730e+14 5.046671e+14 4.569504e+14 4.958035e+14 
##     2015(77)     2015(78)     2015(79)     2015(80)     2015(81)     2015(82) 
## 5.240687e+14 1.037160e+15 6.611219e+14 4.599882e+14 5.833230e+14 5.482288e+14 
##     2015(83)     2015(84)     2015(85)     2015(86)     2015(87)     2015(88) 
## 5.176829e+14 4.409808e+14 4.730770e+14 4.196774e+14 3.827915e+14 3.734347e+14 
##     2015(89)     2015(90)     2015(91)     2015(92)     2015(93)     2015(94) 
## 4.123784e+14 3.922169e+14 3.697831e+14 3.695227e+14 3.861327e+14 4.488565e+14 
##     2015(95)     2015(96)     2015(97)     2015(98)     2015(99)    2015(100) 
## 3.754652e+14 4.456212e+14 4.166666e+14 3.532640e+14 3.607403e+14 4.180083e+14 
##    2015(101)    2015(102)    2015(103)    2015(104)    2015(105)    2015(106) 
## 4.557635e+14 5.875367e+14 3.922530e+14 3.682388e+14 4.279331e+14 4.026615e+14 
##    2015(107)    2015(108)    2015(109)    2015(110)    2015(111)    2015(112) 
## 3.749621e+14 3.752839e+14 4.086740e+14 3.850617e+14 4.299834e+14 4.483267e+14 
##    2015(113)    2015(114)    2015(115)    2015(116)    2015(117)    2015(118) 
## 3.654885e+14 3.743866e+14 4.002548e+14 3.316428e+14 3.807700e+14 3.765508e+14 
##    2015(119)    2015(120)    2015(121)    2015(122)    2015(123)    2015(124) 
## 3.799998e+14 3.979392e+14 3.929084e+14 3.699422e+14 3.735931e+14 3.831551e+14 
##    2015(125)    2015(126)    2015(127)    2015(128)    2015(129)    2015(130) 
## 3.873476e+14 3.414070e+14 3.192845e+14 3.491194e+14 3.253507e+14 3.723208e+14 
##    2015(131)    2015(132)    2015(133)    2015(134)    2015(135)    2015(136) 
## 4.048445e+14 3.816720e+14 3.817797e+14 3.711642e+14 3.474271e+14 3.333072e+14 
##    2015(137)    2015(138)    2015(139)    2015(140)    2015(141)    2015(142) 
## 3.290577e+14 3.398155e+14 9.601262e+14 5.275713e+14 3.919599e+14 5.192401e+14 
##    2015(143)    2015(144)    2015(145)    2015(146)    2015(147)    2015(148) 
## 4.300701e+14 4.395074e+14 3.999505e+14 4.944364e+14 4.358458e+14 4.235039e+14 
##    2015(149)    2015(150)    2015(151)    2015(152)    2015(153)    2015(154) 
## 4.681800e+14 3.745310e+14 4.155205e+14 3.861014e+14 3.433659e+14 4.226628e+14 
##    2015(155)    2015(156)    2015(157)    2015(158)    2015(159)    2015(160) 
## 4.684273e+14 4.592118e+14 3.861455e+14 3.569082e+14 3.790954e+14 4.106119e+14 
##    2015(161)    2015(162)    2015(163)    2015(164)    2015(165)    2015(166) 
## 4.256844e+14 4.777309e+14 5.474152e+14 5.428157e+14 5.114369e+14 5.950591e+14 
##    2015(167)    2015(168)    2015(169)    2015(170)    2015(171)    2015(172) 
## 4.549774e+14 4.800796e+14 4.930346e+14 4.894300e+14 4.579924e+14 4.240300e+14 
##    2015(173)    2015(174)    2015(175)    2015(176)    2015(177)    2015(178) 
## 3.961119e+14 3.867967e+14 4.500884e+14 4.273109e+14 4.544738e+14 4.156135e+14 
##    2015(179)    2015(180)    2015(181)    2015(182)    2015(183)    2015(184) 
## 3.843745e+14 4.340657e+14 4.962105e+14 3.596498e+14 4.597646e+14 4.006532e+14 
##    2015(185)    2015(186)    2015(187)    2015(188)    2015(189)    2015(190) 
## 5.190374e+14 4.873453e+14 4.322591e+14 4.993339e+14 5.123678e+14 4.301067e+14 
##    2015(191)    2015(192)    2015(193)    2015(194)    2015(195)    2015(196) 
## 4.633607e+14 4.839284e+14 4.577830e+14 5.206215e+14 8.753695e+14 5.936228e+14 
##    2015(197)    2015(198)    2015(199)    2015(200)    2015(201)    2015(202) 
## 4.624301e+14 5.536127e+14 4.423030e+14 4.274812e+14 4.546627e+14 4.201165e+14 
##    2015(203)    2015(204)    2015(205)    2015(206)    2015(207)    2015(208) 
## 3.996847e+14 3.544997e+14 3.846207e+14 3.821552e+14 3.774403e+14 3.535947e+14 
##    2015(209)    2015(210)    2015(211)    2015(212)    2015(213)    2015(214) 
## 3.411381e+14 3.478164e+14 3.308127e+14 3.109522e+14 3.240490e+14 3.803832e+14 
##    2015(215)    2015(216)    2015(217)    2015(218)    2015(219)    2015(220) 
## 3.503322e+14 2.770178e+14 3.409421e+14 3.966108e+14 3.816307e+14 4.393143e+14 
##    2015(221)    2015(222)    2015(223)    2015(224)    2015(225)    2015(226) 
## 4.321607e+14 3.895784e+14 3.931042e+14 3.642137e+14 4.485592e+14 3.714463e+14 
##    2015(227)    2015(228)    2015(229)    2015(230)    2015(231)    2015(232) 
## 5.901294e+14 4.144034e+14 3.776583e+14 4.355655e+14 4.227008e+14 3.612676e+14 
##    2015(233)    2015(234)    2015(235)    2015(236)    2015(237)    2015(238) 
## 3.724627e+14 4.070872e+14 3.680171e+14 3.698144e+14 3.664429e+14 3.716324e+14 
##    2015(239)    2015(240)    2015(241)    2015(242)    2015(243)    2015(244) 
## 3.750379e+14 3.631556e+14 4.051249e+14 3.572995e+14 3.457528e+14 3.369777e+14 
##    2015(245)    2015(246)    2015(247)    2015(248)    2015(249)    2015(250) 
## 2.921648e+14 3.687236e+14 3.282741e+14 3.467371e+14 4.231838e+14 3.017109e+14 
##    2015(251)    2015(252)    2015(253)    2015(254)    2015(255)    2015(256) 
## 3.819425e+14 4.573130e+14 4.173194e+14 3.981731e+14 5.142750e+14 1.051896e+15 
##    2015(257)    2015(258)    2015(259)    2015(260)    2015(261)    2015(262) 
## 5.321496e+14 4.410827e+14 6.286097e+14 4.594398e+14 4.082961e+14 3.673217e+14 
##    2015(263)    2015(264)    2015(265)    2015(266)    2015(267)    2015(268) 
## 4.069317e+14 4.347932e+14 4.511817e+14 4.562459e+14 5.348038e+14 5.361617e+14 
##    2015(269)    2015(270)    2015(271)    2015(272)    2015(273)    2015(274) 
## 5.694032e+14 5.119074e+14 4.652462e+14 4.157098e+14 3.911681e+14 5.064567e+14 
##    2015(275)    2015(276)    2015(277)    2015(278)    2015(279)    2015(280) 
## 4.184888e+14 3.926568e+14 4.679810e+14 3.987982e+14 4.003290e+14 4.019037e+14 
##    2015(281)    2015(282)    2015(283)    2015(284)    2015(285)    2015(286) 
## 3.969224e+14 4.453610e+14 4.671062e+14 4.161296e+14 3.885392e+14 4.204360e+14 
##    2015(287)    2015(288)    2015(289)    2015(290)    2015(291)    2015(292) 
## 4.029707e+14 3.968468e+14 4.295118e+14 3.433033e+14 4.119763e+14 3.862262e+14 
##    2015(293)    2015(294)    2015(295)    2015(296)    2015(297)    2015(298) 
## 3.470047e+14 3.916580e+14 4.212833e+14 3.892615e+14 4.011978e+14 3.940081e+14 
##    2015(299)    2015(300)    2015(301)    2015(302)    2015(303)    2015(304) 
## 3.933924e+14 4.111771e+14 3.817288e+14 3.704150e+14 4.109733e+14 3.994101e+14 
##    2015(305)    2015(306)    2015(307)    2015(308)    2015(309)    2015(310) 
## 3.686132e+14 4.071537e+14 3.969114e+14 5.552088e+14 4.757532e+14 3.621194e+14 
##    2015(311)    2015(312)    2015(313)    2015(314)    2015(315)    2015(316) 
## 4.696944e+14 4.240583e+14 4.107290e+14 4.436468e+14 4.681624e+14 4.823926e+14 
##    2015(317)    2015(318)    2015(319)    2015(320)    2015(321)    2015(322) 
## 4.240415e+14 3.881558e+14 4.148947e+14 4.492178e+14 3.929730e+14 5.046671e+14 
##    2015(323)    2015(324)    2015(325)    2015(326)    2015(327)    2015(328) 
## 4.569504e+14 4.958035e+14 5.240687e+14 1.037160e+15 6.611219e+14 4.599882e+14 
##    2015(329)    2015(330)    2015(331)    2015(332)    2015(333)    2015(334) 
## 5.833230e+14 5.482288e+14 5.176829e+14 4.409808e+14 4.730770e+14 4.196774e+14 
##    2015(335)    2015(336)    2015(337)    2015(338)    2015(339)    2015(340) 
## 3.827915e+14 3.734347e+14 4.123784e+14 3.922169e+14 3.697831e+14 3.695227e+14 
##    2015(341)    2015(342)    2015(343)    2015(344)    2015(345)    2015(346) 
## 3.861327e+14 4.488565e+14 3.754652e+14 4.456212e+14 4.166666e+14 3.532640e+14 
##    2015(347)    2015(348)    2015(349)    2015(350)    2015(351)    2015(352) 
## 3.607403e+14 4.180083e+14 4.557635e+14 5.875367e+14 3.922530e+14 3.682388e+14 
##    2015(353)    2015(354)    2015(355)    2015(356)    2015(357)    2015(358) 
## 4.279331e+14 4.026615e+14 3.749621e+14 3.752839e+14 4.086740e+14 3.850617e+14 
##    2015(359)    2015(360)    2015(361)    2015(362)    2015(363)    2015(364) 
## 4.299834e+14 4.483267e+14 3.654885e+14 3.743866e+14 4.002548e+14 3.316428e+14 
##    2015(365) 
## 3.807700e+14

Computation and Plot of 10 steps ahead forecast for Turnover.ts with lag 2, 61, 70, and 117

Turnover.forecast.AR2n61n70n117 <- predict(AR.Turnover.ts.lag2n61n70n117, n.ahead = 10)
Turnover.forecast.AR2n61n70n117 <- ts(Turnover.forecast.AR2n61n70n117, start = end(Turnover.ts)[1] + 1, frequency = frequency(Turnover.ts))
ts.plot(Turnover.ts, Turnover.forecast.AR2n61n70n117, col = c("black", "red"), lty = c(1, 2), xlab = "Time", ylab = "Turnover.ts")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Turnover.forecast.AR2n61n70n117)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 248) 
## Frequency = 365 
##    2015(118)    2015(119)    2015(120)    2015(121)    2015(122)    2015(123) 
## 2.843328e+14 3.300140e+14 5.355669e+14 4.556652e+14 3.214857e+14 4.490779e+14 
##    2015(124)    2015(125)    2015(126)    2015(127)    2015(128)    2015(129) 
## 9.516066e+14 4.667516e+14 4.034747e+14 4.442095e+14 4.094747e+14 4.464079e+14 
##    2015(130)    2015(131)    2015(132)    2015(133)    2015(134)    2015(135) 
## 3.019085e+14 3.338873e+14 4.538866e+14 4.170239e+14 5.057920e+14 5.148106e+14 
##    2015(136)    2015(137)    2015(138)    2015(139)    2015(140)    2015(141) 
## 5.654224e+14 5.951847e+14 9.331840e+14 5.255144e+14 6.678249e+14 4.324794e+14 
##    2015(142)    2015(143)    2015(144)    2015(145)    2015(146)    2015(147) 
## 5.388959e+14 5.092309e+14 4.169909e+14 5.175807e+14 4.042004e+14 7.753734e+14 
##    2015(148)    2015(149)    2015(150)    2015(151)    2015(152)    2015(153) 
## 4.546934e+14 4.161430e+14 4.291345e+14 4.480293e+14 4.121090e+14 3.369849e+14 
##    2015(154)    2015(155)    2015(156)    2015(157)    2015(158)    2015(159) 
## 4.151113e+14 3.467545e+14 4.281638e+14 3.951658e+14 2.720864e+14 2.980391e+14 
##    2015(160)    2015(161)    2015(162)    2015(163)    2015(164)    2015(165) 
## 3.220605e+14 3.667963e+14 5.290260e+14 4.442216e+14 3.828011e+14 4.400103e+14 
##    2015(166)    2015(167)    2015(168)    2015(169)    2015(170)    2015(171) 
## 3.960856e+14 3.970777e+14 3.299462e+14 3.942927e+14 3.872102e+14 5.644025e+14 
##    2015(172)    2015(173)    2015(174)    2015(175)    2015(176)    2015(177) 
## 4.049325e+14 2.920580e+14 3.085694e+14 3.389439e+14 4.749459e+14 4.200219e+14 
##    2015(178)    2015(179)    2015(180)    2015(181)    2015(182)    2015(183) 
## 3.444982e+14 3.779961e+14 3.725111e+14 4.149036e+14 3.949697e+14 3.617282e+14 
##    2015(184)    2015(185)    2015(186)    2015(187)    2015(188)    2015(189) 
## 4.389876e+14 3.154934e+14 3.524328e+14 3.116666e+14 3.811239e+14 3.378156e+14 
##    2015(190)    2015(191)    2015(192)    2015(193)    2015(194)    2015(195) 
## 5.021257e+14 3.992006e+14 4.595697e+14 4.494703e+14 9.427325e+14 5.304186e+14 
##    2015(196)    2015(197)    2015(198)    2015(199)    2015(200)    2015(201) 
## 5.411520e+14 3.743827e+14 3.928009e+14 9.507512e+14 4.959646e+14 4.323781e+14 
##    2015(202)    2015(203)    2015(204)    2015(205)    2015(206)    2015(207) 
## 3.328825e+14 3.276474e+14 3.154810e+14 3.150607e+14 3.893042e+14 3.237797e+14 
##    2015(208)    2015(209)    2015(210)    2015(211)    2015(212)    2015(213) 
## 7.009195e+14 4.315094e+14 3.695596e+14 3.047088e+14 3.574160e+14 3.016987e+14 
##    2015(214)    2015(215)    2015(216)    2015(217)    2015(218)    2015(219) 
## 3.143000e+14 4.291799e+14 4.336294e+14 3.638782e+14 4.948797e+14 2.896416e+14 
##    2015(220)    2015(221)    2015(222)    2015(223)    2015(224)    2015(225) 
## 3.470376e+14 3.787814e+14 4.264731e+14 4.695653e+14 4.870306e+14 4.592880e+14 
##    2015(226)    2015(227)    2015(228)    2015(229)    2015(230)    2015(231) 
## 4.953680e+14 3.545042e+14 5.339300e+14 3.722555e+14 4.233579e+14 4.234395e+14 
##    2015(232)    2015(233)    2015(234)    2015(235)    2015(236)    2015(237) 
## 4.139849e+14 3.889398e+14 3.643027e+14 4.929222e+14 3.833262e+14 4.359203e+14 
##    2015(238)    2015(239)    2015(240)    2015(241)    2015(242)    2015(243) 
## 3.449376e+14 3.598114e+14 3.737231e+14 4.280743e+14 2.675985e+14 3.080393e+14 
##    2015(244)    2015(245)    2015(246)    2015(247)    2015(248)    2015(249) 
## 2.955669e+14 4.012537e+14 3.954396e+14 4.025355e+14 3.675916e+14 4.224834e+14 
##    2015(250)    2015(251)    2015(252)    2015(253)    2015(254)    2015(255) 
## 4.140690e+14 2.863004e+14 3.840506e+14 3.514829e+14 5.086482e+14 1.323220e+15 
##    2015(256)    2015(257)    2015(258)    2015(259)    2015(260)    2015(261) 
## 6.778920e+14 7.787334e+14 4.615196e+14 3.868358e+14 4.613334e+14 4.549539e+14 
##    2015(262)    2015(263)    2015(264)    2015(265)    2015(266)    2015(267) 
## 4.965889e+14 4.194295e+14 6.167449e+14 4.988020e+14 3.719835e+14 4.124119e+14 
##    2015(268)    2015(269)    2015(270)    2015(271)    2015(272)    2015(273) 
## 3.609068e+14 3.413978e+14 4.426893e+14 4.289439e+14 3.777151e+14 2.412377e+14 
##    2015(274)    2015(275)    2015(276)    2015(277)    2015(278)    2015(279) 
## 2.762512e+14 3.352129e+14 2.917540e+14 3.269703e+14 4.331010e+14 4.628899e+14 
##    2015(280)    2015(281)    2015(282)    2015(283)    2015(284)    2015(285) 
## 4.905795e+14 4.140495e+14 4.591343e+14 3.768019e+14 3.958798e+14 3.909487e+14 
##    2015(286)    2015(287)    2015(288)    2015(289)    2015(290)    2015(291) 
## 3.720448e+14 5.727803e+14 3.648690e+14 3.649271e+14 3.526866e+14 3.894666e+14 
##    2015(292)    2015(293)    2015(294)    2015(295)    2015(296)    2015(297) 
## 3.508676e+14 3.618410e+14 3.744305e+14 2.976690e+14 4.975067e+14 4.108855e+14 
##    2015(298)    2015(299)    2015(300)    2015(301)    2015(302)    2015(303) 
## 3.047479e+14 3.802333e+14 3.220665e+14 4.751214e+14 3.657259e+14 3.483276e+14 
##    2015(304)    2015(305)    2015(306)    2015(307)    2015(308)    2015(309) 
## 3.541376e+14 3.531430e+14 3.278895e+14 3.474210e+14 3.773616e+14 4.962947e+14 
##    2015(310)    2015(311)    2015(312)    2015(313)    2015(314)    2015(315) 
## 4.282547e+14 7.417403e+14 5.360157e+14 3.936315e+14 3.405282e+14 4.516534e+14 
##    2015(316)    2015(317)    2015(318)    2015(319)    2015(320)    2015(321) 
## 9.092587e+14 5.110785e+14 4.291414e+14 3.353485e+14 3.254087e+14 3.938276e+14 
##    2015(322)    2015(323)    2015(324)    2015(325)    2015(326)    2015(327) 
## 3.257680e+14 4.086541e+14 4.311773e+14 8.064996e+14 4.683300e+14 7.494843e+14 
##    2015(328)    2015(329)    2015(330)    2015(331)    2015(332)    2015(333) 
## 5.244571e+14 4.756420e+14 4.260932e+14 3.783793e+14 2.908468e+14 3.248177e+14 
##    2015(334)    2015(335)    2015(336)    2015(337)    2015(338)    2015(339) 
## 5.082419e+14 4.122501e+14 4.778605e+14 4.723741e+14 4.440983e+14 3.860174e+14 
##    2015(340)    2015(341)    2015(342)    2015(343)    2015(344)    2015(345) 
## 3.234109e+14 3.762396e+14 3.486128e+14 6.961057e+14 3.627582e+14 3.644528e+14 
##    2015(346)    2015(347)    2015(348)    2015(349)    2015(350)    2015(351) 
## 3.671018e+14 3.577159e+14 2.998050e+14 3.697022e+14 3.421104e+14 4.804235e+14 
##    2015(352)    2015(353)    2015(354)    2015(355)    2015(356)    2015(357) 
## 3.471694e+14 2.877822e+14 3.026069e+14 3.712919e+14 3.218256e+14 3.690115e+14 
##    2015(358)    2015(359)    2015(360)    2015(361)    2015(362)    2015(363) 
## 3.316116e+14 2.726681e+14 3.330638e+14 2.643042e+14 2.828703e+14 2.905869e+14 
##    2015(364)    2015(365) 
## 3.490093e+14 3.323483e+14

Computation and Plot of 10 steps ahead forecast for Volume.ts with lag 1 to 32

Volume.forecast.AR1to32 <- predict(AR.Volume.ts.lag1.32, n.ahead = 10)
Volume.forecast.AR1to32 <- ts(Volume.forecast.AR1to32, start = end(Volume.ts)[1] + 1, frequency = frequency(Volume.ts))
ts.plot(Volume.ts, Volume.forecast.AR1to32, col = c("black", "red"), lty = c(1, 2), xlab = "Time", ylab = "Volume.ts")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Volume.forecast.AR1to32)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 333) 
## Frequency = 365 
##  2015(33)  2015(34)  2015(35)  2015(36)  2015(37)  2015(38)  2015(39)  2015(40) 
##   2141368   2187982   1857078   2717486   1627725   2249563   2106873   2165372 
##  2015(41)  2015(42)  2015(43)  2015(44)  2015(45)  2015(46)  2015(47)  2015(48) 
##   2069275   1694266   2141183   1978126   1686048   1769824   2002108   1683801 
##  2015(49)  2015(50)  2015(51)  2015(52)  2015(53)  2015(54)  2015(55)  2015(56) 
##   2117899   1886843   1858595   2135476   1609631   1766688   1839265   1713597 
##  2015(57)  2015(58)  2015(59)  2015(60)  2015(61)  2015(62)  2015(63)  2015(64) 
##   1859779   1890789   1714786   2541614   2231724   1541390   2128925   2105058 
##  2015(65)  2015(66)  2015(67)  2015(68)  2015(69)  2015(70)  2015(71)  2015(72) 
##   1889398   2429666   2104744   2037250   2215016   1570860   1928542   2178751 
##  2015(73)  2015(74)  2015(75)  2015(76)  2015(77)  2015(78)  2015(79)  2015(80) 
##   1757528   2547754   2166061   2070267   2740759   5016010   3567635   2273653 
##  2015(81)  2015(82)  2015(83)  2015(84)  2015(85)  2015(86)  2015(87)  2015(88) 
##   3114630   3032273   3495149   3390423   2675059   2156224   1967321   1903709 
##  2015(89)  2015(90)  2015(91)  2015(92)  2015(93)  2015(94)  2015(95)  2015(96) 
##   2252823   1841157   1923654   2258913   1683538   1993496   2351338   2125646 
##  2015(97)  2015(98)  2015(99) 2015(100) 2015(101) 2015(102) 2015(103) 2015(104) 
##   2226299   1398776   2130706   2445211   2946146   3536124   2275779   1869783 
## 2015(105) 2015(106) 2015(107) 2015(108) 2015(109) 2015(110) 2015(111) 2015(112) 
##   1726949   2906804   2218789   2622330   2105722   2017607   2272247   1998523 
## 2015(113) 2015(114) 2015(115) 2015(116) 2015(117) 2015(118) 2015(119) 2015(120) 
##   2371179   2207862   2544626   2143917   2646757   2685130   2897466   2843011 
## 2015(121) 2015(122) 2015(123) 2015(124) 2015(125) 2015(126) 2015(127) 2015(128) 
##   2681520   2438530   2696178   2972810   3129574   2585702   1994094   2372637 
## 2015(129) 2015(130) 2015(131) 2015(132) 2015(133) 2015(134) 2015(135) 2015(136) 
##   2013485   2841143   3053897   2765406   2568509   2767007   2305862   2521092 
## 2015(137) 2015(138) 2015(139) 2015(140) 2015(141) 2015(142) 2015(143) 2015(144) 
##   2544150   2499063   8219702   4729049   2370538   4269293   3264044   4091589 
## 2015(145) 2015(146) 2015(147) 2015(148) 2015(149) 2015(150) 2015(151) 2015(152) 
##   5268958   4073609   3597811   4124595   3150496   3034059   2670597   2612250 
## 2015(153) 2015(154) 2015(155) 2015(156) 2015(157) 2015(158) 2015(159) 2015(160) 
##   3870635   3058188   3894454   4465677   2532386   2411270   1675881   3687455 
## 2015(161) 2015(162) 2015(163) 2015(164) 2015(165) 2015(166) 2015(167) 2015(168) 
##   3528140   5417119   5148974   4718616   4524208   3704656   5296890   4100980 
## 2015(169) 2015(170) 2015(171) 2015(172) 2015(173) 2015(174) 2015(175) 2015(176) 
##   5685641   5236663   4520989   4257667   2978891   3413150   3676313   3375662 
## 2015(177) 2015(178) 2015(179) 2015(180) 2015(181) 2015(182) 2015(183) 2015(184) 
##   4356815   3365489   3337644   3808502   3917379   2844422   3790803   3460415 
## 2015(185) 2015(186) 2015(187) 2015(188) 2015(189) 2015(190) 2015(191) 2015(192) 
##   4434478   4794683   4090361   4159916   4810178   3519575   4437071   4754434 
## 2015(193) 2015(194) 2015(195) 2015(196) 2015(197) 2015(198) 2015(199) 2015(200) 
##   3848105   5599867   7705601   5513383   3973219   5158296   4161834   4804612 
## 2015(201) 2015(202) 2015(203) 2015(204) 2015(205) 2015(206) 2015(207) 2015(208) 
##   5077298   4008921   3332865   3272673   2487744   3411511   2564144   2606946 
## 2015(209) 2015(210) 2015(211) 2015(212) 2015(213) 2015(214) 2015(215) 2015(216) 
##   3634982   2223091   2920426   2786769   2445953   2876344   2387704   2170209 
## 2015(217) 2015(218) 2015(219) 2015(220) 2015(221) 2015(222) 2015(223) 2015(224) 
##   2926684   3959044   3685325   4157883   3617789   2255504   4102658   3273507 
## 2015(225) 2015(226) 2015(227) 2015(228) 2015(229) 2015(230) 2015(231) 2015(232) 
##   4154179   3873171   4924011   3601188   2788453   3332347   3635048   2853922 
## 2015(233) 2015(234) 2015(235) 2015(236) 2015(237) 2015(238) 2015(239) 2015(240) 
##   3139123   3104116   2536553   3042628   2469944   2569119   2502955   2201711 
## 2015(241) 2015(242) 2015(243) 2015(244) 2015(245) 2015(246) 2015(247) 2015(248) 
##   3152874   2643982   2556164   2787335   1810364   2628416   1928325   2840425 
## 2015(249) 2015(250) 2015(251) 2015(252) 2015(253) 2015(254) 2015(255) 2015(256) 
##   3060959   2512393   2136868   2928584   2614524   1784933   3861491   5102143 
## 2015(257) 2015(258) 2015(259) 2015(260) 2015(261) 2015(262) 2015(263) 2015(264) 
##   3596575   2492474   3382596   2678229   2623104   3145869   2360347   2231362 
## 2015(265) 2015(266) 2015(267) 2015(268) 2015(269) 2015(270) 2015(271) 2015(272) 
##   2795624   1941512   2518060   2056460   2754970   3314584   2196153   2527783 
## 2015(273) 2015(274) 2015(275) 2015(276) 2015(277) 2015(278) 2015(279) 2015(280) 
##   2489335   2695720   2150232   1562524   2687167   1858164   2651631   2294573 
## 2015(281) 2015(282) 2015(283) 2015(284) 2015(285) 2015(286) 2015(287) 2015(288) 
##   2141368   2187982   1857078   2717486   1627725   2249563   2106873   2165372 
## 2015(289) 2015(290) 2015(291) 2015(292) 2015(293) 2015(294) 2015(295) 2015(296) 
##   2069275   1694266   2141183   1978126   1686048   1769824   2002108   1683801 
## 2015(297) 2015(298) 2015(299) 2015(300) 2015(301) 2015(302) 2015(303) 2015(304) 
##   2117899   1886843   1858595   2135476   1609631   1766688   1839265   1713597 
## 2015(305) 2015(306) 2015(307) 2015(308) 2015(309) 2015(310) 2015(311) 2015(312) 
##   1859779   1890789   1714786   2541614   2231724   1541390   2128925   2105058 
## 2015(313) 2015(314) 2015(315) 2015(316) 2015(317) 2015(318) 2015(319) 2015(320) 
##   1889398   2429666   2104744   2037250   2215016   1570860   1928542   2178751 
## 2015(321) 2015(322) 2015(323) 2015(324) 2015(325) 2015(326) 2015(327) 2015(328) 
##   1757528   2547754   2166061   2070267   2740759   5016010   3567635   2273653 
## 2015(329) 2015(330) 2015(331) 2015(332) 2015(333) 2015(334) 2015(335) 2015(336) 
##   3114630   3032273   3495149   3390423   2675059   2156224   1967321   1903709 
## 2015(337) 2015(338) 2015(339) 2015(340) 2015(341) 2015(342) 2015(343) 2015(344) 
##   2252823   1841157   1923654   2258913   1683538   1993496   2351338   2125646 
## 2015(345) 2015(346) 2015(347) 2015(348) 2015(349) 2015(350) 2015(351) 2015(352) 
##   2226299   1398776   2130706   2445211   2946146   3536124   2275779   1869783 
## 2015(353) 2015(354) 2015(355) 2015(356) 2015(357) 2015(358) 2015(359) 2015(360) 
##   1726949   2906804   2218789   2622330   2105722   2017607   2272247   1998523 
## 2015(361) 2015(362) 2015(363) 2015(364) 2015(365) 
##   2371179   2207862   2544626   2143917   2646757

Computation and Plot of 10 steps ahead forecast for Volume with 1 to 32 lags and 91 to 122 lags

Volume.forecast.AR1to32and91to122 <- predict(AR.Volume.ts.lag1.32n90.122, n.ahead = 10)
Volume.forecast.AR1to32and91to122 <- ts(Volume.forecast.AR1to32and91to122, 
                                        start = end(train_data.Volume)[1] + 1, 
                                        frequency = frequency(Volume.ts))
time_series_plot <- ts.plot(Volume.ts, Volume.forecast.AR1to32and91to122, col = c("black", "red"), lty = c(1, 2), xlab = "Time", ylab = "Volume")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Volume.forecast.AR1to32and91to122)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 243) 
## Frequency = 365 
## 2015(123) 2015(124) 2015(125) 2015(126) 2015(127) 2015(128) 2015(129) 2015(130) 
## 3954532.3 5700605.9 2379593.7 2397080.7 2953199.1 2414288.9 1598006.6 2775501.6 
## 2015(131) 2015(132) 2015(133) 2015(134) 2015(135) 2015(136) 2015(137) 2015(138) 
## 3392655.4 3340282.2 2999364.8 2948646.1 3031476.1 2879275.6 3203254.3 3310617.5 
## 2015(139) 2015(140) 2015(141) 2015(142) 2015(143) 2015(144) 2015(145) 2015(146) 
## 8254408.1 5217615.4 2559225.4 3723928.0 3617469.9 4402678.5 5608309.2 4407231.6 
## 2015(147) 2015(148) 2015(149) 2015(150) 2015(151) 2015(152) 2015(153) 2015(154) 
## 4280590.6 4535112.6 2801812.4 3973312.7 2604181.1 3088551.4 3935324.6 3352888.0 
## 2015(155) 2015(156) 2015(157) 2015(158) 2015(159) 2015(160) 2015(161) 2015(162) 
## 3828508.2 3897746.8 3070565.3 2726785.0 2524209.7 3802202.0 3707475.0 5103421.2 
## 2015(163) 2015(164) 2015(165) 2015(166) 2015(167) 2015(168) 2015(169) 2015(170) 
## 5859738.6 5242868.8 4971544.1 3614305.5 5045804.4 4337561.0 5409714.8 5526310.7 
## 2015(171) 2015(172) 2015(173) 2015(174) 2015(175) 2015(176) 2015(177) 2015(178) 
## 4510301.5 4212377.1 2342005.4 2927933.0 3347477.5 4457621.3 3909257.6 3046130.8 
## 2015(179) 2015(180) 2015(181) 2015(182) 2015(183) 2015(184) 2015(185) 2015(186) 
## 3268596.5 3889687.5 3924016.9 3143752.9 3825132.0 3913458.2 4166797.7 4117491.4 
## 2015(187) 2015(188) 2015(189) 2015(190) 2015(191) 2015(192) 2015(193) 2015(194) 
## 4272454.4 3180800.4 4721080.7 4688219.5 3656472.0 4022948.9 4287813.2 8318420.7 
## 2015(195) 2015(196) 2015(197) 2015(198) 2015(199) 2015(200) 2015(201) 2015(202) 
## 7343597.8 4791656.9 3867325.9 4448074.3 3808932.3 4996852.0 5189307.0 4106231.8 
## 2015(203) 2015(204) 2015(205) 2015(206) 2015(207) 2015(208) 2015(209) 2015(210) 
## 3442202.2 3294891.6 2541481.2 3786523.1 2227641.9 2514316.2 3596444.8 2454013.6 
## 2015(211) 2015(212) 2015(213) 2015(214) 2015(215) 2015(216) 2015(217) 2015(218) 
## 2451945.3 2765987.6 2955712.0 3382079.6 2521255.6 2494182.1 3549777.6 4810145.1 
## 2015(219) 2015(220) 2015(221) 2015(222) 2015(223) 2015(224) 2015(225) 2015(226) 
## 3816752.0 4355365.7 4465890.6 2471494.9 4010631.2 4071418.8 4149060.8 4528511.9 
## 2015(227) 2015(228) 2015(229) 2015(230) 2015(231) 2015(232) 2015(233) 2015(234) 
## 4954754.9 3763392.4 1990858.3 3529126.2 3633114.9 3059139.1 2428290.1 2756721.0 
## 2015(235) 2015(236) 2015(237) 2015(238) 2015(239) 2015(240) 2015(241) 2015(242) 
## 1668316.9 1761798.0 3542577.9 1432489.0 2716101.9 2329350.3 2353077.0 2387487.4 
## 2015(243) 2015(244) 2015(245) 2015(246) 2015(247) 2015(248) 2015(249) 2015(250) 
## 2352233.3 1879016.0 2169135.5 2370394.6 2127544.8 3065162.4 1366106.6 2312081.2 
## 2015(251) 2015(252) 2015(253) 2015(254) 2015(255) 2015(256) 2015(257) 2015(258) 
## 3112400.8 1453063.9  698797.0 2279330.5 8153410.0 3584976.3 2050649.5 2298611.0 
## 2015(259) 2015(260) 2015(261) 2015(262) 2015(263) 2015(264) 2015(265) 2015(266) 
## 1855506.1 1721805.1 2064609.4 3132456.1 2107590.2 2499891.6 2417879.8 1412277.7 
## 2015(267) 2015(268) 2015(269) 2015(270) 2015(271) 2015(272) 2015(273) 2015(274) 
## 2826532.8 1743872.3 1817557.5 3164472.6 1926295.4 2266484.2  947475.5 2101331.5 
## 2015(275) 2015(276) 2015(277) 2015(278) 2015(279) 2015(280) 2015(281) 2015(282) 
## 2034436.5  986150.7 1962614.1 2248404.1 2418202.3 2061805.6 2419365.7 2156529.4 
## 2015(283) 2015(284) 2015(285) 2015(286) 2015(287) 2015(288) 2015(289) 2015(290) 
## 1092818.9 1861116.0 1167888.6 1990299.3 2189878.3 1462903.6 1411004.5  704762.6 
## 2015(291) 2015(292) 2015(293) 2015(294) 2015(295) 2015(296) 2015(297) 2015(298) 
## 1059535.5 1532790.6 2404662.2 1121510.3 1672057.7 1982582.9 2557682.8 1419402.4 
## 2015(299) 2015(300) 2015(301) 2015(302) 2015(303) 2015(304) 2015(305) 2015(306) 
## 1975880.7 1936388.6 2832545.3 1083402.6 1227263.9 2212160.3 1029032.8 1514478.8 
## 2015(307) 2015(308) 2015(309) 2015(310) 2015(311) 2015(312) 2015(313) 2015(314) 
## 2956761.7 1933676.2 1348533.3 2307997.9 4849240.9 1945157.2 1352242.7 2688710.6 
## 2015(315) 2015(316) 2015(317) 2015(318) 2015(319) 2015(320) 2015(321) 2015(322) 
## 1586457.4 1566279.2 2019181.4 2294504.0 1738287.2 2294095.8 1832083.5 2698523.7 
## 2015(323) 2015(324) 2015(325) 2015(326) 2015(327) 2015(328) 2015(329) 2015(330) 
## 2552109.5 1555552.3 3239167.3 5049484.9 3912203.3 1375463.4 2972372.6 3383797.9 
## 2015(331) 2015(332) 2015(333) 2015(334) 2015(335) 2015(336) 2015(337) 2015(338) 
## 3605519.8 2616977.0 3060376.8 2710306.1 1865558.2 2190438.7 2401556.4 1354773.4 
## 2015(339) 2015(340) 2015(341) 2015(342) 2015(343) 2015(344) 2015(345) 2015(346) 
## 2462680.5 2038267.9 1703896.6 2173656.9 3449234.8 1999302.2 1969544.4 1754942.2 
## 2015(347) 2015(348) 2015(349) 2015(350) 2015(351) 2015(352) 2015(353) 2015(354) 
## 3009724.9 1639761.9 3171904.4 3971804.7 2463823.0 1933559.9 1640211.7 3573329.7 
## 2015(355) 2015(356) 2015(357) 2015(358) 2015(359) 2015(360) 2015(361) 2015(362) 
## 3135003.7 2985453.8 3253281.5 2764967.3 2512492.3 2535217.1 2286100.6 2765279.0 
## 2015(363) 2015(364) 2015(365) 
## 2240505.0 2302526.3 3497956.7

ARDL Models

Open.ts.diff <- diff(Open.ts)
tsdisplay(Open.ts.diff)

Close.ts.diff <- diff(Close.ts)
tsdisplay(Close.ts.diff)

Turnover.ts <- infy_stock.ts[,"Turnover"]
Volume.ts <- infy_stock.ts[,"Volume"]
tsdisplay(Turnover.ts)

tsdisplay(Volume.ts)

ARDL of Turnover and Close

ardl.turnover.close.1 <- dynlm(Turnover.ts ~ L(Turnover.ts, 1:4) + L(Close.ts.diff, 110), data = infy_stock)
summary(ardl.turnover.close.1)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 1:4) + L(Close.ts.diff, 
##     110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.759e+14 -1.190e+14 -4.453e+13  5.802e+13  1.781e+15 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            2.379e+14  4.188e+13   5.679 3.78e-08 ***
## L(Turnover.ts, 1:4)1   3.277e-01  6.329e-02   5.178 4.65e-07 ***
## L(Turnover.ts, 1:4)2   3.515e-02  6.661e-02   0.528    0.598    
## L(Turnover.ts, 1:4)3  -1.813e-02  6.671e-02  -0.272    0.786    
## L(Turnover.ts, 1:4)4   8.763e-02  6.337e-02   1.383    0.168    
## L(Close.ts.diff, 110)  4.385e+10  1.844e+11   0.238    0.812    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.537e+14 on 248 degrees of freedom
## Multiple R-squared:  0.1263, Adjusted R-squared:  0.1087 
## F-statistic: 7.172 on 5 and 248 DF,  p-value: 2.743e-06
ardl.turnover.close.2 <- dynlm(Turnover.ts ~ L(Turnover.ts, 1:4) + L(Close.ts.diff, 1:110), data = infy_stock)
summary(ardl.turnover.close.2)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 1:4) + L(Close.ts.diff, 
##     1:110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.735e+14 -9.649e+13 -3.265e+13  4.919e+13  1.050e+15 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 2.329e+14  5.284e+13   4.407 2.08e-05 ***
## L(Turnover.ts, 1:4)1        3.394e-01  8.448e-02   4.017 9.60e-05 ***
## L(Turnover.ts, 1:4)2        7.559e-02  8.914e-02   0.848 0.397897    
## L(Turnover.ts, 1:4)3       -5.991e-02  8.919e-02  -0.672 0.502864    
## L(Turnover.ts, 1:4)4        9.371e-02  8.434e-02   1.111 0.268478    
## L(Close.ts.diff, 1:110)1    7.339e+10  1.611e+11   0.456 0.649388    
## L(Close.ts.diff, 1:110)2    1.657e+11  1.612e+11   1.028 0.305817    
## L(Close.ts.diff, 1:110)3    4.332e+10  1.617e+11   0.268 0.789204    
## L(Close.ts.diff, 1:110)4   -8.638e+10  1.618e+11  -0.534 0.594402    
## L(Close.ts.diff, 1:110)5    1.430e+11  1.620e+11   0.883 0.378722    
## L(Close.ts.diff, 1:110)6    8.402e+11  1.957e+11   4.293 3.29e-05 ***
## L(Close.ts.diff, 1:110)7   -2.172e+11  2.088e+11  -1.040 0.299955    
## L(Close.ts.diff, 1:110)8   -1.052e+11  2.092e+11  -0.503 0.615890    
## L(Close.ts.diff, 1:110)9    1.464e+11  2.088e+11   0.701 0.484299    
## L(Close.ts.diff, 1:110)10  -9.255e+10  2.086e+11  -0.444 0.657961    
## L(Close.ts.diff, 1:110)11  -1.621e+10  1.954e+11  -0.083 0.934008    
## L(Close.ts.diff, 1:110)12  -6.319e+10  1.951e+11  -0.324 0.746579    
## L(Close.ts.diff, 1:110)13   1.828e+11  1.953e+11   0.936 0.350926    
## L(Close.ts.diff, 1:110)14   1.700e+11  1.959e+11   0.868 0.387061    
## L(Close.ts.diff, 1:110)15   7.128e+10  1.965e+11   0.363 0.717289    
## L(Close.ts.diff, 1:110)16   1.206e+11  1.968e+11   0.613 0.540998    
## L(Close.ts.diff, 1:110)17   2.457e+11  1.962e+11   1.252 0.212560    
## L(Close.ts.diff, 1:110)18   3.434e+10  1.972e+11   0.174 0.861992    
## L(Close.ts.diff, 1:110)19   1.181e+11  1.968e+11   0.600 0.549307    
## L(Close.ts.diff, 1:110)20   3.291e+09  1.966e+11   0.017 0.986670    
## L(Close.ts.diff, 1:110)21  -1.867e+10  1.967e+11  -0.095 0.924545    
## L(Close.ts.diff, 1:110)22   4.037e+10  1.957e+11   0.206 0.836893    
## L(Close.ts.diff, 1:110)23  -6.412e+10  1.956e+11  -0.328 0.743565    
## L(Close.ts.diff, 1:110)24   1.775e+11  1.946e+11   0.912 0.363203    
## L(Close.ts.diff, 1:110)25   9.822e+10  1.954e+11   0.503 0.615977    
## L(Close.ts.diff, 1:110)26  -9.431e+11  1.955e+11  -4.823 3.67e-06 ***
## L(Close.ts.diff, 1:110)27   1.977e+11  2.113e+11   0.935 0.351197    
## L(Close.ts.diff, 1:110)28   3.297e+10  2.116e+11   0.156 0.876418    
## L(Close.ts.diff, 1:110)29   7.482e+10  2.110e+11   0.355 0.723470    
## L(Close.ts.diff, 1:110)30  -1.721e+10  2.076e+11  -0.083 0.934058    
## L(Close.ts.diff, 1:110)31  -1.372e+11  1.961e+11  -0.700 0.485290    
## L(Close.ts.diff, 1:110)32   1.895e+11  1.964e+11   0.965 0.336298    
## L(Close.ts.diff, 1:110)33  -6.174e+10  1.968e+11  -0.314 0.754153    
## L(Close.ts.diff, 1:110)34  -8.987e+10  1.964e+11  -0.458 0.647906    
## L(Close.ts.diff, 1:110)35   4.004e+09  1.957e+11   0.020 0.983701    
## L(Close.ts.diff, 1:110)36  -5.505e+10  1.955e+11  -0.282 0.778705    
## L(Close.ts.diff, 1:110)37   8.448e+10  1.952e+11   0.433 0.665822    
## L(Close.ts.diff, 1:110)38  -1.034e+11  1.951e+11  -0.530 0.596762    
## L(Close.ts.diff, 1:110)39   1.527e+11  1.950e+11   0.783 0.435093    
## L(Close.ts.diff, 1:110)40   3.860e+10  1.956e+11   0.197 0.843839    
## L(Close.ts.diff, 1:110)41  -1.435e+11  1.959e+11  -0.733 0.465072    
## L(Close.ts.diff, 1:110)42  -1.637e+11  1.961e+11  -0.835 0.405096    
## L(Close.ts.diff, 1:110)43  -8.991e+10  1.962e+11  -0.458 0.647521    
## L(Close.ts.diff, 1:110)44   1.694e+11  1.962e+11   0.863 0.389466    
## L(Close.ts.diff, 1:110)45   9.928e+10  1.967e+11   0.505 0.614490    
## L(Close.ts.diff, 1:110)46   8.374e+10  1.968e+11   0.426 0.671100    
## L(Close.ts.diff, 1:110)47   1.267e+10  1.964e+11   0.065 0.948629    
## L(Close.ts.diff, 1:110)48  -7.329e+10  1.956e+11  -0.375 0.708483    
## L(Close.ts.diff, 1:110)49  -2.369e+10  1.957e+11  -0.121 0.903837    
## L(Close.ts.diff, 1:110)50  -7.656e+10  1.957e+11  -0.391 0.696191    
## L(Close.ts.diff, 1:110)51  -6.874e+10  1.956e+11  -0.351 0.725829    
## L(Close.ts.diff, 1:110)52  -1.316e+11  1.955e+11  -0.673 0.502071    
## L(Close.ts.diff, 1:110)53  -1.302e+11  1.956e+11  -0.666 0.506643    
## L(Close.ts.diff, 1:110)54   4.434e+10  1.962e+11   0.226 0.821527    
## L(Close.ts.diff, 1:110)55  -6.630e+10  1.962e+11  -0.338 0.735944    
## L(Close.ts.diff, 1:110)56   5.868e+10  1.962e+11   0.299 0.765380    
## L(Close.ts.diff, 1:110)57  -7.955e+10  1.960e+11  -0.406 0.685506    
## L(Close.ts.diff, 1:110)58   3.189e+11  1.957e+11   1.630 0.105448    
## L(Close.ts.diff, 1:110)59  -6.487e+09  1.976e+11  -0.033 0.973855    
## L(Close.ts.diff, 1:110)60  -6.811e+10  1.974e+11  -0.345 0.730630    
## L(Close.ts.diff, 1:110)61   5.678e+09  1.972e+11   0.029 0.977077    
## L(Close.ts.diff, 1:110)62  -1.244e+11  1.965e+11  -0.633 0.527797    
## L(Close.ts.diff, 1:110)63   2.182e+10  1.953e+11   0.112 0.911218    
## L(Close.ts.diff, 1:110)64  -1.290e+11  1.954e+11  -0.660 0.510300    
## L(Close.ts.diff, 1:110)65  -4.913e+10  1.956e+11  -0.251 0.802104    
## L(Close.ts.diff, 1:110)66   1.716e+11  1.956e+11   0.877 0.381862    
## L(Close.ts.diff, 1:110)67   3.261e+10  1.961e+11   0.166 0.868160    
## L(Close.ts.diff, 1:110)68  -1.529e+11  1.959e+11  -0.780 0.436597    
## L(Close.ts.diff, 1:110)69   1.901e+11  1.963e+11   0.969 0.334410    
## L(Close.ts.diff, 1:110)70  -1.062e+10  1.965e+11  -0.054 0.956999    
## L(Close.ts.diff, 1:110)71   7.715e+10  1.961e+11   0.394 0.694545    
## L(Close.ts.diff, 1:110)72  -1.286e+11  1.960e+11  -0.656 0.512991    
## L(Close.ts.diff, 1:110)73  -2.963e+10  1.956e+11  -0.151 0.879828    
## L(Close.ts.diff, 1:110)74   1.183e+11  1.959e+11   0.604 0.546719    
## L(Close.ts.diff, 1:110)75   1.475e+10  1.963e+11   0.075 0.940220    
## L(Close.ts.diff, 1:110)76   8.400e+11  1.958e+11   4.291 3.32e-05 ***
## L(Close.ts.diff, 1:110)77   3.778e+10  2.075e+11   0.182 0.855775    
## L(Close.ts.diff, 1:110)78  -8.592e+10  2.074e+11  -0.414 0.679314    
## L(Close.ts.diff, 1:110)79  -9.532e+10  2.074e+11  -0.460 0.646531    
## L(Close.ts.diff, 1:110)80   6.725e+10  2.065e+11   0.326 0.745186    
## L(Close.ts.diff, 1:110)81  -2.137e+10  1.975e+11  -0.108 0.913998    
## L(Close.ts.diff, 1:110)82  -7.124e+11  1.958e+11  -3.638 0.000386 ***
## L(Close.ts.diff, 1:110)83  -3.165e+08  2.042e+11  -0.002 0.998766    
## L(Close.ts.diff, 1:110)84  -6.625e+09  2.037e+11  -0.033 0.974101    
## L(Close.ts.diff, 1:110)85  -1.514e+11  2.030e+11  -0.746 0.456962    
## L(Close.ts.diff, 1:110)86   6.248e+10  2.018e+11   0.310 0.757291    
## L(Close.ts.diff, 1:110)87   1.008e+10  1.955e+11   0.052 0.958947    
## L(Close.ts.diff, 1:110)88   1.621e+10  1.955e+11   0.083 0.934020    
## L(Close.ts.diff, 1:110)89   1.850e+10  1.954e+11   0.095 0.924721    
## L(Close.ts.diff, 1:110)90  -7.614e+10  1.949e+11  -0.391 0.696588    
## L(Close.ts.diff, 1:110)91   7.648e+10  1.949e+11   0.393 0.695280    
## L(Close.ts.diff, 1:110)92   8.090e+10  1.951e+11   0.415 0.679044    
## L(Close.ts.diff, 1:110)93   3.490e+10  1.953e+11   0.179 0.858413    
## L(Close.ts.diff, 1:110)94   8.301e+10  1.950e+11   0.426 0.670977    
## L(Close.ts.diff, 1:110)95   1.086e+10  1.956e+11   0.056 0.955808    
## L(Close.ts.diff, 1:110)96  -3.669e+10  1.954e+11  -0.188 0.851353    
## L(Close.ts.diff, 1:110)97   1.097e+10  1.952e+11   0.056 0.955280    
## L(Close.ts.diff, 1:110)98   3.885e+10  1.952e+11   0.199 0.842573    
## L(Close.ts.diff, 1:110)99   1.531e+11  1.950e+11   0.785 0.433730    
## L(Close.ts.diff, 1:110)100  2.930e+11  1.956e+11   1.498 0.136323    
## L(Close.ts.diff, 1:110)101 -5.918e+10  1.972e+11  -0.300 0.764513    
## L(Close.ts.diff, 1:110)102 -4.528e+09  1.971e+11  -0.023 0.981705    
## L(Close.ts.diff, 1:110)103  1.211e+11  1.971e+11   0.615 0.539768    
## L(Close.ts.diff, 1:110)104  3.255e+08  1.974e+11   0.002 0.998686    
## L(Close.ts.diff, 1:110)105 -1.619e+11  1.942e+11  -0.833 0.406053    
## L(Close.ts.diff, 1:110)106 -9.826e+10  1.953e+11  -0.503 0.615602    
## L(Close.ts.diff, 1:110)107 -1.163e+11  1.953e+11  -0.595 0.552643    
## L(Close.ts.diff, 1:110)108 -1.040e+11  1.952e+11  -0.533 0.595153    
## L(Close.ts.diff, 1:110)109  2.938e+10  1.950e+11   0.151 0.880456    
## L(Close.ts.diff, 1:110)110  8.288e+10  1.949e+11   0.425 0.671371    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.559e+14 on 139 degrees of freedom
## Multiple R-squared:  0.5018, Adjusted R-squared:  0.09325 
## F-statistic: 1.228 on 114 and 139 DF,  p-value: 0.1237
ardl.turnover.close.3 <- dynlm(Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts,61) + L(Turnover.ts, 75) + L(Turnover.ts,117) + L(Close.ts.diff, 110), data = infy_stock)
summary(ardl.turnover.close.3)
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts, 
##     61) + L(Turnover.ts, 75) + L(Turnover.ts, 117) + L(Close.ts.diff, 
##     110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -5.755e+14 -1.384e+14 -2.222e+13  1.007e+14  1.825e+15 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           9.077e+13  5.152e+13   1.762  0.07939 .  
## L(Turnover.ts, 2)     1.706e-01  5.747e-02   2.969  0.00329 ** 
## L(Turnover.ts, 61)    2.840e-01  5.778e-02   4.914 1.64e-06 ***
## L(Turnover.ts, 75)    4.264e-02  5.746e-02   0.742  0.45878    
## L(Turnover.ts, 117)   2.884e-01  5.784e-02   4.987 1.17e-06 ***
## L(Close.ts.diff, 110) 1.181e+11  1.778e+11   0.665  0.50697    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.44e+14 on 242 degrees of freedom
## Multiple R-squared:  0.2045, Adjusted R-squared:  0.188 
## F-statistic: 12.44 on 5 and 242 DF,  p-value: 9.408e-11
ardl.turnover.close.4 <- dynlm(Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts,61) + L(Turnover.ts, 75) + L(Turnover.ts,117) + L(Close.ts.diff, 1:110), data = infy_stock)
summary(ardl.turnover.close.4)
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts, 
##     61) + L(Turnover.ts, 75) + L(Turnover.ts, 117) + L(Close.ts.diff, 
##     1:110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -4.384e+14 -1.097e+14 -2.262e+13  7.092e+13  1.108e+15 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 1.106e+14  7.389e+13   1.498  0.13663    
## L(Turnover.ts, 2)           1.818e-01  7.859e-02   2.313  0.02224 *  
## L(Turnover.ts, 61)          2.717e-01  8.743e-02   3.108  0.00231 ** 
## L(Turnover.ts, 75)         -9.467e-03  8.713e-02  -0.109  0.91364    
## L(Turnover.ts, 117)         2.946e-01  9.255e-02   3.184  0.00181 ** 
## L(Close.ts.diff, 1:110)1   -2.861e+10  1.945e+11  -0.147  0.88326    
## L(Close.ts.diff, 1:110)2    1.521e+11  1.957e+11   0.777  0.43848    
## L(Close.ts.diff, 1:110)3    6.492e+08  1.942e+11   0.003  0.99734    
## L(Close.ts.diff, 1:110)4   -9.810e+10  1.952e+11  -0.503  0.61612    
## L(Close.ts.diff, 1:110)5    1.409e+11  1.944e+11   0.725  0.46979    
## L(Close.ts.diff, 1:110)6    4.138e+11  2.227e+11   1.859  0.06530 .  
## L(Close.ts.diff, 1:110)7   -4.007e+10  1.968e+11  -0.204  0.83900    
## L(Close.ts.diff, 1:110)8   -8.854e+10  2.085e+11  -0.425  0.67183    
## L(Close.ts.diff, 1:110)9    1.879e+11  1.961e+11   0.958  0.33956    
## L(Close.ts.diff, 1:110)10   9.941e+09  1.952e+11   0.051  0.95947    
## L(Close.ts.diff, 1:110)11   2.261e+10  1.950e+11   0.116  0.90786    
## L(Close.ts.diff, 1:110)12   2.422e+11  2.183e+11   1.110  0.26922    
## L(Close.ts.diff, 1:110)13   1.887e+11  1.954e+11   0.966  0.33585    
## L(Close.ts.diff, 1:110)14   2.739e+11  1.954e+11   1.402  0.16338    
## L(Close.ts.diff, 1:110)15   2.032e+11  1.960e+11   1.037  0.30179    
## L(Close.ts.diff, 1:110)16   1.543e+11  1.973e+11   0.782  0.43563    
## L(Close.ts.diff, 1:110)17   3.081e+11  1.950e+11   1.580  0.11658    
## L(Close.ts.diff, 1:110)18   7.711e+10  1.956e+11   0.394  0.69413    
## L(Close.ts.diff, 1:110)19   1.816e+11  1.962e+11   0.925  0.35659    
## L(Close.ts.diff, 1:110)20   1.353e+11  2.040e+11   0.663  0.50838    
## L(Close.ts.diff, 1:110)21   4.811e+10  1.965e+11   0.245  0.80699    
## L(Close.ts.diff, 1:110)22   9.921e+10  1.968e+11   0.504  0.61506    
## L(Close.ts.diff, 1:110)23   3.112e+10  1.960e+11   0.159  0.87411    
## L(Close.ts.diff, 1:110)24   3.041e+11  1.961e+11   1.550  0.12346    
## L(Close.ts.diff, 1:110)25   2.750e+11  1.962e+11   1.402  0.16337    
## L(Close.ts.diff, 1:110)26  -5.933e+11  2.134e+11  -2.780  0.00622 ** 
## L(Close.ts.diff, 1:110)27   1.456e+10  1.993e+11   0.073  0.94188    
## L(Close.ts.diff, 1:110)28   1.327e+11  2.072e+11   0.640  0.52307    
## L(Close.ts.diff, 1:110)29   8.735e+10  1.972e+11   0.443  0.65850    
## L(Close.ts.diff, 1:110)30  -1.742e+10  1.962e+11  -0.089  0.92939    
## L(Close.ts.diff, 1:110)31  -1.962e+11  1.962e+11  -1.000  0.31914    
## L(Close.ts.diff, 1:110)32   6.967e+10  1.964e+11   0.355  0.72332    
## L(Close.ts.diff, 1:110)33  -4.210e+10  1.972e+11  -0.213  0.83127    
## L(Close.ts.diff, 1:110)34  -1.024e+11  1.953e+11  -0.524  0.60083    
## L(Close.ts.diff, 1:110)35  -6.332e+10  1.953e+11  -0.324  0.74631    
## L(Close.ts.diff, 1:110)36  -1.464e+11  1.965e+11  -0.745  0.45778    
## L(Close.ts.diff, 1:110)37   1.796e+10  1.964e+11   0.091  0.92725    
## L(Close.ts.diff, 1:110)38  -1.741e+11  1.970e+11  -0.884  0.37847    
## L(Close.ts.diff, 1:110)39   1.427e+11  1.949e+11   0.732  0.46517    
## L(Close.ts.diff, 1:110)40   6.295e+10  2.128e+11   0.296  0.76781    
## L(Close.ts.diff, 1:110)41  -1.481e+11  1.993e+11  -0.743  0.45874    
## L(Close.ts.diff, 1:110)42  -2.085e+11  1.957e+11  -1.066  0.28852    
## L(Close.ts.diff, 1:110)43  -1.441e+11  1.952e+11  -0.738  0.46159    
## L(Close.ts.diff, 1:110)44   1.391e+11  1.963e+11   0.708  0.47994    
## L(Close.ts.diff, 1:110)45   1.611e+11  1.955e+11   0.824  0.41134    
## L(Close.ts.diff, 1:110)46   8.892e+10  1.949e+11   0.456  0.64891    
## L(Close.ts.diff, 1:110)47   2.950e+10  1.952e+11   0.151  0.88009    
## L(Close.ts.diff, 1:110)48  -1.250e+11  1.958e+11  -0.639  0.52419    
## L(Close.ts.diff, 1:110)49  -1.461e+10  1.955e+11  -0.075  0.94053    
## L(Close.ts.diff, 1:110)50  -6.991e+09  1.981e+11  -0.035  0.97190    
## L(Close.ts.diff, 1:110)51  -4.997e+10  1.954e+11  -0.256  0.79858    
## L(Close.ts.diff, 1:110)52  -2.406e+11  1.981e+11  -1.215  0.22666    
## L(Close.ts.diff, 1:110)53  -2.213e+11  1.952e+11  -1.134  0.25902    
## L(Close.ts.diff, 1:110)54   1.635e+10  1.955e+11   0.084  0.93348    
## L(Close.ts.diff, 1:110)55  -8.485e+10  1.959e+11  -0.433  0.66563    
## L(Close.ts.diff, 1:110)56  -4.230e+09  1.958e+11  -0.022  0.98280    
## L(Close.ts.diff, 1:110)57  -8.049e+10  1.955e+11  -0.412  0.68129    
## L(Close.ts.diff, 1:110)58   2.391e+11  1.957e+11   1.221  0.22409    
## L(Close.ts.diff, 1:110)59   1.043e+11  1.955e+11   0.533  0.59476    
## L(Close.ts.diff, 1:110)60  -8.921e+10  1.965e+11  -0.454  0.65052    
## L(Close.ts.diff, 1:110)61  -2.069e+10  1.956e+11  -0.106  0.91592    
## L(Close.ts.diff, 1:110)62  -3.194e+11  2.041e+11  -1.564  0.12009    
## L(Close.ts.diff, 1:110)63  -1.170e+11  1.965e+11  -0.595  0.55264    
## L(Close.ts.diff, 1:110)64  -1.089e+11  1.987e+11  -0.548  0.58461    
## L(Close.ts.diff, 1:110)65  -4.240e+09  1.958e+11  -0.022  0.98275    
## L(Close.ts.diff, 1:110)66   1.512e+11  1.958e+11   0.772  0.44137    
## L(Close.ts.diff, 1:110)67  -1.484e+11  2.111e+11  -0.703  0.48342    
## L(Close.ts.diff, 1:110)68  -2.021e+11  1.954e+11  -1.034  0.30278    
## L(Close.ts.diff, 1:110)69   1.209e+11  1.947e+11   0.621  0.53587    
## L(Close.ts.diff, 1:110)70   5.483e+10  1.956e+11   0.280  0.77968    
## L(Close.ts.diff, 1:110)71   1.230e+11  1.957e+11   0.628  0.53097    
## L(Close.ts.diff, 1:110)72  -7.109e+10  1.952e+11  -0.364  0.71630    
## L(Close.ts.diff, 1:110)73  -3.854e+10  1.954e+11  -0.197  0.84398    
## L(Close.ts.diff, 1:110)74   4.417e+10  1.956e+11   0.226  0.82173    
## L(Close.ts.diff, 1:110)75   3.656e+09  1.960e+11   0.019  0.98514    
## L(Close.ts.diff, 1:110)76   8.334e+11  1.959e+11   4.255 3.91e-05 ***
## L(Close.ts.diff, 1:110)77   2.712e+11  1.961e+11   1.383  0.16903    
## L(Close.ts.diff, 1:110)78  -9.198e+10  2.092e+11  -0.440  0.66086    
## L(Close.ts.diff, 1:110)79  -1.253e+11  1.986e+11  -0.631  0.52937    
## L(Close.ts.diff, 1:110)80   1.007e+11  1.974e+11   0.510  0.61096    
## L(Close.ts.diff, 1:110)81   5.203e+10  2.114e+11   0.246  0.80592    
## L(Close.ts.diff, 1:110)82  -4.597e+11  2.156e+11  -2.132  0.03483 *  
## L(Close.ts.diff, 1:110)83  -1.148e+11  2.000e+11  -0.574  0.56695    
## L(Close.ts.diff, 1:110)84   7.064e+10  2.025e+11   0.349  0.72777    
## L(Close.ts.diff, 1:110)85  -1.529e+11  1.958e+11  -0.781  0.43610    
## L(Close.ts.diff, 1:110)86  -8.517e+09  1.957e+11  -0.044  0.96536    
## L(Close.ts.diff, 1:110)87   2.762e+11  2.098e+11   1.317  0.19018    
## L(Close.ts.diff, 1:110)88   4.054e+10  1.951e+11   0.208  0.83573    
## L(Close.ts.diff, 1:110)89   4.640e+10  1.957e+11   0.237  0.81292    
## L(Close.ts.diff, 1:110)90  -1.128e+11  1.952e+11  -0.578  0.56446    
## L(Close.ts.diff, 1:110)91   8.581e+10  1.951e+11   0.440  0.66083    
## L(Close.ts.diff, 1:110)92   9.266e+10  1.968e+11   0.471  0.63857    
## L(Close.ts.diff, 1:110)93   3.228e+10  1.954e+11   0.165  0.86907    
## L(Close.ts.diff, 1:110)94  -9.814e+09  1.978e+11  -0.050  0.96050    
## L(Close.ts.diff, 1:110)95   7.836e+10  1.954e+11   0.401  0.68901    
## L(Close.ts.diff, 1:110)96   3.101e+09  1.956e+11   0.016  0.98738    
## L(Close.ts.diff, 1:110)97   3.338e+10  1.948e+11   0.171  0.86422    
## L(Close.ts.diff, 1:110)98   7.496e+10  1.949e+11   0.385  0.70115    
## L(Close.ts.diff, 1:110)99   2.078e+11  1.950e+11   1.066  0.28857    
## L(Close.ts.diff, 1:110)100  3.745e+11  1.956e+11   1.915  0.05766 .  
## L(Close.ts.diff, 1:110)101  3.678e+10  2.096e+11   0.175  0.86098    
## L(Close.ts.diff, 1:110)102  3.637e+09  1.970e+11   0.018  0.98530    
## L(Close.ts.diff, 1:110)103  1.728e+11  1.958e+11   0.882  0.37917    
## L(Close.ts.diff, 1:110)104  1.298e+11  1.954e+11   0.664  0.50775    
## L(Close.ts.diff, 1:110)105 -1.281e+11  1.946e+11  -0.658  0.51165    
## L(Close.ts.diff, 1:110)106 -8.310e+10  1.972e+11  -0.421  0.67415    
## L(Close.ts.diff, 1:110)107 -1.727e+11  1.947e+11  -0.887  0.37657    
## L(Close.ts.diff, 1:110)108 -1.724e+11  1.944e+11  -0.887  0.37680    
## L(Close.ts.diff, 1:110)109 -1.502e+09  1.947e+11  -0.008  0.99386    
## L(Close.ts.diff, 1:110)110  1.082e+11  1.946e+11   0.556  0.57925    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.551e+14 on 133 degrees of freedom
## Multiple R-squared:  0.5223, Adjusted R-squared:  0.1128 
## F-statistic: 1.276 on 114 and 133 DF,  p-value: 0.08804

ARDL of Turnover and Open

ardl.turnover.open.1 <- dynlm(Turnover.ts ~ L(Turnover.ts, 1:4) + L(Open.ts.diff, 110), data = infy_stock)
summary(ardl.turnover.close.1)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 1:4) + L(Close.ts.diff, 
##     110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.759e+14 -1.190e+14 -4.453e+13  5.802e+13  1.781e+15 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            2.379e+14  4.188e+13   5.679 3.78e-08 ***
## L(Turnover.ts, 1:4)1   3.277e-01  6.329e-02   5.178 4.65e-07 ***
## L(Turnover.ts, 1:4)2   3.515e-02  6.661e-02   0.528    0.598    
## L(Turnover.ts, 1:4)3  -1.813e-02  6.671e-02  -0.272    0.786    
## L(Turnover.ts, 1:4)4   8.763e-02  6.337e-02   1.383    0.168    
## L(Close.ts.diff, 110)  4.385e+10  1.844e+11   0.238    0.812    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.537e+14 on 248 degrees of freedom
## Multiple R-squared:  0.1263, Adjusted R-squared:  0.1087 
## F-statistic: 7.172 on 5 and 248 DF,  p-value: 2.743e-06
ardl.turnover.open.2 <- dynlm(Turnover.ts ~ L(Turnover.ts, 1:4) + L(Open.ts.diff, 35) + L (Open.ts.diff, 110), data = infy_stock)
summary(ardl.turnover.close.2)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 1:4) + L(Close.ts.diff, 
##     1:110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.735e+14 -9.649e+13 -3.265e+13  4.919e+13  1.050e+15 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 2.329e+14  5.284e+13   4.407 2.08e-05 ***
## L(Turnover.ts, 1:4)1        3.394e-01  8.448e-02   4.017 9.60e-05 ***
## L(Turnover.ts, 1:4)2        7.559e-02  8.914e-02   0.848 0.397897    
## L(Turnover.ts, 1:4)3       -5.991e-02  8.919e-02  -0.672 0.502864    
## L(Turnover.ts, 1:4)4        9.371e-02  8.434e-02   1.111 0.268478    
## L(Close.ts.diff, 1:110)1    7.339e+10  1.611e+11   0.456 0.649388    
## L(Close.ts.diff, 1:110)2    1.657e+11  1.612e+11   1.028 0.305817    
## L(Close.ts.diff, 1:110)3    4.332e+10  1.617e+11   0.268 0.789204    
## L(Close.ts.diff, 1:110)4   -8.638e+10  1.618e+11  -0.534 0.594402    
## L(Close.ts.diff, 1:110)5    1.430e+11  1.620e+11   0.883 0.378722    
## L(Close.ts.diff, 1:110)6    8.402e+11  1.957e+11   4.293 3.29e-05 ***
## L(Close.ts.diff, 1:110)7   -2.172e+11  2.088e+11  -1.040 0.299955    
## L(Close.ts.diff, 1:110)8   -1.052e+11  2.092e+11  -0.503 0.615890    
## L(Close.ts.diff, 1:110)9    1.464e+11  2.088e+11   0.701 0.484299    
## L(Close.ts.diff, 1:110)10  -9.255e+10  2.086e+11  -0.444 0.657961    
## L(Close.ts.diff, 1:110)11  -1.621e+10  1.954e+11  -0.083 0.934008    
## L(Close.ts.diff, 1:110)12  -6.319e+10  1.951e+11  -0.324 0.746579    
## L(Close.ts.diff, 1:110)13   1.828e+11  1.953e+11   0.936 0.350926    
## L(Close.ts.diff, 1:110)14   1.700e+11  1.959e+11   0.868 0.387061    
## L(Close.ts.diff, 1:110)15   7.128e+10  1.965e+11   0.363 0.717289    
## L(Close.ts.diff, 1:110)16   1.206e+11  1.968e+11   0.613 0.540998    
## L(Close.ts.diff, 1:110)17   2.457e+11  1.962e+11   1.252 0.212560    
## L(Close.ts.diff, 1:110)18   3.434e+10  1.972e+11   0.174 0.861992    
## L(Close.ts.diff, 1:110)19   1.181e+11  1.968e+11   0.600 0.549307    
## L(Close.ts.diff, 1:110)20   3.291e+09  1.966e+11   0.017 0.986670    
## L(Close.ts.diff, 1:110)21  -1.867e+10  1.967e+11  -0.095 0.924545    
## L(Close.ts.diff, 1:110)22   4.037e+10  1.957e+11   0.206 0.836893    
## L(Close.ts.diff, 1:110)23  -6.412e+10  1.956e+11  -0.328 0.743565    
## L(Close.ts.diff, 1:110)24   1.775e+11  1.946e+11   0.912 0.363203    
## L(Close.ts.diff, 1:110)25   9.822e+10  1.954e+11   0.503 0.615977    
## L(Close.ts.diff, 1:110)26  -9.431e+11  1.955e+11  -4.823 3.67e-06 ***
## L(Close.ts.diff, 1:110)27   1.977e+11  2.113e+11   0.935 0.351197    
## L(Close.ts.diff, 1:110)28   3.297e+10  2.116e+11   0.156 0.876418    
## L(Close.ts.diff, 1:110)29   7.482e+10  2.110e+11   0.355 0.723470    
## L(Close.ts.diff, 1:110)30  -1.721e+10  2.076e+11  -0.083 0.934058    
## L(Close.ts.diff, 1:110)31  -1.372e+11  1.961e+11  -0.700 0.485290    
## L(Close.ts.diff, 1:110)32   1.895e+11  1.964e+11   0.965 0.336298    
## L(Close.ts.diff, 1:110)33  -6.174e+10  1.968e+11  -0.314 0.754153    
## L(Close.ts.diff, 1:110)34  -8.987e+10  1.964e+11  -0.458 0.647906    
## L(Close.ts.diff, 1:110)35   4.004e+09  1.957e+11   0.020 0.983701    
## L(Close.ts.diff, 1:110)36  -5.505e+10  1.955e+11  -0.282 0.778705    
## L(Close.ts.diff, 1:110)37   8.448e+10  1.952e+11   0.433 0.665822    
## L(Close.ts.diff, 1:110)38  -1.034e+11  1.951e+11  -0.530 0.596762    
## L(Close.ts.diff, 1:110)39   1.527e+11  1.950e+11   0.783 0.435093    
## L(Close.ts.diff, 1:110)40   3.860e+10  1.956e+11   0.197 0.843839    
## L(Close.ts.diff, 1:110)41  -1.435e+11  1.959e+11  -0.733 0.465072    
## L(Close.ts.diff, 1:110)42  -1.637e+11  1.961e+11  -0.835 0.405096    
## L(Close.ts.diff, 1:110)43  -8.991e+10  1.962e+11  -0.458 0.647521    
## L(Close.ts.diff, 1:110)44   1.694e+11  1.962e+11   0.863 0.389466    
## L(Close.ts.diff, 1:110)45   9.928e+10  1.967e+11   0.505 0.614490    
## L(Close.ts.diff, 1:110)46   8.374e+10  1.968e+11   0.426 0.671100    
## L(Close.ts.diff, 1:110)47   1.267e+10  1.964e+11   0.065 0.948629    
## L(Close.ts.diff, 1:110)48  -7.329e+10  1.956e+11  -0.375 0.708483    
## L(Close.ts.diff, 1:110)49  -2.369e+10  1.957e+11  -0.121 0.903837    
## L(Close.ts.diff, 1:110)50  -7.656e+10  1.957e+11  -0.391 0.696191    
## L(Close.ts.diff, 1:110)51  -6.874e+10  1.956e+11  -0.351 0.725829    
## L(Close.ts.diff, 1:110)52  -1.316e+11  1.955e+11  -0.673 0.502071    
## L(Close.ts.diff, 1:110)53  -1.302e+11  1.956e+11  -0.666 0.506643    
## L(Close.ts.diff, 1:110)54   4.434e+10  1.962e+11   0.226 0.821527    
## L(Close.ts.diff, 1:110)55  -6.630e+10  1.962e+11  -0.338 0.735944    
## L(Close.ts.diff, 1:110)56   5.868e+10  1.962e+11   0.299 0.765380    
## L(Close.ts.diff, 1:110)57  -7.955e+10  1.960e+11  -0.406 0.685506    
## L(Close.ts.diff, 1:110)58   3.189e+11  1.957e+11   1.630 0.105448    
## L(Close.ts.diff, 1:110)59  -6.487e+09  1.976e+11  -0.033 0.973855    
## L(Close.ts.diff, 1:110)60  -6.811e+10  1.974e+11  -0.345 0.730630    
## L(Close.ts.diff, 1:110)61   5.678e+09  1.972e+11   0.029 0.977077    
## L(Close.ts.diff, 1:110)62  -1.244e+11  1.965e+11  -0.633 0.527797    
## L(Close.ts.diff, 1:110)63   2.182e+10  1.953e+11   0.112 0.911218    
## L(Close.ts.diff, 1:110)64  -1.290e+11  1.954e+11  -0.660 0.510300    
## L(Close.ts.diff, 1:110)65  -4.913e+10  1.956e+11  -0.251 0.802104    
## L(Close.ts.diff, 1:110)66   1.716e+11  1.956e+11   0.877 0.381862    
## L(Close.ts.diff, 1:110)67   3.261e+10  1.961e+11   0.166 0.868160    
## L(Close.ts.diff, 1:110)68  -1.529e+11  1.959e+11  -0.780 0.436597    
## L(Close.ts.diff, 1:110)69   1.901e+11  1.963e+11   0.969 0.334410    
## L(Close.ts.diff, 1:110)70  -1.062e+10  1.965e+11  -0.054 0.956999    
## L(Close.ts.diff, 1:110)71   7.715e+10  1.961e+11   0.394 0.694545    
## L(Close.ts.diff, 1:110)72  -1.286e+11  1.960e+11  -0.656 0.512991    
## L(Close.ts.diff, 1:110)73  -2.963e+10  1.956e+11  -0.151 0.879828    
## L(Close.ts.diff, 1:110)74   1.183e+11  1.959e+11   0.604 0.546719    
## L(Close.ts.diff, 1:110)75   1.475e+10  1.963e+11   0.075 0.940220    
## L(Close.ts.diff, 1:110)76   8.400e+11  1.958e+11   4.291 3.32e-05 ***
## L(Close.ts.diff, 1:110)77   3.778e+10  2.075e+11   0.182 0.855775    
## L(Close.ts.diff, 1:110)78  -8.592e+10  2.074e+11  -0.414 0.679314    
## L(Close.ts.diff, 1:110)79  -9.532e+10  2.074e+11  -0.460 0.646531    
## L(Close.ts.diff, 1:110)80   6.725e+10  2.065e+11   0.326 0.745186    
## L(Close.ts.diff, 1:110)81  -2.137e+10  1.975e+11  -0.108 0.913998    
## L(Close.ts.diff, 1:110)82  -7.124e+11  1.958e+11  -3.638 0.000386 ***
## L(Close.ts.diff, 1:110)83  -3.165e+08  2.042e+11  -0.002 0.998766    
## L(Close.ts.diff, 1:110)84  -6.625e+09  2.037e+11  -0.033 0.974101    
## L(Close.ts.diff, 1:110)85  -1.514e+11  2.030e+11  -0.746 0.456962    
## L(Close.ts.diff, 1:110)86   6.248e+10  2.018e+11   0.310 0.757291    
## L(Close.ts.diff, 1:110)87   1.008e+10  1.955e+11   0.052 0.958947    
## L(Close.ts.diff, 1:110)88   1.621e+10  1.955e+11   0.083 0.934020    
## L(Close.ts.diff, 1:110)89   1.850e+10  1.954e+11   0.095 0.924721    
## L(Close.ts.diff, 1:110)90  -7.614e+10  1.949e+11  -0.391 0.696588    
## L(Close.ts.diff, 1:110)91   7.648e+10  1.949e+11   0.393 0.695280    
## L(Close.ts.diff, 1:110)92   8.090e+10  1.951e+11   0.415 0.679044    
## L(Close.ts.diff, 1:110)93   3.490e+10  1.953e+11   0.179 0.858413    
## L(Close.ts.diff, 1:110)94   8.301e+10  1.950e+11   0.426 0.670977    
## L(Close.ts.diff, 1:110)95   1.086e+10  1.956e+11   0.056 0.955808    
## L(Close.ts.diff, 1:110)96  -3.669e+10  1.954e+11  -0.188 0.851353    
## L(Close.ts.diff, 1:110)97   1.097e+10  1.952e+11   0.056 0.955280    
## L(Close.ts.diff, 1:110)98   3.885e+10  1.952e+11   0.199 0.842573    
## L(Close.ts.diff, 1:110)99   1.531e+11  1.950e+11   0.785 0.433730    
## L(Close.ts.diff, 1:110)100  2.930e+11  1.956e+11   1.498 0.136323    
## L(Close.ts.diff, 1:110)101 -5.918e+10  1.972e+11  -0.300 0.764513    
## L(Close.ts.diff, 1:110)102 -4.528e+09  1.971e+11  -0.023 0.981705    
## L(Close.ts.diff, 1:110)103  1.211e+11  1.971e+11   0.615 0.539768    
## L(Close.ts.diff, 1:110)104  3.255e+08  1.974e+11   0.002 0.998686    
## L(Close.ts.diff, 1:110)105 -1.619e+11  1.942e+11  -0.833 0.406053    
## L(Close.ts.diff, 1:110)106 -9.826e+10  1.953e+11  -0.503 0.615602    
## L(Close.ts.diff, 1:110)107 -1.163e+11  1.953e+11  -0.595 0.552643    
## L(Close.ts.diff, 1:110)108 -1.040e+11  1.952e+11  -0.533 0.595153    
## L(Close.ts.diff, 1:110)109  2.938e+10  1.950e+11   0.151 0.880456    
## L(Close.ts.diff, 1:110)110  8.288e+10  1.949e+11   0.425 0.671371    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.559e+14 on 139 degrees of freedom
## Multiple R-squared:  0.5018, Adjusted R-squared:  0.09325 
## F-statistic: 1.228 on 114 and 139 DF,  p-value: 0.1237
ardl.turnover.open.3 <- dynlm(Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts,61) + L(Turnover.ts, 75) + L(Turnover.ts,117) + L(Open.ts.diff, 110), data = infy_stock)
summary(ardl.turnover.close.3)
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts, 
##     61) + L(Turnover.ts, 75) + L(Turnover.ts, 117) + L(Close.ts.diff, 
##     110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -5.755e+14 -1.384e+14 -2.222e+13  1.007e+14  1.825e+15 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           9.077e+13  5.152e+13   1.762  0.07939 .  
## L(Turnover.ts, 2)     1.706e-01  5.747e-02   2.969  0.00329 ** 
## L(Turnover.ts, 61)    2.840e-01  5.778e-02   4.914 1.64e-06 ***
## L(Turnover.ts, 75)    4.264e-02  5.746e-02   0.742  0.45878    
## L(Turnover.ts, 117)   2.884e-01  5.784e-02   4.987 1.17e-06 ***
## L(Close.ts.diff, 110) 1.181e+11  1.778e+11   0.665  0.50697    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.44e+14 on 242 degrees of freedom
## Multiple R-squared:  0.2045, Adjusted R-squared:  0.188 
## F-statistic: 12.44 on 5 and 242 DF,  p-value: 9.408e-11
ardl.turnover.open.4 <- dynlm(Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts,61) + L(Turnover.ts, 75) + L(Turnover.ts,117) + L(Open.ts.diff, 35) + L(Open.ts.diff, 110), data = infy_stock)
summary(ardl.turnover.close.4)
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts, 
##     61) + L(Turnover.ts, 75) + L(Turnover.ts, 117) + L(Close.ts.diff, 
##     1:110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -4.384e+14 -1.097e+14 -2.262e+13  7.092e+13  1.108e+15 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 1.106e+14  7.389e+13   1.498  0.13663    
## L(Turnover.ts, 2)           1.818e-01  7.859e-02   2.313  0.02224 *  
## L(Turnover.ts, 61)          2.717e-01  8.743e-02   3.108  0.00231 ** 
## L(Turnover.ts, 75)         -9.467e-03  8.713e-02  -0.109  0.91364    
## L(Turnover.ts, 117)         2.946e-01  9.255e-02   3.184  0.00181 ** 
## L(Close.ts.diff, 1:110)1   -2.861e+10  1.945e+11  -0.147  0.88326    
## L(Close.ts.diff, 1:110)2    1.521e+11  1.957e+11   0.777  0.43848    
## L(Close.ts.diff, 1:110)3    6.492e+08  1.942e+11   0.003  0.99734    
## L(Close.ts.diff, 1:110)4   -9.810e+10  1.952e+11  -0.503  0.61612    
## L(Close.ts.diff, 1:110)5    1.409e+11  1.944e+11   0.725  0.46979    
## L(Close.ts.diff, 1:110)6    4.138e+11  2.227e+11   1.859  0.06530 .  
## L(Close.ts.diff, 1:110)7   -4.007e+10  1.968e+11  -0.204  0.83900    
## L(Close.ts.diff, 1:110)8   -8.854e+10  2.085e+11  -0.425  0.67183    
## L(Close.ts.diff, 1:110)9    1.879e+11  1.961e+11   0.958  0.33956    
## L(Close.ts.diff, 1:110)10   9.941e+09  1.952e+11   0.051  0.95947    
## L(Close.ts.diff, 1:110)11   2.261e+10  1.950e+11   0.116  0.90786    
## L(Close.ts.diff, 1:110)12   2.422e+11  2.183e+11   1.110  0.26922    
## L(Close.ts.diff, 1:110)13   1.887e+11  1.954e+11   0.966  0.33585    
## L(Close.ts.diff, 1:110)14   2.739e+11  1.954e+11   1.402  0.16338    
## L(Close.ts.diff, 1:110)15   2.032e+11  1.960e+11   1.037  0.30179    
## L(Close.ts.diff, 1:110)16   1.543e+11  1.973e+11   0.782  0.43563    
## L(Close.ts.diff, 1:110)17   3.081e+11  1.950e+11   1.580  0.11658    
## L(Close.ts.diff, 1:110)18   7.711e+10  1.956e+11   0.394  0.69413    
## L(Close.ts.diff, 1:110)19   1.816e+11  1.962e+11   0.925  0.35659    
## L(Close.ts.diff, 1:110)20   1.353e+11  2.040e+11   0.663  0.50838    
## L(Close.ts.diff, 1:110)21   4.811e+10  1.965e+11   0.245  0.80699    
## L(Close.ts.diff, 1:110)22   9.921e+10  1.968e+11   0.504  0.61506    
## L(Close.ts.diff, 1:110)23   3.112e+10  1.960e+11   0.159  0.87411    
## L(Close.ts.diff, 1:110)24   3.041e+11  1.961e+11   1.550  0.12346    
## L(Close.ts.diff, 1:110)25   2.750e+11  1.962e+11   1.402  0.16337    
## L(Close.ts.diff, 1:110)26  -5.933e+11  2.134e+11  -2.780  0.00622 ** 
## L(Close.ts.diff, 1:110)27   1.456e+10  1.993e+11   0.073  0.94188    
## L(Close.ts.diff, 1:110)28   1.327e+11  2.072e+11   0.640  0.52307    
## L(Close.ts.diff, 1:110)29   8.735e+10  1.972e+11   0.443  0.65850    
## L(Close.ts.diff, 1:110)30  -1.742e+10  1.962e+11  -0.089  0.92939    
## L(Close.ts.diff, 1:110)31  -1.962e+11  1.962e+11  -1.000  0.31914    
## L(Close.ts.diff, 1:110)32   6.967e+10  1.964e+11   0.355  0.72332    
## L(Close.ts.diff, 1:110)33  -4.210e+10  1.972e+11  -0.213  0.83127    
## L(Close.ts.diff, 1:110)34  -1.024e+11  1.953e+11  -0.524  0.60083    
## L(Close.ts.diff, 1:110)35  -6.332e+10  1.953e+11  -0.324  0.74631    
## L(Close.ts.diff, 1:110)36  -1.464e+11  1.965e+11  -0.745  0.45778    
## L(Close.ts.diff, 1:110)37   1.796e+10  1.964e+11   0.091  0.92725    
## L(Close.ts.diff, 1:110)38  -1.741e+11  1.970e+11  -0.884  0.37847    
## L(Close.ts.diff, 1:110)39   1.427e+11  1.949e+11   0.732  0.46517    
## L(Close.ts.diff, 1:110)40   6.295e+10  2.128e+11   0.296  0.76781    
## L(Close.ts.diff, 1:110)41  -1.481e+11  1.993e+11  -0.743  0.45874    
## L(Close.ts.diff, 1:110)42  -2.085e+11  1.957e+11  -1.066  0.28852    
## L(Close.ts.diff, 1:110)43  -1.441e+11  1.952e+11  -0.738  0.46159    
## L(Close.ts.diff, 1:110)44   1.391e+11  1.963e+11   0.708  0.47994    
## L(Close.ts.diff, 1:110)45   1.611e+11  1.955e+11   0.824  0.41134    
## L(Close.ts.diff, 1:110)46   8.892e+10  1.949e+11   0.456  0.64891    
## L(Close.ts.diff, 1:110)47   2.950e+10  1.952e+11   0.151  0.88009    
## L(Close.ts.diff, 1:110)48  -1.250e+11  1.958e+11  -0.639  0.52419    
## L(Close.ts.diff, 1:110)49  -1.461e+10  1.955e+11  -0.075  0.94053    
## L(Close.ts.diff, 1:110)50  -6.991e+09  1.981e+11  -0.035  0.97190    
## L(Close.ts.diff, 1:110)51  -4.997e+10  1.954e+11  -0.256  0.79858    
## L(Close.ts.diff, 1:110)52  -2.406e+11  1.981e+11  -1.215  0.22666    
## L(Close.ts.diff, 1:110)53  -2.213e+11  1.952e+11  -1.134  0.25902    
## L(Close.ts.diff, 1:110)54   1.635e+10  1.955e+11   0.084  0.93348    
## L(Close.ts.diff, 1:110)55  -8.485e+10  1.959e+11  -0.433  0.66563    
## L(Close.ts.diff, 1:110)56  -4.230e+09  1.958e+11  -0.022  0.98280    
## L(Close.ts.diff, 1:110)57  -8.049e+10  1.955e+11  -0.412  0.68129    
## L(Close.ts.diff, 1:110)58   2.391e+11  1.957e+11   1.221  0.22409    
## L(Close.ts.diff, 1:110)59   1.043e+11  1.955e+11   0.533  0.59476    
## L(Close.ts.diff, 1:110)60  -8.921e+10  1.965e+11  -0.454  0.65052    
## L(Close.ts.diff, 1:110)61  -2.069e+10  1.956e+11  -0.106  0.91592    
## L(Close.ts.diff, 1:110)62  -3.194e+11  2.041e+11  -1.564  0.12009    
## L(Close.ts.diff, 1:110)63  -1.170e+11  1.965e+11  -0.595  0.55264    
## L(Close.ts.diff, 1:110)64  -1.089e+11  1.987e+11  -0.548  0.58461    
## L(Close.ts.diff, 1:110)65  -4.240e+09  1.958e+11  -0.022  0.98275    
## L(Close.ts.diff, 1:110)66   1.512e+11  1.958e+11   0.772  0.44137    
## L(Close.ts.diff, 1:110)67  -1.484e+11  2.111e+11  -0.703  0.48342    
## L(Close.ts.diff, 1:110)68  -2.021e+11  1.954e+11  -1.034  0.30278    
## L(Close.ts.diff, 1:110)69   1.209e+11  1.947e+11   0.621  0.53587    
## L(Close.ts.diff, 1:110)70   5.483e+10  1.956e+11   0.280  0.77968    
## L(Close.ts.diff, 1:110)71   1.230e+11  1.957e+11   0.628  0.53097    
## L(Close.ts.diff, 1:110)72  -7.109e+10  1.952e+11  -0.364  0.71630    
## L(Close.ts.diff, 1:110)73  -3.854e+10  1.954e+11  -0.197  0.84398    
## L(Close.ts.diff, 1:110)74   4.417e+10  1.956e+11   0.226  0.82173    
## L(Close.ts.diff, 1:110)75   3.656e+09  1.960e+11   0.019  0.98514    
## L(Close.ts.diff, 1:110)76   8.334e+11  1.959e+11   4.255 3.91e-05 ***
## L(Close.ts.diff, 1:110)77   2.712e+11  1.961e+11   1.383  0.16903    
## L(Close.ts.diff, 1:110)78  -9.198e+10  2.092e+11  -0.440  0.66086    
## L(Close.ts.diff, 1:110)79  -1.253e+11  1.986e+11  -0.631  0.52937    
## L(Close.ts.diff, 1:110)80   1.007e+11  1.974e+11   0.510  0.61096    
## L(Close.ts.diff, 1:110)81   5.203e+10  2.114e+11   0.246  0.80592    
## L(Close.ts.diff, 1:110)82  -4.597e+11  2.156e+11  -2.132  0.03483 *  
## L(Close.ts.diff, 1:110)83  -1.148e+11  2.000e+11  -0.574  0.56695    
## L(Close.ts.diff, 1:110)84   7.064e+10  2.025e+11   0.349  0.72777    
## L(Close.ts.diff, 1:110)85  -1.529e+11  1.958e+11  -0.781  0.43610    
## L(Close.ts.diff, 1:110)86  -8.517e+09  1.957e+11  -0.044  0.96536    
## L(Close.ts.diff, 1:110)87   2.762e+11  2.098e+11   1.317  0.19018    
## L(Close.ts.diff, 1:110)88   4.054e+10  1.951e+11   0.208  0.83573    
## L(Close.ts.diff, 1:110)89   4.640e+10  1.957e+11   0.237  0.81292    
## L(Close.ts.diff, 1:110)90  -1.128e+11  1.952e+11  -0.578  0.56446    
## L(Close.ts.diff, 1:110)91   8.581e+10  1.951e+11   0.440  0.66083    
## L(Close.ts.diff, 1:110)92   9.266e+10  1.968e+11   0.471  0.63857    
## L(Close.ts.diff, 1:110)93   3.228e+10  1.954e+11   0.165  0.86907    
## L(Close.ts.diff, 1:110)94  -9.814e+09  1.978e+11  -0.050  0.96050    
## L(Close.ts.diff, 1:110)95   7.836e+10  1.954e+11   0.401  0.68901    
## L(Close.ts.diff, 1:110)96   3.101e+09  1.956e+11   0.016  0.98738    
## L(Close.ts.diff, 1:110)97   3.338e+10  1.948e+11   0.171  0.86422    
## L(Close.ts.diff, 1:110)98   7.496e+10  1.949e+11   0.385  0.70115    
## L(Close.ts.diff, 1:110)99   2.078e+11  1.950e+11   1.066  0.28857    
## L(Close.ts.diff, 1:110)100  3.745e+11  1.956e+11   1.915  0.05766 .  
## L(Close.ts.diff, 1:110)101  3.678e+10  2.096e+11   0.175  0.86098    
## L(Close.ts.diff, 1:110)102  3.637e+09  1.970e+11   0.018  0.98530    
## L(Close.ts.diff, 1:110)103  1.728e+11  1.958e+11   0.882  0.37917    
## L(Close.ts.diff, 1:110)104  1.298e+11  1.954e+11   0.664  0.50775    
## L(Close.ts.diff, 1:110)105 -1.281e+11  1.946e+11  -0.658  0.51165    
## L(Close.ts.diff, 1:110)106 -8.310e+10  1.972e+11  -0.421  0.67415    
## L(Close.ts.diff, 1:110)107 -1.727e+11  1.947e+11  -0.887  0.37657    
## L(Close.ts.diff, 1:110)108 -1.724e+11  1.944e+11  -0.887  0.37680    
## L(Close.ts.diff, 1:110)109 -1.502e+09  1.947e+11  -0.008  0.99386    
## L(Close.ts.diff, 1:110)110  1.082e+11  1.946e+11   0.556  0.57925    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.551e+14 on 133 degrees of freedom
## Multiple R-squared:  0.5223, Adjusted R-squared:  0.1128 
## F-statistic: 1.276 on 114 and 133 DF,  p-value: 0.08804

ARDL of Volume and Close

ardl.volume.close.1 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Close.ts.diff, 110), data = infy_stock)
summary(ardl.volume.close.1)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Close.ts.diff, 
##     110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2655876  -835982  -253740   406222 16602471 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            5.428e+05  4.000e+05   1.357   0.1762    
## L(Volume.ts, 1:32)1    3.211e-01  6.739e-02   4.766 3.42e-06 ***
## L(Volume.ts, 1:32)2    5.738e-02  7.077e-02   0.811   0.4184    
## L(Volume.ts, 1:32)3   -4.028e-02  7.105e-02  -0.567   0.5714    
## L(Volume.ts, 1:32)4    9.029e-02  7.045e-02   1.282   0.2013    
## L(Volume.ts, 1:32)5    2.284e-03  7.043e-02   0.032   0.9742    
## L(Volume.ts, 1:32)6    5.138e-02  7.046e-02   0.729   0.4666    
## L(Volume.ts, 1:32)7    1.222e-01  7.049e-02   1.733   0.0845 .  
## L(Volume.ts, 1:32)8   -2.718e-03  7.091e-02  -0.038   0.9695    
## L(Volume.ts, 1:32)9   -6.121e-03  7.072e-02  -0.087   0.9311    
## L(Volume.ts, 1:32)10   5.304e-02  7.130e-02   0.744   0.4577    
## L(Volume.ts, 1:32)11  -7.402e-02  7.035e-02  -1.052   0.2938    
## L(Volume.ts, 1:32)12   1.587e-02  7.050e-02   0.225   0.8221    
## L(Volume.ts, 1:32)13  -3.196e-02  7.051e-02  -0.453   0.6508    
## L(Volume.ts, 1:32)14  -3.331e-02  7.062e-02  -0.472   0.6376    
## L(Volume.ts, 1:32)15   7.403e-02  7.049e-02   1.050   0.2948    
## L(Volume.ts, 1:32)16  -3.776e-02  7.078e-02  -0.534   0.5942    
## L(Volume.ts, 1:32)17  -1.413e-02  7.114e-02  -0.199   0.8428    
## L(Volume.ts, 1:32)18   4.508e-02  7.084e-02   0.636   0.5252    
## L(Volume.ts, 1:32)19  -1.906e-02  7.087e-02  -0.269   0.7882    
## L(Volume.ts, 1:32)20   1.334e-02  7.086e-02   0.188   0.8508    
## L(Volume.ts, 1:32)21  -2.452e-02  7.099e-02  -0.345   0.7301    
## L(Volume.ts, 1:32)22   1.536e-02  7.073e-02   0.217   0.8283    
## L(Volume.ts, 1:32)23  -6.945e-03  7.063e-02  -0.098   0.9218    
## L(Volume.ts, 1:32)24   8.218e-02  7.068e-02   1.163   0.2462    
## L(Volume.ts, 1:32)25   3.781e-02  7.105e-02   0.532   0.5952    
## L(Volume.ts, 1:32)26   3.019e-02  7.045e-02   0.428   0.6687    
## L(Volume.ts, 1:32)27   1.034e-02  7.041e-02   0.147   0.8834    
## L(Volume.ts, 1:32)28  -8.898e-02  7.311e-02  -1.217   0.2249    
## L(Volume.ts, 1:32)29   1.327e-01  7.052e-02   1.882   0.0611 .  
## L(Volume.ts, 1:32)30  -2.937e-02  7.094e-02  -0.414   0.6793    
## L(Volume.ts, 1:32)31   3.599e-02  7.102e-02   0.507   0.6128    
## L(Volume.ts, 1:32)32   3.964e-02  6.747e-02   0.588   0.5575    
## L(Close.ts.diff, 110) -1.808e+02  1.437e+03  -0.126   0.9000    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1854000 on 220 degrees of freedom
## Multiple R-squared:  0.268,  Adjusted R-squared:  0.1582 
## F-statistic: 2.441 on 33 and 220 DF,  p-value: 6.89e-05
ardl.volume.close.2 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Close.ts.diff, 1:110), data = infy_stock)
summary(ardl.volume.close.2)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Close.ts.diff, 
##     1:110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2616765  -664712   -77535   379842  6043927 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 1.834e+06  7.916e+05   2.317  0.02233 *  
## L(Volume.ts, 1:32)1         2.839e-01  9.492e-02   2.991  0.00342 ** 
## L(Volume.ts, 1:32)2         5.724e-02  9.894e-02   0.579  0.56407    
## L(Volume.ts, 1:32)3        -1.020e-01  9.886e-02  -1.032  0.30455    
## L(Volume.ts, 1:32)4         9.376e-02  9.862e-02   0.951  0.34381    
## L(Volume.ts, 1:32)5        -3.309e-02  9.817e-02  -0.337  0.73669    
## L(Volume.ts, 1:32)6         2.138e-01  9.814e-02   2.179  0.03145 *  
## L(Volume.ts, 1:32)7         1.283e-01  1.001e-01   1.282  0.20258    
## L(Volume.ts, 1:32)8        -5.782e-02  1.004e-01  -0.576  0.56602    
## L(Volume.ts, 1:32)9         3.384e-02  9.988e-02   0.339  0.73539    
## L(Volume.ts, 1:32)10        3.517e-03  1.010e-01   0.035  0.97228    
## L(Volume.ts, 1:32)11       -1.465e-01  9.978e-02  -1.468  0.14488    
## L(Volume.ts, 1:32)12        1.599e-03  1.016e-01   0.016  0.98747    
## L(Volume.ts, 1:32)13       -1.056e-01  9.988e-02  -1.057  0.29272    
## L(Volume.ts, 1:32)14       -1.012e-01  1.004e-01  -1.008  0.31589    
## L(Volume.ts, 1:32)15        2.966e-02  1.005e-01   0.295  0.76849    
## L(Volume.ts, 1:32)16       -5.455e-02  1.004e-01  -0.543  0.58804    
## L(Volume.ts, 1:32)17        6.465e-02  1.006e-01   0.643  0.52163    
## L(Volume.ts, 1:32)18        3.846e-02  1.002e-01   0.384  0.70175    
## L(Volume.ts, 1:32)19       -3.670e-02  9.987e-02  -0.367  0.71397    
## L(Volume.ts, 1:32)20        1.803e-01  9.958e-02   1.811  0.07291 .  
## L(Volume.ts, 1:32)21       -6.883e-02  1.007e-01  -0.683  0.49579    
## L(Volume.ts, 1:32)22       -5.455e-02  9.966e-02  -0.547  0.58520    
## L(Volume.ts, 1:32)23       -8.851e-02  1.000e-01  -0.885  0.37819    
## L(Volume.ts, 1:32)24        5.916e-02  1.016e-01   0.582  0.56153    
## L(Volume.ts, 1:32)25        4.650e-02  1.016e-01   0.458  0.64813    
## L(Volume.ts, 1:32)26       -1.093e-01  1.011e-01  -1.082  0.28163    
## L(Volume.ts, 1:32)27        7.259e-03  9.953e-02   0.073  0.94199    
## L(Volume.ts, 1:32)28       -8.456e-02  9.970e-02  -0.848  0.39817    
## L(Volume.ts, 1:32)29        1.139e-01  9.412e-02   1.211  0.22858    
## L(Volume.ts, 1:32)30       -9.664e-03  9.409e-02  -0.103  0.91838    
## L(Volume.ts, 1:32)31       -2.868e-02  9.391e-02  -0.305  0.76063    
## L(Volume.ts, 1:32)32        1.110e-01  8.762e-02   1.267  0.20769    
## L(Close.ts.diff, 1:110)1   -1.462e+02  1.210e+03  -0.121  0.90406    
## L(Close.ts.diff, 1:110)2    5.881e+02  1.210e+03   0.486  0.62798    
## L(Close.ts.diff, 1:110)3    2.747e+02  1.211e+03   0.227  0.82104    
## L(Close.ts.diff, 1:110)4   -1.140e+03  1.212e+03  -0.940  0.34902    
## L(Close.ts.diff, 1:110)5    3.560e+02  1.218e+03   0.292  0.77065    
## L(Close.ts.diff, 1:110)6    3.366e+03  1.455e+03   2.313  0.02256 *  
## L(Close.ts.diff, 1:110)7   -1.147e+03  1.494e+03  -0.768  0.44419    
## L(Close.ts.diff, 1:110)8   -1.230e+03  1.494e+03  -0.823  0.41213    
## L(Close.ts.diff, 1:110)9   -3.403e+02  1.496e+03  -0.227  0.82051    
## L(Close.ts.diff, 1:110)10  -5.076e+02  1.475e+03  -0.344  0.73145    
## L(Close.ts.diff, 1:110)11  -8.795e+02  1.475e+03  -0.596  0.55210    
## L(Close.ts.diff, 1:110)12  -1.557e+03  1.476e+03  -1.055  0.29377    
## L(Close.ts.diff, 1:110)13   8.243e+02  1.476e+03   0.558  0.57775    
## L(Close.ts.diff, 1:110)14   1.228e+03  1.481e+03   0.829  0.40889    
## L(Close.ts.diff, 1:110)15  -4.525e+01  1.485e+03  -0.030  0.97574    
## L(Close.ts.diff, 1:110)16   3.690e+02  1.484e+03   0.249  0.80415    
## L(Close.ts.diff, 1:110)17   1.378e+03  1.482e+03   0.930  0.35456    
## L(Close.ts.diff, 1:110)18  -3.476e+02  1.487e+03  -0.234  0.81563    
## L(Close.ts.diff, 1:110)19  -6.267e+00  1.483e+03  -0.004  0.99664    
## L(Close.ts.diff, 1:110)20  -9.261e+01  1.473e+03  -0.063  0.94999    
## L(Close.ts.diff, 1:110)21  -7.406e+02  1.473e+03  -0.503  0.61609    
## L(Close.ts.diff, 1:110)22  -4.984e+01  1.469e+03  -0.034  0.97299    
## L(Close.ts.diff, 1:110)23  -1.833e+03  1.469e+03  -1.248  0.21474    
## L(Close.ts.diff, 1:110)24   3.469e+02  1.469e+03   0.236  0.81381    
## L(Close.ts.diff, 1:110)25   9.659e+02  1.469e+03   0.658  0.51212    
## L(Close.ts.diff, 1:110)26  -9.938e+03  1.471e+03  -6.755 6.86e-10 ***
## L(Close.ts.diff, 1:110)27   1.209e+03  1.761e+03   0.686  0.49399    
## L(Close.ts.diff, 1:110)28   3.478e+02  1.763e+03   0.197  0.84400    
## L(Close.ts.diff, 1:110)29   3.762e+02  1.762e+03   0.214  0.83129    
## L(Close.ts.diff, 1:110)30  -4.712e+02  1.760e+03  -0.268  0.78943    
## L(Close.ts.diff, 1:110)31  -2.620e+03  1.760e+03  -1.489  0.13930    
## L(Close.ts.diff, 1:110)32   2.837e+03  1.773e+03   1.600  0.11239    
## L(Close.ts.diff, 1:110)33   2.161e+02  1.777e+03   0.122  0.90343    
## L(Close.ts.diff, 1:110)34  -1.469e+03  1.776e+03  -0.827  0.41016    
## L(Close.ts.diff, 1:110)35  -9.850e+02  1.763e+03  -0.559  0.57755    
## L(Close.ts.diff, 1:110)36  -7.892e+02  1.769e+03  -0.446  0.65635    
## L(Close.ts.diff, 1:110)37  -2.313e+02  1.772e+03  -0.131  0.89638    
## L(Close.ts.diff, 1:110)38  -1.650e+03  1.758e+03  -0.939  0.34981    
## L(Close.ts.diff, 1:110)39  -4.083e+02  1.670e+03  -0.244  0.80733    
## L(Close.ts.diff, 1:110)40  -5.623e+01  1.672e+03  -0.034  0.97324    
## L(Close.ts.diff, 1:110)41  -1.010e+03  1.667e+03  -0.606  0.54576    
## L(Close.ts.diff, 1:110)42  -1.927e+03  1.670e+03  -1.154  0.25117    
## L(Close.ts.diff, 1:110)43  -5.776e+02  1.679e+03  -0.344  0.73151    
## L(Close.ts.diff, 1:110)44   9.991e+02  1.674e+03   0.597  0.55177    
## L(Close.ts.diff, 1:110)45   4.668e+01  1.663e+03   0.028  0.97766    
## L(Close.ts.diff, 1:110)46   1.295e+03  1.662e+03   0.779  0.43751    
## L(Close.ts.diff, 1:110)47  -7.589e+02  1.653e+03  -0.459  0.64698    
## L(Close.ts.diff, 1:110)48  -6.981e+02  1.652e+03  -0.423  0.67334    
## L(Close.ts.diff, 1:110)49  -1.960e+03  1.653e+03  -1.185  0.23838    
## L(Close.ts.diff, 1:110)50  -1.290e+03  1.669e+03  -0.773  0.44126    
## L(Close.ts.diff, 1:110)51  -8.033e+02  1.673e+03  -0.480  0.63217    
## L(Close.ts.diff, 1:110)52  -3.024e+03  1.671e+03  -1.809  0.07310 .  
## L(Close.ts.diff, 1:110)53  -2.420e+03  1.689e+03  -1.433  0.15462    
## L(Close.ts.diff, 1:110)54  -1.194e+03  1.703e+03  -0.701  0.48488    
## L(Close.ts.diff, 1:110)55   5.645e+01  1.665e+03   0.034  0.97301    
## L(Close.ts.diff, 1:110)56  -5.048e+01  1.661e+03  -0.030  0.97581    
## L(Close.ts.diff, 1:110)57  -1.431e+03  1.656e+03  -0.864  0.38966    
## L(Close.ts.diff, 1:110)58   2.823e+03  1.618e+03   1.745  0.08373 .  
## L(Close.ts.diff, 1:110)59   6.819e+02  1.479e+03   0.461  0.64563    
## L(Close.ts.diff, 1:110)60  -1.525e+02  1.474e+03  -0.103  0.91780    
## L(Close.ts.diff, 1:110)61  -6.843e+02  1.471e+03  -0.465  0.64276    
## L(Close.ts.diff, 1:110)62  -1.538e+03  1.470e+03  -1.046  0.29762    
## L(Close.ts.diff, 1:110)63  -2.373e+02  1.477e+03  -0.161  0.87264    
## L(Close.ts.diff, 1:110)64  -3.029e+03  1.474e+03  -2.055  0.04226 *  
## L(Close.ts.diff, 1:110)65  -1.621e+03  1.494e+03  -1.085  0.28013    
## L(Close.ts.diff, 1:110)66   1.213e+02  1.500e+03   0.081  0.93567    
## L(Close.ts.diff, 1:110)67  -1.577e+02  1.492e+03  -0.106  0.91598    
## L(Close.ts.diff, 1:110)68  -1.641e+03  1.487e+03  -1.103  0.27242    
## L(Close.ts.diff, 1:110)69   8.109e+02  1.491e+03   0.544  0.58754    
## L(Close.ts.diff, 1:110)70  -3.972e+02  1.485e+03  -0.268  0.78957    
## L(Close.ts.diff, 1:110)71   8.528e+02  1.480e+03   0.576  0.56560    
## L(Close.ts.diff, 1:110)72  -1.410e+03  1.482e+03  -0.951  0.34343    
## L(Close.ts.diff, 1:110)73  -1.310e+03  1.486e+03  -0.882  0.37976    
## L(Close.ts.diff, 1:110)74   6.551e+02  1.500e+03   0.437  0.66315    
## L(Close.ts.diff, 1:110)75  -1.075e+03  1.493e+03  -0.720  0.47320    
## L(Close.ts.diff, 1:110)76   2.771e+03  1.489e+03   1.861  0.06535 .  
## L(Close.ts.diff, 1:110)77   2.118e+02  1.504e+03   0.141  0.88823    
## L(Close.ts.diff, 1:110)78  -1.321e+03  1.502e+03  -0.879  0.38108    
## L(Close.ts.diff, 1:110)79  -8.237e+02  1.504e+03  -0.548  0.58491    
## L(Close.ts.diff, 1:110)80  -1.501e+02  1.503e+03  -0.100  0.92063    
## L(Close.ts.diff, 1:110)81  -9.441e+02  1.503e+03  -0.628  0.53116    
## L(Close.ts.diff, 1:110)82  -6.434e+03  1.506e+03  -4.274 4.08e-05 ***
## L(Close.ts.diff, 1:110)83  -2.066e+03  1.627e+03  -1.270  0.20674    
## L(Close.ts.diff, 1:110)84  -7.141e+02  1.637e+03  -0.436  0.66362    
## L(Close.ts.diff, 1:110)85  -1.535e+03  1.619e+03  -0.948  0.34509    
## L(Close.ts.diff, 1:110)86  -1.035e+02  1.618e+03  -0.064  0.94913    
## L(Close.ts.diff, 1:110)87  -3.230e+02  1.616e+03  -0.200  0.84196    
## L(Close.ts.diff, 1:110)88   1.091e+03  1.609e+03   0.678  0.49919    
## L(Close.ts.diff, 1:110)89   1.524e+03  1.610e+03   0.947  0.34588    
## L(Close.ts.diff, 1:110)90  -3.577e+02  1.607e+03  -0.223  0.82425    
## L(Close.ts.diff, 1:110)91   6.251e+02  1.597e+03   0.391  0.69627    
## L(Close.ts.diff, 1:110)92   6.443e+02  1.612e+03   0.400  0.69008    
## L(Close.ts.diff, 1:110)93  -1.056e+03  1.616e+03  -0.654  0.51466    
## L(Close.ts.diff, 1:110)94  -6.949e+02  1.616e+03  -0.430  0.66810    
## L(Close.ts.diff, 1:110)95  -1.323e+03  1.623e+03  -0.815  0.41685    
## L(Close.ts.diff, 1:110)96  -2.106e+03  1.626e+03  -1.295  0.19786    
## L(Close.ts.diff, 1:110)97   2.237e+02  1.635e+03   0.137  0.89143    
## L(Close.ts.diff, 1:110)98  -9.916e+02  1.635e+03  -0.606  0.54552    
## L(Close.ts.diff, 1:110)99   1.304e+03  1.624e+03   0.803  0.42397    
## L(Close.ts.diff, 1:110)100  1.578e+03  1.625e+03   0.971  0.33380    
## L(Close.ts.diff, 1:110)101 -1.005e+03  1.612e+03  -0.623  0.53440    
## L(Close.ts.diff, 1:110)102  1.229e+03  1.615e+03   0.761  0.44824    
## L(Close.ts.diff, 1:110)103  6.648e+02  1.610e+03   0.413  0.68049    
## L(Close.ts.diff, 1:110)104 -1.361e+02  1.611e+03  -0.085  0.93280    
## L(Close.ts.diff, 1:110)105 -2.105e+03  1.581e+03  -1.331  0.18591    
## L(Close.ts.diff, 1:110)106 -1.955e+03  1.592e+03  -1.228  0.22202    
## L(Close.ts.diff, 1:110)107 -1.605e+03  1.603e+03  -1.002  0.31866    
## L(Close.ts.diff, 1:110)108 -2.038e+03  1.596e+03  -1.277  0.20423    
## L(Close.ts.diff, 1:110)109 -8.089e+02  1.566e+03  -0.517  0.60642    
## L(Close.ts.diff, 1:110)110 -6.369e+02  1.557e+03  -0.409  0.68322    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1807000 on 111 degrees of freedom
## Multiple R-squared:  0.6492, Adjusted R-squared:  0.2005 
## F-statistic: 1.447 on 142 and 111 DF,  p-value: 0.02121
ardl.volume.close.3 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 91:122) + L(Close.ts.diff, 110), data = infy_stock)
summary(ardl.volume.close.3)
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 
##     91:122) + L(Close.ts.diff, 110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3162262  -836678  -195987   521126 15845331 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              2.078e+06  9.549e+05   2.176  0.03086 *  
## L(Volume.ts, 1:32)1      3.079e-01  7.492e-02   4.110 6.04e-05 ***
## L(Volume.ts, 1:32)2      8.519e-02  7.857e-02   1.084  0.27971    
## L(Volume.ts, 1:32)3     -7.064e-02  7.980e-02  -0.885  0.37723    
## L(Volume.ts, 1:32)4      4.374e-02  7.981e-02   0.548  0.58433    
## L(Volume.ts, 1:32)5      2.636e-02  7.908e-02   0.333  0.73931    
## L(Volume.ts, 1:32)6      4.160e-02  7.708e-02   0.540  0.59007    
## L(Volume.ts, 1:32)7      9.882e-02  7.685e-02   1.286  0.20016    
## L(Volume.ts, 1:32)8     -1.168e-02  7.688e-02  -0.152  0.87942    
## L(Volume.ts, 1:32)9      6.567e-03  7.643e-02   0.086  0.93162    
## L(Volume.ts, 1:32)10     6.030e-02  7.706e-02   0.782  0.43503    
## L(Volume.ts, 1:32)11    -1.064e-01  7.676e-02  -1.387  0.16733    
## L(Volume.ts, 1:32)12     3.283e-02  7.709e-02   0.426  0.67069    
## L(Volume.ts, 1:32)13    -7.042e-02  7.724e-02  -0.912  0.36312    
## L(Volume.ts, 1:32)14    -3.211e-02  7.745e-02  -0.415  0.67899    
## L(Volume.ts, 1:32)15     5.738e-02  7.723e-02   0.743  0.45852    
## L(Volume.ts, 1:32)16    -3.638e-02  7.757e-02  -0.469  0.63969    
## L(Volume.ts, 1:32)17    -3.244e-02  7.787e-02  -0.417  0.67745    
## L(Volume.ts, 1:32)18     1.844e-02  7.744e-02   0.238  0.81204    
## L(Volume.ts, 1:32)19     6.324e-03  7.746e-02   0.082  0.93503    
## L(Volume.ts, 1:32)20     1.090e-02  7.735e-02   0.141  0.88807    
## L(Volume.ts, 1:32)21    -2.162e-02  7.788e-02  -0.278  0.78160    
## L(Volume.ts, 1:32)22     1.143e-02  7.797e-02   0.147  0.88365    
## L(Volume.ts, 1:32)23     3.903e-03  7.776e-02   0.050  0.96002    
## L(Volume.ts, 1:32)24     5.468e-02  7.744e-02   0.706  0.48105    
## L(Volume.ts, 1:32)25     3.664e-02  7.755e-02   0.472  0.63721    
## L(Volume.ts, 1:32)26     3.145e-02  7.672e-02   0.410  0.68233    
## L(Volume.ts, 1:32)27     3.461e-02  7.671e-02   0.451  0.65242    
## L(Volume.ts, 1:32)28    -8.312e-02  7.972e-02  -1.043  0.29850    
## L(Volume.ts, 1:32)29     6.754e-02  7.660e-02   0.882  0.37910    
## L(Volume.ts, 1:32)30     3.911e-02  8.053e-02   0.486  0.62783    
## L(Volume.ts, 1:32)31    -6.293e-03  8.094e-02  -0.078  0.93812    
## L(Volume.ts, 1:32)32     5.716e-02  7.646e-02   0.748  0.45571    
## L(Volume.ts, 91:122)91  -6.240e-02  7.642e-02  -0.817  0.41527    
## L(Volume.ts, 91:122)92   4.233e-02  8.076e-02   0.524  0.60089    
## L(Volume.ts, 91:122)93  -2.370e-02  8.073e-02  -0.294  0.76940    
## L(Volume.ts, 91:122)94   8.186e-03  7.669e-02   0.107  0.91512    
## L(Volume.ts, 91:122)95  -5.600e-02  7.660e-02  -0.731  0.46568    
## L(Volume.ts, 91:122)96  -1.704e-02  7.682e-02  -0.222  0.82472    
## L(Volume.ts, 91:122)97  -4.758e-02  7.688e-02  -0.619  0.53682    
## L(Volume.ts, 91:122)98  -8.314e-02  7.748e-02  -1.073  0.28473    
## L(Volume.ts, 91:122)99   9.454e-02  7.752e-02   1.220  0.22427    
## L(Volume.ts, 91:122)100 -6.465e-02  7.813e-02  -0.827  0.40911    
## L(Volume.ts, 91:122)101  3.458e-02  7.846e-02   0.441  0.65994    
## L(Volume.ts, 91:122)102  1.127e-03  7.769e-02   0.015  0.98845    
## L(Volume.ts, 91:122)103 -1.182e-02  7.723e-02  -0.153  0.87857    
## L(Volume.ts, 91:122)104  1.468e-02  7.909e-02   0.186  0.85299    
## L(Volume.ts, 91:122)105  2.418e-02  7.766e-02   0.311  0.75592    
## L(Volume.ts, 91:122)106 -5.411e-02  7.774e-02  -0.696  0.48731    
## L(Volume.ts, 91:122)107  4.041e-02  7.773e-02   0.520  0.60375    
## L(Volume.ts, 91:122)108 -4.923e-02  7.752e-02  -0.635  0.52616    
## L(Volume.ts, 91:122)109 -5.262e-02  7.745e-02  -0.679  0.49774    
## L(Volume.ts, 91:122)110  3.794e-02  7.718e-02   0.492  0.62360    
## L(Volume.ts, 91:122)111 -1.403e-01  8.131e-02  -1.726  0.08617 .  
## L(Volume.ts, 91:122)112  1.460e-02  8.154e-02   0.179  0.85807    
## L(Volume.ts, 91:122)113  9.254e-02  8.117e-02   1.140  0.25585    
## L(Volume.ts, 91:122)114 -9.978e-02  8.134e-02  -1.227  0.22156    
## L(Volume.ts, 91:122)115 -8.866e-02  8.179e-02  -1.084  0.27983    
## L(Volume.ts, 91:122)116  6.144e-02  7.700e-02   0.798  0.42600    
## L(Volume.ts, 91:122)117  2.540e-01  7.742e-02   3.281  0.00124 ** 
## L(Volume.ts, 91:122)118 -1.302e-01  7.951e-02  -1.637  0.10333    
## L(Volume.ts, 91:122)119 -6.888e-02  8.027e-02  -0.858  0.39197    
## L(Volume.ts, 91:122)120  5.118e-02  7.974e-02   0.642  0.52186    
## L(Volume.ts, 91:122)121 -2.605e-02  7.892e-02  -0.330  0.74174    
## L(Volume.ts, 91:122)122 -5.801e-02  7.499e-02  -0.773  0.44028    
## L(Close.ts.diff, 110)   -2.788e+02  1.530e+03  -0.182  0.85563    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1890000 on 177 degrees of freedom
## Multiple R-squared:  0.3864, Adjusted R-squared:  0.161 
## F-statistic: 1.715 on 65 and 177 DF,  p-value: 0.002947
ardl.volume.close.4 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 91:122) + L(Close.ts.diff, 1:110), data = infy_stock)
summary(ardl.volume.close.4)
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 
##     91:122) + L(Close.ts.diff, 1:110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2450151  -629268  -161738   590886  5117462 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 4.953e+06  2.672e+06   1.854 0.068104 .  
## L(Volume.ts, 1:32)1         3.387e-01  1.199e-01   2.825 0.006201 ** 
## L(Volume.ts, 1:32)2         1.105e-02  1.276e-01   0.087 0.931237    
## L(Volume.ts, 1:32)3        -1.208e-01  1.309e-01  -0.923 0.359391    
## L(Volume.ts, 1:32)4         1.092e-01  1.317e-01   0.829 0.410051    
## L(Volume.ts, 1:32)5        -9.374e-02  1.292e-01  -0.726 0.470510    
## L(Volume.ts, 1:32)6         2.617e-01  1.293e-01   2.024 0.046865 *  
## L(Volume.ts, 1:32)7         5.899e-02  1.320e-01   0.447 0.656323    
## L(Volume.ts, 1:32)8         5.241e-02  1.313e-01   0.399 0.691137    
## L(Volume.ts, 1:32)9         6.382e-02  1.331e-01   0.479 0.633124    
## L(Volume.ts, 1:32)10       -1.797e-03  1.353e-01  -0.013 0.989437    
## L(Volume.ts, 1:32)11       -1.139e-01  1.336e-01  -0.853 0.396828    
## L(Volume.ts, 1:32)12       -1.645e-02  1.347e-01  -0.122 0.903173    
## L(Volume.ts, 1:32)13       -2.077e-02  1.302e-01  -0.160 0.873723    
## L(Volume.ts, 1:32)14       -1.528e-01  1.303e-01  -1.173 0.244944    
## L(Volume.ts, 1:32)15        8.337e-02  1.312e-01   0.636 0.527121    
## L(Volume.ts, 1:32)16       -5.681e-02  1.311e-01  -0.433 0.666158    
## L(Volume.ts, 1:32)17       -7.015e-02  1.317e-01  -0.533 0.595884    
## L(Volume.ts, 1:32)18        5.269e-02  1.338e-01   0.394 0.694927    
## L(Volume.ts, 1:32)19       -1.250e-01  1.323e-01  -0.945 0.348148    
## L(Volume.ts, 1:32)20        2.338e-01  1.326e-01   1.764 0.082234 .  
## L(Volume.ts, 1:32)21       -1.616e-01  1.365e-01  -1.184 0.240703    
## L(Volume.ts, 1:32)22       -4.644e-02  1.363e-01  -0.341 0.734426    
## L(Volume.ts, 1:32)23       -4.703e-02  1.345e-01  -0.350 0.727629    
## L(Volume.ts, 1:32)24       -2.692e-02  1.318e-01  -0.204 0.838810    
## L(Volume.ts, 1:32)25        7.401e-02  1.302e-01   0.569 0.571556    
## L(Volume.ts, 1:32)26       -1.817e-01  1.294e-01  -1.404 0.164810    
## L(Volume.ts, 1:32)27        1.197e-01  1.270e-01   0.943 0.349006    
## L(Volume.ts, 1:32)28       -8.826e-02  1.288e-01  -0.685 0.495577    
## L(Volume.ts, 1:32)29       -6.342e-02  1.180e-01  -0.538 0.592649    
## L(Volume.ts, 1:32)30        6.081e-02  1.175e-01   0.518 0.606378    
## L(Volume.ts, 1:32)31       -9.698e-02  1.190e-01  -0.815 0.417840    
## L(Volume.ts, 1:32)32        1.413e-01  1.112e-01   1.271 0.208174    
## L(Volume.ts, 91:122)91      5.711e-02  1.049e-01   0.545 0.587761    
## L(Volume.ts, 91:122)92     -6.727e-02  1.103e-01  -0.610 0.543802    
## L(Volume.ts, 91:122)93      6.234e-02  1.102e-01   0.566 0.573427    
## L(Volume.ts, 91:122)94     -1.881e-01  1.103e-01  -1.705 0.092753 .  
## L(Volume.ts, 91:122)95      1.742e-02  1.088e-01   0.160 0.873229    
## L(Volume.ts, 91:122)96     -1.150e-01  1.097e-01  -1.048 0.298124    
## L(Volume.ts, 91:122)97     -4.370e-02  1.105e-01  -0.395 0.693732    
## L(Volume.ts, 91:122)98     -6.807e-02  1.100e-01  -0.619 0.538174    
## L(Volume.ts, 91:122)99      4.654e-02  1.088e-01   0.428 0.670319    
## L(Volume.ts, 91:122)100    -6.340e-02  1.094e-01  -0.580 0.564097    
## L(Volume.ts, 91:122)101    -3.195e-02  1.095e-01  -0.292 0.771352    
## L(Volume.ts, 91:122)102     8.306e-02  1.092e-01   0.760 0.449614    
## L(Volume.ts, 91:122)103    -1.334e-01  1.087e-01  -1.228 0.223774    
## L(Volume.ts, 91:122)104     5.985e-02  1.104e-01   0.542 0.589454    
## L(Volume.ts, 91:122)105     9.617e-02  1.087e-01   0.885 0.379280    
## L(Volume.ts, 91:122)106    -1.286e-01  1.120e-01  -1.149 0.254777    
## L(Volume.ts, 91:122)107     1.112e-01  1.142e-01   0.974 0.333699    
## L(Volume.ts, 91:122)108    -1.472e-01  1.151e-01  -1.279 0.205108    
## L(Volume.ts, 91:122)109    -2.626e-02  1.171e-01  -0.224 0.823274    
## L(Volume.ts, 91:122)110     1.753e-01  1.136e-01   1.544 0.127310    
## L(Volume.ts, 91:122)111    -1.110e-01  1.191e-01  -0.932 0.354566    
## L(Volume.ts, 91:122)112     1.189e-01  1.472e-01   0.808 0.422185    
## L(Volume.ts, 91:122)113    -6.881e-02  1.438e-01  -0.478 0.633921    
## L(Volume.ts, 91:122)114    -1.011e-02  1.408e-01  -0.072 0.942957    
## L(Volume.ts, 91:122)115    -1.743e-01  1.404e-01  -1.241 0.218814    
## L(Volume.ts, 91:122)116     6.476e-03  1.364e-01   0.047 0.962271    
## L(Volume.ts, 91:122)117     1.531e-01  1.545e-01   0.991 0.325176    
## L(Volume.ts, 91:122)118    -1.516e-01  1.534e-01  -0.988 0.326636    
## L(Volume.ts, 91:122)119    -1.675e-01  1.559e-01  -1.074 0.286404    
## L(Volume.ts, 91:122)120    -5.380e-02  1.554e-01  -0.346 0.730190    
## L(Volume.ts, 91:122)121    -4.933e-02  1.532e-01  -0.322 0.748456    
## L(Volume.ts, 91:122)122    -4.175e-02  1.295e-01  -0.322 0.748219    
## L(Close.ts.diff, 1:110)1   -8.393e+02  2.191e+03  -0.383 0.702853    
## L(Close.ts.diff, 1:110)2    2.256e+03  2.159e+03   1.045 0.299786    
## L(Close.ts.diff, 1:110)3   -3.011e+02  2.212e+03  -0.136 0.892111    
## L(Close.ts.diff, 1:110)4    5.762e+02  2.230e+03   0.258 0.796874    
## L(Close.ts.diff, 1:110)5    1.705e+03  2.209e+03   0.772 0.442928    
## L(Close.ts.diff, 1:110)6    5.648e+03  3.588e+03   1.574 0.120086    
## L(Close.ts.diff, 1:110)7   -8.154e+02  3.695e+03  -0.221 0.825998    
## L(Close.ts.diff, 1:110)8    3.707e+03  3.719e+03   0.997 0.322366    
## L(Close.ts.diff, 1:110)9    1.053e+03  3.786e+03   0.278 0.781679    
## L(Close.ts.diff, 1:110)10   2.840e+03  3.749e+03   0.758 0.451307    
## L(Close.ts.diff, 1:110)11   3.009e+02  2.308e+03   0.130 0.896668    
## L(Close.ts.diff, 1:110)12   7.292e+02  1.996e+03   0.365 0.715990    
## L(Close.ts.diff, 1:110)13   1.733e+03  1.969e+03   0.880 0.381896    
## L(Close.ts.diff, 1:110)14   1.099e+03  1.976e+03   0.556 0.579734    
## L(Close.ts.diff, 1:110)15   7.498e+02  1.977e+03   0.379 0.705716    
## L(Close.ts.diff, 1:110)16   9.805e+02  1.978e+03   0.496 0.621680    
## L(Close.ts.diff, 1:110)17   1.407e+03  1.926e+03   0.731 0.467486    
## L(Close.ts.diff, 1:110)18  -7.842e+01  1.816e+03  -0.043 0.965685    
## L(Close.ts.diff, 1:110)19   9.498e+02  1.802e+03   0.527 0.599906    
## L(Close.ts.diff, 1:110)20   1.458e+03  1.782e+03   0.818 0.416089    
## L(Close.ts.diff, 1:110)21  -1.678e+02  1.763e+03  -0.095 0.924453    
## L(Close.ts.diff, 1:110)22  -4.866e+01  1.759e+03  -0.028 0.978009    
## L(Close.ts.diff, 1:110)23  -8.880e+02  1.759e+03  -0.505 0.615301    
## L(Close.ts.diff, 1:110)24   6.887e+02  1.740e+03   0.396 0.693553    
## L(Close.ts.diff, 1:110)25   1.736e+03  1.729e+03   1.004 0.318737    
## L(Close.ts.diff, 1:110)26  -1.072e+04  1.754e+03  -6.114 5.36e-08 ***
## L(Close.ts.diff, 1:110)27   3.316e+03  2.238e+03   1.482 0.143002    
## L(Close.ts.diff, 1:110)28   1.805e+02  2.250e+03   0.080 0.936286    
## L(Close.ts.diff, 1:110)29   3.777e+02  2.289e+03   0.165 0.869408    
## L(Close.ts.diff, 1:110)30   3.503e+02  2.299e+03   0.152 0.879333    
## L(Close.ts.diff, 1:110)31  -1.687e+03  2.333e+03  -0.723 0.472175    
## L(Close.ts.diff, 1:110)32   4.818e+03  2.356e+03   2.045 0.044730 *  
## L(Close.ts.diff, 1:110)33   4.828e+02  2.422e+03   0.199 0.842624    
## L(Close.ts.diff, 1:110)34   2.063e+03  2.425e+03   0.851 0.397778    
## L(Close.ts.diff, 1:110)35   1.453e+03  2.419e+03   0.601 0.549904    
## L(Close.ts.diff, 1:110)36   6.778e+01  2.506e+03   0.027 0.978505    
## L(Close.ts.diff, 1:110)37   1.323e+03  2.457e+03   0.539 0.591836    
## L(Close.ts.diff, 1:110)38  -7.929e+02  2.464e+03  -0.322 0.748629    
## L(Close.ts.diff, 1:110)39   3.266e+03  2.283e+03   1.431 0.157074    
## L(Close.ts.diff, 1:110)40   4.758e+02  2.264e+03   0.210 0.834196    
## L(Close.ts.diff, 1:110)41   1.013e+03  2.284e+03   0.444 0.658740    
## L(Close.ts.diff, 1:110)42  -3.978e+02  2.226e+03  -0.179 0.858720    
## L(Close.ts.diff, 1:110)43  -1.148e+03  2.246e+03  -0.511 0.610983    
## L(Close.ts.diff, 1:110)44   2.125e+03  2.231e+03   0.952 0.344290    
## L(Close.ts.diff, 1:110)45   1.455e+02  2.225e+03   0.065 0.948048    
## L(Close.ts.diff, 1:110)46   3.478e+03  2.207e+03   1.576 0.119756    
## L(Close.ts.diff, 1:110)47  -1.565e+03  2.249e+03  -0.696 0.488791    
## L(Close.ts.diff, 1:110)48  -2.593e+01  2.257e+03  -0.011 0.990867    
## L(Close.ts.diff, 1:110)49  -8.677e+02  2.211e+03  -0.392 0.695994    
## L(Close.ts.diff, 1:110)50  -1.951e+03  2.213e+03  -0.882 0.381134    
## L(Close.ts.diff, 1:110)51   1.092e+03  2.193e+03   0.498 0.620204    
## L(Close.ts.diff, 1:110)52  -4.137e+03  2.188e+03  -1.891 0.062924 .  
## L(Close.ts.diff, 1:110)53   1.545e+02  2.249e+03   0.069 0.945451    
## L(Close.ts.diff, 1:110)54   2.292e+02  2.243e+03   0.102 0.918898    
## L(Close.ts.diff, 1:110)55  -2.372e+03  2.134e+03  -1.111 0.270272    
## L(Close.ts.diff, 1:110)56   1.086e+03  2.198e+03   0.494 0.622696    
## L(Close.ts.diff, 1:110)57  -2.077e+03  2.295e+03  -0.905 0.368713    
## L(Close.ts.diff, 1:110)58   4.068e+03  2.145e+03   1.896 0.062180 .  
## L(Close.ts.diff, 1:110)59   5.600e+02  1.971e+03   0.284 0.777210    
## L(Close.ts.diff, 1:110)60   7.366e+02  1.956e+03   0.376 0.707721    
## L(Close.ts.diff, 1:110)61  -3.065e+01  1.958e+03  -0.016 0.987556    
## L(Close.ts.diff, 1:110)62  -2.949e+03  2.048e+03  -1.440 0.154403    
## L(Close.ts.diff, 1:110)63   8.277e+02  2.085e+03   0.397 0.692555    
## L(Close.ts.diff, 1:110)64  -1.286e+03  2.078e+03  -0.619 0.538137    
## L(Close.ts.diff, 1:110)65   1.826e+02  2.051e+03   0.089 0.929314    
## L(Close.ts.diff, 1:110)66   8.585e+02  2.035e+03   0.422 0.674460    
## L(Close.ts.diff, 1:110)67  -2.610e+02  1.923e+03  -0.136 0.892437    
## L(Close.ts.diff, 1:110)68  -1.806e+03  1.797e+03  -1.005 0.318505    
## L(Close.ts.diff, 1:110)69   6.626e+02  1.802e+03   0.368 0.714226    
## L(Close.ts.diff, 1:110)70   2.690e+02  1.792e+03   0.150 0.881140    
## L(Close.ts.diff, 1:110)71   1.100e+03  1.766e+03   0.623 0.535463    
## L(Close.ts.diff, 1:110)72  -1.234e+03  1.753e+03  -0.704 0.483730    
## L(Close.ts.diff, 1:110)73  -1.026e+03  1.757e+03  -0.584 0.561082    
## L(Close.ts.diff, 1:110)74  -4.279e+00  1.788e+03  -0.002 0.998098    
## L(Close.ts.diff, 1:110)75  -2.122e+01  1.786e+03  -0.012 0.990553    
## L(Close.ts.diff, 1:110)76   3.120e+03  1.776e+03   1.757 0.083411 .  
## L(Close.ts.diff, 1:110)77   4.751e+02  1.818e+03   0.261 0.794631    
## L(Close.ts.diff, 1:110)78  -7.639e+02  1.815e+03  -0.421 0.675254    
## L(Close.ts.diff, 1:110)79  -8.090e+02  1.821e+03  -0.444 0.658203    
## L(Close.ts.diff, 1:110)80  -3.270e+02  1.822e+03  -0.179 0.858080    
## L(Close.ts.diff, 1:110)81  -1.701e+03  1.827e+03  -0.931 0.354968    
## L(Close.ts.diff, 1:110)82  -6.581e+03  1.856e+03  -3.546 0.000713 ***
## L(Close.ts.diff, 1:110)83  -8.662e+02  2.020e+03  -0.429 0.669378    
## L(Close.ts.diff, 1:110)84  -2.531e+03  2.020e+03  -1.253 0.214449    
## L(Close.ts.diff, 1:110)85  -2.127e+03  2.015e+03  -1.056 0.294770    
## L(Close.ts.diff, 1:110)86  -2.249e+01  2.025e+03  -0.011 0.991169    
## L(Close.ts.diff, 1:110)87  -1.378e+03  2.002e+03  -0.688 0.493670    
## L(Close.ts.diff, 1:110)88   2.165e+03  1.976e+03   1.096 0.276940    
## L(Close.ts.diff, 1:110)89   9.805e+01  1.965e+03   0.050 0.960356    
## L(Close.ts.diff, 1:110)90   1.031e+03  1.959e+03   0.526 0.600394    
## L(Close.ts.diff, 1:110)91   1.291e+03  1.966e+03   0.657 0.513507    
## L(Close.ts.diff, 1:110)92   1.087e+03  1.962e+03   0.554 0.581304    
## L(Close.ts.diff, 1:110)93   1.606e+02  1.958e+03   0.082 0.934882    
## L(Close.ts.diff, 1:110)94  -1.090e+03  2.002e+03  -0.544 0.587938    
## L(Close.ts.diff, 1:110)95   1.053e+03  2.001e+03   0.526 0.600533    
## L(Close.ts.diff, 1:110)96  -2.277e+03  1.995e+03  -1.142 0.257574    
## L(Close.ts.diff, 1:110)97   1.128e+03  2.040e+03   0.553 0.582026    
## L(Close.ts.diff, 1:110)98  -6.654e+02  2.001e+03  -0.333 0.740472    
## L(Close.ts.diff, 1:110)99   1.019e+03  1.951e+03   0.522 0.603052    
## L(Close.ts.diff, 1:110)100  2.804e+03  1.933e+03   1.451 0.151482    
## L(Close.ts.diff, 1:110)101 -2.683e+03  1.892e+03  -1.418 0.160785    
## L(Close.ts.diff, 1:110)102  1.914e+03  1.933e+03   0.990 0.325466    
## L(Close.ts.diff, 1:110)103 -3.829e+00  1.938e+03  -0.002 0.998429    
## L(Close.ts.diff, 1:110)104 -6.315e+02  1.932e+03  -0.327 0.744804    
## L(Close.ts.diff, 1:110)105 -1.105e+03  1.876e+03  -0.589 0.557622    
## L(Close.ts.diff, 1:110)106 -2.065e+03  1.883e+03  -1.097 0.276677    
## L(Close.ts.diff, 1:110)107 -1.550e+03  1.909e+03  -0.812 0.419686    
## L(Close.ts.diff, 1:110)108 -3.232e+03  1.901e+03  -1.700 0.093710 .  
## L(Close.ts.diff, 1:110)109  3.884e+02  1.889e+03   0.206 0.837679    
## L(Close.ts.diff, 1:110)110 -4.634e+02  1.891e+03  -0.245 0.807154    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1917000 on 68 degrees of freedom
## Multiple R-squared:  0.7575, Adjusted R-squared:  0.1369 
## F-statistic: 1.221 on 174 and 68 DF,  p-value: 0.1738

ARDL of Volume and Open

ardl.volume.open.1 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Open.ts.diff, 110), data = infy_stock)
summary(ardl.volume.open.1)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Open.ts.diff, 
##     110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2622514  -846166  -262527   432638 16612825 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           5.486e+05  3.997e+05   1.372   0.1713    
## L(Volume.ts, 1:32)1   3.214e-01  6.738e-02   4.770 3.35e-06 ***
## L(Volume.ts, 1:32)2   5.707e-02  7.077e-02   0.806   0.4209    
## L(Volume.ts, 1:32)3  -4.049e-02  7.095e-02  -0.571   0.5688    
## L(Volume.ts, 1:32)4   9.003e-02  7.044e-02   1.278   0.2026    
## L(Volume.ts, 1:32)5   1.597e-03  7.047e-02   0.023   0.9819    
## L(Volume.ts, 1:32)6   5.137e-02  7.042e-02   0.730   0.4664    
## L(Volume.ts, 1:32)7   1.236e-01  7.070e-02   1.748   0.0819 .  
## L(Volume.ts, 1:32)8  -3.481e-03  7.097e-02  -0.049   0.9609    
## L(Volume.ts, 1:32)9  -6.644e-03  7.073e-02  -0.094   0.9252    
## L(Volume.ts, 1:32)10  5.447e-02  7.128e-02   0.764   0.4456    
## L(Volume.ts, 1:32)11 -7.348e-02  7.037e-02  -1.044   0.2975    
## L(Volume.ts, 1:32)12  1.580e-02  7.049e-02   0.224   0.8228    
## L(Volume.ts, 1:32)13 -3.200e-02  7.049e-02  -0.454   0.6503    
## L(Volume.ts, 1:32)14 -3.337e-02  7.053e-02  -0.473   0.6366    
## L(Volume.ts, 1:32)15  7.360e-02  7.050e-02   1.044   0.2977    
## L(Volume.ts, 1:32)16 -3.783e-02  7.072e-02  -0.535   0.5933    
## L(Volume.ts, 1:32)17 -1.469e-02  7.114e-02  -0.207   0.8366    
## L(Volume.ts, 1:32)18  4.622e-02  7.096e-02   0.651   0.5155    
## L(Volume.ts, 1:32)19 -1.960e-02  7.086e-02  -0.277   0.7823    
## L(Volume.ts, 1:32)20  1.328e-02  7.083e-02   0.188   0.8514    
## L(Volume.ts, 1:32)21 -2.454e-02  7.085e-02  -0.346   0.7294    
## L(Volume.ts, 1:32)22  1.593e-02  7.067e-02   0.225   0.8219    
## L(Volume.ts, 1:32)23 -7.492e-03  7.061e-02  -0.106   0.9156    
## L(Volume.ts, 1:32)24  8.295e-02  7.074e-02   1.173   0.2422    
## L(Volume.ts, 1:32)25  3.720e-02  7.103e-02   0.524   0.6010    
## L(Volume.ts, 1:32)26  3.017e-02  7.044e-02   0.428   0.6689    
## L(Volume.ts, 1:32)27  1.040e-02  7.040e-02   0.148   0.8827    
## L(Volume.ts, 1:32)28 -9.240e-02  7.360e-02  -1.255   0.2107    
## L(Volume.ts, 1:32)29  1.339e-01  7.065e-02   1.895   0.0594 .  
## L(Volume.ts, 1:32)30 -2.942e-02  7.085e-02  -0.415   0.6784    
## L(Volume.ts, 1:32)31  3.618e-02  7.081e-02   0.511   0.6099    
## L(Volume.ts, 1:32)32  3.936e-02  6.740e-02   0.584   0.5599    
## L(Open.ts.diff, 110) -3.881e+02  1.416e+03  -0.274   0.7843    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1854000 on 220 degrees of freedom
## Multiple R-squared:  0.2682, Adjusted R-squared:  0.1584 
## F-statistic: 2.443 on 33 and 220 DF,  p-value: 6.762e-05
ardl.volume.open.2 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Close.ts.diff, 35) + L(Open.ts.diff, 110), data = infy_stock)
summary(ardl.volume.open.2)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Close.ts.diff, 
##     35) + L(Open.ts.diff, 110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2612945  -830527  -232826   421930 16574526 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           5.749e+05  3.999e+05   1.438   0.1520    
## L(Volume.ts, 1:32)1   3.203e-01  6.732e-02   4.758 3.54e-06 ***
## L(Volume.ts, 1:32)2   5.762e-02  7.070e-02   0.815   0.4160    
## L(Volume.ts, 1:32)3  -4.257e-02  7.090e-02  -0.600   0.5488    
## L(Volume.ts, 1:32)4   8.482e-02  7.050e-02   1.203   0.2303    
## L(Volume.ts, 1:32)5   3.206e-03  7.042e-02   0.046   0.9637    
## L(Volume.ts, 1:32)6   5.477e-02  7.040e-02   0.778   0.4374    
## L(Volume.ts, 1:32)7   1.225e-01  7.064e-02   1.735   0.0842 .  
## L(Volume.ts, 1:32)8   2.506e-03  7.107e-02   0.035   0.9719    
## L(Volume.ts, 1:32)9  -4.600e-02  7.794e-02  -0.590   0.5557    
## L(Volume.ts, 1:32)10  6.816e-02  7.212e-02   0.945   0.3457    
## L(Volume.ts, 1:32)11 -6.939e-02  7.038e-02  -0.986   0.3253    
## L(Volume.ts, 1:32)12  1.163e-02  7.051e-02   0.165   0.8692    
## L(Volume.ts, 1:32)13 -3.010e-02  7.044e-02  -0.427   0.6695    
## L(Volume.ts, 1:32)14 -3.204e-02  7.047e-02  -0.455   0.6499    
## L(Volume.ts, 1:32)15  7.158e-02  7.046e-02   1.016   0.3108    
## L(Volume.ts, 1:32)16 -2.897e-02  7.104e-02  -0.408   0.6838    
## L(Volume.ts, 1:32)17 -1.907e-02  7.116e-02  -0.268   0.7889    
## L(Volume.ts, 1:32)18  5.015e-02  7.097e-02   0.707   0.4805    
## L(Volume.ts, 1:32)19 -1.619e-02  7.084e-02  -0.229   0.8195    
## L(Volume.ts, 1:32)20  8.890e-03  7.086e-02   0.125   0.9003    
## L(Volume.ts, 1:32)21 -1.966e-02  7.089e-02  -0.277   0.7818    
## L(Volume.ts, 1:32)22  1.260e-02  7.065e-02   0.178   0.8586    
## L(Volume.ts, 1:32)23 -1.347e-02  7.072e-02  -0.190   0.8491    
## L(Volume.ts, 1:32)24  8.634e-02  7.073e-02   1.221   0.2235    
## L(Volume.ts, 1:32)25  3.649e-02  7.096e-02   0.514   0.6076    
## L(Volume.ts, 1:32)26  3.078e-02  7.037e-02   0.437   0.6622    
## L(Volume.ts, 1:32)27  9.942e-03  7.033e-02   0.141   0.8877    
## L(Volume.ts, 1:32)28 -9.932e-02  7.376e-02  -1.347   0.1795    
## L(Volume.ts, 1:32)29  1.547e-01  7.268e-02   2.128   0.0345 *  
## L(Volume.ts, 1:32)30 -3.241e-02  7.082e-02  -0.458   0.6477    
## L(Volume.ts, 1:32)31  3.125e-02  7.086e-02   0.441   0.6596    
## L(Volume.ts, 1:32)32  4.074e-02  6.735e-02   0.605   0.5458    
## L(Close.ts.diff, 35) -1.836e+03  1.534e+03  -1.197   0.2327    
## L(Open.ts.diff, 110) -4.993e+02  1.418e+03  -0.352   0.7251    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1852000 on 219 degrees of freedom
## Multiple R-squared:  0.273,  Adjusted R-squared:  0.1601 
## F-statistic: 2.418 on 34 and 219 DF,  p-value: 6.968e-05
ardl.volume.open.3 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 91:122) + L(Close.ts.diff, 110), data = infy_stock)
summary(ardl.volume.open.3)
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 
##     91:122) + L(Close.ts.diff, 110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3162262  -836678  -195987   521126 15845331 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              2.078e+06  9.549e+05   2.176  0.03086 *  
## L(Volume.ts, 1:32)1      3.079e-01  7.492e-02   4.110 6.04e-05 ***
## L(Volume.ts, 1:32)2      8.519e-02  7.857e-02   1.084  0.27971    
## L(Volume.ts, 1:32)3     -7.064e-02  7.980e-02  -0.885  0.37723    
## L(Volume.ts, 1:32)4      4.374e-02  7.981e-02   0.548  0.58433    
## L(Volume.ts, 1:32)5      2.636e-02  7.908e-02   0.333  0.73931    
## L(Volume.ts, 1:32)6      4.160e-02  7.708e-02   0.540  0.59007    
## L(Volume.ts, 1:32)7      9.882e-02  7.685e-02   1.286  0.20016    
## L(Volume.ts, 1:32)8     -1.168e-02  7.688e-02  -0.152  0.87942    
## L(Volume.ts, 1:32)9      6.567e-03  7.643e-02   0.086  0.93162    
## L(Volume.ts, 1:32)10     6.030e-02  7.706e-02   0.782  0.43503    
## L(Volume.ts, 1:32)11    -1.064e-01  7.676e-02  -1.387  0.16733    
## L(Volume.ts, 1:32)12     3.283e-02  7.709e-02   0.426  0.67069    
## L(Volume.ts, 1:32)13    -7.042e-02  7.724e-02  -0.912  0.36312    
## L(Volume.ts, 1:32)14    -3.211e-02  7.745e-02  -0.415  0.67899    
## L(Volume.ts, 1:32)15     5.738e-02  7.723e-02   0.743  0.45852    
## L(Volume.ts, 1:32)16    -3.638e-02  7.757e-02  -0.469  0.63969    
## L(Volume.ts, 1:32)17    -3.244e-02  7.787e-02  -0.417  0.67745    
## L(Volume.ts, 1:32)18     1.844e-02  7.744e-02   0.238  0.81204    
## L(Volume.ts, 1:32)19     6.324e-03  7.746e-02   0.082  0.93503    
## L(Volume.ts, 1:32)20     1.090e-02  7.735e-02   0.141  0.88807    
## L(Volume.ts, 1:32)21    -2.162e-02  7.788e-02  -0.278  0.78160    
## L(Volume.ts, 1:32)22     1.143e-02  7.797e-02   0.147  0.88365    
## L(Volume.ts, 1:32)23     3.903e-03  7.776e-02   0.050  0.96002    
## L(Volume.ts, 1:32)24     5.468e-02  7.744e-02   0.706  0.48105    
## L(Volume.ts, 1:32)25     3.664e-02  7.755e-02   0.472  0.63721    
## L(Volume.ts, 1:32)26     3.145e-02  7.672e-02   0.410  0.68233    
## L(Volume.ts, 1:32)27     3.461e-02  7.671e-02   0.451  0.65242    
## L(Volume.ts, 1:32)28    -8.312e-02  7.972e-02  -1.043  0.29850    
## L(Volume.ts, 1:32)29     6.754e-02  7.660e-02   0.882  0.37910    
## L(Volume.ts, 1:32)30     3.911e-02  8.053e-02   0.486  0.62783    
## L(Volume.ts, 1:32)31    -6.293e-03  8.094e-02  -0.078  0.93812    
## L(Volume.ts, 1:32)32     5.716e-02  7.646e-02   0.748  0.45571    
## L(Volume.ts, 91:122)91  -6.240e-02  7.642e-02  -0.817  0.41527    
## L(Volume.ts, 91:122)92   4.233e-02  8.076e-02   0.524  0.60089    
## L(Volume.ts, 91:122)93  -2.370e-02  8.073e-02  -0.294  0.76940    
## L(Volume.ts, 91:122)94   8.186e-03  7.669e-02   0.107  0.91512    
## L(Volume.ts, 91:122)95  -5.600e-02  7.660e-02  -0.731  0.46568    
## L(Volume.ts, 91:122)96  -1.704e-02  7.682e-02  -0.222  0.82472    
## L(Volume.ts, 91:122)97  -4.758e-02  7.688e-02  -0.619  0.53682    
## L(Volume.ts, 91:122)98  -8.314e-02  7.748e-02  -1.073  0.28473    
## L(Volume.ts, 91:122)99   9.454e-02  7.752e-02   1.220  0.22427    
## L(Volume.ts, 91:122)100 -6.465e-02  7.813e-02  -0.827  0.40911    
## L(Volume.ts, 91:122)101  3.458e-02  7.846e-02   0.441  0.65994    
## L(Volume.ts, 91:122)102  1.127e-03  7.769e-02   0.015  0.98845    
## L(Volume.ts, 91:122)103 -1.182e-02  7.723e-02  -0.153  0.87857    
## L(Volume.ts, 91:122)104  1.468e-02  7.909e-02   0.186  0.85299    
## L(Volume.ts, 91:122)105  2.418e-02  7.766e-02   0.311  0.75592    
## L(Volume.ts, 91:122)106 -5.411e-02  7.774e-02  -0.696  0.48731    
## L(Volume.ts, 91:122)107  4.041e-02  7.773e-02   0.520  0.60375    
## L(Volume.ts, 91:122)108 -4.923e-02  7.752e-02  -0.635  0.52616    
## L(Volume.ts, 91:122)109 -5.262e-02  7.745e-02  -0.679  0.49774    
## L(Volume.ts, 91:122)110  3.794e-02  7.718e-02   0.492  0.62360    
## L(Volume.ts, 91:122)111 -1.403e-01  8.131e-02  -1.726  0.08617 .  
## L(Volume.ts, 91:122)112  1.460e-02  8.154e-02   0.179  0.85807    
## L(Volume.ts, 91:122)113  9.254e-02  8.117e-02   1.140  0.25585    
## L(Volume.ts, 91:122)114 -9.978e-02  8.134e-02  -1.227  0.22156    
## L(Volume.ts, 91:122)115 -8.866e-02  8.179e-02  -1.084  0.27983    
## L(Volume.ts, 91:122)116  6.144e-02  7.700e-02   0.798  0.42600    
## L(Volume.ts, 91:122)117  2.540e-01  7.742e-02   3.281  0.00124 ** 
## L(Volume.ts, 91:122)118 -1.302e-01  7.951e-02  -1.637  0.10333    
## L(Volume.ts, 91:122)119 -6.888e-02  8.027e-02  -0.858  0.39197    
## L(Volume.ts, 91:122)120  5.118e-02  7.974e-02   0.642  0.52186    
## L(Volume.ts, 91:122)121 -2.605e-02  7.892e-02  -0.330  0.74174    
## L(Volume.ts, 91:122)122 -5.801e-02  7.499e-02  -0.773  0.44028    
## L(Close.ts.diff, 110)   -2.788e+02  1.530e+03  -0.182  0.85563    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1890000 on 177 degrees of freedom
## Multiple R-squared:  0.3864, Adjusted R-squared:  0.161 
## F-statistic: 1.715 on 65 and 177 DF,  p-value: 0.002947
ardl.volume.open.4 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 91:122) + L(Close.ts.diff, 35) + L(Open.ts.diff, 110), data = infy_stock)
summary(ardl.volume.open.4)
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 
##     91:122) + L(Close.ts.diff, 35) + L(Open.ts.diff, 110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3136183  -840361  -195259   515199 15856611 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              2.040e+06  9.635e+05   2.117  0.03565 *  
## L(Volume.ts, 1:32)1      3.091e-01  7.517e-02   4.112 6.02e-05 ***
## L(Volume.ts, 1:32)2      8.446e-02  7.890e-02   1.071  0.28585    
## L(Volume.ts, 1:32)3     -7.176e-02  7.993e-02  -0.898  0.37054    
## L(Volume.ts, 1:32)4      4.267e-02  8.009e-02   0.533  0.59488    
## L(Volume.ts, 1:32)5      2.608e-02  7.935e-02   0.329  0.74277    
## L(Volume.ts, 1:32)6      4.293e-02  7.734e-02   0.555  0.57954    
## L(Volume.ts, 1:32)7      9.987e-02  7.724e-02   1.293  0.19767    
## L(Volume.ts, 1:32)8     -9.560e-03  7.756e-02  -0.123  0.90204    
## L(Volume.ts, 1:32)9     -7.331e-03  8.655e-02  -0.085  0.93259    
## L(Volume.ts, 1:32)10     6.608e-02  7.855e-02   0.841  0.40134    
## L(Volume.ts, 1:32)11    -1.034e-01  7.726e-02  -1.338  0.18266    
## L(Volume.ts, 1:32)12     3.100e-02  7.744e-02   0.400  0.68938    
## L(Volume.ts, 1:32)13    -6.825e-02  7.773e-02  -0.878  0.38118    
## L(Volume.ts, 1:32)14    -3.182e-02  7.754e-02  -0.410  0.68201    
## L(Volume.ts, 1:32)15     5.676e-02  7.747e-02   0.733  0.46473    
## L(Volume.ts, 1:32)16    -3.445e-02  7.797e-02  -0.442  0.65915    
## L(Volume.ts, 1:32)17    -3.349e-02  7.812e-02  -0.429  0.66871    
## L(Volume.ts, 1:32)18     2.039e-02  7.780e-02   0.262  0.79362    
## L(Volume.ts, 1:32)19     8.272e-03  7.806e-02   0.106  0.91573    
## L(Volume.ts, 1:32)20     8.804e-03  7.778e-02   0.113  0.91001    
## L(Volume.ts, 1:32)21    -2.018e-02  7.810e-02  -0.258  0.79640    
## L(Volume.ts, 1:32)22     1.177e-02  7.831e-02   0.150  0.88068    
## L(Volume.ts, 1:32)23     7.627e-04  7.827e-02   0.010  0.99224    
## L(Volume.ts, 1:32)24     5.780e-02  7.802e-02   0.741  0.45981    
## L(Volume.ts, 1:32)25     3.580e-02  7.765e-02   0.461  0.64529    
## L(Volume.ts, 1:32)26     3.149e-02  7.693e-02   0.409  0.68279    
## L(Volume.ts, 1:32)27     3.479e-02  7.700e-02   0.452  0.65192    
## L(Volume.ts, 1:32)28    -8.764e-02  8.103e-02  -1.082  0.28091    
## L(Volume.ts, 1:32)29     7.474e-02  7.893e-02   0.947  0.34495    
## L(Volume.ts, 1:32)30     3.819e-02  8.066e-02   0.473  0.63645    
## L(Volume.ts, 1:32)31    -7.198e-03  8.102e-02  -0.089  0.92931    
## L(Volume.ts, 1:32)32     5.731e-02  7.659e-02   0.748  0.45528    
## L(Volume.ts, 91:122)91  -6.121e-02  7.666e-02  -0.799  0.42565    
## L(Volume.ts, 91:122)92   4.070e-02  8.105e-02   0.502  0.61616    
## L(Volume.ts, 91:122)93  -2.346e-02  8.091e-02  -0.290  0.77222    
## L(Volume.ts, 91:122)94   8.079e-03  7.683e-02   0.105  0.91637    
## L(Volume.ts, 91:122)95  -5.468e-02  7.684e-02  -0.712  0.47771    
## L(Volume.ts, 91:122)96  -1.578e-02  7.704e-02  -0.205  0.83796    
## L(Volume.ts, 91:122)97  -4.506e-02  7.756e-02  -0.581  0.56201    
## L(Volume.ts, 91:122)98  -8.417e-02  7.768e-02  -1.084  0.28006    
## L(Volume.ts, 91:122)99   9.383e-02  7.770e-02   1.207  0.22886    
## L(Volume.ts, 91:122)100 -6.418e-02  7.841e-02  -0.819  0.41418    
## L(Volume.ts, 91:122)101  3.317e-02  7.899e-02   0.420  0.67503    
## L(Volume.ts, 91:122)102  1.920e-03  7.803e-02   0.025  0.98040    
## L(Volume.ts, 91:122)103 -1.300e-02  7.745e-02  -0.168  0.86689    
## L(Volume.ts, 91:122)104  1.757e-02  7.929e-02   0.222  0.82492    
## L(Volume.ts, 91:122)105  2.227e-02  7.798e-02   0.286  0.77555    
## L(Volume.ts, 91:122)106 -5.287e-02  7.802e-02  -0.678  0.49886    
## L(Volume.ts, 91:122)107  3.868e-02  7.858e-02   0.492  0.62314    
## L(Volume.ts, 91:122)108 -4.692e-02  7.851e-02  -0.598  0.55083    
## L(Volume.ts, 91:122)109 -5.258e-02  7.765e-02  -0.677  0.49918    
## L(Volume.ts, 91:122)110  3.818e-02  7.755e-02   0.492  0.62307    
## L(Volume.ts, 91:122)111 -1.392e-01  8.158e-02  -1.707  0.08963 .  
## L(Volume.ts, 91:122)112  1.268e-02  8.191e-02   0.155  0.87716    
## L(Volume.ts, 91:122)113  9.116e-02  8.143e-02   1.120  0.26444    
## L(Volume.ts, 91:122)114 -9.830e-02  8.162e-02  -1.204  0.23005    
## L(Volume.ts, 91:122)115 -8.967e-02  8.201e-02  -1.093  0.27572    
## L(Volume.ts, 91:122)116  6.354e-02  7.745e-02   0.820  0.41309    
## L(Volume.ts, 91:122)117  2.541e-01  7.778e-02   3.267  0.00131 ** 
## L(Volume.ts, 91:122)118 -1.326e-01  7.995e-02  -1.659  0.09899 .  
## L(Volume.ts, 91:122)119 -6.365e-02  8.158e-02  -0.780  0.43634    
## L(Volume.ts, 91:122)120  5.062e-02  8.010e-02   0.632  0.52822    
## L(Volume.ts, 91:122)121 -2.533e-02  7.926e-02  -0.320  0.74967    
## L(Volume.ts, 91:122)122 -5.590e-02  7.534e-02  -0.742  0.45912    
## L(Close.ts.diff, 35)    -5.703e+02  1.687e+03  -0.338  0.73565    
## L(Open.ts.diff, 110)    -4.591e+02  1.527e+03  -0.301  0.76400    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1895000 on 176 degrees of freedom
## Multiple R-squared:  0.3869, Adjusted R-squared:  0.157 
## F-statistic: 1.683 on 66 and 176 DF,  p-value: 0.00383

Analyzing ARDL Residuals with ACF and PACF

plot_acf_pacf <- function(model_residuals, model_name) {
  par(mfrow = c(1, 2))  # Set up a 1x2 plotting area
  acf(model_residuals, main = paste("ACF of Residuals:", model_name))
  pacf(model_residuals, main = paste("PACF of Residuals:", model_name))
}
Turnover and Close

ACF and PACF show that residuals are within the confidence bound meaning there is no autocorrelation or partial autocorrelation found in the residuals.

ardl.turnover.close.1 <- dynlm(Turnover.ts ~ L(Turnover.ts, 1:4) + L(Close.ts.diff, 110))
summary(ardl.turnover.close.1)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 1:4) + L(Close.ts.diff, 
##     110))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.759e+14 -1.190e+14 -4.453e+13  5.802e+13  1.781e+15 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            2.379e+14  4.188e+13   5.679 3.78e-08 ***
## L(Turnover.ts, 1:4)1   3.277e-01  6.329e-02   5.178 4.65e-07 ***
## L(Turnover.ts, 1:4)2   3.515e-02  6.661e-02   0.528    0.598    
## L(Turnover.ts, 1:4)3  -1.813e-02  6.671e-02  -0.272    0.786    
## L(Turnover.ts, 1:4)4   8.763e-02  6.337e-02   1.383    0.168    
## L(Close.ts.diff, 110)  4.385e+10  1.844e+11   0.238    0.812    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.537e+14 on 248 degrees of freedom
## Multiple R-squared:  0.1263, Adjusted R-squared:  0.1087 
## F-statistic: 7.172 on 5 and 248 DF,  p-value: 2.743e-06
plot_acf_pacf(residuals(ardl.turnover.close.1), "ardl.turnover.close.1")

The ACF graph of the residuals show that in between lag 0.01 and 0.02 there is very slight autocorrelation (touching the bound). The PACF graph has long spikes, with onw crossing the confidence bound between 0.05 and 0.06.

ardl.turnover.close.2 <- dynlm(Turnover.ts ~ L(Turnover.ts, 1:4) + L(Close.ts.diff, 1:110))
summary(ardl.turnover.close.2)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 1:4) + L(Close.ts.diff, 
##     1:110))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.735e+14 -9.649e+13 -3.265e+13  4.919e+13  1.050e+15 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 2.329e+14  5.284e+13   4.407 2.08e-05 ***
## L(Turnover.ts, 1:4)1        3.394e-01  8.448e-02   4.017 9.60e-05 ***
## L(Turnover.ts, 1:4)2        7.559e-02  8.914e-02   0.848 0.397897    
## L(Turnover.ts, 1:4)3       -5.991e-02  8.919e-02  -0.672 0.502864    
## L(Turnover.ts, 1:4)4        9.371e-02  8.434e-02   1.111 0.268478    
## L(Close.ts.diff, 1:110)1    7.339e+10  1.611e+11   0.456 0.649388    
## L(Close.ts.diff, 1:110)2    1.657e+11  1.612e+11   1.028 0.305817    
## L(Close.ts.diff, 1:110)3    4.332e+10  1.617e+11   0.268 0.789204    
## L(Close.ts.diff, 1:110)4   -8.638e+10  1.618e+11  -0.534 0.594402    
## L(Close.ts.diff, 1:110)5    1.430e+11  1.620e+11   0.883 0.378722    
## L(Close.ts.diff, 1:110)6    8.402e+11  1.957e+11   4.293 3.29e-05 ***
## L(Close.ts.diff, 1:110)7   -2.172e+11  2.088e+11  -1.040 0.299955    
## L(Close.ts.diff, 1:110)8   -1.052e+11  2.092e+11  -0.503 0.615890    
## L(Close.ts.diff, 1:110)9    1.464e+11  2.088e+11   0.701 0.484299    
## L(Close.ts.diff, 1:110)10  -9.255e+10  2.086e+11  -0.444 0.657961    
## L(Close.ts.diff, 1:110)11  -1.621e+10  1.954e+11  -0.083 0.934008    
## L(Close.ts.diff, 1:110)12  -6.319e+10  1.951e+11  -0.324 0.746579    
## L(Close.ts.diff, 1:110)13   1.828e+11  1.953e+11   0.936 0.350926    
## L(Close.ts.diff, 1:110)14   1.700e+11  1.959e+11   0.868 0.387061    
## L(Close.ts.diff, 1:110)15   7.128e+10  1.965e+11   0.363 0.717289    
## L(Close.ts.diff, 1:110)16   1.206e+11  1.968e+11   0.613 0.540998    
## L(Close.ts.diff, 1:110)17   2.457e+11  1.962e+11   1.252 0.212560    
## L(Close.ts.diff, 1:110)18   3.434e+10  1.972e+11   0.174 0.861992    
## L(Close.ts.diff, 1:110)19   1.181e+11  1.968e+11   0.600 0.549307    
## L(Close.ts.diff, 1:110)20   3.291e+09  1.966e+11   0.017 0.986670    
## L(Close.ts.diff, 1:110)21  -1.867e+10  1.967e+11  -0.095 0.924545    
## L(Close.ts.diff, 1:110)22   4.037e+10  1.957e+11   0.206 0.836893    
## L(Close.ts.diff, 1:110)23  -6.412e+10  1.956e+11  -0.328 0.743565    
## L(Close.ts.diff, 1:110)24   1.775e+11  1.946e+11   0.912 0.363203    
## L(Close.ts.diff, 1:110)25   9.822e+10  1.954e+11   0.503 0.615977    
## L(Close.ts.diff, 1:110)26  -9.431e+11  1.955e+11  -4.823 3.67e-06 ***
## L(Close.ts.diff, 1:110)27   1.977e+11  2.113e+11   0.935 0.351197    
## L(Close.ts.diff, 1:110)28   3.297e+10  2.116e+11   0.156 0.876418    
## L(Close.ts.diff, 1:110)29   7.482e+10  2.110e+11   0.355 0.723470    
## L(Close.ts.diff, 1:110)30  -1.721e+10  2.076e+11  -0.083 0.934058    
## L(Close.ts.diff, 1:110)31  -1.372e+11  1.961e+11  -0.700 0.485290    
## L(Close.ts.diff, 1:110)32   1.895e+11  1.964e+11   0.965 0.336298    
## L(Close.ts.diff, 1:110)33  -6.174e+10  1.968e+11  -0.314 0.754153    
## L(Close.ts.diff, 1:110)34  -8.987e+10  1.964e+11  -0.458 0.647906    
## L(Close.ts.diff, 1:110)35   4.004e+09  1.957e+11   0.020 0.983701    
## L(Close.ts.diff, 1:110)36  -5.505e+10  1.955e+11  -0.282 0.778705    
## L(Close.ts.diff, 1:110)37   8.448e+10  1.952e+11   0.433 0.665822    
## L(Close.ts.diff, 1:110)38  -1.034e+11  1.951e+11  -0.530 0.596762    
## L(Close.ts.diff, 1:110)39   1.527e+11  1.950e+11   0.783 0.435093    
## L(Close.ts.diff, 1:110)40   3.860e+10  1.956e+11   0.197 0.843839    
## L(Close.ts.diff, 1:110)41  -1.435e+11  1.959e+11  -0.733 0.465072    
## L(Close.ts.diff, 1:110)42  -1.637e+11  1.961e+11  -0.835 0.405096    
## L(Close.ts.diff, 1:110)43  -8.991e+10  1.962e+11  -0.458 0.647521    
## L(Close.ts.diff, 1:110)44   1.694e+11  1.962e+11   0.863 0.389466    
## L(Close.ts.diff, 1:110)45   9.928e+10  1.967e+11   0.505 0.614490    
## L(Close.ts.diff, 1:110)46   8.374e+10  1.968e+11   0.426 0.671100    
## L(Close.ts.diff, 1:110)47   1.267e+10  1.964e+11   0.065 0.948629    
## L(Close.ts.diff, 1:110)48  -7.329e+10  1.956e+11  -0.375 0.708483    
## L(Close.ts.diff, 1:110)49  -2.369e+10  1.957e+11  -0.121 0.903837    
## L(Close.ts.diff, 1:110)50  -7.656e+10  1.957e+11  -0.391 0.696191    
## L(Close.ts.diff, 1:110)51  -6.874e+10  1.956e+11  -0.351 0.725829    
## L(Close.ts.diff, 1:110)52  -1.316e+11  1.955e+11  -0.673 0.502071    
## L(Close.ts.diff, 1:110)53  -1.302e+11  1.956e+11  -0.666 0.506643    
## L(Close.ts.diff, 1:110)54   4.434e+10  1.962e+11   0.226 0.821527    
## L(Close.ts.diff, 1:110)55  -6.630e+10  1.962e+11  -0.338 0.735944    
## L(Close.ts.diff, 1:110)56   5.868e+10  1.962e+11   0.299 0.765380    
## L(Close.ts.diff, 1:110)57  -7.955e+10  1.960e+11  -0.406 0.685506    
## L(Close.ts.diff, 1:110)58   3.189e+11  1.957e+11   1.630 0.105448    
## L(Close.ts.diff, 1:110)59  -6.487e+09  1.976e+11  -0.033 0.973855    
## L(Close.ts.diff, 1:110)60  -6.811e+10  1.974e+11  -0.345 0.730630    
## L(Close.ts.diff, 1:110)61   5.678e+09  1.972e+11   0.029 0.977077    
## L(Close.ts.diff, 1:110)62  -1.244e+11  1.965e+11  -0.633 0.527797    
## L(Close.ts.diff, 1:110)63   2.182e+10  1.953e+11   0.112 0.911218    
## L(Close.ts.diff, 1:110)64  -1.290e+11  1.954e+11  -0.660 0.510300    
## L(Close.ts.diff, 1:110)65  -4.913e+10  1.956e+11  -0.251 0.802104    
## L(Close.ts.diff, 1:110)66   1.716e+11  1.956e+11   0.877 0.381862    
## L(Close.ts.diff, 1:110)67   3.261e+10  1.961e+11   0.166 0.868160    
## L(Close.ts.diff, 1:110)68  -1.529e+11  1.959e+11  -0.780 0.436597    
## L(Close.ts.diff, 1:110)69   1.901e+11  1.963e+11   0.969 0.334410    
## L(Close.ts.diff, 1:110)70  -1.062e+10  1.965e+11  -0.054 0.956999    
## L(Close.ts.diff, 1:110)71   7.715e+10  1.961e+11   0.394 0.694545    
## L(Close.ts.diff, 1:110)72  -1.286e+11  1.960e+11  -0.656 0.512991    
## L(Close.ts.diff, 1:110)73  -2.963e+10  1.956e+11  -0.151 0.879828    
## L(Close.ts.diff, 1:110)74   1.183e+11  1.959e+11   0.604 0.546719    
## L(Close.ts.diff, 1:110)75   1.475e+10  1.963e+11   0.075 0.940220    
## L(Close.ts.diff, 1:110)76   8.400e+11  1.958e+11   4.291 3.32e-05 ***
## L(Close.ts.diff, 1:110)77   3.778e+10  2.075e+11   0.182 0.855775    
## L(Close.ts.diff, 1:110)78  -8.592e+10  2.074e+11  -0.414 0.679314    
## L(Close.ts.diff, 1:110)79  -9.532e+10  2.074e+11  -0.460 0.646531    
## L(Close.ts.diff, 1:110)80   6.725e+10  2.065e+11   0.326 0.745186    
## L(Close.ts.diff, 1:110)81  -2.137e+10  1.975e+11  -0.108 0.913998    
## L(Close.ts.diff, 1:110)82  -7.124e+11  1.958e+11  -3.638 0.000386 ***
## L(Close.ts.diff, 1:110)83  -3.165e+08  2.042e+11  -0.002 0.998766    
## L(Close.ts.diff, 1:110)84  -6.625e+09  2.037e+11  -0.033 0.974101    
## L(Close.ts.diff, 1:110)85  -1.514e+11  2.030e+11  -0.746 0.456962    
## L(Close.ts.diff, 1:110)86   6.248e+10  2.018e+11   0.310 0.757291    
## L(Close.ts.diff, 1:110)87   1.008e+10  1.955e+11   0.052 0.958947    
## L(Close.ts.diff, 1:110)88   1.621e+10  1.955e+11   0.083 0.934020    
## L(Close.ts.diff, 1:110)89   1.850e+10  1.954e+11   0.095 0.924721    
## L(Close.ts.diff, 1:110)90  -7.614e+10  1.949e+11  -0.391 0.696588    
## L(Close.ts.diff, 1:110)91   7.648e+10  1.949e+11   0.393 0.695280    
## L(Close.ts.diff, 1:110)92   8.090e+10  1.951e+11   0.415 0.679044    
## L(Close.ts.diff, 1:110)93   3.490e+10  1.953e+11   0.179 0.858413    
## L(Close.ts.diff, 1:110)94   8.301e+10  1.950e+11   0.426 0.670977    
## L(Close.ts.diff, 1:110)95   1.086e+10  1.956e+11   0.056 0.955808    
## L(Close.ts.diff, 1:110)96  -3.669e+10  1.954e+11  -0.188 0.851353    
## L(Close.ts.diff, 1:110)97   1.097e+10  1.952e+11   0.056 0.955280    
## L(Close.ts.diff, 1:110)98   3.885e+10  1.952e+11   0.199 0.842573    
## L(Close.ts.diff, 1:110)99   1.531e+11  1.950e+11   0.785 0.433730    
## L(Close.ts.diff, 1:110)100  2.930e+11  1.956e+11   1.498 0.136323    
## L(Close.ts.diff, 1:110)101 -5.918e+10  1.972e+11  -0.300 0.764513    
## L(Close.ts.diff, 1:110)102 -4.528e+09  1.971e+11  -0.023 0.981705    
## L(Close.ts.diff, 1:110)103  1.211e+11  1.971e+11   0.615 0.539768    
## L(Close.ts.diff, 1:110)104  3.255e+08  1.974e+11   0.002 0.998686    
## L(Close.ts.diff, 1:110)105 -1.619e+11  1.942e+11  -0.833 0.406053    
## L(Close.ts.diff, 1:110)106 -9.826e+10  1.953e+11  -0.503 0.615602    
## L(Close.ts.diff, 1:110)107 -1.163e+11  1.953e+11  -0.595 0.552643    
## L(Close.ts.diff, 1:110)108 -1.040e+11  1.952e+11  -0.533 0.595153    
## L(Close.ts.diff, 1:110)109  2.938e+10  1.950e+11   0.151 0.880456    
## L(Close.ts.diff, 1:110)110  8.288e+10  1.949e+11   0.425 0.671371    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.559e+14 on 139 degrees of freedom
## Multiple R-squared:  0.5018, Adjusted R-squared:  0.09325 
## F-statistic: 1.228 on 114 and 139 DF,  p-value: 0.1237
plot_acf_pacf(residuals(ardl.turnover.close.2), "ardl.turnover.close.2")

ACF graph shows autocorrelation of residuals between 0 and 0.01. PACF graph shows spikes reaching almost to the confidence bounds, but is still contained meaning there is still no significant partial autocorrelation between residuals.

ardl.turnover.close.3 <- dynlm(Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts,61) + L(Turnover.ts, 75) + L(Turnover.ts,117) + L(Close.ts.diff, 110))
summary(ardl.turnover.close.3)
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts, 
##     61) + L(Turnover.ts, 75) + L(Turnover.ts, 117) + L(Close.ts.diff, 
##     110))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -5.755e+14 -1.384e+14 -2.222e+13  1.007e+14  1.825e+15 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           9.077e+13  5.152e+13   1.762  0.07939 .  
## L(Turnover.ts, 2)     1.706e-01  5.747e-02   2.969  0.00329 ** 
## L(Turnover.ts, 61)    2.840e-01  5.778e-02   4.914 1.64e-06 ***
## L(Turnover.ts, 75)    4.264e-02  5.746e-02   0.742  0.45878    
## L(Turnover.ts, 117)   2.884e-01  5.784e-02   4.987 1.17e-06 ***
## L(Close.ts.diff, 110) 1.181e+11  1.778e+11   0.665  0.50697    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.44e+14 on 242 degrees of freedom
## Multiple R-squared:  0.2045, Adjusted R-squared:  0.188 
## F-statistic: 12.44 on 5 and 242 DF,  p-value: 9.408e-11
plot_acf_pacf(residuals(ardl.turnover.close.3), "ardl.turnover.close.3")

The ACF graph shows autocorrelation of residuals at lags (between 0 and 0.01 ) and 0.02. The PACF graph doesn’t show any partial autocorrelation.

ardl.turnover.close.4 <- dynlm(Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts,61) + L(Turnover.ts, 75) + L(Turnover.ts,117) + L(Close.ts.diff, 1:110))
summary(ardl.turnover.close.4)
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts, 
##     61) + L(Turnover.ts, 75) + L(Turnover.ts, 117) + L(Close.ts.diff, 
##     1:110))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -4.384e+14 -1.097e+14 -2.262e+13  7.092e+13  1.108e+15 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 1.106e+14  7.389e+13   1.498  0.13663    
## L(Turnover.ts, 2)           1.818e-01  7.859e-02   2.313  0.02224 *  
## L(Turnover.ts, 61)          2.717e-01  8.743e-02   3.108  0.00231 ** 
## L(Turnover.ts, 75)         -9.467e-03  8.713e-02  -0.109  0.91364    
## L(Turnover.ts, 117)         2.946e-01  9.255e-02   3.184  0.00181 ** 
## L(Close.ts.diff, 1:110)1   -2.861e+10  1.945e+11  -0.147  0.88326    
## L(Close.ts.diff, 1:110)2    1.521e+11  1.957e+11   0.777  0.43848    
## L(Close.ts.diff, 1:110)3    6.492e+08  1.942e+11   0.003  0.99734    
## L(Close.ts.diff, 1:110)4   -9.810e+10  1.952e+11  -0.503  0.61612    
## L(Close.ts.diff, 1:110)5    1.409e+11  1.944e+11   0.725  0.46979    
## L(Close.ts.diff, 1:110)6    4.138e+11  2.227e+11   1.859  0.06530 .  
## L(Close.ts.diff, 1:110)7   -4.007e+10  1.968e+11  -0.204  0.83900    
## L(Close.ts.diff, 1:110)8   -8.854e+10  2.085e+11  -0.425  0.67183    
## L(Close.ts.diff, 1:110)9    1.879e+11  1.961e+11   0.958  0.33956    
## L(Close.ts.diff, 1:110)10   9.941e+09  1.952e+11   0.051  0.95947    
## L(Close.ts.diff, 1:110)11   2.261e+10  1.950e+11   0.116  0.90786    
## L(Close.ts.diff, 1:110)12   2.422e+11  2.183e+11   1.110  0.26922    
## L(Close.ts.diff, 1:110)13   1.887e+11  1.954e+11   0.966  0.33585    
## L(Close.ts.diff, 1:110)14   2.739e+11  1.954e+11   1.402  0.16338    
## L(Close.ts.diff, 1:110)15   2.032e+11  1.960e+11   1.037  0.30179    
## L(Close.ts.diff, 1:110)16   1.543e+11  1.973e+11   0.782  0.43563    
## L(Close.ts.diff, 1:110)17   3.081e+11  1.950e+11   1.580  0.11658    
## L(Close.ts.diff, 1:110)18   7.711e+10  1.956e+11   0.394  0.69413    
## L(Close.ts.diff, 1:110)19   1.816e+11  1.962e+11   0.925  0.35659    
## L(Close.ts.diff, 1:110)20   1.353e+11  2.040e+11   0.663  0.50838    
## L(Close.ts.diff, 1:110)21   4.811e+10  1.965e+11   0.245  0.80699    
## L(Close.ts.diff, 1:110)22   9.921e+10  1.968e+11   0.504  0.61506    
## L(Close.ts.diff, 1:110)23   3.112e+10  1.960e+11   0.159  0.87411    
## L(Close.ts.diff, 1:110)24   3.041e+11  1.961e+11   1.550  0.12346    
## L(Close.ts.diff, 1:110)25   2.750e+11  1.962e+11   1.402  0.16337    
## L(Close.ts.diff, 1:110)26  -5.933e+11  2.134e+11  -2.780  0.00622 ** 
## L(Close.ts.diff, 1:110)27   1.456e+10  1.993e+11   0.073  0.94188    
## L(Close.ts.diff, 1:110)28   1.327e+11  2.072e+11   0.640  0.52307    
## L(Close.ts.diff, 1:110)29   8.735e+10  1.972e+11   0.443  0.65850    
## L(Close.ts.diff, 1:110)30  -1.742e+10  1.962e+11  -0.089  0.92939    
## L(Close.ts.diff, 1:110)31  -1.962e+11  1.962e+11  -1.000  0.31914    
## L(Close.ts.diff, 1:110)32   6.967e+10  1.964e+11   0.355  0.72332    
## L(Close.ts.diff, 1:110)33  -4.210e+10  1.972e+11  -0.213  0.83127    
## L(Close.ts.diff, 1:110)34  -1.024e+11  1.953e+11  -0.524  0.60083    
## L(Close.ts.diff, 1:110)35  -6.332e+10  1.953e+11  -0.324  0.74631    
## L(Close.ts.diff, 1:110)36  -1.464e+11  1.965e+11  -0.745  0.45778    
## L(Close.ts.diff, 1:110)37   1.796e+10  1.964e+11   0.091  0.92725    
## L(Close.ts.diff, 1:110)38  -1.741e+11  1.970e+11  -0.884  0.37847    
## L(Close.ts.diff, 1:110)39   1.427e+11  1.949e+11   0.732  0.46517    
## L(Close.ts.diff, 1:110)40   6.295e+10  2.128e+11   0.296  0.76781    
## L(Close.ts.diff, 1:110)41  -1.481e+11  1.993e+11  -0.743  0.45874    
## L(Close.ts.diff, 1:110)42  -2.085e+11  1.957e+11  -1.066  0.28852    
## L(Close.ts.diff, 1:110)43  -1.441e+11  1.952e+11  -0.738  0.46159    
## L(Close.ts.diff, 1:110)44   1.391e+11  1.963e+11   0.708  0.47994    
## L(Close.ts.diff, 1:110)45   1.611e+11  1.955e+11   0.824  0.41134    
## L(Close.ts.diff, 1:110)46   8.892e+10  1.949e+11   0.456  0.64891    
## L(Close.ts.diff, 1:110)47   2.950e+10  1.952e+11   0.151  0.88009    
## L(Close.ts.diff, 1:110)48  -1.250e+11  1.958e+11  -0.639  0.52419    
## L(Close.ts.diff, 1:110)49  -1.461e+10  1.955e+11  -0.075  0.94053    
## L(Close.ts.diff, 1:110)50  -6.991e+09  1.981e+11  -0.035  0.97190    
## L(Close.ts.diff, 1:110)51  -4.997e+10  1.954e+11  -0.256  0.79858    
## L(Close.ts.diff, 1:110)52  -2.406e+11  1.981e+11  -1.215  0.22666    
## L(Close.ts.diff, 1:110)53  -2.213e+11  1.952e+11  -1.134  0.25902    
## L(Close.ts.diff, 1:110)54   1.635e+10  1.955e+11   0.084  0.93348    
## L(Close.ts.diff, 1:110)55  -8.485e+10  1.959e+11  -0.433  0.66563    
## L(Close.ts.diff, 1:110)56  -4.230e+09  1.958e+11  -0.022  0.98280    
## L(Close.ts.diff, 1:110)57  -8.049e+10  1.955e+11  -0.412  0.68129    
## L(Close.ts.diff, 1:110)58   2.391e+11  1.957e+11   1.221  0.22409    
## L(Close.ts.diff, 1:110)59   1.043e+11  1.955e+11   0.533  0.59476    
## L(Close.ts.diff, 1:110)60  -8.921e+10  1.965e+11  -0.454  0.65052    
## L(Close.ts.diff, 1:110)61  -2.069e+10  1.956e+11  -0.106  0.91592    
## L(Close.ts.diff, 1:110)62  -3.194e+11  2.041e+11  -1.564  0.12009    
## L(Close.ts.diff, 1:110)63  -1.170e+11  1.965e+11  -0.595  0.55264    
## L(Close.ts.diff, 1:110)64  -1.089e+11  1.987e+11  -0.548  0.58461    
## L(Close.ts.diff, 1:110)65  -4.240e+09  1.958e+11  -0.022  0.98275    
## L(Close.ts.diff, 1:110)66   1.512e+11  1.958e+11   0.772  0.44137    
## L(Close.ts.diff, 1:110)67  -1.484e+11  2.111e+11  -0.703  0.48342    
## L(Close.ts.diff, 1:110)68  -2.021e+11  1.954e+11  -1.034  0.30278    
## L(Close.ts.diff, 1:110)69   1.209e+11  1.947e+11   0.621  0.53587    
## L(Close.ts.diff, 1:110)70   5.483e+10  1.956e+11   0.280  0.77968    
## L(Close.ts.diff, 1:110)71   1.230e+11  1.957e+11   0.628  0.53097    
## L(Close.ts.diff, 1:110)72  -7.109e+10  1.952e+11  -0.364  0.71630    
## L(Close.ts.diff, 1:110)73  -3.854e+10  1.954e+11  -0.197  0.84398    
## L(Close.ts.diff, 1:110)74   4.417e+10  1.956e+11   0.226  0.82173    
## L(Close.ts.diff, 1:110)75   3.656e+09  1.960e+11   0.019  0.98514    
## L(Close.ts.diff, 1:110)76   8.334e+11  1.959e+11   4.255 3.91e-05 ***
## L(Close.ts.diff, 1:110)77   2.712e+11  1.961e+11   1.383  0.16903    
## L(Close.ts.diff, 1:110)78  -9.198e+10  2.092e+11  -0.440  0.66086    
## L(Close.ts.diff, 1:110)79  -1.253e+11  1.986e+11  -0.631  0.52937    
## L(Close.ts.diff, 1:110)80   1.007e+11  1.974e+11   0.510  0.61096    
## L(Close.ts.diff, 1:110)81   5.203e+10  2.114e+11   0.246  0.80592    
## L(Close.ts.diff, 1:110)82  -4.597e+11  2.156e+11  -2.132  0.03483 *  
## L(Close.ts.diff, 1:110)83  -1.148e+11  2.000e+11  -0.574  0.56695    
## L(Close.ts.diff, 1:110)84   7.064e+10  2.025e+11   0.349  0.72777    
## L(Close.ts.diff, 1:110)85  -1.529e+11  1.958e+11  -0.781  0.43610    
## L(Close.ts.diff, 1:110)86  -8.517e+09  1.957e+11  -0.044  0.96536    
## L(Close.ts.diff, 1:110)87   2.762e+11  2.098e+11   1.317  0.19018    
## L(Close.ts.diff, 1:110)88   4.054e+10  1.951e+11   0.208  0.83573    
## L(Close.ts.diff, 1:110)89   4.640e+10  1.957e+11   0.237  0.81292    
## L(Close.ts.diff, 1:110)90  -1.128e+11  1.952e+11  -0.578  0.56446    
## L(Close.ts.diff, 1:110)91   8.581e+10  1.951e+11   0.440  0.66083    
## L(Close.ts.diff, 1:110)92   9.266e+10  1.968e+11   0.471  0.63857    
## L(Close.ts.diff, 1:110)93   3.228e+10  1.954e+11   0.165  0.86907    
## L(Close.ts.diff, 1:110)94  -9.814e+09  1.978e+11  -0.050  0.96050    
## L(Close.ts.diff, 1:110)95   7.836e+10  1.954e+11   0.401  0.68901    
## L(Close.ts.diff, 1:110)96   3.101e+09  1.956e+11   0.016  0.98738    
## L(Close.ts.diff, 1:110)97   3.338e+10  1.948e+11   0.171  0.86422    
## L(Close.ts.diff, 1:110)98   7.496e+10  1.949e+11   0.385  0.70115    
## L(Close.ts.diff, 1:110)99   2.078e+11  1.950e+11   1.066  0.28857    
## L(Close.ts.diff, 1:110)100  3.745e+11  1.956e+11   1.915  0.05766 .  
## L(Close.ts.diff, 1:110)101  3.678e+10  2.096e+11   0.175  0.86098    
## L(Close.ts.diff, 1:110)102  3.637e+09  1.970e+11   0.018  0.98530    
## L(Close.ts.diff, 1:110)103  1.728e+11  1.958e+11   0.882  0.37917    
## L(Close.ts.diff, 1:110)104  1.298e+11  1.954e+11   0.664  0.50775    
## L(Close.ts.diff, 1:110)105 -1.281e+11  1.946e+11  -0.658  0.51165    
## L(Close.ts.diff, 1:110)106 -8.310e+10  1.972e+11  -0.421  0.67415    
## L(Close.ts.diff, 1:110)107 -1.727e+11  1.947e+11  -0.887  0.37657    
## L(Close.ts.diff, 1:110)108 -1.724e+11  1.944e+11  -0.887  0.37680    
## L(Close.ts.diff, 1:110)109 -1.502e+09  1.947e+11  -0.008  0.99386    
## L(Close.ts.diff, 1:110)110  1.082e+11  1.946e+11   0.556  0.57925    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.551e+14 on 133 degrees of freedom
## Multiple R-squared:  0.5223, Adjusted R-squared:  0.1128 
## F-statistic: 1.276 on 114 and 133 DF,  p-value: 0.08804
plot_acf_pacf(residuals(ardl.turnover.close.4), "ardl.turnover.close.4")

BASED ON ALL 4 ACF AND PACF GRAPHS MODEL: ardl.turnover.close.1 is the best fitted model since there is no correlation in the residuals and they are centered around 0. This means that there is no misspecification in this model.

Turnover and Open

ACF and PACF show that residuals are within the confidence bound meaning there is no autocorrelation or partial autocorrelation found in the residuals.

ardl.turnover.open.1 <- dynlm(Turnover.ts ~ L(Turnover.ts, 1:4) + L(Open.ts.diff, 110), data = infy_stock)
summary(ardl.turnover.open.1)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 1:4) + L(Open.ts.diff, 
##     110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.749e+14 -1.200e+14 -4.689e+13  5.768e+13  1.780e+15 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           2.376e+14  4.187e+13   5.675 3.86e-08 ***
## L(Turnover.ts, 1:4)1  3.277e-01  6.326e-02   5.180 4.59e-07 ***
## L(Turnover.ts, 1:4)2  3.542e-02  6.660e-02   0.532    0.595    
## L(Turnover.ts, 1:4)3 -1.833e-02  6.665e-02  -0.275    0.784    
## L(Turnover.ts, 1:4)4  8.819e-02  6.338e-02   1.391    0.165    
## L(Open.ts.diff, 110)  7.057e+10  1.803e+11   0.391    0.696    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.536e+14 on 248 degrees of freedom
## Multiple R-squared:  0.1267, Adjusted R-squared:  0.1091 
## F-statistic: 7.194 on 5 and 248 DF,  p-value: 2.624e-06
plot_acf_pacf(residuals(ardl.turnover.open.1), "ardl.turnover.open.1")

ACF and PACF show that residuals are within the confidence bound meaning there is no autocorrelation or partial autocorrelation found in the residuals.

ardl.turnover.open.2 <- dynlm(Turnover.ts ~ L(Turnover.ts, 1:4) + L(Open.ts.diff, 35) + L (Open.ts.diff, 110), data = infy_stock)
summary(ardl.turnover.open.2)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 1:4) + L(Open.ts.diff, 
##     35) + L(Open.ts.diff, 110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.740e+14 -1.181e+14 -4.666e+13  5.844e+13  1.779e+15 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           2.378e+14  4.196e+13   5.667 4.03e-08 ***
## L(Turnover.ts, 1:4)1  3.277e-01  6.338e-02   5.171 4.81e-07 ***
## L(Turnover.ts, 1:4)2  3.482e-02  6.677e-02   0.522    0.602    
## L(Turnover.ts, 1:4)3 -1.781e-02  6.681e-02  -0.267    0.790    
## L(Turnover.ts, 1:4)4  8.773e-02  6.353e-02   1.381    0.169    
## L(Open.ts.diff, 35)  -4.377e+10  1.797e+11  -0.244    0.808    
## L(Open.ts.diff, 110)  7.082e+10  1.806e+11   0.392    0.695    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.541e+14 on 247 degrees of freedom
## Multiple R-squared:  0.1269, Adjusted R-squared:  0.1057 
## F-statistic: 5.982 on 6 and 247 DF,  p-value: 7.42e-06
plot_acf_pacf(residuals(ardl.turnover.open.2), "ardl.turnover.open.2")

ACF graph shows a few residuals extending outside of the confience bounds, and PACF does not show any significant correlation of residuals but does have long spikes. This is an indicator that there is misspecfication within the model.

ardl.turnover.open.3 <- dynlm(Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts,61) + L(Turnover.ts, 75) + L(Turnover.ts,117) + L(Open.ts.diff, 110), data = infy_stock)
summary(ardl.turnover.open.3)
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts, 
##     61) + L(Turnover.ts, 75) + L(Turnover.ts, 117) + L(Open.ts.diff, 
##     110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -5.737e+14 -1.372e+14 -1.935e+13  1.007e+14  1.827e+15 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          9.040e+13  5.152e+13   1.755  0.08061 .  
## L(Turnover.ts, 2)    1.709e-01  5.746e-02   2.974  0.00323 ** 
## L(Turnover.ts, 61)   2.830e-01  5.774e-02   4.902 1.74e-06 ***
## L(Turnover.ts, 75)   4.284e-02  5.745e-02   0.746  0.45658    
## L(Turnover.ts, 117)  2.897e-01  5.788e-02   5.006 1.07e-06 ***
## L(Open.ts.diff, 110) 1.286e+11  1.736e+11   0.741  0.45937    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.44e+14 on 242 degrees of freedom
## Multiple R-squared:  0.2048, Adjusted R-squared:  0.1884 
## F-statistic: 12.47 on 5 and 242 DF,  p-value: 8.938e-11
plot_acf_pacf(residuals(ardl.turnover.open.3), "ardl.turnover.open.3")

ACF graph shows a few residuals extending outside of the confience bounds, and PACF does not show any significant correlation of residuals but does have long spikes. This is an indicator that there is misspecfication within the model.

ardl.turnover.open.4 <- dynlm(Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts,61) + L(Turnover.ts, 75) + L(Turnover.ts,117) + L(Open.ts.diff, 35) + L(Open.ts.diff, 110), data = infy_stock)
summary(ardl.turnover.open.4)
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = Turnover.ts ~ L(Turnover.ts, 2) + L(Turnover.ts, 
##     61) + L(Turnover.ts, 75) + L(Turnover.ts, 117) + L(Open.ts.diff, 
##     35) + L(Open.ts.diff, 110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -5.790e+14 -1.361e+14 -2.027e+13  9.983e+13  1.829e+15 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           9.102e+13  5.163e+13   1.763  0.07918 .  
## L(Turnover.ts, 2)     1.701e-01  5.758e-02   2.955  0.00344 ** 
## L(Turnover.ts, 61)    2.824e-01  5.785e-02   4.882 1.91e-06 ***
## L(Turnover.ts, 75)    4.174e-02  5.760e-02   0.725  0.46938    
## L(Turnover.ts, 117)   2.907e-01  5.801e-02   5.011 1.05e-06 ***
## L(Open.ts.diff, 35)  -7.722e+10  1.739e+11  -0.444  0.65740    
## L(Open.ts.diff, 110)  1.293e+11  1.738e+11   0.744  0.45782    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.444e+14 on 241 degrees of freedom
## Multiple R-squared:  0.2055, Adjusted R-squared:  0.1857 
## F-statistic: 10.39 on 6 and 241 DF,  p-value: 3.077e-10
plot_acf_pacf(residuals(ardl.turnover.open.4), "ardl.turnover.open.4")

BASED ON ALL 4 ACF AND PACF GRAPHS, models ardl.turnover.open.1 and ardl.turnover.open.2 represent the data the best.

Volume and Close

ACF and PACF graph shows that residuals are cenetered around 0 and within the confidence bound, and spikes are short. This means that the residuals are white noise and the model is successfully capturting the data.

ardl.volume.close.1 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Close.ts.diff, 110), data = infy_stock)
summary(ardl.volume.close.1)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Close.ts.diff, 
##     110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2655876  -835982  -253740   406222 16602471 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            5.428e+05  4.000e+05   1.357   0.1762    
## L(Volume.ts, 1:32)1    3.211e-01  6.739e-02   4.766 3.42e-06 ***
## L(Volume.ts, 1:32)2    5.738e-02  7.077e-02   0.811   0.4184    
## L(Volume.ts, 1:32)3   -4.028e-02  7.105e-02  -0.567   0.5714    
## L(Volume.ts, 1:32)4    9.029e-02  7.045e-02   1.282   0.2013    
## L(Volume.ts, 1:32)5    2.284e-03  7.043e-02   0.032   0.9742    
## L(Volume.ts, 1:32)6    5.138e-02  7.046e-02   0.729   0.4666    
## L(Volume.ts, 1:32)7    1.222e-01  7.049e-02   1.733   0.0845 .  
## L(Volume.ts, 1:32)8   -2.718e-03  7.091e-02  -0.038   0.9695    
## L(Volume.ts, 1:32)9   -6.121e-03  7.072e-02  -0.087   0.9311    
## L(Volume.ts, 1:32)10   5.304e-02  7.130e-02   0.744   0.4577    
## L(Volume.ts, 1:32)11  -7.402e-02  7.035e-02  -1.052   0.2938    
## L(Volume.ts, 1:32)12   1.587e-02  7.050e-02   0.225   0.8221    
## L(Volume.ts, 1:32)13  -3.196e-02  7.051e-02  -0.453   0.6508    
## L(Volume.ts, 1:32)14  -3.331e-02  7.062e-02  -0.472   0.6376    
## L(Volume.ts, 1:32)15   7.403e-02  7.049e-02   1.050   0.2948    
## L(Volume.ts, 1:32)16  -3.776e-02  7.078e-02  -0.534   0.5942    
## L(Volume.ts, 1:32)17  -1.413e-02  7.114e-02  -0.199   0.8428    
## L(Volume.ts, 1:32)18   4.508e-02  7.084e-02   0.636   0.5252    
## L(Volume.ts, 1:32)19  -1.906e-02  7.087e-02  -0.269   0.7882    
## L(Volume.ts, 1:32)20   1.334e-02  7.086e-02   0.188   0.8508    
## L(Volume.ts, 1:32)21  -2.452e-02  7.099e-02  -0.345   0.7301    
## L(Volume.ts, 1:32)22   1.536e-02  7.073e-02   0.217   0.8283    
## L(Volume.ts, 1:32)23  -6.945e-03  7.063e-02  -0.098   0.9218    
## L(Volume.ts, 1:32)24   8.218e-02  7.068e-02   1.163   0.2462    
## L(Volume.ts, 1:32)25   3.781e-02  7.105e-02   0.532   0.5952    
## L(Volume.ts, 1:32)26   3.019e-02  7.045e-02   0.428   0.6687    
## L(Volume.ts, 1:32)27   1.034e-02  7.041e-02   0.147   0.8834    
## L(Volume.ts, 1:32)28  -8.898e-02  7.311e-02  -1.217   0.2249    
## L(Volume.ts, 1:32)29   1.327e-01  7.052e-02   1.882   0.0611 .  
## L(Volume.ts, 1:32)30  -2.937e-02  7.094e-02  -0.414   0.6793    
## L(Volume.ts, 1:32)31   3.599e-02  7.102e-02   0.507   0.6128    
## L(Volume.ts, 1:32)32   3.964e-02  6.747e-02   0.588   0.5575    
## L(Close.ts.diff, 110) -1.808e+02  1.437e+03  -0.126   0.9000    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1854000 on 220 degrees of freedom
## Multiple R-squared:  0.268,  Adjusted R-squared:  0.1582 
## F-statistic: 2.441 on 33 and 220 DF,  p-value: 6.89e-05
plot_acf_pacf(residuals(ardl.volume.close.1), "ardl.volume.close.1")

ACF and PACF graph shows that residuals are centered around 0 and within the confidence, and spikes are mostly short. In the PACF graph however there are longer spikes. This means that the residuals are white noise and the model is successfully capturing the data.

ardl.volume.close.2 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Close.ts.diff, 1:110), data = infy_stock)
summary(ardl.volume.close.2)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Close.ts.diff, 
##     1:110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2616765  -664712   -77535   379842  6043927 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 1.834e+06  7.916e+05   2.317  0.02233 *  
## L(Volume.ts, 1:32)1         2.839e-01  9.492e-02   2.991  0.00342 ** 
## L(Volume.ts, 1:32)2         5.724e-02  9.894e-02   0.579  0.56407    
## L(Volume.ts, 1:32)3        -1.020e-01  9.886e-02  -1.032  0.30455    
## L(Volume.ts, 1:32)4         9.376e-02  9.862e-02   0.951  0.34381    
## L(Volume.ts, 1:32)5        -3.309e-02  9.817e-02  -0.337  0.73669    
## L(Volume.ts, 1:32)6         2.138e-01  9.814e-02   2.179  0.03145 *  
## L(Volume.ts, 1:32)7         1.283e-01  1.001e-01   1.282  0.20258    
## L(Volume.ts, 1:32)8        -5.782e-02  1.004e-01  -0.576  0.56602    
## L(Volume.ts, 1:32)9         3.384e-02  9.988e-02   0.339  0.73539    
## L(Volume.ts, 1:32)10        3.517e-03  1.010e-01   0.035  0.97228    
## L(Volume.ts, 1:32)11       -1.465e-01  9.978e-02  -1.468  0.14488    
## L(Volume.ts, 1:32)12        1.599e-03  1.016e-01   0.016  0.98747    
## L(Volume.ts, 1:32)13       -1.056e-01  9.988e-02  -1.057  0.29272    
## L(Volume.ts, 1:32)14       -1.012e-01  1.004e-01  -1.008  0.31589    
## L(Volume.ts, 1:32)15        2.966e-02  1.005e-01   0.295  0.76849    
## L(Volume.ts, 1:32)16       -5.455e-02  1.004e-01  -0.543  0.58804    
## L(Volume.ts, 1:32)17        6.465e-02  1.006e-01   0.643  0.52163    
## L(Volume.ts, 1:32)18        3.846e-02  1.002e-01   0.384  0.70175    
## L(Volume.ts, 1:32)19       -3.670e-02  9.987e-02  -0.367  0.71397    
## L(Volume.ts, 1:32)20        1.803e-01  9.958e-02   1.811  0.07291 .  
## L(Volume.ts, 1:32)21       -6.883e-02  1.007e-01  -0.683  0.49579    
## L(Volume.ts, 1:32)22       -5.455e-02  9.966e-02  -0.547  0.58520    
## L(Volume.ts, 1:32)23       -8.851e-02  1.000e-01  -0.885  0.37819    
## L(Volume.ts, 1:32)24        5.916e-02  1.016e-01   0.582  0.56153    
## L(Volume.ts, 1:32)25        4.650e-02  1.016e-01   0.458  0.64813    
## L(Volume.ts, 1:32)26       -1.093e-01  1.011e-01  -1.082  0.28163    
## L(Volume.ts, 1:32)27        7.259e-03  9.953e-02   0.073  0.94199    
## L(Volume.ts, 1:32)28       -8.456e-02  9.970e-02  -0.848  0.39817    
## L(Volume.ts, 1:32)29        1.139e-01  9.412e-02   1.211  0.22858    
## L(Volume.ts, 1:32)30       -9.664e-03  9.409e-02  -0.103  0.91838    
## L(Volume.ts, 1:32)31       -2.868e-02  9.391e-02  -0.305  0.76063    
## L(Volume.ts, 1:32)32        1.110e-01  8.762e-02   1.267  0.20769    
## L(Close.ts.diff, 1:110)1   -1.462e+02  1.210e+03  -0.121  0.90406    
## L(Close.ts.diff, 1:110)2    5.881e+02  1.210e+03   0.486  0.62798    
## L(Close.ts.diff, 1:110)3    2.747e+02  1.211e+03   0.227  0.82104    
## L(Close.ts.diff, 1:110)4   -1.140e+03  1.212e+03  -0.940  0.34902    
## L(Close.ts.diff, 1:110)5    3.560e+02  1.218e+03   0.292  0.77065    
## L(Close.ts.diff, 1:110)6    3.366e+03  1.455e+03   2.313  0.02256 *  
## L(Close.ts.diff, 1:110)7   -1.147e+03  1.494e+03  -0.768  0.44419    
## L(Close.ts.diff, 1:110)8   -1.230e+03  1.494e+03  -0.823  0.41213    
## L(Close.ts.diff, 1:110)9   -3.403e+02  1.496e+03  -0.227  0.82051    
## L(Close.ts.diff, 1:110)10  -5.076e+02  1.475e+03  -0.344  0.73145    
## L(Close.ts.diff, 1:110)11  -8.795e+02  1.475e+03  -0.596  0.55210    
## L(Close.ts.diff, 1:110)12  -1.557e+03  1.476e+03  -1.055  0.29377    
## L(Close.ts.diff, 1:110)13   8.243e+02  1.476e+03   0.558  0.57775    
## L(Close.ts.diff, 1:110)14   1.228e+03  1.481e+03   0.829  0.40889    
## L(Close.ts.diff, 1:110)15  -4.525e+01  1.485e+03  -0.030  0.97574    
## L(Close.ts.diff, 1:110)16   3.690e+02  1.484e+03   0.249  0.80415    
## L(Close.ts.diff, 1:110)17   1.378e+03  1.482e+03   0.930  0.35456    
## L(Close.ts.diff, 1:110)18  -3.476e+02  1.487e+03  -0.234  0.81563    
## L(Close.ts.diff, 1:110)19  -6.267e+00  1.483e+03  -0.004  0.99664    
## L(Close.ts.diff, 1:110)20  -9.261e+01  1.473e+03  -0.063  0.94999    
## L(Close.ts.diff, 1:110)21  -7.406e+02  1.473e+03  -0.503  0.61609    
## L(Close.ts.diff, 1:110)22  -4.984e+01  1.469e+03  -0.034  0.97299    
## L(Close.ts.diff, 1:110)23  -1.833e+03  1.469e+03  -1.248  0.21474    
## L(Close.ts.diff, 1:110)24   3.469e+02  1.469e+03   0.236  0.81381    
## L(Close.ts.diff, 1:110)25   9.659e+02  1.469e+03   0.658  0.51212    
## L(Close.ts.diff, 1:110)26  -9.938e+03  1.471e+03  -6.755 6.86e-10 ***
## L(Close.ts.diff, 1:110)27   1.209e+03  1.761e+03   0.686  0.49399    
## L(Close.ts.diff, 1:110)28   3.478e+02  1.763e+03   0.197  0.84400    
## L(Close.ts.diff, 1:110)29   3.762e+02  1.762e+03   0.214  0.83129    
## L(Close.ts.diff, 1:110)30  -4.712e+02  1.760e+03  -0.268  0.78943    
## L(Close.ts.diff, 1:110)31  -2.620e+03  1.760e+03  -1.489  0.13930    
## L(Close.ts.diff, 1:110)32   2.837e+03  1.773e+03   1.600  0.11239    
## L(Close.ts.diff, 1:110)33   2.161e+02  1.777e+03   0.122  0.90343    
## L(Close.ts.diff, 1:110)34  -1.469e+03  1.776e+03  -0.827  0.41016    
## L(Close.ts.diff, 1:110)35  -9.850e+02  1.763e+03  -0.559  0.57755    
## L(Close.ts.diff, 1:110)36  -7.892e+02  1.769e+03  -0.446  0.65635    
## L(Close.ts.diff, 1:110)37  -2.313e+02  1.772e+03  -0.131  0.89638    
## L(Close.ts.diff, 1:110)38  -1.650e+03  1.758e+03  -0.939  0.34981    
## L(Close.ts.diff, 1:110)39  -4.083e+02  1.670e+03  -0.244  0.80733    
## L(Close.ts.diff, 1:110)40  -5.623e+01  1.672e+03  -0.034  0.97324    
## L(Close.ts.diff, 1:110)41  -1.010e+03  1.667e+03  -0.606  0.54576    
## L(Close.ts.diff, 1:110)42  -1.927e+03  1.670e+03  -1.154  0.25117    
## L(Close.ts.diff, 1:110)43  -5.776e+02  1.679e+03  -0.344  0.73151    
## L(Close.ts.diff, 1:110)44   9.991e+02  1.674e+03   0.597  0.55177    
## L(Close.ts.diff, 1:110)45   4.668e+01  1.663e+03   0.028  0.97766    
## L(Close.ts.diff, 1:110)46   1.295e+03  1.662e+03   0.779  0.43751    
## L(Close.ts.diff, 1:110)47  -7.589e+02  1.653e+03  -0.459  0.64698    
## L(Close.ts.diff, 1:110)48  -6.981e+02  1.652e+03  -0.423  0.67334    
## L(Close.ts.diff, 1:110)49  -1.960e+03  1.653e+03  -1.185  0.23838    
## L(Close.ts.diff, 1:110)50  -1.290e+03  1.669e+03  -0.773  0.44126    
## L(Close.ts.diff, 1:110)51  -8.033e+02  1.673e+03  -0.480  0.63217    
## L(Close.ts.diff, 1:110)52  -3.024e+03  1.671e+03  -1.809  0.07310 .  
## L(Close.ts.diff, 1:110)53  -2.420e+03  1.689e+03  -1.433  0.15462    
## L(Close.ts.diff, 1:110)54  -1.194e+03  1.703e+03  -0.701  0.48488    
## L(Close.ts.diff, 1:110)55   5.645e+01  1.665e+03   0.034  0.97301    
## L(Close.ts.diff, 1:110)56  -5.048e+01  1.661e+03  -0.030  0.97581    
## L(Close.ts.diff, 1:110)57  -1.431e+03  1.656e+03  -0.864  0.38966    
## L(Close.ts.diff, 1:110)58   2.823e+03  1.618e+03   1.745  0.08373 .  
## L(Close.ts.diff, 1:110)59   6.819e+02  1.479e+03   0.461  0.64563    
## L(Close.ts.diff, 1:110)60  -1.525e+02  1.474e+03  -0.103  0.91780    
## L(Close.ts.diff, 1:110)61  -6.843e+02  1.471e+03  -0.465  0.64276    
## L(Close.ts.diff, 1:110)62  -1.538e+03  1.470e+03  -1.046  0.29762    
## L(Close.ts.diff, 1:110)63  -2.373e+02  1.477e+03  -0.161  0.87264    
## L(Close.ts.diff, 1:110)64  -3.029e+03  1.474e+03  -2.055  0.04226 *  
## L(Close.ts.diff, 1:110)65  -1.621e+03  1.494e+03  -1.085  0.28013    
## L(Close.ts.diff, 1:110)66   1.213e+02  1.500e+03   0.081  0.93567    
## L(Close.ts.diff, 1:110)67  -1.577e+02  1.492e+03  -0.106  0.91598    
## L(Close.ts.diff, 1:110)68  -1.641e+03  1.487e+03  -1.103  0.27242    
## L(Close.ts.diff, 1:110)69   8.109e+02  1.491e+03   0.544  0.58754    
## L(Close.ts.diff, 1:110)70  -3.972e+02  1.485e+03  -0.268  0.78957    
## L(Close.ts.diff, 1:110)71   8.528e+02  1.480e+03   0.576  0.56560    
## L(Close.ts.diff, 1:110)72  -1.410e+03  1.482e+03  -0.951  0.34343    
## L(Close.ts.diff, 1:110)73  -1.310e+03  1.486e+03  -0.882  0.37976    
## L(Close.ts.diff, 1:110)74   6.551e+02  1.500e+03   0.437  0.66315    
## L(Close.ts.diff, 1:110)75  -1.075e+03  1.493e+03  -0.720  0.47320    
## L(Close.ts.diff, 1:110)76   2.771e+03  1.489e+03   1.861  0.06535 .  
## L(Close.ts.diff, 1:110)77   2.118e+02  1.504e+03   0.141  0.88823    
## L(Close.ts.diff, 1:110)78  -1.321e+03  1.502e+03  -0.879  0.38108    
## L(Close.ts.diff, 1:110)79  -8.237e+02  1.504e+03  -0.548  0.58491    
## L(Close.ts.diff, 1:110)80  -1.501e+02  1.503e+03  -0.100  0.92063    
## L(Close.ts.diff, 1:110)81  -9.441e+02  1.503e+03  -0.628  0.53116    
## L(Close.ts.diff, 1:110)82  -6.434e+03  1.506e+03  -4.274 4.08e-05 ***
## L(Close.ts.diff, 1:110)83  -2.066e+03  1.627e+03  -1.270  0.20674    
## L(Close.ts.diff, 1:110)84  -7.141e+02  1.637e+03  -0.436  0.66362    
## L(Close.ts.diff, 1:110)85  -1.535e+03  1.619e+03  -0.948  0.34509    
## L(Close.ts.diff, 1:110)86  -1.035e+02  1.618e+03  -0.064  0.94913    
## L(Close.ts.diff, 1:110)87  -3.230e+02  1.616e+03  -0.200  0.84196    
## L(Close.ts.diff, 1:110)88   1.091e+03  1.609e+03   0.678  0.49919    
## L(Close.ts.diff, 1:110)89   1.524e+03  1.610e+03   0.947  0.34588    
## L(Close.ts.diff, 1:110)90  -3.577e+02  1.607e+03  -0.223  0.82425    
## L(Close.ts.diff, 1:110)91   6.251e+02  1.597e+03   0.391  0.69627    
## L(Close.ts.diff, 1:110)92   6.443e+02  1.612e+03   0.400  0.69008    
## L(Close.ts.diff, 1:110)93  -1.056e+03  1.616e+03  -0.654  0.51466    
## L(Close.ts.diff, 1:110)94  -6.949e+02  1.616e+03  -0.430  0.66810    
## L(Close.ts.diff, 1:110)95  -1.323e+03  1.623e+03  -0.815  0.41685    
## L(Close.ts.diff, 1:110)96  -2.106e+03  1.626e+03  -1.295  0.19786    
## L(Close.ts.diff, 1:110)97   2.237e+02  1.635e+03   0.137  0.89143    
## L(Close.ts.diff, 1:110)98  -9.916e+02  1.635e+03  -0.606  0.54552    
## L(Close.ts.diff, 1:110)99   1.304e+03  1.624e+03   0.803  0.42397    
## L(Close.ts.diff, 1:110)100  1.578e+03  1.625e+03   0.971  0.33380    
## L(Close.ts.diff, 1:110)101 -1.005e+03  1.612e+03  -0.623  0.53440    
## L(Close.ts.diff, 1:110)102  1.229e+03  1.615e+03   0.761  0.44824    
## L(Close.ts.diff, 1:110)103  6.648e+02  1.610e+03   0.413  0.68049    
## L(Close.ts.diff, 1:110)104 -1.361e+02  1.611e+03  -0.085  0.93280    
## L(Close.ts.diff, 1:110)105 -2.105e+03  1.581e+03  -1.331  0.18591    
## L(Close.ts.diff, 1:110)106 -1.955e+03  1.592e+03  -1.228  0.22202    
## L(Close.ts.diff, 1:110)107 -1.605e+03  1.603e+03  -1.002  0.31866    
## L(Close.ts.diff, 1:110)108 -2.038e+03  1.596e+03  -1.277  0.20423    
## L(Close.ts.diff, 1:110)109 -8.089e+02  1.566e+03  -0.517  0.60642    
## L(Close.ts.diff, 1:110)110 -6.369e+02  1.557e+03  -0.409  0.68322    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1807000 on 111 degrees of freedom
## Multiple R-squared:  0.6492, Adjusted R-squared:  0.2005 
## F-statistic: 1.447 on 142 and 111 DF,  p-value: 0.02121
plot_acf_pacf(residuals(ardl.volume.close.2), "ardl.volume.close.2")

ACF and PACF graph shows that residuals are centered around 0 and within the confidence, and spikes are mostly short. In the PACF graph however there are longer spikes. This means that the residuals are white noise and the model is successfully capturing the data.

ardl.volume.close.3 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 91:122) + L(Close.ts.diff, 110), data = infy_stock)
summary(ardl.volume.close.3)
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 
##     91:122) + L(Close.ts.diff, 110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3162262  -836678  -195987   521126 15845331 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              2.078e+06  9.549e+05   2.176  0.03086 *  
## L(Volume.ts, 1:32)1      3.079e-01  7.492e-02   4.110 6.04e-05 ***
## L(Volume.ts, 1:32)2      8.519e-02  7.857e-02   1.084  0.27971    
## L(Volume.ts, 1:32)3     -7.064e-02  7.980e-02  -0.885  0.37723    
## L(Volume.ts, 1:32)4      4.374e-02  7.981e-02   0.548  0.58433    
## L(Volume.ts, 1:32)5      2.636e-02  7.908e-02   0.333  0.73931    
## L(Volume.ts, 1:32)6      4.160e-02  7.708e-02   0.540  0.59007    
## L(Volume.ts, 1:32)7      9.882e-02  7.685e-02   1.286  0.20016    
## L(Volume.ts, 1:32)8     -1.168e-02  7.688e-02  -0.152  0.87942    
## L(Volume.ts, 1:32)9      6.567e-03  7.643e-02   0.086  0.93162    
## L(Volume.ts, 1:32)10     6.030e-02  7.706e-02   0.782  0.43503    
## L(Volume.ts, 1:32)11    -1.064e-01  7.676e-02  -1.387  0.16733    
## L(Volume.ts, 1:32)12     3.283e-02  7.709e-02   0.426  0.67069    
## L(Volume.ts, 1:32)13    -7.042e-02  7.724e-02  -0.912  0.36312    
## L(Volume.ts, 1:32)14    -3.211e-02  7.745e-02  -0.415  0.67899    
## L(Volume.ts, 1:32)15     5.738e-02  7.723e-02   0.743  0.45852    
## L(Volume.ts, 1:32)16    -3.638e-02  7.757e-02  -0.469  0.63969    
## L(Volume.ts, 1:32)17    -3.244e-02  7.787e-02  -0.417  0.67745    
## L(Volume.ts, 1:32)18     1.844e-02  7.744e-02   0.238  0.81204    
## L(Volume.ts, 1:32)19     6.324e-03  7.746e-02   0.082  0.93503    
## L(Volume.ts, 1:32)20     1.090e-02  7.735e-02   0.141  0.88807    
## L(Volume.ts, 1:32)21    -2.162e-02  7.788e-02  -0.278  0.78160    
## L(Volume.ts, 1:32)22     1.143e-02  7.797e-02   0.147  0.88365    
## L(Volume.ts, 1:32)23     3.903e-03  7.776e-02   0.050  0.96002    
## L(Volume.ts, 1:32)24     5.468e-02  7.744e-02   0.706  0.48105    
## L(Volume.ts, 1:32)25     3.664e-02  7.755e-02   0.472  0.63721    
## L(Volume.ts, 1:32)26     3.145e-02  7.672e-02   0.410  0.68233    
## L(Volume.ts, 1:32)27     3.461e-02  7.671e-02   0.451  0.65242    
## L(Volume.ts, 1:32)28    -8.312e-02  7.972e-02  -1.043  0.29850    
## L(Volume.ts, 1:32)29     6.754e-02  7.660e-02   0.882  0.37910    
## L(Volume.ts, 1:32)30     3.911e-02  8.053e-02   0.486  0.62783    
## L(Volume.ts, 1:32)31    -6.293e-03  8.094e-02  -0.078  0.93812    
## L(Volume.ts, 1:32)32     5.716e-02  7.646e-02   0.748  0.45571    
## L(Volume.ts, 91:122)91  -6.240e-02  7.642e-02  -0.817  0.41527    
## L(Volume.ts, 91:122)92   4.233e-02  8.076e-02   0.524  0.60089    
## L(Volume.ts, 91:122)93  -2.370e-02  8.073e-02  -0.294  0.76940    
## L(Volume.ts, 91:122)94   8.186e-03  7.669e-02   0.107  0.91512    
## L(Volume.ts, 91:122)95  -5.600e-02  7.660e-02  -0.731  0.46568    
## L(Volume.ts, 91:122)96  -1.704e-02  7.682e-02  -0.222  0.82472    
## L(Volume.ts, 91:122)97  -4.758e-02  7.688e-02  -0.619  0.53682    
## L(Volume.ts, 91:122)98  -8.314e-02  7.748e-02  -1.073  0.28473    
## L(Volume.ts, 91:122)99   9.454e-02  7.752e-02   1.220  0.22427    
## L(Volume.ts, 91:122)100 -6.465e-02  7.813e-02  -0.827  0.40911    
## L(Volume.ts, 91:122)101  3.458e-02  7.846e-02   0.441  0.65994    
## L(Volume.ts, 91:122)102  1.127e-03  7.769e-02   0.015  0.98845    
## L(Volume.ts, 91:122)103 -1.182e-02  7.723e-02  -0.153  0.87857    
## L(Volume.ts, 91:122)104  1.468e-02  7.909e-02   0.186  0.85299    
## L(Volume.ts, 91:122)105  2.418e-02  7.766e-02   0.311  0.75592    
## L(Volume.ts, 91:122)106 -5.411e-02  7.774e-02  -0.696  0.48731    
## L(Volume.ts, 91:122)107  4.041e-02  7.773e-02   0.520  0.60375    
## L(Volume.ts, 91:122)108 -4.923e-02  7.752e-02  -0.635  0.52616    
## L(Volume.ts, 91:122)109 -5.262e-02  7.745e-02  -0.679  0.49774    
## L(Volume.ts, 91:122)110  3.794e-02  7.718e-02   0.492  0.62360    
## L(Volume.ts, 91:122)111 -1.403e-01  8.131e-02  -1.726  0.08617 .  
## L(Volume.ts, 91:122)112  1.460e-02  8.154e-02   0.179  0.85807    
## L(Volume.ts, 91:122)113  9.254e-02  8.117e-02   1.140  0.25585    
## L(Volume.ts, 91:122)114 -9.978e-02  8.134e-02  -1.227  0.22156    
## L(Volume.ts, 91:122)115 -8.866e-02  8.179e-02  -1.084  0.27983    
## L(Volume.ts, 91:122)116  6.144e-02  7.700e-02   0.798  0.42600    
## L(Volume.ts, 91:122)117  2.540e-01  7.742e-02   3.281  0.00124 ** 
## L(Volume.ts, 91:122)118 -1.302e-01  7.951e-02  -1.637  0.10333    
## L(Volume.ts, 91:122)119 -6.888e-02  8.027e-02  -0.858  0.39197    
## L(Volume.ts, 91:122)120  5.118e-02  7.974e-02   0.642  0.52186    
## L(Volume.ts, 91:122)121 -2.605e-02  7.892e-02  -0.330  0.74174    
## L(Volume.ts, 91:122)122 -5.801e-02  7.499e-02  -0.773  0.44028    
## L(Close.ts.diff, 110)   -2.788e+02  1.530e+03  -0.182  0.85563    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1890000 on 177 degrees of freedom
## Multiple R-squared:  0.3864, Adjusted R-squared:  0.161 
## F-statistic: 1.715 on 65 and 177 DF,  p-value: 0.002947
plot_acf_pacf(residuals(ardl.volume.close.3), "ardl.volume.close.3")

The ACF graph shows residuals outside confidence bound between 0.05 and 0.06 lags meaning there is serial correlation there. The PACF graph shows this as well and also shows longer spikes than the other model, This means that the model is misspecified.

ardl.volume.close.4 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 91:122) + L(Close.ts.diff, 1:110), data = infy_stock)
summary(ardl.volume.close.4)
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 
##     91:122) + L(Close.ts.diff, 1:110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2450151  -629268  -161738   590886  5117462 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 4.953e+06  2.672e+06   1.854 0.068104 .  
## L(Volume.ts, 1:32)1         3.387e-01  1.199e-01   2.825 0.006201 ** 
## L(Volume.ts, 1:32)2         1.105e-02  1.276e-01   0.087 0.931237    
## L(Volume.ts, 1:32)3        -1.208e-01  1.309e-01  -0.923 0.359391    
## L(Volume.ts, 1:32)4         1.092e-01  1.317e-01   0.829 0.410051    
## L(Volume.ts, 1:32)5        -9.374e-02  1.292e-01  -0.726 0.470510    
## L(Volume.ts, 1:32)6         2.617e-01  1.293e-01   2.024 0.046865 *  
## L(Volume.ts, 1:32)7         5.899e-02  1.320e-01   0.447 0.656323    
## L(Volume.ts, 1:32)8         5.241e-02  1.313e-01   0.399 0.691137    
## L(Volume.ts, 1:32)9         6.382e-02  1.331e-01   0.479 0.633124    
## L(Volume.ts, 1:32)10       -1.797e-03  1.353e-01  -0.013 0.989437    
## L(Volume.ts, 1:32)11       -1.139e-01  1.336e-01  -0.853 0.396828    
## L(Volume.ts, 1:32)12       -1.645e-02  1.347e-01  -0.122 0.903173    
## L(Volume.ts, 1:32)13       -2.077e-02  1.302e-01  -0.160 0.873723    
## L(Volume.ts, 1:32)14       -1.528e-01  1.303e-01  -1.173 0.244944    
## L(Volume.ts, 1:32)15        8.337e-02  1.312e-01   0.636 0.527121    
## L(Volume.ts, 1:32)16       -5.681e-02  1.311e-01  -0.433 0.666158    
## L(Volume.ts, 1:32)17       -7.015e-02  1.317e-01  -0.533 0.595884    
## L(Volume.ts, 1:32)18        5.269e-02  1.338e-01   0.394 0.694927    
## L(Volume.ts, 1:32)19       -1.250e-01  1.323e-01  -0.945 0.348148    
## L(Volume.ts, 1:32)20        2.338e-01  1.326e-01   1.764 0.082234 .  
## L(Volume.ts, 1:32)21       -1.616e-01  1.365e-01  -1.184 0.240703    
## L(Volume.ts, 1:32)22       -4.644e-02  1.363e-01  -0.341 0.734426    
## L(Volume.ts, 1:32)23       -4.703e-02  1.345e-01  -0.350 0.727629    
## L(Volume.ts, 1:32)24       -2.692e-02  1.318e-01  -0.204 0.838810    
## L(Volume.ts, 1:32)25        7.401e-02  1.302e-01   0.569 0.571556    
## L(Volume.ts, 1:32)26       -1.817e-01  1.294e-01  -1.404 0.164810    
## L(Volume.ts, 1:32)27        1.197e-01  1.270e-01   0.943 0.349006    
## L(Volume.ts, 1:32)28       -8.826e-02  1.288e-01  -0.685 0.495577    
## L(Volume.ts, 1:32)29       -6.342e-02  1.180e-01  -0.538 0.592649    
## L(Volume.ts, 1:32)30        6.081e-02  1.175e-01   0.518 0.606378    
## L(Volume.ts, 1:32)31       -9.698e-02  1.190e-01  -0.815 0.417840    
## L(Volume.ts, 1:32)32        1.413e-01  1.112e-01   1.271 0.208174    
## L(Volume.ts, 91:122)91      5.711e-02  1.049e-01   0.545 0.587761    
## L(Volume.ts, 91:122)92     -6.727e-02  1.103e-01  -0.610 0.543802    
## L(Volume.ts, 91:122)93      6.234e-02  1.102e-01   0.566 0.573427    
## L(Volume.ts, 91:122)94     -1.881e-01  1.103e-01  -1.705 0.092753 .  
## L(Volume.ts, 91:122)95      1.742e-02  1.088e-01   0.160 0.873229    
## L(Volume.ts, 91:122)96     -1.150e-01  1.097e-01  -1.048 0.298124    
## L(Volume.ts, 91:122)97     -4.370e-02  1.105e-01  -0.395 0.693732    
## L(Volume.ts, 91:122)98     -6.807e-02  1.100e-01  -0.619 0.538174    
## L(Volume.ts, 91:122)99      4.654e-02  1.088e-01   0.428 0.670319    
## L(Volume.ts, 91:122)100    -6.340e-02  1.094e-01  -0.580 0.564097    
## L(Volume.ts, 91:122)101    -3.195e-02  1.095e-01  -0.292 0.771352    
## L(Volume.ts, 91:122)102     8.306e-02  1.092e-01   0.760 0.449614    
## L(Volume.ts, 91:122)103    -1.334e-01  1.087e-01  -1.228 0.223774    
## L(Volume.ts, 91:122)104     5.985e-02  1.104e-01   0.542 0.589454    
## L(Volume.ts, 91:122)105     9.617e-02  1.087e-01   0.885 0.379280    
## L(Volume.ts, 91:122)106    -1.286e-01  1.120e-01  -1.149 0.254777    
## L(Volume.ts, 91:122)107     1.112e-01  1.142e-01   0.974 0.333699    
## L(Volume.ts, 91:122)108    -1.472e-01  1.151e-01  -1.279 0.205108    
## L(Volume.ts, 91:122)109    -2.626e-02  1.171e-01  -0.224 0.823274    
## L(Volume.ts, 91:122)110     1.753e-01  1.136e-01   1.544 0.127310    
## L(Volume.ts, 91:122)111    -1.110e-01  1.191e-01  -0.932 0.354566    
## L(Volume.ts, 91:122)112     1.189e-01  1.472e-01   0.808 0.422185    
## L(Volume.ts, 91:122)113    -6.881e-02  1.438e-01  -0.478 0.633921    
## L(Volume.ts, 91:122)114    -1.011e-02  1.408e-01  -0.072 0.942957    
## L(Volume.ts, 91:122)115    -1.743e-01  1.404e-01  -1.241 0.218814    
## L(Volume.ts, 91:122)116     6.476e-03  1.364e-01   0.047 0.962271    
## L(Volume.ts, 91:122)117     1.531e-01  1.545e-01   0.991 0.325176    
## L(Volume.ts, 91:122)118    -1.516e-01  1.534e-01  -0.988 0.326636    
## L(Volume.ts, 91:122)119    -1.675e-01  1.559e-01  -1.074 0.286404    
## L(Volume.ts, 91:122)120    -5.380e-02  1.554e-01  -0.346 0.730190    
## L(Volume.ts, 91:122)121    -4.933e-02  1.532e-01  -0.322 0.748456    
## L(Volume.ts, 91:122)122    -4.175e-02  1.295e-01  -0.322 0.748219    
## L(Close.ts.diff, 1:110)1   -8.393e+02  2.191e+03  -0.383 0.702853    
## L(Close.ts.diff, 1:110)2    2.256e+03  2.159e+03   1.045 0.299786    
## L(Close.ts.diff, 1:110)3   -3.011e+02  2.212e+03  -0.136 0.892111    
## L(Close.ts.diff, 1:110)4    5.762e+02  2.230e+03   0.258 0.796874    
## L(Close.ts.diff, 1:110)5    1.705e+03  2.209e+03   0.772 0.442928    
## L(Close.ts.diff, 1:110)6    5.648e+03  3.588e+03   1.574 0.120086    
## L(Close.ts.diff, 1:110)7   -8.154e+02  3.695e+03  -0.221 0.825998    
## L(Close.ts.diff, 1:110)8    3.707e+03  3.719e+03   0.997 0.322366    
## L(Close.ts.diff, 1:110)9    1.053e+03  3.786e+03   0.278 0.781679    
## L(Close.ts.diff, 1:110)10   2.840e+03  3.749e+03   0.758 0.451307    
## L(Close.ts.diff, 1:110)11   3.009e+02  2.308e+03   0.130 0.896668    
## L(Close.ts.diff, 1:110)12   7.292e+02  1.996e+03   0.365 0.715990    
## L(Close.ts.diff, 1:110)13   1.733e+03  1.969e+03   0.880 0.381896    
## L(Close.ts.diff, 1:110)14   1.099e+03  1.976e+03   0.556 0.579734    
## L(Close.ts.diff, 1:110)15   7.498e+02  1.977e+03   0.379 0.705716    
## L(Close.ts.diff, 1:110)16   9.805e+02  1.978e+03   0.496 0.621680    
## L(Close.ts.diff, 1:110)17   1.407e+03  1.926e+03   0.731 0.467486    
## L(Close.ts.diff, 1:110)18  -7.842e+01  1.816e+03  -0.043 0.965685    
## L(Close.ts.diff, 1:110)19   9.498e+02  1.802e+03   0.527 0.599906    
## L(Close.ts.diff, 1:110)20   1.458e+03  1.782e+03   0.818 0.416089    
## L(Close.ts.diff, 1:110)21  -1.678e+02  1.763e+03  -0.095 0.924453    
## L(Close.ts.diff, 1:110)22  -4.866e+01  1.759e+03  -0.028 0.978009    
## L(Close.ts.diff, 1:110)23  -8.880e+02  1.759e+03  -0.505 0.615301    
## L(Close.ts.diff, 1:110)24   6.887e+02  1.740e+03   0.396 0.693553    
## L(Close.ts.diff, 1:110)25   1.736e+03  1.729e+03   1.004 0.318737    
## L(Close.ts.diff, 1:110)26  -1.072e+04  1.754e+03  -6.114 5.36e-08 ***
## L(Close.ts.diff, 1:110)27   3.316e+03  2.238e+03   1.482 0.143002    
## L(Close.ts.diff, 1:110)28   1.805e+02  2.250e+03   0.080 0.936286    
## L(Close.ts.diff, 1:110)29   3.777e+02  2.289e+03   0.165 0.869408    
## L(Close.ts.diff, 1:110)30   3.503e+02  2.299e+03   0.152 0.879333    
## L(Close.ts.diff, 1:110)31  -1.687e+03  2.333e+03  -0.723 0.472175    
## L(Close.ts.diff, 1:110)32   4.818e+03  2.356e+03   2.045 0.044730 *  
## L(Close.ts.diff, 1:110)33   4.828e+02  2.422e+03   0.199 0.842624    
## L(Close.ts.diff, 1:110)34   2.063e+03  2.425e+03   0.851 0.397778    
## L(Close.ts.diff, 1:110)35   1.453e+03  2.419e+03   0.601 0.549904    
## L(Close.ts.diff, 1:110)36   6.778e+01  2.506e+03   0.027 0.978505    
## L(Close.ts.diff, 1:110)37   1.323e+03  2.457e+03   0.539 0.591836    
## L(Close.ts.diff, 1:110)38  -7.929e+02  2.464e+03  -0.322 0.748629    
## L(Close.ts.diff, 1:110)39   3.266e+03  2.283e+03   1.431 0.157074    
## L(Close.ts.diff, 1:110)40   4.758e+02  2.264e+03   0.210 0.834196    
## L(Close.ts.diff, 1:110)41   1.013e+03  2.284e+03   0.444 0.658740    
## L(Close.ts.diff, 1:110)42  -3.978e+02  2.226e+03  -0.179 0.858720    
## L(Close.ts.diff, 1:110)43  -1.148e+03  2.246e+03  -0.511 0.610983    
## L(Close.ts.diff, 1:110)44   2.125e+03  2.231e+03   0.952 0.344290    
## L(Close.ts.diff, 1:110)45   1.455e+02  2.225e+03   0.065 0.948048    
## L(Close.ts.diff, 1:110)46   3.478e+03  2.207e+03   1.576 0.119756    
## L(Close.ts.diff, 1:110)47  -1.565e+03  2.249e+03  -0.696 0.488791    
## L(Close.ts.diff, 1:110)48  -2.593e+01  2.257e+03  -0.011 0.990867    
## L(Close.ts.diff, 1:110)49  -8.677e+02  2.211e+03  -0.392 0.695994    
## L(Close.ts.diff, 1:110)50  -1.951e+03  2.213e+03  -0.882 0.381134    
## L(Close.ts.diff, 1:110)51   1.092e+03  2.193e+03   0.498 0.620204    
## L(Close.ts.diff, 1:110)52  -4.137e+03  2.188e+03  -1.891 0.062924 .  
## L(Close.ts.diff, 1:110)53   1.545e+02  2.249e+03   0.069 0.945451    
## L(Close.ts.diff, 1:110)54   2.292e+02  2.243e+03   0.102 0.918898    
## L(Close.ts.diff, 1:110)55  -2.372e+03  2.134e+03  -1.111 0.270272    
## L(Close.ts.diff, 1:110)56   1.086e+03  2.198e+03   0.494 0.622696    
## L(Close.ts.diff, 1:110)57  -2.077e+03  2.295e+03  -0.905 0.368713    
## L(Close.ts.diff, 1:110)58   4.068e+03  2.145e+03   1.896 0.062180 .  
## L(Close.ts.diff, 1:110)59   5.600e+02  1.971e+03   0.284 0.777210    
## L(Close.ts.diff, 1:110)60   7.366e+02  1.956e+03   0.376 0.707721    
## L(Close.ts.diff, 1:110)61  -3.065e+01  1.958e+03  -0.016 0.987556    
## L(Close.ts.diff, 1:110)62  -2.949e+03  2.048e+03  -1.440 0.154403    
## L(Close.ts.diff, 1:110)63   8.277e+02  2.085e+03   0.397 0.692555    
## L(Close.ts.diff, 1:110)64  -1.286e+03  2.078e+03  -0.619 0.538137    
## L(Close.ts.diff, 1:110)65   1.826e+02  2.051e+03   0.089 0.929314    
## L(Close.ts.diff, 1:110)66   8.585e+02  2.035e+03   0.422 0.674460    
## L(Close.ts.diff, 1:110)67  -2.610e+02  1.923e+03  -0.136 0.892437    
## L(Close.ts.diff, 1:110)68  -1.806e+03  1.797e+03  -1.005 0.318505    
## L(Close.ts.diff, 1:110)69   6.626e+02  1.802e+03   0.368 0.714226    
## L(Close.ts.diff, 1:110)70   2.690e+02  1.792e+03   0.150 0.881140    
## L(Close.ts.diff, 1:110)71   1.100e+03  1.766e+03   0.623 0.535463    
## L(Close.ts.diff, 1:110)72  -1.234e+03  1.753e+03  -0.704 0.483730    
## L(Close.ts.diff, 1:110)73  -1.026e+03  1.757e+03  -0.584 0.561082    
## L(Close.ts.diff, 1:110)74  -4.279e+00  1.788e+03  -0.002 0.998098    
## L(Close.ts.diff, 1:110)75  -2.122e+01  1.786e+03  -0.012 0.990553    
## L(Close.ts.diff, 1:110)76   3.120e+03  1.776e+03   1.757 0.083411 .  
## L(Close.ts.diff, 1:110)77   4.751e+02  1.818e+03   0.261 0.794631    
## L(Close.ts.diff, 1:110)78  -7.639e+02  1.815e+03  -0.421 0.675254    
## L(Close.ts.diff, 1:110)79  -8.090e+02  1.821e+03  -0.444 0.658203    
## L(Close.ts.diff, 1:110)80  -3.270e+02  1.822e+03  -0.179 0.858080    
## L(Close.ts.diff, 1:110)81  -1.701e+03  1.827e+03  -0.931 0.354968    
## L(Close.ts.diff, 1:110)82  -6.581e+03  1.856e+03  -3.546 0.000713 ***
## L(Close.ts.diff, 1:110)83  -8.662e+02  2.020e+03  -0.429 0.669378    
## L(Close.ts.diff, 1:110)84  -2.531e+03  2.020e+03  -1.253 0.214449    
## L(Close.ts.diff, 1:110)85  -2.127e+03  2.015e+03  -1.056 0.294770    
## L(Close.ts.diff, 1:110)86  -2.249e+01  2.025e+03  -0.011 0.991169    
## L(Close.ts.diff, 1:110)87  -1.378e+03  2.002e+03  -0.688 0.493670    
## L(Close.ts.diff, 1:110)88   2.165e+03  1.976e+03   1.096 0.276940    
## L(Close.ts.diff, 1:110)89   9.805e+01  1.965e+03   0.050 0.960356    
## L(Close.ts.diff, 1:110)90   1.031e+03  1.959e+03   0.526 0.600394    
## L(Close.ts.diff, 1:110)91   1.291e+03  1.966e+03   0.657 0.513507    
## L(Close.ts.diff, 1:110)92   1.087e+03  1.962e+03   0.554 0.581304    
## L(Close.ts.diff, 1:110)93   1.606e+02  1.958e+03   0.082 0.934882    
## L(Close.ts.diff, 1:110)94  -1.090e+03  2.002e+03  -0.544 0.587938    
## L(Close.ts.diff, 1:110)95   1.053e+03  2.001e+03   0.526 0.600533    
## L(Close.ts.diff, 1:110)96  -2.277e+03  1.995e+03  -1.142 0.257574    
## L(Close.ts.diff, 1:110)97   1.128e+03  2.040e+03   0.553 0.582026    
## L(Close.ts.diff, 1:110)98  -6.654e+02  2.001e+03  -0.333 0.740472    
## L(Close.ts.diff, 1:110)99   1.019e+03  1.951e+03   0.522 0.603052    
## L(Close.ts.diff, 1:110)100  2.804e+03  1.933e+03   1.451 0.151482    
## L(Close.ts.diff, 1:110)101 -2.683e+03  1.892e+03  -1.418 0.160785    
## L(Close.ts.diff, 1:110)102  1.914e+03  1.933e+03   0.990 0.325466    
## L(Close.ts.diff, 1:110)103 -3.829e+00  1.938e+03  -0.002 0.998429    
## L(Close.ts.diff, 1:110)104 -6.315e+02  1.932e+03  -0.327 0.744804    
## L(Close.ts.diff, 1:110)105 -1.105e+03  1.876e+03  -0.589 0.557622    
## L(Close.ts.diff, 1:110)106 -2.065e+03  1.883e+03  -1.097 0.276677    
## L(Close.ts.diff, 1:110)107 -1.550e+03  1.909e+03  -0.812 0.419686    
## L(Close.ts.diff, 1:110)108 -3.232e+03  1.901e+03  -1.700 0.093710 .  
## L(Close.ts.diff, 1:110)109  3.884e+02  1.889e+03   0.206 0.837679    
## L(Close.ts.diff, 1:110)110 -4.634e+02  1.891e+03  -0.245 0.807154    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1917000 on 68 degrees of freedom
## Multiple R-squared:  0.7575, Adjusted R-squared:  0.1369 
## F-statistic: 1.221 on 174 and 68 DF,  p-value: 0.1738
plot_acf_pacf(residuals(ardl.volume.close.4), "ardl.volume.close.4")

Based on ALL 4 ACF and PACF graphs, model ardl.volume.close.1 represents the data the best.

Volume and Open

ACF and PACF graph shows that residuals are centered around 0 and within the confidence bound, and spikes are short. This means that the residuals are white noise and the model is successfully capturing the data.

ardl.volume.open.1 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Open.ts.diff, 110), data = infy_stock)
summary(ardl.volume.open.1)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Open.ts.diff, 
##     110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2622514  -846166  -262527   432638 16612825 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           5.486e+05  3.997e+05   1.372   0.1713    
## L(Volume.ts, 1:32)1   3.214e-01  6.738e-02   4.770 3.35e-06 ***
## L(Volume.ts, 1:32)2   5.707e-02  7.077e-02   0.806   0.4209    
## L(Volume.ts, 1:32)3  -4.049e-02  7.095e-02  -0.571   0.5688    
## L(Volume.ts, 1:32)4   9.003e-02  7.044e-02   1.278   0.2026    
## L(Volume.ts, 1:32)5   1.597e-03  7.047e-02   0.023   0.9819    
## L(Volume.ts, 1:32)6   5.137e-02  7.042e-02   0.730   0.4664    
## L(Volume.ts, 1:32)7   1.236e-01  7.070e-02   1.748   0.0819 .  
## L(Volume.ts, 1:32)8  -3.481e-03  7.097e-02  -0.049   0.9609    
## L(Volume.ts, 1:32)9  -6.644e-03  7.073e-02  -0.094   0.9252    
## L(Volume.ts, 1:32)10  5.447e-02  7.128e-02   0.764   0.4456    
## L(Volume.ts, 1:32)11 -7.348e-02  7.037e-02  -1.044   0.2975    
## L(Volume.ts, 1:32)12  1.580e-02  7.049e-02   0.224   0.8228    
## L(Volume.ts, 1:32)13 -3.200e-02  7.049e-02  -0.454   0.6503    
## L(Volume.ts, 1:32)14 -3.337e-02  7.053e-02  -0.473   0.6366    
## L(Volume.ts, 1:32)15  7.360e-02  7.050e-02   1.044   0.2977    
## L(Volume.ts, 1:32)16 -3.783e-02  7.072e-02  -0.535   0.5933    
## L(Volume.ts, 1:32)17 -1.469e-02  7.114e-02  -0.207   0.8366    
## L(Volume.ts, 1:32)18  4.622e-02  7.096e-02   0.651   0.5155    
## L(Volume.ts, 1:32)19 -1.960e-02  7.086e-02  -0.277   0.7823    
## L(Volume.ts, 1:32)20  1.328e-02  7.083e-02   0.188   0.8514    
## L(Volume.ts, 1:32)21 -2.454e-02  7.085e-02  -0.346   0.7294    
## L(Volume.ts, 1:32)22  1.593e-02  7.067e-02   0.225   0.8219    
## L(Volume.ts, 1:32)23 -7.492e-03  7.061e-02  -0.106   0.9156    
## L(Volume.ts, 1:32)24  8.295e-02  7.074e-02   1.173   0.2422    
## L(Volume.ts, 1:32)25  3.720e-02  7.103e-02   0.524   0.6010    
## L(Volume.ts, 1:32)26  3.017e-02  7.044e-02   0.428   0.6689    
## L(Volume.ts, 1:32)27  1.040e-02  7.040e-02   0.148   0.8827    
## L(Volume.ts, 1:32)28 -9.240e-02  7.360e-02  -1.255   0.2107    
## L(Volume.ts, 1:32)29  1.339e-01  7.065e-02   1.895   0.0594 .  
## L(Volume.ts, 1:32)30 -2.942e-02  7.085e-02  -0.415   0.6784    
## L(Volume.ts, 1:32)31  3.618e-02  7.081e-02   0.511   0.6099    
## L(Volume.ts, 1:32)32  3.936e-02  6.740e-02   0.584   0.5599    
## L(Open.ts.diff, 110) -3.881e+02  1.416e+03  -0.274   0.7843    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1854000 on 220 degrees of freedom
## Multiple R-squared:  0.2682, Adjusted R-squared:  0.1584 
## F-statistic: 2.443 on 33 and 220 DF,  p-value: 6.762e-05
plot_acf_pacf(residuals(ardl.volume.open.1), "ardl.volume.open.1")

ACF and PACF graph shows that residuals are centered around 0 and within the confidence bound, and spikes are short. This means that the residuals are white noise and the model is successfully capturing the data.

ardl.volume.open.2 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Open.ts.diff, 35) + L(Open.ts.diff, 110), data = infy_stock)
summary(ardl.volume.open.2)
## 
## Time series regression with "ts" data:
## Start = 2015(112), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Open.ts.diff, 
##     35) + L(Open.ts.diff, 110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2548149  -798757  -270064   411072 16666155 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           5.674e+05  4.003e+05   1.418   0.1577    
## L(Volume.ts, 1:32)1   3.202e-01  6.741e-02   4.750 3.67e-06 ***
## L(Volume.ts, 1:32)2   5.517e-02  7.081e-02   0.779   0.4367    
## L(Volume.ts, 1:32)3  -3.899e-02  7.098e-02  -0.549   0.5833    
## L(Volume.ts, 1:32)4   8.428e-02  7.070e-02   1.192   0.2346    
## L(Volume.ts, 1:32)5   2.376e-03  7.049e-02   0.034   0.9731    
## L(Volume.ts, 1:32)6   5.203e-02  7.043e-02   0.739   0.4608    
## L(Volume.ts, 1:32)7   1.265e-01  7.078e-02   1.788   0.0752 .  
## L(Volume.ts, 1:32)8   3.990e-04  7.109e-02   0.006   0.9955    
## L(Volume.ts, 1:32)9  -4.135e-02  7.936e-02  -0.521   0.6029    
## L(Volume.ts, 1:32)10  6.773e-02  7.261e-02   0.933   0.3519    
## L(Volume.ts, 1:32)11 -6.702e-02  7.070e-02  -0.948   0.3442    
## L(Volume.ts, 1:32)12  1.041e-02  7.073e-02   0.147   0.8832    
## L(Volume.ts, 1:32)13 -2.987e-02  7.054e-02  -0.423   0.6724    
## L(Volume.ts, 1:32)14 -3.572e-02  7.059e-02  -0.506   0.6133    
## L(Volume.ts, 1:32)15  7.614e-02  7.057e-02   1.079   0.2818    
## L(Volume.ts, 1:32)16 -3.192e-02  7.100e-02  -0.450   0.6535    
## L(Volume.ts, 1:32)17 -1.889e-02  7.128e-02  -0.265   0.7912    
## L(Volume.ts, 1:32)18  4.770e-02  7.099e-02   0.672   0.5024    
## L(Volume.ts, 1:32)19 -1.582e-02  7.097e-02  -0.223   0.8238    
## L(Volume.ts, 1:32)20  1.197e-02  7.086e-02   0.169   0.8660    
## L(Volume.ts, 1:32)21 -2.325e-02  7.087e-02  -0.328   0.7432    
## L(Volume.ts, 1:32)22  1.447e-02  7.069e-02   0.205   0.8380    
## L(Volume.ts, 1:32)23 -1.235e-02  7.080e-02  -0.174   0.8617    
## L(Volume.ts, 1:32)24  8.552e-02  7.080e-02   1.208   0.2284    
## L(Volume.ts, 1:32)25  3.449e-02  7.109e-02   0.485   0.6281    
## L(Volume.ts, 1:32)26  3.335e-02  7.053e-02   0.473   0.6368    
## L(Volume.ts, 1:32)27  8.895e-03  7.042e-02   0.126   0.8996    
## L(Volume.ts, 1:32)28 -9.694e-02  7.376e-02  -1.314   0.1902    
## L(Volume.ts, 1:32)29  1.501e-01  7.262e-02   2.066   0.0400 *  
## L(Volume.ts, 1:32)30 -3.257e-02  7.094e-02  -0.459   0.6466    
## L(Volume.ts, 1:32)31  3.462e-02  7.083e-02   0.489   0.6255    
## L(Volume.ts, 1:32)32  4.068e-02  6.743e-02   0.603   0.5469    
## L(Open.ts.diff, 35)  -1.474e+03  1.528e+03  -0.965   0.3358    
## L(Open.ts.diff, 110) -4.603e+02  1.419e+03  -0.324   0.7459    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1854000 on 219 degrees of freedom
## Multiple R-squared:  0.2713, Adjusted R-squared:  0.1582 
## F-statistic: 2.398 on 34 and 219 DF,  p-value: 8.15e-05
plot_acf_pacf(residuals(ardl.volume.open.2), "ardl.volume.open.2")

ACF and PACF graph shows that residuals are centered around 0 and within the confidence, and spikes are mostly short. In the PACF graph however there are longer spikes. This means that the residuals are white noise and the model is successfully capturing the data.

ardl.volume.open.3 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 91:122) + L(Open.ts.diff, 110), data = infy_stock)
summary(ardl.volume.open.3)
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 
##     91:122) + L(Open.ts.diff, 110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3154747  -835633  -192877   519592 15851812 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              2.081e+06  9.535e+05   2.182  0.03042 *  
## L(Volume.ts, 1:32)1      3.085e-01  7.496e-02   4.116 5.91e-05 ***
## L(Volume.ts, 1:32)2      8.421e-02  7.870e-02   1.070  0.28602    
## L(Volume.ts, 1:32)3     -7.088e-02  7.969e-02  -0.889  0.37497    
## L(Volume.ts, 1:32)4      4.391e-02  7.981e-02   0.550  0.58290    
## L(Volume.ts, 1:32)5      2.560e-02  7.914e-02   0.324  0.74670    
## L(Volume.ts, 1:32)6      4.145e-02  7.702e-02   0.538  0.59115    
## L(Volume.ts, 1:32)7      1.002e-01  7.704e-02   1.300  0.19520    
## L(Volume.ts, 1:32)8     -1.237e-02  7.692e-02  -0.161  0.87241    
## L(Volume.ts, 1:32)9      6.278e-03  7.643e-02   0.082  0.93463    
## L(Volume.ts, 1:32)10     6.122e-02  7.703e-02   0.795  0.42779    
## L(Volume.ts, 1:32)11    -1.055e-01  7.680e-02  -1.374  0.17119    
## L(Volume.ts, 1:32)12     3.269e-02  7.708e-02   0.424  0.67204    
## L(Volume.ts, 1:32)13    -7.063e-02  7.722e-02  -0.915  0.36165    
## L(Volume.ts, 1:32)14    -3.175e-02  7.735e-02  -0.410  0.68199    
## L(Volume.ts, 1:32)15     5.666e-02  7.727e-02   0.733  0.46439    
## L(Volume.ts, 1:32)16    -3.639e-02  7.756e-02  -0.469  0.63949    
## L(Volume.ts, 1:32)17    -3.313e-02  7.792e-02  -0.425  0.67121    
## L(Volume.ts, 1:32)18     1.984e-02  7.759e-02   0.256  0.79850    
## L(Volume.ts, 1:32)19     5.470e-03  7.742e-02   0.071  0.94376    
## L(Volume.ts, 1:32)20     1.098e-02  7.732e-02   0.142  0.88728    
## L(Volume.ts, 1:32)21    -2.210e-02  7.770e-02  -0.284  0.77640    
## L(Volume.ts, 1:32)22     1.274e-02  7.806e-02   0.163  0.87056    
## L(Volume.ts, 1:32)23     2.844e-03  7.783e-02   0.037  0.97089    
## L(Volume.ts, 1:32)24     5.575e-02  7.759e-02   0.718  0.47340    
## L(Volume.ts, 1:32)25     3.632e-02  7.744e-02   0.469  0.63960    
## L(Volume.ts, 1:32)26     3.107e-02  7.673e-02   0.405  0.68604    
## L(Volume.ts, 1:32)27     3.538e-02  7.678e-02   0.461  0.64551    
## L(Volume.ts, 1:32)28    -8.622e-02  8.072e-02  -1.068  0.28691    
## L(Volume.ts, 1:32)29     6.903e-02  7.691e-02   0.898  0.37061    
## L(Volume.ts, 1:32)30     3.856e-02  8.045e-02   0.479  0.63234    
## L(Volume.ts, 1:32)31    -5.650e-03  8.068e-02  -0.070  0.94425    
## L(Volume.ts, 1:32)32     5.668e-02  7.637e-02   0.742  0.45897    
## L(Volume.ts, 91:122)91  -6.199e-02  7.643e-02  -0.811  0.41844    
## L(Volume.ts, 91:122)92   4.167e-02  8.080e-02   0.516  0.60673    
## L(Volume.ts, 91:122)93  -2.367e-02  8.070e-02  -0.293  0.76963    
## L(Volume.ts, 91:122)94   8.407e-03  7.663e-02   0.110  0.91277    
## L(Volume.ts, 91:122)95  -5.569e-02  7.659e-02  -0.727  0.46816    
## L(Volume.ts, 91:122)96  -1.711e-02  7.674e-02  -0.223  0.82384    
## L(Volume.ts, 91:122)97  -4.800e-02  7.688e-02  -0.624  0.53320    
## L(Volume.ts, 91:122)98  -8.314e-02  7.743e-02  -1.074  0.28436    
## L(Volume.ts, 91:122)99   9.407e-02  7.750e-02   1.214  0.22644    
## L(Volume.ts, 91:122)100 -6.515e-02  7.816e-02  -0.834  0.40562    
## L(Volume.ts, 91:122)101  3.534e-02  7.853e-02   0.450  0.65325    
## L(Volume.ts, 91:122)102  5.435e-04  7.773e-02   0.007  0.99443    
## L(Volume.ts, 91:122)103 -1.191e-02  7.719e-02  -0.154  0.87752    
## L(Volume.ts, 91:122)104  1.611e-02  7.897e-02   0.204  0.83857    
## L(Volume.ts, 91:122)105  2.384e-02  7.765e-02   0.307  0.75919    
## L(Volume.ts, 91:122)106 -5.431e-02  7.771e-02  -0.699  0.48555    
## L(Volume.ts, 91:122)107  4.166e-02  7.789e-02   0.535  0.59336    
## L(Volume.ts, 91:122)108 -5.032e-02  7.767e-02  -0.648  0.51795    
## L(Volume.ts, 91:122)109 -5.208e-02  7.744e-02  -0.673  0.50212    
## L(Volume.ts, 91:122)110  3.705e-02  7.729e-02   0.479  0.63225    
## L(Volume.ts, 91:122)111 -1.404e-01  8.130e-02  -1.727  0.08591 .  
## L(Volume.ts, 91:122)112  1.465e-02  8.150e-02   0.180  0.85756    
## L(Volume.ts, 91:122)113  9.189e-02  8.120e-02   1.132  0.25930    
## L(Volume.ts, 91:122)114 -9.942e-02  8.135e-02  -1.222  0.22330    
## L(Volume.ts, 91:122)115 -8.935e-02  8.180e-02  -1.092  0.27619    
## L(Volume.ts, 91:122)116  6.274e-02  7.722e-02   0.813  0.41755    
## L(Volume.ts, 91:122)117  2.531e-01  7.752e-02   3.265  0.00132 ** 
## L(Volume.ts, 91:122)118 -1.304e-01  7.949e-02  -1.641  0.10264    
## L(Volume.ts, 91:122)119 -6.804e-02  8.034e-02  -0.847  0.39820    
## L(Volume.ts, 91:122)120  5.194e-02  7.980e-02   0.651  0.51594    
## L(Volume.ts, 91:122)121 -2.678e-02  7.894e-02  -0.339  0.73488    
## L(Volume.ts, 91:122)122 -5.760e-02  7.498e-02  -0.768  0.44339    
## L(Open.ts.diff, 110)    -4.233e+02  1.519e+03  -0.279  0.78090    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1890000 on 177 degrees of freedom
## Multiple R-squared:  0.3865, Adjusted R-squared:  0.1612 
## F-statistic: 1.716 on 65 and 177 DF,  p-value: 0.002916
plot_acf_pacf(residuals(ardl.volume.open.3), "ardl.volume.open.3")

ACF and PACF graph shows that residuals are centered around 0 and within the confidence, and spikes are mostly short. In the PACF graph however there are longer spikes. This means that the residuals are white noise and the model is successfully capturing the data.

ardl.volume.open.4 <- dynlm(Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 91:122) + L(Open.ts.diff, 35) + L(Open.ts.diff, 110), data = infy_stock)
summary(ardl.volume.open.4)
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = Volume.ts ~ L(Volume.ts, 1:32) + L(Volume.ts, 
##     91:122) + L(Open.ts.diff, 35) + L(Open.ts.diff, 110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -3155009  -835609  -193015   519767 15851545 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              2.081e+06  9.638e+05   2.159  0.03218 *  
## L(Volume.ts, 1:32)1      3.085e-01  7.520e-02   4.103 6.23e-05 ***
## L(Volume.ts, 1:32)2      8.422e-02  7.898e-02   1.066  0.28774    
## L(Volume.ts, 1:32)3     -7.088e-02  7.993e-02  -0.887  0.37642    
## L(Volume.ts, 1:32)4      4.392e-02  8.014e-02   0.548  0.58440    
## L(Volume.ts, 1:32)5      2.560e-02  7.937e-02   0.323  0.74738    
## L(Volume.ts, 1:32)6      4.145e-02  7.725e-02   0.537  0.59228    
## L(Volume.ts, 1:32)7      1.002e-01  7.741e-02   1.294  0.19742    
## L(Volume.ts, 1:32)8     -1.239e-02  7.740e-02  -0.160  0.87304    
## L(Volume.ts, 1:32)9      6.385e-03  8.755e-02   0.073  0.94195    
## L(Volume.ts, 1:32)10     6.118e-02  7.901e-02   0.774  0.43978    
## L(Volume.ts, 1:32)11    -1.055e-01  7.747e-02  -1.362  0.17481    
## L(Volume.ts, 1:32)12     3.270e-02  7.751e-02   0.422  0.67361    
## L(Volume.ts, 1:32)13    -7.064e-02  7.769e-02  -0.909  0.36446    
## L(Volume.ts, 1:32)14    -3.174e-02  7.763e-02  -0.409  0.68315    
## L(Volume.ts, 1:32)15     5.665e-02  7.764e-02   0.730  0.46662    
## L(Volume.ts, 1:32)16    -3.641e-02  7.792e-02  -0.467  0.64094    
## L(Volume.ts, 1:32)17    -3.312e-02  7.825e-02  -0.423  0.67260    
## L(Volume.ts, 1:32)18     1.983e-02  7.785e-02   0.255  0.79922    
## L(Volume.ts, 1:32)19     5.455e-03  7.786e-02   0.070  0.94422    
## L(Volume.ts, 1:32)20     1.098e-02  7.755e-02   0.142  0.88758    
## L(Volume.ts, 1:32)21    -2.211e-02  7.795e-02  -0.284  0.77705    
## L(Volume.ts, 1:32)22     1.274e-02  7.828e-02   0.163  0.87091    
## L(Volume.ts, 1:32)23     2.859e-03  7.829e-02   0.037  0.97091    
## L(Volume.ts, 1:32)24     5.574e-02  7.797e-02   0.715  0.47563    
## L(Volume.ts, 1:32)25     3.633e-02  7.770e-02   0.468  0.64068    
## L(Volume.ts, 1:32)26     3.106e-02  7.704e-02   0.403  0.68731    
## L(Volume.ts, 1:32)27     3.539e-02  7.706e-02   0.459  0.64663    
## L(Volume.ts, 1:32)28    -8.621e-02  8.105e-02  -1.064  0.28893    
## L(Volume.ts, 1:32)29     6.899e-02  7.912e-02   0.872  0.38445    
## L(Volume.ts, 1:32)30     3.857e-02  8.085e-02   0.477  0.63392    
## L(Volume.ts, 1:32)31    -5.650e-03  8.091e-02  -0.070  0.94441    
## L(Volume.ts, 1:32)32     5.668e-02  7.663e-02   0.740  0.46055    
## L(Volume.ts, 91:122)91  -6.200e-02  7.678e-02  -0.807  0.42047    
## L(Volume.ts, 91:122)92   4.168e-02  8.114e-02   0.514  0.60815    
## L(Volume.ts, 91:122)93  -2.367e-02  8.094e-02  -0.292  0.77032    
## L(Volume.ts, 91:122)94   8.405e-03  7.685e-02   0.109  0.91303    
## L(Volume.ts, 91:122)95  -5.569e-02  7.684e-02  -0.725  0.46955    
## L(Volume.ts, 91:122)96  -1.711e-02  7.696e-02  -0.222  0.82436    
## L(Volume.ts, 91:122)97  -4.803e-02  7.797e-02  -0.616  0.53870    
## L(Volume.ts, 91:122)98  -8.314e-02  7.767e-02  -1.070  0.28590    
## L(Volume.ts, 91:122)99   9.408e-02  7.774e-02   1.210  0.22783    
## L(Volume.ts, 91:122)100 -6.516e-02  7.847e-02  -0.830  0.40744    
## L(Volume.ts, 91:122)101  3.535e-02  7.891e-02   0.448  0.65469    
## L(Volume.ts, 91:122)102  5.372e-04  7.799e-02   0.007  0.99451    
## L(Volume.ts, 91:122)103 -1.191e-02  7.746e-02  -0.154  0.87801    
## L(Volume.ts, 91:122)104  1.611e-02  7.923e-02   0.203  0.83915    
## L(Volume.ts, 91:122)105  2.384e-02  7.787e-02   0.306  0.75987    
## L(Volume.ts, 91:122)106 -5.431e-02  7.794e-02  -0.697  0.48690    
## L(Volume.ts, 91:122)107  4.167e-02  7.818e-02   0.533  0.59467    
## L(Volume.ts, 91:122)108 -5.033e-02  7.804e-02  -0.645  0.51984    
## L(Volume.ts, 91:122)109 -5.208e-02  7.766e-02  -0.671  0.50334    
## L(Volume.ts, 91:122)110  3.705e-02  7.752e-02   0.478  0.63333    
## L(Volume.ts, 91:122)111 -1.404e-01  8.161e-02  -1.720  0.08710 .  
## L(Volume.ts, 91:122)112  1.466e-02  8.185e-02   0.179  0.85806    
## L(Volume.ts, 91:122)113  9.190e-02  8.147e-02   1.128  0.26085    
## L(Volume.ts, 91:122)114 -9.941e-02  8.158e-02  -1.219  0.22462    
## L(Volume.ts, 91:122)115 -8.935e-02  8.204e-02  -1.089  0.27762    
## L(Volume.ts, 91:122)116  6.273e-02  7.754e-02   0.809  0.41961    
## L(Volume.ts, 91:122)117  2.531e-01  7.777e-02   3.254  0.00136 ** 
## L(Volume.ts, 91:122)118 -1.304e-01  7.972e-02  -1.636  0.10362    
## L(Volume.ts, 91:122)119 -6.807e-02  8.131e-02  -0.837  0.40363    
## L(Volume.ts, 91:122)120  5.195e-02  8.014e-02   0.648  0.51765    
## L(Volume.ts, 91:122)121 -2.679e-02  7.926e-02  -0.338  0.73582    
## L(Volume.ts, 91:122)122 -5.762e-02  7.548e-02  -0.763  0.44626    
## L(Open.ts.diff, 35)      4.193e+00  1.658e+03   0.003  0.99799    
## L(Open.ts.diff, 110)    -4.230e+02  1.527e+03  -0.277  0.78209    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1895000 on 176 degrees of freedom
## Multiple R-squared:  0.3865, Adjusted R-squared:  0.1565 
## F-statistic:  1.68 on 66 and 176 DF,  p-value: 0.003931
plot_acf_pacf(residuals(ardl.volume.open.4), "ardl.volume.open.4")

Based on all 4 ACF and PACF graphs, models ardl.volume.open.1 and ardl.volume.open.2 are the best fits for the data.

Training and Testing for ARDL models

Turnover and Close
Size
train_size.Turnover.ardl <- floor (2/3 * length(Turnover.ts))
train_size.Close.diff.ardl <- floor (2/3 * length(Close.ts.diff))

Data

train_data.Turnover.ardl <- Turnover.ts[1:train_size.Turnover.ardl]
train_data.Turnover.ardl = ts(train_data.Turnover.ardl,
                              start=c(2015,1),
                              end=c(2015,365),
                              frequency=365)
train_data.Close.diff.ardl <- Close.ts.diff[1:train_size.Close.diff.ardl]
train_data.Close.diff.ardl = ts(train_data.Close.diff.ardl,
                               start=c(2015,1),
                               end=c(2015,365),
                               frequency=365)

Test

test_data.Turnover.ardl <- Turnover.ts[(train_size.Turnover.ardl + 1):length(Turnover.ts)] 
test_data.Turnover.ardl = ts(test_data.Turnover.ardl, start=c(2015,1), end=c(2015,365), frequency=365)

test_data.Close.diff.ardl <- Close.ts.diff[(train_size.Close.diff.ardl + 1):length(Close.ts.diff)] 
test_data.Close.diff.ardl = ts(test_data.Close.diff.ardl, start=c(2015,1), end=c(2015,365), frequency=365)

length(train_data.Turnover.ardl)  
## [1] 365
length(test_data.Close.diff.ardl)
## [1] 365

Training and Testing for Turnover with lag (1:4) and Close with lag (110)

Turnover.Close.training.1 <- dynlm(train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 1:4) + L(train_data.Close.diff.ardl, 110))
summary(Turnover.Close.training.1)
## 
## Time series regression with "ts" data:
## Start = 2015(111), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 
##     1:4) + L(train_data.Close.diff.ardl, 110))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.824e+14 -1.182e+14 -4.393e+13  5.605e+13  1.779e+15 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                         2.421e+14  4.189e+13   5.779 2.24e-08 ***
## L(train_data.Turnover.ardl, 1:4)1   3.317e-01  6.312e-02   5.255 3.19e-07 ***
## L(train_data.Turnover.ardl, 1:4)2   3.212e-02  6.655e-02   0.483    0.630    
## L(train_data.Turnover.ardl, 1:4)3  -2.603e-02  6.653e-02  -0.391    0.696    
## L(train_data.Turnover.ardl, 1:4)4   8.752e-02  6.315e-02   1.386    0.167    
## L(train_data.Close.diff.ardl, 110)  7.216e+10  2.355e+11   0.306    0.760    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.521e+14 on 249 degrees of freedom
## Multiple R-squared:  0.1263, Adjusted R-squared:  0.1088 
## F-statistic:   7.2 on 5 and 249 DF,  p-value: 2.582e-06
Turnover.Close.testing.1 <- predict(Turnover.Close.training.1, n.ahead = length(test_data.Turnover.ardl, test_data.Close.diff.ardl))
head(Turnover.Close.testing.1)
##    2015(111)    2015(112)    2015(113)    2015(114)    2015(115)    2015(116) 
## 4.261698e+14 4.430394e+14 3.568575e+14 3.651518e+14 3.938898e+14 3.333381e+14
Turnover.Close.fitted_training.1 <- fitted(Turnover.Close.training.1)
head(Turnover.Close.fitted_training.1)
## Time Series:
## Start = c(2015, 111) 
## End = c(2015, 116) 
## Frequency = 365 
## [1] 4.261698e+14 4.430394e+14 3.568575e+14 3.651518e+14 3.938898e+14
## [6] 3.333381e+14
Turnover.Close.1.training.mse_value <- mse(train_data.Turnover.ardl, Turnover.Close.fitted_training.1)
Turnover.Close.1.training.rmse_value <- rmse(train_data.Turnover.ardl, Turnover.Close.fitted_training.1)

Turnover.testing.n.1 = as.numeric(Turnover.Close.testing.1)

Turnover.Close.1.testing.mse_value <- mse(test_data.Turnover.ardl, Turnover.testing.n.1)
Turnover.Close.1.testing.rmse_value <- rmse(test_data.Turnover.ardl, Turnover.testing.n.1)

cat("Training Model MSE:", Turnover.Close.1.training.mse_value, "\n Training Model RMSE:", Turnover.Close.1.training.rmse_value , "\n Testing Model MSE:", Turnover.Close.1.testing.mse_value, "\n Testing Model RMSE:", Turnover.Close.1.testing.rmse_value , "\n")
## Training Model MSE: 6.206749e+28 
##  Training Model RMSE: 2.491335e+14 
##  Testing Model MSE: 9.040994e+28 
##  Testing Model RMSE: 3.006825e+14
cat(" Training Model AIC:", AIC(Turnover.Close.training.1), "\n Training Model BIC:", BIC(Turnover.Close.training.1), "\n")
##  Training Model AIC: 17643.65 
##  Training Model BIC: 17668.44

The MSE and RMSE of the training model are extremely high, which suggest a bad model fit. This is further supported by its R-squared values of 0.1263. It is relatively low, meaning only a small percentage of the variance in the dependent variable can be explained by the independent variable, in this case, Close on Turnover. The MSE and RMSE of the testing model are also extremely high, so we can conclude that the ARDL model of Turnover with lag(1:4) and Close with lag (110) is a bad fit.

Training and Testing for Turnover with lag (1:4) and Close with lag (1:110)

Turnover.Close.training.2 <- dynlm(train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 1:4) + L(train_data.Close.diff.ardl, 1:110), data = infy_stock)
summary(Turnover.Close.training.2)
## 
## Time series regression with "ts" data:
## Start = 2015(111), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 
##     1:4) + L(train_data.Close.diff.ardl, 1:110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -4.776e+14 -7.744e+13 -1.566e+13  5.255e+13  1.700e+15 
## 
## Coefficients:
##                                           Estimate Std. Error t value Pr(>|t|)
## (Intercept)                              2.394e+14  5.528e+13   4.330 2.82e-05
## L(train_data.Turnover.ardl, 1:4)1        3.509e-01  8.423e-02   4.166 5.39e-05
## L(train_data.Turnover.ardl, 1:4)2        2.883e-02  8.919e-02   0.323   0.7469
## L(train_data.Turnover.ardl, 1:4)3       -2.155e-02  8.900e-02  -0.242   0.8090
## L(train_data.Turnover.ardl, 1:4)4        8.805e-02  8.383e-02   1.050   0.2954
## L(train_data.Close.diff.ardl, 1:110)1    9.013e+10  1.997e+11   0.451   0.6525
## L(train_data.Close.diff.ardl, 1:110)2   -3.013e+10  1.998e+11  -0.151   0.8803
## L(train_data.Close.diff.ardl, 1:110)3    1.983e+11  1.998e+11   0.993   0.3226
## L(train_data.Close.diff.ardl, 1:110)4    5.280e+10  2.004e+11   0.264   0.7925
## L(train_data.Close.diff.ardl, 1:110)5    7.057e+10  2.001e+11   0.353   0.7249
## L(train_data.Close.diff.ardl, 1:110)6   -1.131e+11  1.989e+11  -0.569   0.5705
## L(train_data.Close.diff.ardl, 1:110)7    3.572e+10  1.988e+11   0.180   0.8577
## L(train_data.Close.diff.ardl, 1:110)8    4.864e+10  1.981e+11   0.246   0.8064
## L(train_data.Close.diff.ardl, 1:110)9   -9.270e+09  1.978e+11  -0.047   0.9627
## L(train_data.Close.diff.ardl, 1:110)10   1.835e+11  1.976e+11   0.929   0.3547
## L(train_data.Close.diff.ardl, 1:110)11   8.119e+10  1.980e+11   0.410   0.6823
## L(train_data.Close.diff.ardl, 1:110)12   9.412e+10  1.978e+11   0.476   0.6350
## L(train_data.Close.diff.ardl, 1:110)13   1.112e+11  2.615e+11   0.425   0.6713
## L(train_data.Close.diff.ardl, 1:110)14   1.833e+11  2.619e+11   0.700   0.4851
## L(train_data.Close.diff.ardl, 1:110)15   2.826e+11  2.620e+11   1.079   0.2826
## L(train_data.Close.diff.ardl, 1:110)16   1.255e+11  2.629e+11   0.477   0.6338
## L(train_data.Close.diff.ardl, 1:110)17   1.295e+11  2.623e+11   0.493   0.6224
## L(train_data.Close.diff.ardl, 1:110)18   5.773e+10  2.624e+11   0.220   0.8262
## L(train_data.Close.diff.ardl, 1:110)19  -4.479e+09  2.623e+11  -0.017   0.9864
## L(train_data.Close.diff.ardl, 1:110)20  -5.977e+10  2.611e+11  -0.229   0.8193
## L(train_data.Close.diff.ardl, 1:110)21   6.963e+10  2.612e+11   0.267   0.7902
## L(train_data.Close.diff.ardl, 1:110)22   4.073e+10  2.613e+11   0.156   0.8763
## L(train_data.Close.diff.ardl, 1:110)23   1.491e+11  2.605e+11   0.572   0.5680
## L(train_data.Close.diff.ardl, 1:110)24   1.125e+11  2.604e+11   0.432   0.6665
## L(train_data.Close.diff.ardl, 1:110)25   2.180e+11  2.604e+11   0.837   0.4039
## L(train_data.Close.diff.ardl, 1:110)26   1.474e+11  2.612e+11   0.564   0.5734
## L(train_data.Close.diff.ardl, 1:110)27  -1.595e+12  2.636e+11  -6.053 1.24e-08
## L(train_data.Close.diff.ardl, 1:110)28   4.188e+11  2.952e+11   1.419   0.1582
## L(train_data.Close.diff.ardl, 1:110)29   1.290e+11  2.976e+11   0.433   0.6654
## L(train_data.Close.diff.ardl, 1:110)30   2.311e+11  2.961e+11   0.780   0.4365
## L(train_data.Close.diff.ardl, 1:110)31   7.227e+10  2.907e+11   0.249   0.8040
## L(train_data.Close.diff.ardl, 1:110)32  -3.334e+11  2.636e+11  -1.264   0.2082
## L(train_data.Close.diff.ardl, 1:110)33  -8.523e+10  2.651e+11  -0.322   0.7483
## L(train_data.Close.diff.ardl, 1:110)34  -1.451e+11  2.652e+11  -0.547   0.5851
## L(train_data.Close.diff.ardl, 1:110)35   7.130e+10  2.629e+11   0.271   0.7867
## L(train_data.Close.diff.ardl, 1:110)36  -2.464e+10  2.650e+11  -0.093   0.9261
## L(train_data.Close.diff.ardl, 1:110)37  -1.438e+11  2.637e+11  -0.545   0.5865
## L(train_data.Close.diff.ardl, 1:110)38   2.433e+11  2.634e+11   0.923   0.3574
## L(train_data.Close.diff.ardl, 1:110)39  -3.398e+10  2.636e+11  -0.129   0.8976
## L(train_data.Close.diff.ardl, 1:110)40   7.051e+10  2.639e+11   0.267   0.7897
## L(train_data.Close.diff.ardl, 1:110)41   3.442e+11  2.640e+11   1.304   0.1945
## L(train_data.Close.diff.ardl, 1:110)42   8.468e+10  2.647e+11   0.320   0.7495
## L(train_data.Close.diff.ardl, 1:110)43  -2.397e+11  2.646e+11  -0.906   0.3666
## L(train_data.Close.diff.ardl, 1:110)44  -1.951e+11  2.653e+11  -0.735   0.4633
## L(train_data.Close.diff.ardl, 1:110)45   2.619e+11  2.656e+11   0.986   0.3258
## L(train_data.Close.diff.ardl, 1:110)46   2.136e+11  2.655e+11   0.805   0.4224
## L(train_data.Close.diff.ardl, 1:110)47   8.741e+10  2.657e+11   0.329   0.7427
## L(train_data.Close.diff.ardl, 1:110)48   6.426e+10  2.654e+11   0.242   0.8091
## L(train_data.Close.diff.ardl, 1:110)49   6.881e+10  2.638e+11   0.261   0.7946
## L(train_data.Close.diff.ardl, 1:110)50  -1.032e+11  2.637e+11  -0.391   0.6961
## L(train_data.Close.diff.ardl, 1:110)51  -2.194e+11  2.629e+11  -0.835   0.4053
## L(train_data.Close.diff.ardl, 1:110)52  -4.618e+09  2.629e+11  -0.018   0.9860
## L(train_data.Close.diff.ardl, 1:110)53  -2.095e+11  2.628e+11  -0.797   0.4266
## L(train_data.Close.diff.ardl, 1:110)54  -4.779e+10  2.637e+11  -0.181   0.8564
## L(train_data.Close.diff.ardl, 1:110)55   1.635e+11  2.636e+11   0.620   0.5360
## L(train_data.Close.diff.ardl, 1:110)56  -2.263e+11  2.638e+11  -0.858   0.3925
## L(train_data.Close.diff.ardl, 1:110)57  -1.074e+11  2.645e+11  -0.406   0.6852
## L(train_data.Close.diff.ardl, 1:110)58  -1.639e+11  2.639e+11  -0.621   0.5357
## L(train_data.Close.diff.ardl, 1:110)59  -4.400e+09  2.639e+11  -0.017   0.9867
## L(train_data.Close.diff.ardl, 1:110)60   1.265e+11  2.634e+11   0.480   0.6318
## L(train_data.Close.diff.ardl, 1:110)61  -1.790e+10  2.637e+11  -0.068   0.9460
## L(train_data.Close.diff.ardl, 1:110)62   1.371e+11  2.637e+11   0.520   0.6039
## L(train_data.Close.diff.ardl, 1:110)63  -2.068e+11  2.632e+11  -0.786   0.4332
## L(train_data.Close.diff.ardl, 1:110)64   4.602e+10  2.644e+11   0.174   0.8621
## L(train_data.Close.diff.ardl, 1:110)65  -1.427e+11  2.638e+11  -0.541   0.5895
## L(train_data.Close.diff.ardl, 1:110)66  -5.698e+10  2.639e+11  -0.216   0.8294
## L(train_data.Close.diff.ardl, 1:110)67   2.544e+11  2.638e+11   0.964   0.3365
## L(train_data.Close.diff.ardl, 1:110)68   1.718e+10  2.641e+11   0.065   0.9482
## L(train_data.Close.diff.ardl, 1:110)69  -1.505e+11  2.640e+11  -0.570   0.5696
## L(train_data.Close.diff.ardl, 1:110)70   2.174e+11  2.643e+11   0.823   0.4122
## L(train_data.Close.diff.ardl, 1:110)71  -5.526e+10  2.643e+11  -0.209   0.8347
## L(train_data.Close.diff.ardl, 1:110)72   4.425e+11  2.641e+11   1.675   0.0961
## L(train_data.Close.diff.ardl, 1:110)73  -3.332e+11  2.662e+11  -1.252   0.2127
## L(train_data.Close.diff.ardl, 1:110)74   1.726e+10  2.677e+11   0.064   0.9487
## L(train_data.Close.diff.ardl, 1:110)75   4.689e+10  2.680e+11   0.175   0.8614
## L(train_data.Close.diff.ardl, 1:110)76  -1.784e+11  2.669e+11  -0.668   0.5050
## L(train_data.Close.diff.ardl, 1:110)77   5.522e+10  2.635e+11   0.210   0.8343
## L(train_data.Close.diff.ardl, 1:110)78   1.205e+11  2.631e+11   0.458   0.6475
## L(train_data.Close.diff.ardl, 1:110)79  -1.194e+11  2.631e+11  -0.454   0.6506
## L(train_data.Close.diff.ardl, 1:110)80  -1.512e+11  2.632e+11  -0.575   0.5664
## L(train_data.Close.diff.ardl, 1:110)81  -8.688e+10  2.634e+11  -0.330   0.7420
## L(train_data.Close.diff.ardl, 1:110)82  -1.030e+11  2.633e+11  -0.391   0.6963
## L(train_data.Close.diff.ardl, 1:110)83  -1.139e+12  2.629e+11  -4.332 2.80e-05
## L(train_data.Close.diff.ardl, 1:110)84   1.495e+10  2.797e+11   0.053   0.9574
## L(train_data.Close.diff.ardl, 1:110)85   1.217e+11  2.768e+11   0.439   0.6610
## L(train_data.Close.diff.ardl, 1:110)86   5.108e+10  2.763e+11   0.185   0.8536
## L(train_data.Close.diff.ardl, 1:110)87   1.838e+11  2.752e+11   0.668   0.5054
## L(train_data.Close.diff.ardl, 1:110)88  -2.690e+10  2.623e+11  -0.103   0.9185
## L(train_data.Close.diff.ardl, 1:110)89  -1.765e+11  2.608e+11  -0.677   0.4996
## L(train_data.Close.diff.ardl, 1:110)90   3.346e+10  2.610e+11   0.128   0.8982
## L(train_data.Close.diff.ardl, 1:110)91  -7.053e+10  2.606e+11  -0.271   0.7871
## L(train_data.Close.diff.ardl, 1:110)92   1.912e+11  2.604e+11   0.734   0.4640
## L(train_data.Close.diff.ardl, 1:110)93   1.268e+11  2.609e+11   0.486   0.6278
## L(train_data.Close.diff.ardl, 1:110)94   2.602e+10  2.606e+11   0.100   0.9206
## L(train_data.Close.diff.ardl, 1:110)95   4.596e+10  2.613e+11   0.176   0.8606
## L(train_data.Close.diff.ardl, 1:110)96   2.413e+11  2.613e+11   0.923   0.3574
## L(train_data.Close.diff.ardl, 1:110)97   1.352e+11  2.619e+11   0.516   0.6066
## L(train_data.Close.diff.ardl, 1:110)98   1.365e+11  2.619e+11   0.521   0.6029
## L(train_data.Close.diff.ardl, 1:110)99   1.939e+10  2.617e+11   0.074   0.9410
## L(train_data.Close.diff.ardl, 1:110)100  2.368e+11  2.619e+11   0.904   0.3674
## L(train_data.Close.diff.ardl, 1:110)101  1.444e+11  2.622e+11   0.551   0.5827
## L(train_data.Close.diff.ardl, 1:110)102 -1.191e+11  2.619e+11  -0.455   0.6498
## L(train_data.Close.diff.ardl, 1:110)103  2.703e+10  2.618e+11   0.103   0.9179
## L(train_data.Close.diff.ardl, 1:110)104  1.834e+11  2.618e+11   0.700   0.4849
## L(train_data.Close.diff.ardl, 1:110)105  3.790e+10  2.606e+11   0.145   0.8846
## L(train_data.Close.diff.ardl, 1:110)106 -3.272e+10  2.618e+11  -0.125   0.9007
## L(train_data.Close.diff.ardl, 1:110)107 -1.475e+11  2.617e+11  -0.564   0.5738
## L(train_data.Close.diff.ardl, 1:110)108 -2.665e+11  2.618e+11  -1.018   0.3105
## L(train_data.Close.diff.ardl, 1:110)109 -9.164e+10  2.620e+11  -0.350   0.7271
## L(train_data.Close.diff.ardl, 1:110)110  1.593e+11  2.619e+11   0.608   0.5440
##                                            
## (Intercept)                             ***
## L(train_data.Turnover.ardl, 1:4)1       ***
## L(train_data.Turnover.ardl, 1:4)2          
## L(train_data.Turnover.ardl, 1:4)3          
## L(train_data.Turnover.ardl, 1:4)4          
## L(train_data.Close.diff.ardl, 1:110)1      
## L(train_data.Close.diff.ardl, 1:110)2      
## L(train_data.Close.diff.ardl, 1:110)3      
## L(train_data.Close.diff.ardl, 1:110)4      
## L(train_data.Close.diff.ardl, 1:110)5      
## L(train_data.Close.diff.ardl, 1:110)6      
## L(train_data.Close.diff.ardl, 1:110)7      
## L(train_data.Close.diff.ardl, 1:110)8      
## L(train_data.Close.diff.ardl, 1:110)9      
## L(train_data.Close.diff.ardl, 1:110)10     
## L(train_data.Close.diff.ardl, 1:110)11     
## L(train_data.Close.diff.ardl, 1:110)12     
## L(train_data.Close.diff.ardl, 1:110)13     
## L(train_data.Close.diff.ardl, 1:110)14     
## L(train_data.Close.diff.ardl, 1:110)15     
## L(train_data.Close.diff.ardl, 1:110)16     
## L(train_data.Close.diff.ardl, 1:110)17     
## L(train_data.Close.diff.ardl, 1:110)18     
## L(train_data.Close.diff.ardl, 1:110)19     
## L(train_data.Close.diff.ardl, 1:110)20     
## L(train_data.Close.diff.ardl, 1:110)21     
## L(train_data.Close.diff.ardl, 1:110)22     
## L(train_data.Close.diff.ardl, 1:110)23     
## L(train_data.Close.diff.ardl, 1:110)24     
## L(train_data.Close.diff.ardl, 1:110)25     
## L(train_data.Close.diff.ardl, 1:110)26     
## L(train_data.Close.diff.ardl, 1:110)27  ***
## L(train_data.Close.diff.ardl, 1:110)28     
## L(train_data.Close.diff.ardl, 1:110)29     
## L(train_data.Close.diff.ardl, 1:110)30     
## L(train_data.Close.diff.ardl, 1:110)31     
## L(train_data.Close.diff.ardl, 1:110)32     
## L(train_data.Close.diff.ardl, 1:110)33     
## L(train_data.Close.diff.ardl, 1:110)34     
## L(train_data.Close.diff.ardl, 1:110)35     
## L(train_data.Close.diff.ardl, 1:110)36     
## L(train_data.Close.diff.ardl, 1:110)37     
## L(train_data.Close.diff.ardl, 1:110)38     
## L(train_data.Close.diff.ardl, 1:110)39     
## L(train_data.Close.diff.ardl, 1:110)40     
## L(train_data.Close.diff.ardl, 1:110)41     
## L(train_data.Close.diff.ardl, 1:110)42     
## L(train_data.Close.diff.ardl, 1:110)43     
## L(train_data.Close.diff.ardl, 1:110)44     
## L(train_data.Close.diff.ardl, 1:110)45     
## L(train_data.Close.diff.ardl, 1:110)46     
## L(train_data.Close.diff.ardl, 1:110)47     
## L(train_data.Close.diff.ardl, 1:110)48     
## L(train_data.Close.diff.ardl, 1:110)49     
## L(train_data.Close.diff.ardl, 1:110)50     
## L(train_data.Close.diff.ardl, 1:110)51     
## L(train_data.Close.diff.ardl, 1:110)52     
## L(train_data.Close.diff.ardl, 1:110)53     
## L(train_data.Close.diff.ardl, 1:110)54     
## L(train_data.Close.diff.ardl, 1:110)55     
## L(train_data.Close.diff.ardl, 1:110)56     
## L(train_data.Close.diff.ardl, 1:110)57     
## L(train_data.Close.diff.ardl, 1:110)58     
## L(train_data.Close.diff.ardl, 1:110)59     
## L(train_data.Close.diff.ardl, 1:110)60     
## L(train_data.Close.diff.ardl, 1:110)61     
## L(train_data.Close.diff.ardl, 1:110)62     
## L(train_data.Close.diff.ardl, 1:110)63     
## L(train_data.Close.diff.ardl, 1:110)64     
## L(train_data.Close.diff.ardl, 1:110)65     
## L(train_data.Close.diff.ardl, 1:110)66     
## L(train_data.Close.diff.ardl, 1:110)67     
## L(train_data.Close.diff.ardl, 1:110)68     
## L(train_data.Close.diff.ardl, 1:110)69     
## L(train_data.Close.diff.ardl, 1:110)70     
## L(train_data.Close.diff.ardl, 1:110)71     
## L(train_data.Close.diff.ardl, 1:110)72  .  
## L(train_data.Close.diff.ardl, 1:110)73     
## L(train_data.Close.diff.ardl, 1:110)74     
## L(train_data.Close.diff.ardl, 1:110)75     
## L(train_data.Close.diff.ardl, 1:110)76     
## L(train_data.Close.diff.ardl, 1:110)77     
## L(train_data.Close.diff.ardl, 1:110)78     
## L(train_data.Close.diff.ardl, 1:110)79     
## L(train_data.Close.diff.ardl, 1:110)80     
## L(train_data.Close.diff.ardl, 1:110)81     
## L(train_data.Close.diff.ardl, 1:110)82     
## L(train_data.Close.diff.ardl, 1:110)83  ***
## L(train_data.Close.diff.ardl, 1:110)84     
## L(train_data.Close.diff.ardl, 1:110)85     
## L(train_data.Close.diff.ardl, 1:110)86     
## L(train_data.Close.diff.ardl, 1:110)87     
## L(train_data.Close.diff.ardl, 1:110)88     
## L(train_data.Close.diff.ardl, 1:110)89     
## L(train_data.Close.diff.ardl, 1:110)90     
## L(train_data.Close.diff.ardl, 1:110)91     
## L(train_data.Close.diff.ardl, 1:110)92     
## L(train_data.Close.diff.ardl, 1:110)93     
## L(train_data.Close.diff.ardl, 1:110)94     
## L(train_data.Close.diff.ardl, 1:110)95     
## L(train_data.Close.diff.ardl, 1:110)96     
## L(train_data.Close.diff.ardl, 1:110)97     
## L(train_data.Close.diff.ardl, 1:110)98     
## L(train_data.Close.diff.ardl, 1:110)99     
## L(train_data.Close.diff.ardl, 1:110)100    
## L(train_data.Close.diff.ardl, 1:110)101    
## L(train_data.Close.diff.ardl, 1:110)102    
## L(train_data.Close.diff.ardl, 1:110)103    
## L(train_data.Close.diff.ardl, 1:110)104    
## L(train_data.Close.diff.ardl, 1:110)105    
## L(train_data.Close.diff.ardl, 1:110)106    
## L(train_data.Close.diff.ardl, 1:110)107    
## L(train_data.Close.diff.ardl, 1:110)108    
## L(train_data.Close.diff.ardl, 1:110)109    
## L(train_data.Close.diff.ardl, 1:110)110    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.6e+14 on 140 degrees of freedom
## Multiple R-squared:  0.4777, Adjusted R-squared:  0.05231 
## F-statistic: 1.123 on 114 and 140 DF,  p-value: 0.2559
Turnover.Close.testing.2 <- predict(Turnover.Close.training.2, n.ahead = length(test_data.Turnover.ardl, test_data.Close.diff.ardl))
head(Turnover.Close.testing.2)
##    2015(111)    2015(112)    2015(113)    2015(114)    2015(115)    2015(116) 
## 4.467430e+14 3.122180e+14 2.610087e+14 3.198778e+14 3.008239e+14 2.760999e+14
Turnover.Close.fitted_training.2 <- fitted(Turnover.Close.training.2)
head(Turnover.Close.fitted_training.2)
## Time Series:
## Start = c(2015, 111) 
## End = c(2015, 116) 
## Frequency = 365 
## [1] 4.467430e+14 3.122180e+14 2.610087e+14 3.198778e+14 3.008239e+14
## [6] 2.760999e+14
Turnover.Close.2.training.mse_value <- mse(train_data.Turnover.ardl, Turnover.Close.fitted_training.2)
Turnover.Close.2.training.rmse_value <- rmse(train_data.Turnover.ardl, Turnover.Close.fitted_training.2)

Turnover.testing.n.2 = as.numeric(Turnover.Close.testing.2)

Turnover.Close.2.testing.mse_value <- mse(test_data.Turnover.ardl, Turnover.testing.n.2)
Turnover.Close.2.testing.rmse_value <- rmse(test_data.Turnover.ardl, Turnover.testing.n.2)

cat("Training Model MSE:", Turnover.Close.2.training.mse_value, "\n Training Model RMSE:", Turnover.Close.2.training.rmse_value , "\n Testing Model MSE:", Turnover.Close.2.testing.mse_value, "\n Testing Model RMSE:", Turnover.Close.2.testing.rmse_value , "\n")
## Training Model MSE: 3.710815e+28 
##  Training Model RMSE: 1.926348e+14 
##  Testing Model MSE: 1.250564e+29 
##  Testing Model RMSE: 3.536331e+14
cat(" Training Model AIC:", AIC(Turnover.Close.training.2), "\n Training Model BIC:", BIC(Turnover.Close.training.2), "\n")
##  Training Model AIC: 17730.49 
##  Training Model BIC: 18141.27

The R-squared of this training model is 0.4777. This value is better compared to the previous model and might hint at a moderate fit, but looking at the high values of MSE and RMSE of both training and testing models, it is to be observed that the ARDL model is not a good fit. Looking at the AIC and BIC of this model are also higher than that of the previous model despite its R-squared value being better suited. We can conclude that this ARDL model is also not a good fit.

Training and Testing for Turnover with lag (2)n(61)n(75)n(117) and Close with lag (110)

Turnover.Close.training.3 <- dynlm(train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 2) + L(train_data.Turnover.ardl, 61) + L(train_data.Turnover.ardl, 75) + L(train_data.Turnover.ardl, 117) + L(train_data.Close.diff.ardl, 110), data = infy_stock)
summary(Turnover.Close.training.3)
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 
##     2) + L(train_data.Turnover.ardl, 61) + L(train_data.Turnover.ardl, 
##     75) + L(train_data.Turnover.ardl, 117) + L(train_data.Close.diff.ardl, 
##     110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -4.274e+14 -1.325e+14 -4.685e+13  7.484e+13  1.888e+15 
## 
## Coefficients:
##                                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        2.593e+14  5.492e+13   4.721 3.98e-06 ***
## L(train_data.Turnover.ardl, 2)     1.464e-01  6.264e-02   2.337   0.0203 *  
## L(train_data.Turnover.ardl, 61)    1.464e-01  6.453e-02   2.268   0.0242 *  
## L(train_data.Turnover.ardl, 75)    1.242e-02  6.266e-02   0.198   0.8431    
## L(train_data.Turnover.ardl, 117)   8.348e-02  6.501e-02   1.284   0.2003    
## L(train_data.Close.diff.ardl, 110) 4.366e+10  2.495e+11   0.175   0.8613    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.646e+14 on 242 degrees of freedom
## Multiple R-squared:  0.05654,    Adjusted R-squared:  0.03705 
## F-statistic: 2.901 on 5 and 242 DF,  p-value: 0.01455
Turnover.Close.testing.3 <- predict(Turnover.Close.training.3, n.ahead = length(test_data.Turnover.ardl, test_data.Close.diff.ardl))
head(Turnover.Close.testing.3)
##    2015(118)    2015(119)    2015(120)    2015(121)    2015(122)    2015(123) 
## 3.734164e+14 3.847273e+14 4.804043e+14 4.365705e+14 3.818708e+14 4.250643e+14
Turnover.Close.fitted_training.3 <- fitted(Turnover.Close.training.3)
head(Turnover.Close.fitted_training.3)
## Time Series:
## Start = c(2015, 118) 
## End = c(2015, 123) 
## Frequency = 365 
## [1] 3.734164e+14 3.847273e+14 4.804043e+14 4.365705e+14 3.818708e+14
## [6] 4.250643e+14
Turnover.Close.3.training.mse_value <- mse(train_data.Turnover.ardl, Turnover.Close.fitted_training.3)
Turnover.Close.3.training.rmse_value <- rmse(train_data.Turnover.ardl, Turnover.Close.fitted_training.3)

Turnover.testing.n.3 = as.numeric(Turnover.Close.testing.3)

Turnover.Close.3.testing.mse_value <- mse(test_data.Turnover.ardl, Turnover.testing.n.3)
Turnover.Close.3.testing.rmse_value <- rmse(test_data.Turnover.ardl, Turnover.testing.n.3)

cat("Training Model MSE:", Turnover.Close.3.training.mse_value, "\n Training Model RMSE:", Turnover.Close.3.training.rmse_value , "\n Testing Model MSE:", Turnover.Close.3.testing.mse_value, "\n Testing Model RMSE:", Turnover.Close.3.testing.rmse_value , "\n")
## Training Model MSE: 6.832031e+28 
##  Training Model RMSE: 2.613815e+14 
##  Testing Model MSE: 7.532087e+28 
##  Testing Model RMSE: 2.744465e+14
cat(" Training Model AIC:", AIC(Turnover.Close.training.3), "\n Training Model BIC:", BIC(Turnover.Close.training.3), "\n")
##  Training Model AIC: 17183.51 
##  Training Model BIC: 17208.1

For this model too, the MSE and RMSE of both training and testing models are high, suggesting a bad fit. The R-squared value of 0.05654 also further supports that conclusion. And though the AIC and BIC of this model seems to be lower than the previous two, it is still high and thus, can be concluded to not be a good fit.

Training and Testing for Turnover with lag (2)n(61)n(75)n(117) and Close with lag (1:110)

Turnover.Close.training.4 <- dynlm(train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 2) + L(train_data.Turnover.ardl, 61) + L(train_data.Turnover.ardl, 75) + L(train_data.Turnover.ardl, 117) + L(train_data.Close.diff.ardl, 1:110))
summary(Turnover.Close.training.4) 
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 
##     2) + L(train_data.Turnover.ardl, 61) + L(train_data.Turnover.ardl, 
##     75) + L(train_data.Turnover.ardl, 117) + L(train_data.Close.diff.ardl, 
##     1:110))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.517e+14 -9.168e+13 -2.370e+13  6.036e+13  1.752e+15 
## 
## Coefficients:
##                                           Estimate Std. Error t value Pr(>|t|)
## (Intercept)                              3.299e+14  7.520e+13   4.386 2.32e-05
## L(train_data.Turnover.ardl, 2)           1.462e-01  8.618e-02   1.696 0.092167
## L(train_data.Turnover.ardl, 61)          1.247e-01  1.078e-01   1.157 0.249333
## L(train_data.Turnover.ardl, 75)          6.533e-02  9.535e-02   0.685 0.494466
## L(train_data.Turnover.ardl, 117)        -1.028e-01  1.103e-01  -0.932 0.353053
## L(train_data.Close.diff.ardl, 1:110)1   -7.166e+10  2.837e+11  -0.253 0.800986
## L(train_data.Close.diff.ardl, 1:110)2   -2.801e+10  2.844e+11  -0.098 0.921687
## L(train_data.Close.diff.ardl, 1:110)3    1.666e+11  2.844e+11   0.586 0.559061
## L(train_data.Close.diff.ardl, 1:110)4   -1.370e+10  2.834e+11  -0.048 0.961500
## L(train_data.Close.diff.ardl, 1:110)5    1.006e+11  2.828e+11   0.356 0.722701
## L(train_data.Close.diff.ardl, 1:110)6   -1.667e+11  2.862e+11  -0.583 0.561182
## L(train_data.Close.diff.ardl, 1:110)7    6.876e+10  2.215e+11   0.310 0.756747
## L(train_data.Close.diff.ardl, 1:110)8    8.633e+10  2.164e+11   0.399 0.690530
## L(train_data.Close.diff.ardl, 1:110)9    3.122e+10  2.160e+11   0.145 0.885310
## L(train_data.Close.diff.ardl, 1:110)10   2.066e+11  2.171e+11   0.951 0.343104
## L(train_data.Close.diff.ardl, 1:110)11   1.649e+11  2.142e+11   0.770 0.442730
## L(train_data.Close.diff.ardl, 1:110)12   1.083e+11  2.146e+11   0.505 0.614650
## L(train_data.Close.diff.ardl, 1:110)13  -2.945e+10  3.313e+11  -0.089 0.929302
## L(train_data.Close.diff.ardl, 1:110)14   2.229e+11  2.837e+11   0.786 0.433515
## L(train_data.Close.diff.ardl, 1:110)15   3.817e+11  2.828e+11   1.350 0.179295
## L(train_data.Close.diff.ardl, 1:110)16   2.522e+11  2.830e+11   0.891 0.374371
## L(train_data.Close.diff.ardl, 1:110)17   2.151e+11  2.861e+11   0.752 0.453409
## L(train_data.Close.diff.ardl, 1:110)18   1.147e+11  2.825e+11   0.406 0.685297
## L(train_data.Close.diff.ardl, 1:110)19   6.083e+10  2.828e+11   0.215 0.830033
## L(train_data.Close.diff.ardl, 1:110)20  -4.189e+10  2.818e+11  -0.149 0.882069
## L(train_data.Close.diff.ardl, 1:110)21   6.689e+10  2.825e+11   0.237 0.813190
## L(train_data.Close.diff.ardl, 1:110)22   4.812e+10  2.833e+11   0.170 0.865391
## L(train_data.Close.diff.ardl, 1:110)23   2.160e+11  2.851e+11   0.758 0.449947
## L(train_data.Close.diff.ardl, 1:110)24   1.851e+11  2.831e+11   0.654 0.514323
## L(train_data.Close.diff.ardl, 1:110)25   2.594e+11  2.856e+11   0.908 0.365324
## L(train_data.Close.diff.ardl, 1:110)26   2.210e+11  2.849e+11   0.776 0.439344
## L(train_data.Close.diff.ardl, 1:110)27  -1.351e+12  3.373e+11  -4.004 0.000103
## L(train_data.Close.diff.ardl, 1:110)28  -4.384e+10  2.924e+11  -0.150 0.881052
## L(train_data.Close.diff.ardl, 1:110)29   3.095e+11  3.125e+11   0.991 0.323677
## L(train_data.Close.diff.ardl, 1:110)30   3.587e+11  2.890e+11   1.241 0.216672
## L(train_data.Close.diff.ardl, 1:110)31   8.525e+10  2.867e+11   0.297 0.766691
## L(train_data.Close.diff.ardl, 1:110)32  -3.379e+11  2.871e+11  -1.177 0.241188
## L(train_data.Close.diff.ardl, 1:110)33  -1.893e+11  2.849e+11  -0.664 0.507540
## L(train_data.Close.diff.ardl, 1:110)34  -1.183e+11  2.859e+11  -0.414 0.679721
## L(train_data.Close.diff.ardl, 1:110)35   5.111e+10  2.844e+11   0.180 0.857638
## L(train_data.Close.diff.ardl, 1:110)36  -8.316e+09  2.865e+11  -0.029 0.976887
## L(train_data.Close.diff.ardl, 1:110)37  -1.630e+11  2.858e+11  -0.570 0.569369
## L(train_data.Close.diff.ardl, 1:110)38   1.923e+11  2.850e+11   0.675 0.500934
## L(train_data.Close.diff.ardl, 1:110)39   4.405e+10  2.880e+11   0.153 0.878667
## L(train_data.Close.diff.ardl, 1:110)40   6.279e+10  2.866e+11   0.219 0.826941
## L(train_data.Close.diff.ardl, 1:110)41   4.606e+11  3.310e+11   1.392 0.166357
## L(train_data.Close.diff.ardl, 1:110)42   2.717e+11  2.914e+11   0.932 0.352810
## L(train_data.Close.diff.ardl, 1:110)43  -1.898e+11  2.872e+11  -0.661 0.509776
## L(train_data.Close.diff.ardl, 1:110)44  -2.759e+11  2.861e+11  -0.964 0.336579
## L(train_data.Close.diff.ardl, 1:110)45   2.412e+11  2.873e+11   0.840 0.402659
## L(train_data.Close.diff.ardl, 1:110)46   3.245e+11  2.867e+11   1.132 0.259659
## L(train_data.Close.diff.ardl, 1:110)47   1.544e+11  2.860e+11   0.540 0.590245
## L(train_data.Close.diff.ardl, 1:110)48   8.503e+10  2.864e+11   0.297 0.766972
## L(train_data.Close.diff.ardl, 1:110)49   1.271e+11  2.860e+11   0.444 0.657502
## L(train_data.Close.diff.ardl, 1:110)50  -3.109e+10  2.847e+11  -0.109 0.913201
## L(train_data.Close.diff.ardl, 1:110)51  -1.426e+11  2.938e+11  -0.485 0.628143
## L(train_data.Close.diff.ardl, 1:110)52  -5.165e+10  2.844e+11  -0.182 0.856183
## L(train_data.Close.diff.ardl, 1:110)53  -2.169e+11  2.849e+11  -0.761 0.447786
## L(train_data.Close.diff.ardl, 1:110)54  -1.350e+11  2.856e+11  -0.473 0.637246
## L(train_data.Close.diff.ardl, 1:110)55   9.666e+10  2.869e+11   0.337 0.736720
## L(train_data.Close.diff.ardl, 1:110)56  -1.758e+11  2.852e+11  -0.616 0.538712
## L(train_data.Close.diff.ardl, 1:110)57  -2.202e+11  2.851e+11  -0.772 0.441375
## L(train_data.Close.diff.ardl, 1:110)58  -2.306e+11  2.847e+11  -0.810 0.419235
## L(train_data.Close.diff.ardl, 1:110)59  -6.470e+10  2.849e+11  -0.227 0.820674
## L(train_data.Close.diff.ardl, 1:110)60   9.474e+10  2.859e+11   0.331 0.740907
## L(train_data.Close.diff.ardl, 1:110)61   2.369e+10  2.846e+11   0.083 0.933803
## L(train_data.Close.diff.ardl, 1:110)62   7.429e+10  2.847e+11   0.261 0.794506
## L(train_data.Close.diff.ardl, 1:110)63  -2.086e+11  2.859e+11  -0.730 0.466882
## L(train_data.Close.diff.ardl, 1:110)64  -2.993e+10  2.854e+11  -0.105 0.916653
## L(train_data.Close.diff.ardl, 1:110)65  -1.674e+11  2.995e+11  -0.559 0.577093
## L(train_data.Close.diff.ardl, 1:110)66  -1.265e+11  2.873e+11  -0.440 0.660537
## L(train_data.Close.diff.ardl, 1:110)67   2.059e+11  2.856e+11   0.721 0.472222
## L(train_data.Close.diff.ardl, 1:110)68   7.855e+10  2.856e+11   0.275 0.783720
## L(train_data.Close.diff.ardl, 1:110)69  -1.664e+11  2.857e+11  -0.582 0.561263
## L(train_data.Close.diff.ardl, 1:110)70   1.509e+11  2.851e+11   0.529 0.597583
## L(train_data.Close.diff.ardl, 1:110)71  -1.249e+10  2.863e+11  -0.044 0.965281
## L(train_data.Close.diff.ardl, 1:110)72   4.188e+11  2.851e+11   1.469 0.144220
## L(train_data.Close.diff.ardl, 1:110)73  -2.404e+11  2.864e+11  -0.839 0.402773
## L(train_data.Close.diff.ardl, 1:110)74  -9.235e+10  2.882e+11  -0.320 0.749180
## L(train_data.Close.diff.ardl, 1:110)75   1.336e+10  2.890e+11   0.046 0.963185
## L(train_data.Close.diff.ardl, 1:110)76  -1.681e+11  2.866e+11  -0.587 0.558492
## L(train_data.Close.diff.ardl, 1:110)77  -6.560e+10  2.877e+11  -0.228 0.819967
## L(train_data.Close.diff.ardl, 1:110)78   1.011e+11  2.853e+11   0.354 0.723681
## L(train_data.Close.diff.ardl, 1:110)79  -1.256e+11  2.860e+11  -0.439 0.661232
## L(train_data.Close.diff.ardl, 1:110)80  -2.278e+11  2.850e+11  -0.799 0.425500
## L(train_data.Close.diff.ardl, 1:110)81  -1.863e+11  2.857e+11  -0.652 0.515551
## L(train_data.Close.diff.ardl, 1:110)82  -1.635e+11  2.859e+11  -0.572 0.568326
## L(train_data.Close.diff.ardl, 1:110)83  -1.376e+12  3.483e+11  -3.950 0.000126
## L(train_data.Close.diff.ardl, 1:110)84  -4.828e+11  2.957e+11  -1.633 0.104926
## L(train_data.Close.diff.ardl, 1:110)85   6.079e+10  3.000e+11   0.203 0.839705
## L(train_data.Close.diff.ardl, 1:110)86   3.801e+10  2.875e+11   0.132 0.895025
## L(train_data.Close.diff.ardl, 1:110)87   1.727e+10  2.887e+11   0.060 0.952383
## L(train_data.Close.diff.ardl, 1:110)88   1.028e+11  3.155e+11   0.326 0.745105
## L(train_data.Close.diff.ardl, 1:110)89  -2.298e+11  2.859e+11  -0.804 0.423049
## L(train_data.Close.diff.ardl, 1:110)90  -6.132e+10  2.833e+11  -0.216 0.828932
## L(train_data.Close.diff.ardl, 1:110)91  -8.693e+10  2.832e+11  -0.307 0.759361
## L(train_data.Close.diff.ardl, 1:110)92   1.575e+11  2.822e+11   0.558 0.577648
## L(train_data.Close.diff.ardl, 1:110)93   2.015e+11  2.829e+11   0.712 0.477404
## L(train_data.Close.diff.ardl, 1:110)94   6.543e+10  2.819e+11   0.232 0.816819
## L(train_data.Close.diff.ardl, 1:110)95   8.842e+10  2.845e+11   0.311 0.756451
## L(train_data.Close.diff.ardl, 1:110)96   2.833e+11  2.831e+11   1.000 0.318889
## L(train_data.Close.diff.ardl, 1:110)97   2.464e+11  2.844e+11   0.866 0.387950
## L(train_data.Close.diff.ardl, 1:110)98   2.116e+11  2.846e+11   0.744 0.458426
## L(train_data.Close.diff.ardl, 1:110)99   3.565e+10  2.832e+11   0.126 0.900016
## L(train_data.Close.diff.ardl, 1:110)100  2.561e+11  2.845e+11   0.900 0.369558
## L(train_data.Close.diff.ardl, 1:110)101  1.885e+11  2.855e+11   0.660 0.510286
## L(train_data.Close.diff.ardl, 1:110)102  3.838e+10  3.156e+11   0.122 0.903389
## L(train_data.Close.diff.ardl, 1:110)103  2.821e+10  2.837e+11   0.099 0.920938
## L(train_data.Close.diff.ardl, 1:110)104  2.596e+11  2.835e+11   0.916 0.361505
## L(train_data.Close.diff.ardl, 1:110)105  1.344e+11  2.830e+11   0.475 0.635600
## L(train_data.Close.diff.ardl, 1:110)106 -6.070e+10  2.847e+11  -0.213 0.831503
## L(train_data.Close.diff.ardl, 1:110)107 -2.314e+11  2.923e+11  -0.791 0.430104
## L(train_data.Close.diff.ardl, 1:110)108 -3.045e+11  2.826e+11  -1.077 0.283242
## L(train_data.Close.diff.ardl, 1:110)109 -1.599e+11  2.837e+11  -0.564 0.573917
## L(train_data.Close.diff.ardl, 1:110)110  1.436e+11  2.835e+11   0.506 0.613471
##                                            
## (Intercept)                             ***
## L(train_data.Turnover.ardl, 2)          .  
## L(train_data.Turnover.ardl, 61)            
## L(train_data.Turnover.ardl, 75)            
## L(train_data.Turnover.ardl, 117)           
## L(train_data.Close.diff.ardl, 1:110)1      
## L(train_data.Close.diff.ardl, 1:110)2      
## L(train_data.Close.diff.ardl, 1:110)3      
## L(train_data.Close.diff.ardl, 1:110)4      
## L(train_data.Close.diff.ardl, 1:110)5      
## L(train_data.Close.diff.ardl, 1:110)6      
## L(train_data.Close.diff.ardl, 1:110)7      
## L(train_data.Close.diff.ardl, 1:110)8      
## L(train_data.Close.diff.ardl, 1:110)9      
## L(train_data.Close.diff.ardl, 1:110)10     
## L(train_data.Close.diff.ardl, 1:110)11     
## L(train_data.Close.diff.ardl, 1:110)12     
## L(train_data.Close.diff.ardl, 1:110)13     
## L(train_data.Close.diff.ardl, 1:110)14     
## L(train_data.Close.diff.ardl, 1:110)15     
## L(train_data.Close.diff.ardl, 1:110)16     
## L(train_data.Close.diff.ardl, 1:110)17     
## L(train_data.Close.diff.ardl, 1:110)18     
## L(train_data.Close.diff.ardl, 1:110)19     
## L(train_data.Close.diff.ardl, 1:110)20     
## L(train_data.Close.diff.ardl, 1:110)21     
## L(train_data.Close.diff.ardl, 1:110)22     
## L(train_data.Close.diff.ardl, 1:110)23     
## L(train_data.Close.diff.ardl, 1:110)24     
## L(train_data.Close.diff.ardl, 1:110)25     
## L(train_data.Close.diff.ardl, 1:110)26     
## L(train_data.Close.diff.ardl, 1:110)27  ***
## L(train_data.Close.diff.ardl, 1:110)28     
## L(train_data.Close.diff.ardl, 1:110)29     
## L(train_data.Close.diff.ardl, 1:110)30     
## L(train_data.Close.diff.ardl, 1:110)31     
## L(train_data.Close.diff.ardl, 1:110)32     
## L(train_data.Close.diff.ardl, 1:110)33     
## L(train_data.Close.diff.ardl, 1:110)34     
## L(train_data.Close.diff.ardl, 1:110)35     
## L(train_data.Close.diff.ardl, 1:110)36     
## L(train_data.Close.diff.ardl, 1:110)37     
## L(train_data.Close.diff.ardl, 1:110)38     
## L(train_data.Close.diff.ardl, 1:110)39     
## L(train_data.Close.diff.ardl, 1:110)40     
## L(train_data.Close.diff.ardl, 1:110)41     
## L(train_data.Close.diff.ardl, 1:110)42     
## L(train_data.Close.diff.ardl, 1:110)43     
## L(train_data.Close.diff.ardl, 1:110)44     
## L(train_data.Close.diff.ardl, 1:110)45     
## L(train_data.Close.diff.ardl, 1:110)46     
## L(train_data.Close.diff.ardl, 1:110)47     
## L(train_data.Close.diff.ardl, 1:110)48     
## L(train_data.Close.diff.ardl, 1:110)49     
## L(train_data.Close.diff.ardl, 1:110)50     
## L(train_data.Close.diff.ardl, 1:110)51     
## L(train_data.Close.diff.ardl, 1:110)52     
## L(train_data.Close.diff.ardl, 1:110)53     
## L(train_data.Close.diff.ardl, 1:110)54     
## L(train_data.Close.diff.ardl, 1:110)55     
## L(train_data.Close.diff.ardl, 1:110)56     
## L(train_data.Close.diff.ardl, 1:110)57     
## L(train_data.Close.diff.ardl, 1:110)58     
## L(train_data.Close.diff.ardl, 1:110)59     
## L(train_data.Close.diff.ardl, 1:110)60     
## L(train_data.Close.diff.ardl, 1:110)61     
## L(train_data.Close.diff.ardl, 1:110)62     
## L(train_data.Close.diff.ardl, 1:110)63     
## L(train_data.Close.diff.ardl, 1:110)64     
## L(train_data.Close.diff.ardl, 1:110)65     
## L(train_data.Close.diff.ardl, 1:110)66     
## L(train_data.Close.diff.ardl, 1:110)67     
## L(train_data.Close.diff.ardl, 1:110)68     
## L(train_data.Close.diff.ardl, 1:110)69     
## L(train_data.Close.diff.ardl, 1:110)70     
## L(train_data.Close.diff.ardl, 1:110)71     
## L(train_data.Close.diff.ardl, 1:110)72     
## L(train_data.Close.diff.ardl, 1:110)73     
## L(train_data.Close.diff.ardl, 1:110)74     
## L(train_data.Close.diff.ardl, 1:110)75     
## L(train_data.Close.diff.ardl, 1:110)76     
## L(train_data.Close.diff.ardl, 1:110)77     
## L(train_data.Close.diff.ardl, 1:110)78     
## L(train_data.Close.diff.ardl, 1:110)79     
## L(train_data.Close.diff.ardl, 1:110)80     
## L(train_data.Close.diff.ardl, 1:110)81     
## L(train_data.Close.diff.ardl, 1:110)82     
## L(train_data.Close.diff.ardl, 1:110)83  ***
## L(train_data.Close.diff.ardl, 1:110)84     
## L(train_data.Close.diff.ardl, 1:110)85     
## L(train_data.Close.diff.ardl, 1:110)86     
## L(train_data.Close.diff.ardl, 1:110)87     
## L(train_data.Close.diff.ardl, 1:110)88     
## L(train_data.Close.diff.ardl, 1:110)89     
## L(train_data.Close.diff.ardl, 1:110)90     
## L(train_data.Close.diff.ardl, 1:110)91     
## L(train_data.Close.diff.ardl, 1:110)92     
## L(train_data.Close.diff.ardl, 1:110)93     
## L(train_data.Close.diff.ardl, 1:110)94     
## L(train_data.Close.diff.ardl, 1:110)95     
## L(train_data.Close.diff.ardl, 1:110)96     
## L(train_data.Close.diff.ardl, 1:110)97     
## L(train_data.Close.diff.ardl, 1:110)98     
## L(train_data.Close.diff.ardl, 1:110)99     
## L(train_data.Close.diff.ardl, 1:110)100    
## L(train_data.Close.diff.ardl, 1:110)101    
## L(train_data.Close.diff.ardl, 1:110)102    
## L(train_data.Close.diff.ardl, 1:110)103    
## L(train_data.Close.diff.ardl, 1:110)104    
## L(train_data.Close.diff.ardl, 1:110)105    
## L(train_data.Close.diff.ardl, 1:110)106    
## L(train_data.Close.diff.ardl, 1:110)107    
## L(train_data.Close.diff.ardl, 1:110)108    
## L(train_data.Close.diff.ardl, 1:110)109    
## L(train_data.Close.diff.ardl, 1:110)110    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.81e+14 on 133 degrees of freedom
## Multiple R-squared:  0.4152, Adjusted R-squared:  -0.08608 
## F-statistic: 0.8283 on 114 and 133 DF,  p-value: 0.8494
Turnover.Close.testing.4 <- predict(Turnover.Close.training.4, n.ahead = length(test_data.Turnover.ardl, test_data.Close.diff.ardl))
head(Turnover.Close.testing.4)
##    2015(118)    2015(119)    2015(120)    2015(121)    2015(122)    2015(123) 
## 3.024653e+14 3.231393e+14 4.290379e+14 2.608829e+14 2.236482e+14 2.309187e+14
Turnover.Close.fitted_training.4 <- fitted(Turnover.Close.training.4)
head(Turnover.Close.fitted_training.4)
## Time Series:
## Start = c(2015, 118) 
## End = c(2015, 123) 
## Frequency = 365 
## [1] 3.024653e+14 3.231393e+14 4.290379e+14 2.608829e+14 2.236482e+14
## [6] 2.309187e+14
Turnover.Close.4.training.mse_value <- mse(train_data.Turnover.ardl, Turnover.Close.fitted_training.4)
Turnover.Close.4.training.rmse_value <- rmse(train_data.Turnover.ardl, Turnover.Close.fitted_training.4)

Turnover.testing.n.4 = as.numeric(Turnover.Close.testing.4)

Turnover.Close.4.testing.mse_value <- mse(test_data.Turnover.ardl, Turnover.testing.n.4)
Turnover.Close.4.testing.rmse_value <- rmse(test_data.Turnover.ardl, Turnover.testing.n.4)

cat("Training Model MSE:", Turnover.Close.4.training.mse_value, "\n Training Model RMSE:", Turnover.Close.4.training.rmse_value , "\n Testing Model MSE:", Turnover.Close.4.testing.mse_value, "\n Testing Model RMSE:", Turnover.Close.4.testing.rmse_value , "\n")
## Training Model MSE: 4.234901e+28 
##  Training Model RMSE: 2.057888e+14 
##  Testing Model MSE: 1.050948e+29 
##  Testing Model RMSE: 3.241834e+14
cat(" Training Model AIC:", AIC(Turnover.Close.training.4), "\n Training Model BIC:", BIC(Turnover.Close.training.4), "\n")
##  Training Model AIC: 17282.9 
##  Training Model BIC: 17690.46

The R-squared of this training model is 0.4152, relatively better compared to that of the other models. A decent percent of the model seems to be explained by stock closing price. The AIC model seems to be lower than the BIC model, thus it might be better compared to BIC model. However, both the training model and the testing model result in high MSE and RMSE values suggesting a bad fit.

Turnover and Open

Size

train_size.Turnover.ardl <- floor (2/3 * length(Turnover.ts))
train_size.Open.diff.ardl <- floor (2/3 * length(Open.ts.diff))

Data

train_data.Turnover.ardl <- Turnover.ts[1:train_size.Turnover.ardl]
train_data.Turnover.ardl = ts(train_data.Turnover.ardl,
                            start=c(2015,1),
                            end=c(2015,365),
                            frequency=365)
train_data.Open.diff.ardl <- Open.ts.diff[1:train_size.Open.diff.ardl]
train_data.Open.diff.ardl = ts(train_data.Open.diff.ardl,
                               start=c(2015,1),
                               end=c(2015,365),
                               frequency=365)

Test

test_data.Turnover.ardl <- Turnover.ts[(train_size.Turnover.ardl + 1):length(Turnover.ts)] 
test_data.Turnover.ardl = ts(test_data.Turnover.ardl, start=c(2015,1), end=c(2015,365), frequency=365)

test_data.Open.diff.ardl <- Open.ts.diff[(train_size.Open.diff.ardl + 1):length(Open.ts.diff)] 
test_data.Open.diff.ardl = ts(test_data.Open.diff.ardl, start=c(2015,1), end=c(2015,365), frequency=365)

length(train_data.Turnover.ardl)  
## [1] 365
length(test_data.Open.diff.ardl)
## [1] 365

Training and Testing for Turnover with lag (1:4) and Close with lag (110)

Turnover.open.training.1 <- dynlm(train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 1:4) + L(train_data.Open.diff.ardl, 110))
summary(Turnover.open.training.1)
## 
## Time series regression with "ts" data:
## Start = 2015(111), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 
##     1:4) + L(train_data.Open.diff.ardl, 110))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.836e+14 -1.171e+14 -4.466e+13  5.824e+13  1.779e+15 
## 
## Coefficients:
##                                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        2.420e+14  4.189e+13   5.777 2.27e-08 ***
## L(train_data.Turnover.ardl, 1:4)1  3.317e-01  6.312e-02   5.256 3.16e-07 ***
## L(train_data.Turnover.ardl, 1:4)2  3.215e-02  6.654e-02   0.483    0.629    
## L(train_data.Turnover.ardl, 1:4)3 -2.656e-02  6.649e-02  -0.400    0.690    
## L(train_data.Turnover.ardl, 1:4)4  8.819e-02  6.312e-02   1.397    0.164    
## L(train_data.Open.diff.ardl, 110)  7.830e+10  2.278e+11   0.344    0.731    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.521e+14 on 249 degrees of freedom
## Multiple R-squared:  0.1264, Adjusted R-squared:  0.1089 
## F-statistic: 7.205 on 5 and 249 DF,  p-value: 2.554e-06
Turnover.open.testing.1 <- predict(Turnover.open.training.1, n.ahead = length(test_data.Turnover.ardl, test_data.Open.diff.ardl))
head(Turnover.open.testing.1)
##    2015(111)    2015(112)    2015(113)    2015(114)    2015(115)    2015(116) 
## 4.235781e+14 4.473081e+14 3.574453e+14 3.632945e+14 3.949272e+14 3.255934e+14
Turnover.open.fitted_training.1 <- fitted(Turnover.open.training.1)
head(Turnover.open.fitted_training.1)
## Time Series:
## Start = c(2015, 111) 
## End = c(2015, 116) 
## Frequency = 365 
## [1] 4.235781e+14 4.473081e+14 3.574453e+14 3.632945e+14 3.949272e+14
## [6] 3.255934e+14
Turnover.open.1.training.mse_value <- mse(train_data.Turnover.ardl, Turnover.open.fitted_training.1)
Turnover.open.1.training.rmse_value <- rmse(train_data.Turnover.ardl, Turnover.open.fitted_training.1)


Turnover.testing.n.1 = as.numeric(Turnover.open.testing.1)

Turnover.open.1.testing.mse_value <- mse(test_data.Turnover.ardl, Turnover.testing.n.1)
Turnover.open.1.testing.rmse_value <- rmse(test_data.Turnover.ardl, Turnover.testing.n.1)

cat("Training Model MSE:", Turnover.open.1.training.mse_value, "\n Training Model RMSE:", Turnover.open.1.training.rmse_value , "\n Testing Model MSE:", Turnover.open.1.testing.mse_value, "\n Testing Model RMSE:", Turnover.open.1.testing.rmse_value , "\n")
## Training Model MSE: 6.206145e+28 
##  Training Model RMSE: 2.491214e+14 
##  Testing Model MSE: 9.034831e+28 
##  Testing Model RMSE: 3.0058e+14
cat(" Training Model AIC:", AIC(Turnover.open.training.1), "\n Training Model BIC:", BIC(Turnover.open.training.1), "\n")
##  Training Model AIC: 17643.63 
##  Training Model BIC: 17668.42

For the ARDL model with Turnover with lag (1:4) and Close with lag (110), the training model has a R-squared value of 0.1264, a relatively low value. The closing price might not have much explanation for the model. And the MSE and RMSE of the training and testing models are also very high, again suggesting a bad fit. The AIC of this model is only slightly lower than the BIC, so it is not that much better than BIC.

Training and Testing for Turnover with lag (1:4) and Close with lag (35)n(110)

Turnover.open.training.2 <- dynlm(train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 1:4) + L(train_data.Open.diff.ardl, 110))
summary(Turnover.open.training.2)
## 
## Time series regression with "ts" data:
## Start = 2015(111), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 
##     1:4) + L(train_data.Open.diff.ardl, 110))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -3.836e+14 -1.171e+14 -4.466e+13  5.824e+13  1.779e+15 
## 
## Coefficients:
##                                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        2.420e+14  4.189e+13   5.777 2.27e-08 ***
## L(train_data.Turnover.ardl, 1:4)1  3.317e-01  6.312e-02   5.256 3.16e-07 ***
## L(train_data.Turnover.ardl, 1:4)2  3.215e-02  6.654e-02   0.483    0.629    
## L(train_data.Turnover.ardl, 1:4)3 -2.656e-02  6.649e-02  -0.400    0.690    
## L(train_data.Turnover.ardl, 1:4)4  8.819e-02  6.312e-02   1.397    0.164    
## L(train_data.Open.diff.ardl, 110)  7.830e+10  2.278e+11   0.344    0.731    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.521e+14 on 249 degrees of freedom
## Multiple R-squared:  0.1264, Adjusted R-squared:  0.1089 
## F-statistic: 7.205 on 5 and 249 DF,  p-value: 2.554e-06
Turnover.open.testing.2 <- predict(Turnover.open.training.2, n.ahead = length(test_data.Turnover.ardl, test_data.Open.diff.ardl))
head(Turnover.open.testing.2)
##    2015(111)    2015(112)    2015(113)    2015(114)    2015(115)    2015(116) 
## 4.235781e+14 4.473081e+14 3.574453e+14 3.632945e+14 3.949272e+14 3.255934e+14
Turnover.open.fitted_training.2 <- fitted(Turnover.open.training.2)
head(Turnover.open.fitted_training.2)
## Time Series:
## Start = c(2015, 111) 
## End = c(2015, 116) 
## Frequency = 365 
## [1] 4.235781e+14 4.473081e+14 3.574453e+14 3.632945e+14 3.949272e+14
## [6] 3.255934e+14
Turnover.open.2.training.mse_value <- mse(train_data.Turnover.ardl, Turnover.open.fitted_training.2)
Turnover.open.2.training.rmse_value <- rmse(train_data.Turnover.ardl, Turnover.open.fitted_training.2)

Turnover.testing.n.2 = as.numeric(Turnover.open.testing.2)

Turnover.open.2.testing.mse_value <- mse(test_data.Turnover.ardl, Turnover.testing.n.2)
Turnover.open.2.testing.rmse_value <- rmse(test_data.Turnover.ardl, Turnover.testing.n.2)

cat("Training Model MSE:", Turnover.open.2.training.mse_value, "\n Training Model RMSE:", Turnover.open.2.training.rmse_value , "\n Testing Model MSE:", Turnover.open.2.testing.mse_value, "\n Testing Model RMSE:", Turnover.open.2.testing.rmse_value , "\n")
## Training Model MSE: 6.206145e+28 
##  Training Model RMSE: 2.491214e+14 
##  Testing Model MSE: 9.034831e+28 
##  Testing Model RMSE: 3.0058e+14
cat(" Training Model AIC:", AIC(Turnover.open.training.2), "\n Training Model BIC:", BIC(Turnover.open.training.2), "\n")
##  Training Model AIC: 17643.63 
##  Training Model BIC: 17668.42

The R-squared value of this training model is not much different from the previous one, suggesting a similarly unfit model. Its AIC and BIC are also of similar values, with AIC being slightly lower than BIC. The MSE and RMSE of both the training and the testing models are also relatively high, so we can concluded that the ARDL model with Turnover with lag (1:4) and Close with lag 35 and lag 110 is a not a good fit.

Training and Testing for Turnover with lag (2)n(61)n(75)n(117) and Close with lag (110)

Turnover.open.training.3 <- dynlm(train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 2) + L(train_data.Turnover.ardl, 61) + L(train_data.Turnover.ardl, 75) + L(train_data.Turnover.ardl, 117) + L(train_data.Open.diff.ardl, 110), data = infy_stock)
summary(Turnover.open.training.3)
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 
##     2) + L(train_data.Turnover.ardl, 61) + L(train_data.Turnover.ardl, 
##     75) + L(train_data.Turnover.ardl, 117) + L(train_data.Open.diff.ardl, 
##     110), data = infy_stock)
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -4.278e+14 -1.336e+14 -4.820e+13  7.673e+13  1.888e+15 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       2.591e+14  5.491e+13   4.718 4.03e-06 ***
## L(train_data.Turnover.ardl, 2)    1.465e-01  6.262e-02   2.339   0.0201 *  
## L(train_data.Turnover.ardl, 61)   1.460e-01  6.453e-02   2.263   0.0245 *  
## L(train_data.Turnover.ardl, 75)   1.275e-02  6.269e-02   0.203   0.8390    
## L(train_data.Turnover.ardl, 117)  8.398e-02  6.481e-02   1.296   0.1963    
## L(train_data.Open.diff.ardl, 110) 5.634e+10  2.409e+11   0.234   0.8153    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.646e+14 on 242 degrees of freedom
## Multiple R-squared:  0.05664,    Adjusted R-squared:  0.03715 
## F-statistic: 2.906 on 5 and 242 DF,  p-value: 0.01441
Turnover.open.testing.3 <- predict(Turnover.open.training.3, n.ahead = length(test_data.Turnover.ardl, test_data.Open.diff.ardl))
head(Turnover.open.testing.3)
##    2015(118)    2015(119)    2015(120)    2015(121)    2015(122)    2015(123) 
## 3.753256e+14 3.824230e+14 4.821168e+14 4.380066e+14 3.810161e+14 4.235079e+14
Turnover.open.fitted_training.3 <- fitted(Turnover.open.training.3)
head(Turnover.open.fitted_training.3)
## Time Series:
## Start = c(2015, 118) 
## End = c(2015, 123) 
## Frequency = 365 
## [1] 3.753256e+14 3.824230e+14 4.821168e+14 4.380066e+14 3.810161e+14
## [6] 4.235079e+14
Turnover.open.3.training.mse_value <- mse(train_data.Turnover.ardl, Turnover.open.fitted_training.3)
Turnover.open.3.training.rmse_value <- rmse(train_data.Turnover.ardl, Turnover.open.fitted_training.3)


Turnover.testing.n.3 = as.numeric(Turnover.open.testing.3)

Turnover.open.3.testing.mse_value <- mse(test_data.Turnover.ardl, Turnover.testing.n.3)
Turnover.open.3.testing.rmse_value <- rmse(test_data.Turnover.ardl, Turnover.testing.n.3)

cat("Training Model MSE:", Turnover.open.3.training.mse_value, "\n Training Model RMSE:", Turnover.open.3.training.rmse_value , "\n Testing Model MSE:", Turnover.open.3.testing.mse_value, "\n Testing Model RMSE:", Turnover.open.3.testing.rmse_value , "\n")
## Training Model MSE: 6.831351e+28 
##  Training Model RMSE: 2.613685e+14 
##  Testing Model MSE: 7.528142e+28 
##  Testing Model RMSE: 2.743746e+14
cat(" Training Model AIC:", AIC(Turnover.open.training.3), "\n Training Model BIC:", BIC(Turnover.open.training.3), "\n")
##  Training Model AIC: 17183.48 
##  Training Model BIC: 17208.08

Looking at the high value of MSE and RMSE of the training and testing models, they are suggesting a bad fit. The R-squared value of 0.05664 also supports this sentiment. The AIC and BIC are though lower than those of other ARDL model, with the AIC model having a slightly smaller value than the BIC model.

Training and Testing for Turnover with lag (2)n(61)n(75)n(117) and Close with lag (35)n(110)

Turnover.open.training.4 <- dynlm(train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 2) + L(train_data.Turnover.ardl, 61) + L(train_data.Turnover.ardl, 75) + L(train_data.Turnover.ardl, 117) + L(train_data.Open.diff.ardl, 35) + L(train_data.Open.diff.ardl, 110))
summary(Turnover.open.training.4) 
## 
## Time series regression with "ts" data:
## Start = 2015(118), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Turnover.ardl ~ L(train_data.Turnover.ardl, 
##     2) + L(train_data.Turnover.ardl, 61) + L(train_data.Turnover.ardl, 
##     75) + L(train_data.Turnover.ardl, 117) + L(train_data.Open.diff.ardl, 
##     35) + L(train_data.Open.diff.ardl, 110))
## 
## Residuals:
##        Min         1Q     Median         3Q        Max 
## -4.253e+14 -1.379e+14 -4.640e+13  7.651e+13  1.886e+15 
## 
## Coefficients:
##                                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        2.571e+14  5.502e+13   4.673 4.95e-06 ***
## L(train_data.Turnover.ardl, 2)     1.469e-01  6.267e-02   2.344   0.0199 *  
## L(train_data.Turnover.ardl, 61)    1.460e-01  6.458e-02   2.261   0.0247 *  
## L(train_data.Turnover.ardl, 75)    1.198e-02  6.275e-02   0.191   0.8488    
## L(train_data.Turnover.ardl, 117)   8.736e-02  6.501e-02   1.344   0.1803    
## L(train_data.Open.diff.ardl, 35)  -1.866e+11  2.408e+11  -0.775   0.4393    
## L(train_data.Open.diff.ardl, 110)  5.331e+10  2.411e+11   0.221   0.8252    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.648e+14 on 241 degrees of freedom
## Multiple R-squared:  0.05898,    Adjusted R-squared:  0.03555 
## F-statistic: 2.518 on 6 and 241 DF,  p-value: 0.02211
Turnover.open.testing.4 <- predict(Turnover.open.training.4, n.ahead = length(test_data.Turnover.ardl, test_data.Open.diff.ardl))
head(Turnover.open.testing.4)
##    2015(118)    2015(119)    2015(120)    2015(121)    2015(122)    2015(123) 
## 3.782094e+14 3.914244e+14 4.748761e+14 4.360750e+14 3.748475e+14 4.314554e+14
Turnover.open.fitted_training.4 <- fitted(Turnover.open.training.4)
head(Turnover.open.fitted_training.4)
## Time Series:
## Start = c(2015, 118) 
## End = c(2015, 123) 
## Frequency = 365 
## [1] 3.782094e+14 3.914244e+14 4.748761e+14 4.360750e+14 3.748475e+14
## [6] 4.314554e+14
Turnover.open.4.training.mse_value <- mse(train_data.Turnover.ardl, Turnover.open.fitted_training.4)
Turnover.open.4.training.rmse_value <- rmse(train_data.Turnover.ardl, Turnover.open.fitted_training.4)

Turnover.testing.n.4 = as.numeric(Turnover.open.testing.4)

Turnover.open.4.testing.mse_value <- mse(test_data.Turnover.ardl, Turnover.testing.n.4)
Turnover.open.4.testing.rmse_value <- rmse(test_data.Turnover.ardl, Turnover.testing.n.4)

cat("Training Model MSE:", Turnover.open.4.training.mse_value, "\n Training Model RMSE:", Turnover.open.4.training.rmse_value , "\n Testing Model MSE:", Turnover.open.4.testing.mse_value, "\n Testing Model RMSE:", Turnover.open.4.testing.rmse_value , "\n")
## Training Model MSE: 6.814379e+28 
##  Training Model RMSE: 2.610437e+14 
##  Testing Model MSE: 7.544455e+28 
##  Testing Model RMSE: 2.746717e+14
cat(" Training Model AIC:", AIC(Turnover.open.training.4), "\n Training Model BIC:", BIC(Turnover.open.training.4), "\n")
##  Training Model AIC: 17184.87 
##  Training Model BIC: 17212.97

This last ARDL model for turnover is also observed to be not a good fit. The R-squared value of 0.05898, and the relatively high values of MSE and RMSE of both the training and the testing model supports this conclusion. The AIC and BIC of this model are not much different from the previous one too, with AIC being lower than BIC.

Volume and Close

Size

train_size.Volume.ardl <- floor (2/3 * length(Volume.ts))
train_size.Close.diff.ardl <- floor (2/3 * length(Close.ts.diff))

Data

train_data.Volume.ardl <- Volume.ts[1:train_size.Volume.ardl]
train_data.Volume.ardl = ts(train_data.Volume.ardl,
                            start=c(2015,1),
                            end=c(2015,365),
                            frequency=365)
train_data.Close.diff.ardl <- Close.ts.diff[1:train_size.Close.diff.ardl]
train_data.Close.diff.ardl = ts(train_data.Close.diff.ardl,
                               start=c(2015,1),
                               end=c(2015,365),
                               frequency=365)

Test

test_data.Volume.ardl <- Volume.ts[(train_size.Volume.ardl + 1):length(Volume.ts)] 
test_data.Volume.ardl = ts(test_data.Volume.ardl, start=c(2015,1), end=c(2015,365), frequency=365)

test_data.Close.diff.ardl <- Close.ts.diff[(train_size.Close.diff.ardl + 1):length(Close.ts.diff)] 
test_data.Close.diff.ardl = ts(test_data.Close.diff.ardl, start=c(2015,1), end=c(2015,365), frequency=365)

length(train_data.Volume.ardl)  
## [1] 365
length(test_data.Close.diff.ardl)
## [1] 365

Testing and Training for Volume with lag (1:32) and Close lag (110)

Volume.Close.training.1 <- dynlm(train_data.Volume.ardl ~ L(train_data.Volume.ardl, 1:32) + L(train_data.Close.diff.ardl, 110))
summary(Volume.Close.training.1)
## 
## Time series regression with "ts" data:
## Start = 2015(111), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Volume.ardl ~ L(train_data.Volume.ardl, 
##     1:32) + L(train_data.Close.diff.ardl, 110))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2243794  -859961  -208859   410699 16614502 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                         5.634e+05  3.911e+05   1.440    0.151    
## L(train_data.Volume.ardl, 1:32)1    3.213e-01  6.714e-02   4.786 3.11e-06 ***
## L(train_data.Volume.ardl, 1:32)2    6.593e-02  7.066e-02   0.933    0.352    
## L(train_data.Volume.ardl, 1:32)3   -4.245e-02  7.065e-02  -0.601    0.549    
## L(train_data.Volume.ardl, 1:32)4    1.058e-01  7.054e-02   1.500    0.135    
## L(train_data.Volume.ardl, 1:32)5   -6.789e-04  7.052e-02  -0.010    0.992    
## L(train_data.Volume.ardl, 1:32)6    4.269e-02  7.055e-02   0.605    0.546    
## L(train_data.Volume.ardl, 1:32)7    9.498e-02  7.051e-02   1.347    0.179    
## L(train_data.Volume.ardl, 1:32)8   -3.525e-03  7.091e-02  -0.050    0.960    
## L(train_data.Volume.ardl, 1:32)9   -3.928e-04  7.033e-02  -0.006    0.996    
## L(train_data.Volume.ardl, 1:32)10   5.399e-02  6.966e-02   0.775    0.439    
## L(train_data.Volume.ardl, 1:32)11  -5.194e-02  6.975e-02  -0.745    0.457    
## L(train_data.Volume.ardl, 1:32)12   1.638e-02  6.983e-02   0.235    0.815    
## L(train_data.Volume.ardl, 1:32)13  -2.872e-02  6.974e-02  -0.412    0.681    
## L(train_data.Volume.ardl, 1:32)14  -2.790e-02  6.975e-02  -0.400    0.690    
## L(train_data.Volume.ardl, 1:32)15   4.999e-02  6.977e-02   0.717    0.474    
## L(train_data.Volume.ardl, 1:32)16  -4.025e-02  6.983e-02  -0.576    0.565    
## L(train_data.Volume.ardl, 1:32)17  -6.026e-03  6.979e-02  -0.086    0.931    
## L(train_data.Volume.ardl, 1:32)18   1.925e-02  6.973e-02   0.276    0.783    
## L(train_data.Volume.ardl, 1:32)19  -2.659e-02  6.971e-02  -0.382    0.703    
## L(train_data.Volume.ardl, 1:32)20   3.286e-02  6.980e-02   0.471    0.638    
## L(train_data.Volume.ardl, 1:32)21  -3.366e-02  6.983e-02  -0.482    0.630    
## L(train_data.Volume.ardl, 1:32)22   4.264e-04  7.007e-02   0.006    0.995    
## L(train_data.Volume.ardl, 1:32)23   1.993e-02  6.999e-02   0.285    0.776    
## L(train_data.Volume.ardl, 1:32)24   1.580e-01  7.004e-02   2.256    0.025 *  
## L(train_data.Volume.ardl, 1:32)25  -1.511e-02  7.080e-02  -0.213    0.831    
## L(train_data.Volume.ardl, 1:32)26   4.845e-02  7.047e-02   0.687    0.492    
## L(train_data.Volume.ardl, 1:32)27   1.936e-02  7.484e-02   0.259    0.796    
## L(train_data.Volume.ardl, 1:32)28  -1.139e-01  7.055e-02  -1.615    0.108    
## L(train_data.Volume.ardl, 1:32)29   7.090e-02  7.063e-02   1.004    0.317    
## L(train_data.Volume.ardl, 1:32)30   1.127e-02  7.100e-02   0.159    0.874    
## L(train_data.Volume.ardl, 1:32)31   2.085e-02  7.057e-02   0.295    0.768    
## L(train_data.Volume.ardl, 1:32)32   5.764e-02  6.718e-02   0.858    0.392    
## L(train_data.Close.diff.ardl, 110)  6.742e+02  1.874e+03   0.360    0.719    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1837000 on 221 degrees of freedom
## Multiple R-squared:  0.2737, Adjusted R-squared:  0.1652 
## F-statistic: 2.523 on 33 and 221 DF,  p-value: 3.628e-05
Volume.Close.testing.1 <- predict(Volume.Close.training.1, n.ahead = length(test_data.Volume.ardl, test_data.Close.diff.ardl))
head(Volume.Close.testing.1)
## 2015(111) 2015(112) 2015(113) 2015(114) 2015(115) 2015(116) 
##   2324120   2136256   2417843   2347545   2609755   2266470
Volume.Close.fitted_training.1 <- fitted(Volume.Close.training.1)
head(Volume.Close.fitted_training.1)
## Time Series:
## Start = c(2015, 111) 
## End = c(2015, 116) 
## Frequency = 365 
## [1] 2324120 2136256 2417843 2347545 2609755 2266470
Volume.Close.1.training.mse_value <- mse(train_data.Volume.ardl, Volume.Close.fitted_training.1)
Volume.Close.1.training.rmse_value <- rmse(train_data.Volume.ardl, Volume.Close.fitted_training.1)

Volume.testing.n.1 = as.numeric(Volume.Close.testing.1)


Volume.Close.1.testing.mse_value <- mse(test_data.Volume.ardl, Volume.testing.n.1)
Volume.Close.1.testing.rmse_value <- rmse(test_data.Volume.ardl, Volume.testing.n.1)

cat("Training Model MSE:", Volume.Close.1.training.mse_value, "\n Training Model RMSE:", Volume.Close.1.training.rmse_value , "\n Testing Model MSE:", Volume.Close.1.testing.mse_value, "\n Testing Model RMSE:", Volume.Close.1.testing.rmse_value , "\n")
## Training Model MSE: 2.92334e+12 
##  Training Model RMSE: 1709778 
##  Testing Model MSE: 4.253261e+12 
##  Testing Model RMSE: 2062344
cat(" Training Model AIC:", AIC(Volume.Close.training.1), "\n Training Model BIC:", BIC(Volume.Close.training.1), "\n")
##  Training Model AIC: 8113.114 
##  Training Model BIC: 8237.059

The R-squared value of this training model is 0.2737. Not a high enough value to suggest that a good percent of this model can be explained by the independent variable. The MSE and RMSE values are also extremely high for both the training and the testing models. However, it has AIC of 8113.114 and BIC of 8237.059, the lowest out of all the ARDL models so far. The AIC model results in lower value than BIC model, suggesting a better fit. However, the low R-squared value and the high MSE and RMSE values still point to a not well fit model.

Testing and Training for Volume with lag (1:32) and Close lag (1:110)

Volume.Close.training.2 <- dynlm(train_data.Volume.ardl ~ L(train_data.Volume.ardl, 1:32) + L(train_data.Close.diff.ardl, 1:110), data = infy_stock)
summary(Volume.Close.training.2)
## 
## Time series regression with "ts" data:
## Start = 2015(111), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Volume.ardl ~ L(train_data.Volume.ardl, 
##     1:32) + L(train_data.Close.diff.ardl, 1:110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2643542  -453755   -44404   325441  7176538 
## 
## Coefficients:
##                                           Estimate Std. Error t value Pr(>|t|)
## (Intercept)                              9.845e+05  6.564e+05   1.500 0.136479
## L(train_data.Volume.ardl, 1:32)1         3.288e-01  9.298e-02   3.537 0.000591
## L(train_data.Volume.ardl, 1:32)2         5.529e-02  9.839e-02   0.562 0.575273
## L(train_data.Volume.ardl, 1:32)3        -2.603e-02  9.650e-02  -0.270 0.787874
## L(train_data.Volume.ardl, 1:32)4         1.201e-01  9.633e-02   1.246 0.215253
## L(train_data.Volume.ardl, 1:32)5        -4.472e-02  9.696e-02  -0.461 0.645513
## L(train_data.Volume.ardl, 1:32)6        -9.591e-02  9.646e-02  -0.994 0.322220
## L(train_data.Volume.ardl, 1:32)7         1.167e-01  9.601e-02   1.216 0.226707
## L(train_data.Volume.ardl, 1:32)8        -6.744e-02  9.703e-02  -0.695 0.488454
## L(train_data.Volume.ardl, 1:32)9         4.914e-02  9.647e-02   0.509 0.611459
## L(train_data.Volume.ardl, 1:32)10        2.459e-02  9.705e-02   0.253 0.800464
## L(train_data.Volume.ardl, 1:32)11        1.288e-02  9.737e-02   0.132 0.895019
## L(train_data.Volume.ardl, 1:32)12        9.877e-02  9.553e-02   1.034 0.303361
## L(train_data.Volume.ardl, 1:32)13       -6.219e-04  9.580e-02  -0.006 0.994832
## L(train_data.Volume.ardl, 1:32)14       -2.204e-03  9.571e-02  -0.023 0.981671
## L(train_data.Volume.ardl, 1:32)15        5.302e-02  9.539e-02   0.556 0.579474
## L(train_data.Volume.ardl, 1:32)16       -1.096e-01  9.525e-02  -1.151 0.252195
## L(train_data.Volume.ardl, 1:32)17       -3.885e-02  9.554e-02  -0.407 0.685015
## L(train_data.Volume.ardl, 1:32)18        1.066e-01  9.544e-02   1.117 0.266212
## L(train_data.Volume.ardl, 1:32)19       -5.254e-02  9.588e-02  -0.548 0.584791
## L(train_data.Volume.ardl, 1:32)20        2.381e-02  9.570e-02   0.249 0.803945
## L(train_data.Volume.ardl, 1:32)21       -8.342e-02  9.536e-02  -0.875 0.383601
## L(train_data.Volume.ardl, 1:32)22       -6.954e-02  9.564e-02  -0.727 0.468678
## L(train_data.Volume.ardl, 1:32)23       -9.116e-03  9.640e-02  -0.095 0.924835
## L(train_data.Volume.ardl, 1:32)24        2.173e-01  9.654e-02   2.250 0.026371
## L(train_data.Volume.ardl, 1:32)25       -1.916e-01  9.825e-02  -1.950 0.053684
## L(train_data.Volume.ardl, 1:32)26        1.220e-01  9.863e-02   1.237 0.218676
## L(train_data.Volume.ardl, 1:32)27       -7.113e-02  9.898e-02  -0.719 0.473865
## L(train_data.Volume.ardl, 1:32)28       -5.399e-02  8.739e-02  -0.618 0.537958
## L(train_data.Volume.ardl, 1:32)29       -1.435e-02  8.588e-02  -0.167 0.867607
## L(train_data.Volume.ardl, 1:32)30        5.938e-02  8.652e-02   0.686 0.493903
## L(train_data.Volume.ardl, 1:32)31       -3.617e-02  8.682e-02  -0.417 0.677750
## L(train_data.Volume.ardl, 1:32)32        1.641e-01  8.057e-02   2.037 0.044001
## L(train_data.Close.diff.ardl, 1:110)1   -4.702e+02  1.250e+03  -0.376 0.707505
## L(train_data.Close.diff.ardl, 1:110)2   -1.014e+03  1.249e+03  -0.812 0.418481
## L(train_data.Close.diff.ardl, 1:110)3    6.938e+02  1.250e+03   0.555 0.579908
## L(train_data.Close.diff.ardl, 1:110)4   -6.864e+02  1.249e+03  -0.550 0.583698
## L(train_data.Close.diff.ardl, 1:110)5   -3.784e+01  1.249e+03  -0.030 0.975888
## L(train_data.Close.diff.ardl, 1:110)6   -2.044e+03  1.241e+03  -1.646 0.102484
## L(train_data.Close.diff.ardl, 1:110)7   -1.321e+03  1.253e+03  -1.055 0.293893
## L(train_data.Close.diff.ardl, 1:110)8   -8.086e+02  1.256e+03  -0.644 0.521170
## L(train_data.Close.diff.ardl, 1:110)9   -3.992e+02  1.255e+03  -0.318 0.751033
## L(train_data.Close.diff.ardl, 1:110)10  -1.503e+02  1.253e+03  -0.120 0.904743
## L(train_data.Close.diff.ardl, 1:110)11  -3.898e+02  1.247e+03  -0.313 0.755196
## L(train_data.Close.diff.ardl, 1:110)12  -9.358e+02  1.243e+03  -0.753 0.453245
## L(train_data.Close.diff.ardl, 1:110)13  -1.923e+01  1.594e+03  -0.012 0.990397
## L(train_data.Close.diff.ardl, 1:110)14   2.498e+03  1.607e+03   1.555 0.122726
## L(train_data.Close.diff.ardl, 1:110)15   1.714e+03  1.622e+03   1.057 0.292844
## L(train_data.Close.diff.ardl, 1:110)16   4.548e+01  1.624e+03   0.028 0.977712
## L(train_data.Close.diff.ardl, 1:110)17   3.234e+02  1.620e+03   0.200 0.842068
## L(train_data.Close.diff.ardl, 1:110)18  -7.526e+02  1.614e+03  -0.466 0.641866
## L(train_data.Close.diff.ardl, 1:110)19  -1.324e+03  1.613e+03  -0.821 0.413409
## L(train_data.Close.diff.ardl, 1:110)20  -4.963e+02  1.600e+03  -0.310 0.756924
## L(train_data.Close.diff.ardl, 1:110)21   1.182e+02  1.593e+03   0.074 0.940998
## L(train_data.Close.diff.ardl, 1:110)22  -4.765e+02  1.597e+03  -0.298 0.766021
## L(train_data.Close.diff.ardl, 1:110)23   1.179e+03  1.585e+03   0.744 0.458708
## L(train_data.Close.diff.ardl, 1:110)24  -3.499e+02  1.565e+03  -0.224 0.823536
## L(train_data.Close.diff.ardl, 1:110)25   2.223e+02  1.564e+03   0.142 0.887195
## L(train_data.Close.diff.ardl, 1:110)26   4.432e+02  1.553e+03   0.285 0.775863
## L(train_data.Close.diff.ardl, 1:110)27  -1.609e+04  1.556e+03 -10.341  < 2e-16
## L(train_data.Close.diff.ardl, 1:110)28   1.435e+03  2.143e+03   0.670 0.504500
## L(train_data.Close.diff.ardl, 1:110)29   9.862e+02  2.157e+03   0.457 0.648365
## L(train_data.Close.diff.ardl, 1:110)30   1.048e+03  2.115e+03   0.495 0.621317
## L(train_data.Close.diff.ardl, 1:110)31   4.887e+02  2.118e+03   0.231 0.817959
## L(train_data.Close.diff.ardl, 1:110)32  -3.509e+03  2.118e+03  -1.657 0.100414
## L(train_data.Close.diff.ardl, 1:110)33  -2.740e+03  2.137e+03  -1.282 0.202480
## L(train_data.Close.diff.ardl, 1:110)34  -9.223e+02  2.142e+03  -0.431 0.667586
## L(train_data.Close.diff.ardl, 1:110)35  -4.674e+02  2.137e+03  -0.219 0.827288
## L(train_data.Close.diff.ardl, 1:110)36  -1.827e+02  2.176e+03  -0.084 0.933247
## L(train_data.Close.diff.ardl, 1:110)37  -1.698e+03  2.167e+03  -0.784 0.434891
## L(train_data.Close.diff.ardl, 1:110)38   1.532e+03  2.183e+03   0.702 0.484158
## L(train_data.Close.diff.ardl, 1:110)39   6.252e+02  2.140e+03   0.292 0.770758
## L(train_data.Close.diff.ardl, 1:110)40   1.041e+03  2.151e+03   0.484 0.629258
## L(train_data.Close.diff.ardl, 1:110)41   2.489e+03  2.158e+03   1.153 0.251218
## L(train_data.Close.diff.ardl, 1:110)42   3.472e+02  2.164e+03   0.160 0.872830
## L(train_data.Close.diff.ardl, 1:110)43  -3.518e+03  2.160e+03  -1.629 0.106194
## L(train_data.Close.diff.ardl, 1:110)44  -2.054e+03  2.180e+03  -0.942 0.348249
## L(train_data.Close.diff.ardl, 1:110)45   2.850e+03  2.186e+03   1.304 0.194941
## L(train_data.Close.diff.ardl, 1:110)46   1.394e+03  2.201e+03   0.634 0.527638
## L(train_data.Close.diff.ardl, 1:110)47   8.080e+02  2.211e+03   0.365 0.715450
## L(train_data.Close.diff.ardl, 1:110)48  -1.859e+03  2.204e+03  -0.843 0.400752
## L(train_data.Close.diff.ardl, 1:110)49  -1.876e+03  2.207e+03  -0.850 0.397148
## L(train_data.Close.diff.ardl, 1:110)50  -2.337e+03  2.221e+03  -1.052 0.295105
## L(train_data.Close.diff.ardl, 1:110)51   4.878e+02  2.240e+03   0.218 0.827994
## L(train_data.Close.diff.ardl, 1:110)52  -3.453e+03  2.244e+03  -1.539 0.126738
## L(train_data.Close.diff.ardl, 1:110)53  -2.075e+03  2.243e+03  -0.925 0.356868
## L(train_data.Close.diff.ardl, 1:110)54  -3.297e+03  2.248e+03  -1.466 0.145397
## L(train_data.Close.diff.ardl, 1:110)55   6.574e+02  2.135e+03   0.308 0.758739
## L(train_data.Close.diff.ardl, 1:110)56  -3.018e+03  2.140e+03  -1.411 0.161130
## L(train_data.Close.diff.ardl, 1:110)57  -8.027e+02  2.162e+03  -0.371 0.711081
## L(train_data.Close.diff.ardl, 1:110)58  -2.789e+03  2.139e+03  -1.304 0.194937
## L(train_data.Close.diff.ardl, 1:110)59   5.202e+02  2.028e+03   0.256 0.798075
## L(train_data.Close.diff.ardl, 1:110)60   1.028e+03  1.725e+03   0.596 0.552272
## L(train_data.Close.diff.ardl, 1:110)61   5.337e+02  1.732e+03   0.308 0.758498
## L(train_data.Close.diff.ardl, 1:110)62  -4.217e+02  1.725e+03  -0.244 0.807390
## L(train_data.Close.diff.ardl, 1:110)63  -1.436e+03  1.710e+03  -0.840 0.402787
## L(train_data.Close.diff.ardl, 1:110)64  -1.080e+03  1.720e+03  -0.628 0.531233
## L(train_data.Close.diff.ardl, 1:110)65  -1.810e+03  1.705e+03  -1.061 0.290780
## L(train_data.Close.diff.ardl, 1:110)66   6.732e+02  1.715e+03   0.393 0.695358
## L(train_data.Close.diff.ardl, 1:110)67   2.290e+03  1.728e+03   1.325 0.187829
## L(train_data.Close.diff.ardl, 1:110)68   3.111e+01  1.742e+03   0.018 0.985781
## L(train_data.Close.diff.ardl, 1:110)69  -2.388e+03  1.737e+03  -1.375 0.171811
## L(train_data.Close.diff.ardl, 1:110)70   1.028e+03  1.735e+03   0.592 0.554848
## L(train_data.Close.diff.ardl, 1:110)71  -1.778e+03  1.736e+03  -1.024 0.308189
## L(train_data.Close.diff.ardl, 1:110)72   2.232e+03  1.744e+03   1.280 0.203271
## L(train_data.Close.diff.ardl, 1:110)73  -4.107e+03  1.747e+03  -2.351 0.020495
## L(train_data.Close.diff.ardl, 1:110)74  -1.251e+03  1.769e+03  -0.707 0.481097
## L(train_data.Close.diff.ardl, 1:110)75  -2.820e+01  1.775e+03  -0.016 0.987354
## L(train_data.Close.diff.ardl, 1:110)76  -1.683e+03  1.770e+03  -0.951 0.343692
## L(train_data.Close.diff.ardl, 1:110)77  -2.880e+02  1.760e+03  -0.164 0.870286
## L(train_data.Close.diff.ardl, 1:110)78   3.260e+02  1.761e+03   0.185 0.853463
## L(train_data.Close.diff.ardl, 1:110)79  -3.509e+03  1.743e+03  -2.014 0.046449
## L(train_data.Close.diff.ardl, 1:110)80  -1.471e+03  1.754e+03  -0.838 0.403559
## L(train_data.Close.diff.ardl, 1:110)81  -1.727e+03  1.739e+03  -0.994 0.322593
## L(train_data.Close.diff.ardl, 1:110)82  -1.786e+03  1.738e+03  -1.027 0.306447
## L(train_data.Close.diff.ardl, 1:110)83  -9.794e+03  1.742e+03  -5.621 1.41e-07
## L(train_data.Close.diff.ardl, 1:110)84  -5.250e+02  1.960e+03  -0.268 0.789343
## L(train_data.Close.diff.ardl, 1:110)85   3.342e+02  1.916e+03   0.174 0.861852
## L(train_data.Close.diff.ardl, 1:110)86   3.141e+02  1.872e+03   0.168 0.867047
## L(train_data.Close.diff.ardl, 1:110)87   1.745e+03  1.861e+03   0.937 0.350605
## L(train_data.Close.diff.ardl, 1:110)88  -9.548e+02  1.867e+03  -0.511 0.610118
## L(train_data.Close.diff.ardl, 1:110)89  -1.957e+03  1.863e+03  -1.051 0.295615
## L(train_data.Close.diff.ardl, 1:110)90  -2.826e+02  1.865e+03  -0.151 0.879855
## L(train_data.Close.diff.ardl, 1:110)91  -6.853e+02  1.846e+03  -0.371 0.711084
## L(train_data.Close.diff.ardl, 1:110)92   1.766e+03  1.865e+03   0.947 0.345918
## L(train_data.Close.diff.ardl, 1:110)93   1.346e+03  1.870e+03   0.720 0.473214
## L(train_data.Close.diff.ardl, 1:110)94  -8.379e+02  1.881e+03  -0.445 0.656868
## L(train_data.Close.diff.ardl, 1:110)95   1.143e+03  1.893e+03   0.604 0.547330
## L(train_data.Close.diff.ardl, 1:110)96  -8.062e+01  1.890e+03  -0.043 0.966055
## L(train_data.Close.diff.ardl, 1:110)97   1.426e+03  1.889e+03   0.755 0.451846
## L(train_data.Close.diff.ardl, 1:110)98   7.780e+02  1.885e+03   0.413 0.680563
## L(train_data.Close.diff.ardl, 1:110)99  -1.123e+03  1.881e+03  -0.597 0.551894
## L(train_data.Close.diff.ardl, 1:110)100  7.495e+02  1.886e+03   0.397 0.691890
## L(train_data.Close.diff.ardl, 1:110)101  1.590e+03  1.870e+03   0.850 0.397161
## L(train_data.Close.diff.ardl, 1:110)102 -2.155e+03  1.864e+03  -1.156 0.250024
## L(train_data.Close.diff.ardl, 1:110)103  3.016e+02  1.871e+03   0.161 0.872203
## L(train_data.Close.diff.ardl, 1:110)104  8.460e+01  1.873e+03   0.045 0.964058
## L(train_data.Close.diff.ardl, 1:110)105 -1.500e+03  1.832e+03  -0.819 0.414620
## L(train_data.Close.diff.ardl, 1:110)106 -7.017e+02  1.844e+03  -0.381 0.704278
## L(train_data.Close.diff.ardl, 1:110)107  9.518e+00  1.841e+03   0.005 0.995884
## L(train_data.Close.diff.ardl, 1:110)108 -4.561e+03  1.821e+03  -2.504 0.013722
## L(train_data.Close.diff.ardl, 1:110)109 -6.035e+02  1.869e+03  -0.323 0.747319
## L(train_data.Close.diff.ardl, 1:110)110  1.364e+02  1.869e+03   0.073 0.941955
##                                            
## (Intercept)                                
## L(train_data.Volume.ardl, 1:32)1        ***
## L(train_data.Volume.ardl, 1:32)2           
## L(train_data.Volume.ardl, 1:32)3           
## L(train_data.Volume.ardl, 1:32)4           
## L(train_data.Volume.ardl, 1:32)5           
## L(train_data.Volume.ardl, 1:32)6           
## L(train_data.Volume.ardl, 1:32)7           
## L(train_data.Volume.ardl, 1:32)8           
## L(train_data.Volume.ardl, 1:32)9           
## L(train_data.Volume.ardl, 1:32)10          
## L(train_data.Volume.ardl, 1:32)11          
## L(train_data.Volume.ardl, 1:32)12          
## L(train_data.Volume.ardl, 1:32)13          
## L(train_data.Volume.ardl, 1:32)14          
## L(train_data.Volume.ardl, 1:32)15          
## L(train_data.Volume.ardl, 1:32)16          
## L(train_data.Volume.ardl, 1:32)17          
## L(train_data.Volume.ardl, 1:32)18          
## L(train_data.Volume.ardl, 1:32)19          
## L(train_data.Volume.ardl, 1:32)20          
## L(train_data.Volume.ardl, 1:32)21          
## L(train_data.Volume.ardl, 1:32)22          
## L(train_data.Volume.ardl, 1:32)23          
## L(train_data.Volume.ardl, 1:32)24       *  
## L(train_data.Volume.ardl, 1:32)25       .  
## L(train_data.Volume.ardl, 1:32)26          
## L(train_data.Volume.ardl, 1:32)27          
## L(train_data.Volume.ardl, 1:32)28          
## L(train_data.Volume.ardl, 1:32)29          
## L(train_data.Volume.ardl, 1:32)30          
## L(train_data.Volume.ardl, 1:32)31          
## L(train_data.Volume.ardl, 1:32)32       *  
## L(train_data.Close.diff.ardl, 1:110)1      
## L(train_data.Close.diff.ardl, 1:110)2      
## L(train_data.Close.diff.ardl, 1:110)3      
## L(train_data.Close.diff.ardl, 1:110)4      
## L(train_data.Close.diff.ardl, 1:110)5      
## L(train_data.Close.diff.ardl, 1:110)6      
## L(train_data.Close.diff.ardl, 1:110)7      
## L(train_data.Close.diff.ardl, 1:110)8      
## L(train_data.Close.diff.ardl, 1:110)9      
## L(train_data.Close.diff.ardl, 1:110)10     
## L(train_data.Close.diff.ardl, 1:110)11     
## L(train_data.Close.diff.ardl, 1:110)12     
## L(train_data.Close.diff.ardl, 1:110)13     
## L(train_data.Close.diff.ardl, 1:110)14     
## L(train_data.Close.diff.ardl, 1:110)15     
## L(train_data.Close.diff.ardl, 1:110)16     
## L(train_data.Close.diff.ardl, 1:110)17     
## L(train_data.Close.diff.ardl, 1:110)18     
## L(train_data.Close.diff.ardl, 1:110)19     
## L(train_data.Close.diff.ardl, 1:110)20     
## L(train_data.Close.diff.ardl, 1:110)21     
## L(train_data.Close.diff.ardl, 1:110)22     
## L(train_data.Close.diff.ardl, 1:110)23     
## L(train_data.Close.diff.ardl, 1:110)24     
## L(train_data.Close.diff.ardl, 1:110)25     
## L(train_data.Close.diff.ardl, 1:110)26     
## L(train_data.Close.diff.ardl, 1:110)27  ***
## L(train_data.Close.diff.ardl, 1:110)28     
## L(train_data.Close.diff.ardl, 1:110)29     
## L(train_data.Close.diff.ardl, 1:110)30     
## L(train_data.Close.diff.ardl, 1:110)31     
## L(train_data.Close.diff.ardl, 1:110)32     
## L(train_data.Close.diff.ardl, 1:110)33     
## L(train_data.Close.diff.ardl, 1:110)34     
## L(train_data.Close.diff.ardl, 1:110)35     
## L(train_data.Close.diff.ardl, 1:110)36     
## L(train_data.Close.diff.ardl, 1:110)37     
## L(train_data.Close.diff.ardl, 1:110)38     
## L(train_data.Close.diff.ardl, 1:110)39     
## L(train_data.Close.diff.ardl, 1:110)40     
## L(train_data.Close.diff.ardl, 1:110)41     
## L(train_data.Close.diff.ardl, 1:110)42     
## L(train_data.Close.diff.ardl, 1:110)43     
## L(train_data.Close.diff.ardl, 1:110)44     
## L(train_data.Close.diff.ardl, 1:110)45     
## L(train_data.Close.diff.ardl, 1:110)46     
## L(train_data.Close.diff.ardl, 1:110)47     
## L(train_data.Close.diff.ardl, 1:110)48     
## L(train_data.Close.diff.ardl, 1:110)49     
## L(train_data.Close.diff.ardl, 1:110)50     
## L(train_data.Close.diff.ardl, 1:110)51     
## L(train_data.Close.diff.ardl, 1:110)52     
## L(train_data.Close.diff.ardl, 1:110)53     
## L(train_data.Close.diff.ardl, 1:110)54     
## L(train_data.Close.diff.ardl, 1:110)55     
## L(train_data.Close.diff.ardl, 1:110)56     
## L(train_data.Close.diff.ardl, 1:110)57     
## L(train_data.Close.diff.ardl, 1:110)58     
## L(train_data.Close.diff.ardl, 1:110)59     
## L(train_data.Close.diff.ardl, 1:110)60     
## L(train_data.Close.diff.ardl, 1:110)61     
## L(train_data.Close.diff.ardl, 1:110)62     
## L(train_data.Close.diff.ardl, 1:110)63     
## L(train_data.Close.diff.ardl, 1:110)64     
## L(train_data.Close.diff.ardl, 1:110)65     
## L(train_data.Close.diff.ardl, 1:110)66     
## L(train_data.Close.diff.ardl, 1:110)67     
## L(train_data.Close.diff.ardl, 1:110)68     
## L(train_data.Close.diff.ardl, 1:110)69     
## L(train_data.Close.diff.ardl, 1:110)70     
## L(train_data.Close.diff.ardl, 1:110)71     
## L(train_data.Close.diff.ardl, 1:110)72     
## L(train_data.Close.diff.ardl, 1:110)73  *  
## L(train_data.Close.diff.ardl, 1:110)74     
## L(train_data.Close.diff.ardl, 1:110)75     
## L(train_data.Close.diff.ardl, 1:110)76     
## L(train_data.Close.diff.ardl, 1:110)77     
## L(train_data.Close.diff.ardl, 1:110)78     
## L(train_data.Close.diff.ardl, 1:110)79  *  
## L(train_data.Close.diff.ardl, 1:110)80     
## L(train_data.Close.diff.ardl, 1:110)81     
## L(train_data.Close.diff.ardl, 1:110)82     
## L(train_data.Close.diff.ardl, 1:110)83  ***
## L(train_data.Close.diff.ardl, 1:110)84     
## L(train_data.Close.diff.ardl, 1:110)85     
## L(train_data.Close.diff.ardl, 1:110)86     
## L(train_data.Close.diff.ardl, 1:110)87     
## L(train_data.Close.diff.ardl, 1:110)88     
## L(train_data.Close.diff.ardl, 1:110)89     
## L(train_data.Close.diff.ardl, 1:110)90     
## L(train_data.Close.diff.ardl, 1:110)91     
## L(train_data.Close.diff.ardl, 1:110)92     
## L(train_data.Close.diff.ardl, 1:110)93     
## L(train_data.Close.diff.ardl, 1:110)94     
## L(train_data.Close.diff.ardl, 1:110)95     
## L(train_data.Close.diff.ardl, 1:110)96     
## L(train_data.Close.diff.ardl, 1:110)97     
## L(train_data.Close.diff.ardl, 1:110)98     
## L(train_data.Close.diff.ardl, 1:110)99     
## L(train_data.Close.diff.ardl, 1:110)100    
## L(train_data.Close.diff.ardl, 1:110)101    
## L(train_data.Close.diff.ardl, 1:110)102    
## L(train_data.Close.diff.ardl, 1:110)103    
## L(train_data.Close.diff.ardl, 1:110)104    
## L(train_data.Close.diff.ardl, 1:110)105    
## L(train_data.Close.diff.ardl, 1:110)106    
## L(train_data.Close.diff.ardl, 1:110)107    
## L(train_data.Close.diff.ardl, 1:110)108 *  
## L(train_data.Close.diff.ardl, 1:110)109    
## L(train_data.Close.diff.ardl, 1:110)110    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1490000 on 112 degrees of freedom
## Multiple R-squared:  0.7579, Adjusted R-squared:  0.4509 
## F-statistic: 2.469 on 142 and 112 DF,  p-value: 5.41e-07
Volume.Close.testing.2 <- predict(Volume.Close.training.2, n.ahead = length(test_data.Volume.ardl, test_data.Close.diff.ardl))
head(Volume.Close.testing.2)
## 2015(111) 2015(112) 2015(113) 2015(114) 2015(115) 2015(116) 
##   2188815   2396618   3021395   2967878   2630902   2670640
Volume.Close.fitted_training.2 <- fitted(Volume.Close.training.2)
head(Volume.Close.fitted_training.2)
## Time Series:
## Start = c(2015, 111) 
## End = c(2015, 116) 
## Frequency = 365 
## [1] 2188815 2396618 3021395 2967878 2630902 2670640
Volume.Close.2.training.mse_value <- mse(train_data.Volume.ardl, Volume.Close.fitted_training.2)
Volume.Close.2.training.rmse_value <- rmse(train_data.Volume.ardl, Volume.Close.fitted_training.2)

Volume.testing.n.2 = as.numeric(Volume.Close.testing.2)


Volume.Close.2.testing.mse_value <- mse(test_data.Volume.ardl, Volume.testing.n.2)
Volume.Close.2.testing.rmse_value <- rmse(test_data.Volume.ardl, Volume.testing.n.2)

cat("Training Model MSE:", Volume.Close.2.training.mse_value, "\n Training Model RMSE:", Volume.Close.2.training.rmse_value , "\n Testing Model MSE:", Volume.Close.2.testing.mse_value, "\n Testing Model RMSE:", Volume.Close.2.testing.rmse_value , "\n")
## Training Model MSE: 974451842772 
##  Training Model RMSE: 987143.3 
##  Testing Model MSE: 6.898777e+12 
##  Testing Model RMSE: 2626552
cat(" Training Model AIC:", AIC(Volume.Close.training.2), "\n Training Model BIC:", BIC(Volume.Close.training.2), "\n")
##  Training Model AIC: 8050.97 
##  Training Model BIC: 8560.912

This training model has a R-squared value of 0.7579, meaning a large portion of the model can be attributed to and explained by the independent variable. The MSE of the models are still high, but the RMSE of both the training and testing models are significantly lower when compared to the other models, suggesting that this model might be a better fit. The AIC and BIC are also lower than that of the previous model.

Testing and Training for Volume with lag (1:32)n(91:122) and Close lag (110)

Volume.Close.training.3 <- dynlm(train_data.Volume.ardl ~ L(train_data.Volume.ardl, 1:32) + L(train_data.Volume.ardl, 91:122) + L(train_data.Close.diff.ardl, 110), data = infy_stock)
summary(Volume.Close.training.3)
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Volume.ardl ~ L(train_data.Volume.ardl, 
##     1:32) + L(train_data.Volume.ardl, 91:122) + L(train_data.Close.diff.ardl, 
##     110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2783386  -861150  -134581   490754 16159831 
## 
## Coefficients:
##                                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                           2.500e+06  1.021e+06   2.449   0.0153 *  
## L(train_data.Volume.ardl, 1:32)1      3.030e-01  7.499e-02   4.041 7.92e-05 ***
## L(train_data.Volume.ardl, 1:32)2      4.374e-02  7.842e-02   0.558   0.5777    
## L(train_data.Volume.ardl, 1:32)3     -3.848e-02  7.907e-02  -0.487   0.6271    
## L(train_data.Volume.ardl, 1:32)4      6.283e-02  7.894e-02   0.796   0.4271    
## L(train_data.Volume.ardl, 1:32)5     -1.749e-02  7.893e-02  -0.222   0.8249    
## L(train_data.Volume.ardl, 1:32)6      2.295e-02  7.872e-02   0.292   0.7710    
## L(train_data.Volume.ardl, 1:32)7      1.091e-01  7.861e-02   1.388   0.1669    
## L(train_data.Volume.ardl, 1:32)8     -3.501e-02  7.914e-02  -0.442   0.6588    
## L(train_data.Volume.ardl, 1:32)9     -5.269e-03  7.901e-02  -0.067   0.9469    
## L(train_data.Volume.ardl, 1:32)10     5.887e-02  7.863e-02   0.749   0.4550    
## L(train_data.Volume.ardl, 1:32)11    -7.503e-02  7.807e-02  -0.961   0.3379    
## L(train_data.Volume.ardl, 1:32)12     4.801e-02  7.836e-02   0.613   0.5409    
## L(train_data.Volume.ardl, 1:32)13    -9.118e-02  7.848e-02  -1.162   0.2469    
## L(train_data.Volume.ardl, 1:32)14    -2.186e-03  7.892e-02  -0.028   0.9779    
## L(train_data.Volume.ardl, 1:32)15     1.101e-02  7.893e-02   0.140   0.8892    
## L(train_data.Volume.ardl, 1:32)16    -4.078e-02  7.884e-02  -0.517   0.6056    
## L(train_data.Volume.ardl, 1:32)17    -7.596e-03  7.859e-02  -0.097   0.9231    
## L(train_data.Volume.ardl, 1:32)18    -5.021e-03  7.866e-02  -0.064   0.9492    
## L(train_data.Volume.ardl, 1:32)19    -2.395e-02  7.852e-02  -0.305   0.7607    
## L(train_data.Volume.ardl, 1:32)20     2.615e-02  7.858e-02   0.333   0.7397    
## L(train_data.Volume.ardl, 1:32)21    -3.462e-02  7.903e-02  -0.438   0.6618    
## L(train_data.Volume.ardl, 1:32)22     3.908e-03  7.969e-02   0.049   0.9609    
## L(train_data.Volume.ardl, 1:32)23     3.326e-02  7.949e-02   0.418   0.6761    
## L(train_data.Volume.ardl, 1:32)24     9.474e-02  7.943e-02   1.193   0.2345    
## L(train_data.Volume.ardl, 1:32)25     3.407e-02  7.975e-02   0.427   0.6698    
## L(train_data.Volume.ardl, 1:32)26     1.819e-02  7.943e-02   0.229   0.8191    
## L(train_data.Volume.ardl, 1:32)27     5.483e-02  8.550e-02   0.641   0.5222    
## L(train_data.Volume.ardl, 1:32)28    -1.163e-01  7.950e-02  -1.463   0.1453    
## L(train_data.Volume.ardl, 1:32)29     3.809e-02  7.935e-02   0.480   0.6318    
## L(train_data.Volume.ardl, 1:32)30     5.844e-02  8.035e-02   0.727   0.4680    
## L(train_data.Volume.ardl, 1:32)31     8.024e-03  8.030e-02   0.100   0.9205    
## L(train_data.Volume.ardl, 1:32)32     7.073e-02  7.557e-02   0.936   0.3506    
## L(train_data.Volume.ardl, 91:122)91  -7.663e-02  7.571e-02  -1.012   0.3128    
## L(train_data.Volume.ardl, 91:122)92   1.525e-02  8.029e-02   0.190   0.8496    
## L(train_data.Volume.ardl, 91:122)93  -1.169e-01  8.000e-02  -1.461   0.1457    
## L(train_data.Volume.ardl, 91:122)94   8.934e-02  7.934e-02   1.126   0.2616    
## L(train_data.Volume.ardl, 91:122)95  -6.091e-02  7.964e-02  -0.765   0.4454    
## L(train_data.Volume.ardl, 91:122)96   1.598e-02  7.943e-02   0.201   0.8407    
## L(train_data.Volume.ardl, 91:122)97  -3.957e-02  7.944e-02  -0.498   0.6191    
## L(train_data.Volume.ardl, 91:122)98  -2.785e-02  7.979e-02  -0.349   0.7275    
## L(train_data.Volume.ardl, 91:122)99   5.709e-02  7.940e-02   0.719   0.4731    
## L(train_data.Volume.ardl, 91:122)100 -5.484e-02  7.947e-02  -0.690   0.4910    
## L(train_data.Volume.ardl, 91:122)101  1.211e-02  7.968e-02   0.152   0.8794    
## L(train_data.Volume.ardl, 91:122)102 -1.998e-03  7.902e-02  -0.025   0.9799    
## L(train_data.Volume.ardl, 91:122)103  9.043e-03  7.840e-02   0.115   0.9083    
## L(train_data.Volume.ardl, 91:122)104 -5.065e-02  7.858e-02  -0.645   0.5200    
## L(train_data.Volume.ardl, 91:122)105 -1.324e-02  7.872e-02  -0.168   0.8666    
## L(train_data.Volume.ardl, 91:122)106 -9.372e-02  7.859e-02  -1.192   0.2347    
## L(train_data.Volume.ardl, 91:122)107  6.061e-02  7.902e-02   0.767   0.4440    
## L(train_data.Volume.ardl, 91:122)108 -3.755e-02  7.899e-02  -0.475   0.6351    
## L(train_data.Volume.ardl, 91:122)109 -3.825e-02  7.893e-02  -0.485   0.6286    
## L(train_data.Volume.ardl, 91:122)110 -4.305e-02  7.849e-02  -0.548   0.5840    
## L(train_data.Volume.ardl, 91:122)111 -2.868e-02  7.834e-02  -0.366   0.7147    
## L(train_data.Volume.ardl, 91:122)112  1.563e-01  7.812e-02   2.001   0.0470 *  
## L(train_data.Volume.ardl, 91:122)113 -8.047e-02  7.863e-02  -1.023   0.3075    
## L(train_data.Volume.ardl, 91:122)114 -5.862e-02  7.883e-02  -0.744   0.4581    
## L(train_data.Volume.ardl, 91:122)115 -8.955e-03  7.951e-02  -0.113   0.9105    
## L(train_data.Volume.ardl, 91:122)116  1.852e-02  7.865e-02   0.235   0.8141    
## L(train_data.Volume.ardl, 91:122)117  8.373e-02  7.873e-02   1.064   0.2890    
## L(train_data.Volume.ardl, 91:122)118 -3.248e-02  7.902e-02  -0.411   0.6815    
## L(train_data.Volume.ardl, 91:122)119 -1.058e-01  7.889e-02  -1.341   0.1815    
## L(train_data.Volume.ardl, 91:122)120  7.376e-02  7.992e-02   0.923   0.3573    
## L(train_data.Volume.ardl, 91:122)121 -4.995e-02  7.829e-02  -0.638   0.5242    
## L(train_data.Volume.ardl, 91:122)122 -1.182e-02  7.499e-02  -0.158   0.8749    
## L(train_data.Close.diff.ardl, 110)    1.042e+03  2.065e+03   0.504   0.6146    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1932000 on 177 degrees of freedom
## Multiple R-squared:  0.354,  Adjusted R-squared:  0.1167 
## F-statistic: 1.492 on 65 and 177 DF,  p-value: 0.02095
Volume.Close.testing.3 <- predict(Volume.Close.training.3, n.ahead = length(test_data.Volume.ardl, test_data.Close.diff.ardl))
head(Volume.Close.testing.3)
## 2015(123) 2015(124) 2015(125) 2015(126) 2015(127) 2015(128) 
##   3465236   4155716   3050391   2200056   3056388   2565630
Volume.Close.fitted_training.3 <- fitted(Volume.Close.training.3)
head(Volume.Close.fitted_training.3)
## Time Series:
## Start = c(2015, 123) 
## End = c(2015, 128) 
## Frequency = 365 
## [1] 3465236 4155716 3050391 2200056 3056388 2565630
Volume.Close.3.training.mse_value <- mse(train_data.Volume.ardl, Volume.Close.fitted_training.3)
Volume.Close.3.training.rmse_value <- rmse(train_data.Volume.ardl, Volume.Close.fitted_training.3)

Volume.testing.n.3 = as.numeric(Volume.Close.testing.3)


Volume.Close.3.testing.mse_value <- mse(test_data.Volume.ardl, Volume.testing.n.3)
Volume.Close.3.testing.rmse_value <- rmse(test_data.Volume.ardl, Volume.testing.n.3)

cat("Training Model MSE:", Volume.Close.3.training.mse_value, "\n Training Model RMSE:", Volume.Close.3.training.rmse_value , "\n Testing Model MSE:", Volume.Close.3.testing.mse_value, "\n Testing Model RMSE:", Volume.Close.3.testing.rmse_value , "\n")
## Training Model MSE: 2.71972e+12 
##  Training Model RMSE: 1649158 
##  Testing Model MSE: 4.671199e+12 
##  Testing Model RMSE: 2161296
cat(" Training Model AIC:", AIC(Volume.Close.training.3), "\n Training Model BIC:", BIC(Volume.Close.training.3), "\n")
##  Training Model AIC: 7781.071 
##  Training Model BIC: 8015.106

The R-squared of this training model is 0.354, not a high enough value to suggest a good fit. But although the MSE of the models are high, the RMSE of both models are not that high compared to others. The AIC and BIC models also result in lower values, with AIC being a slightly better fit than the BIC.

Testing and Training for Volume with lag (1:32)n(91:122) and Close lag (1:110)

Volume.Close.training.4 <- dynlm(train_data.Volume.ardl ~ L(train_data.Volume.ardl, 1:32) + L(train_data.Volume.ardl, 91:122) + L(train_data.Close.diff.ardl, 1:110))
summary(Volume.Close.training.4) 
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Volume.ardl ~ L(train_data.Volume.ardl, 
##     1:32) + L(train_data.Volume.ardl, 91:122) + L(train_data.Close.diff.ardl, 
##     1:110))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2541601  -372924   -24793   374553  5313139 
## 
## Coefficients:
##                                           Estimate Std. Error t value Pr(>|t|)
## (Intercept)                              4.000e+06  2.198e+06   1.820 0.073209
## L(train_data.Volume.ardl, 1:32)1         4.292e-01  1.195e-01   3.591 0.000618
## L(train_data.Volume.ardl, 1:32)2        -2.411e-02  1.295e-01  -0.186 0.852804
## L(train_data.Volume.ardl, 1:32)3        -2.397e-02  1.323e-01  -0.181 0.856795
## L(train_data.Volume.ardl, 1:32)4         9.798e-02  1.273e-01   0.769 0.444300
## L(train_data.Volume.ardl, 1:32)5        -2.345e-02  1.303e-01  -0.180 0.857725
## L(train_data.Volume.ardl, 1:32)6        -2.264e-01  1.293e-01  -1.751 0.084519
## L(train_data.Volume.ardl, 1:32)7         2.531e-01  1.314e-01   1.926 0.058227
## L(train_data.Volume.ardl, 1:32)8        -2.333e-01  1.355e-01  -1.722 0.089695
## L(train_data.Volume.ardl, 1:32)9         5.345e-02  1.424e-01   0.375 0.708538
## L(train_data.Volume.ardl, 1:32)10        1.191e-02  1.418e-01   0.084 0.933356
## L(train_data.Volume.ardl, 1:32)11        7.074e-03  1.316e-01   0.054 0.957289
## L(train_data.Volume.ardl, 1:32)12        4.239e-02  1.268e-01   0.334 0.739125
## L(train_data.Volume.ardl, 1:32)13       -8.582e-02  1.265e-01  -0.678 0.499958
## L(train_data.Volume.ardl, 1:32)14        3.596e-02  1.297e-01   0.277 0.782433
## L(train_data.Volume.ardl, 1:32)15       -6.102e-02  1.310e-01  -0.466 0.642947
## L(train_data.Volume.ardl, 1:32)16       -9.215e-02  1.345e-01  -0.685 0.495446
## L(train_data.Volume.ardl, 1:32)17        8.074e-02  1.335e-01   0.605 0.547266
## L(train_data.Volume.ardl, 1:32)18        1.103e-01  1.332e-01   0.828 0.410526
## L(train_data.Volume.ardl, 1:32)19       -7.908e-02  1.324e-01  -0.597 0.552191
## L(train_data.Volume.ardl, 1:32)20        4.696e-02  1.323e-01   0.355 0.723622
## L(train_data.Volume.ardl, 1:32)21       -1.577e-01  1.331e-01  -1.185 0.240287
## L(train_data.Volume.ardl, 1:32)22        2.474e-04  1.336e-01   0.002 0.998528
## L(train_data.Volume.ardl, 1:32)23        6.768e-02  1.345e-01   0.503 0.616515
## L(train_data.Volume.ardl, 1:32)24       -1.704e-02  1.333e-01  -0.128 0.898702
## L(train_data.Volume.ardl, 1:32)25       -6.091e-02  1.325e-01  -0.460 0.647294
## L(train_data.Volume.ardl, 1:32)26        3.312e-02  1.321e-01   0.251 0.802772
## L(train_data.Volume.ardl, 1:32)27       -1.608e-01  1.316e-01  -1.222 0.225817
## L(train_data.Volume.ardl, 1:32)28        2.240e-02  1.115e-01   0.201 0.841372
## L(train_data.Volume.ardl, 1:32)29       -1.239e-01  1.090e-01  -1.136 0.259756
## L(train_data.Volume.ardl, 1:32)30        8.851e-02  1.094e-01   0.809 0.421096
## L(train_data.Volume.ardl, 1:32)31       -3.509e-02  1.092e-01  -0.321 0.748931
## L(train_data.Volume.ardl, 1:32)32        1.358e-01  1.011e-01   1.344 0.183472
## L(train_data.Volume.ardl, 91:122)91      2.392e-02  8.426e-02   0.284 0.777389
## L(train_data.Volume.ardl, 91:122)92     -6.513e-02  8.549e-02  -0.762 0.448826
## L(train_data.Volume.ardl, 91:122)93     -4.418e-02  8.611e-02  -0.513 0.609512
## L(train_data.Volume.ardl, 91:122)94      1.814e-01  8.629e-02   2.102 0.039263
## L(train_data.Volume.ardl, 91:122)95     -6.623e-02  8.921e-02  -0.742 0.460440
## L(train_data.Volume.ardl, 91:122)96      7.434e-02  8.838e-02   0.841 0.403254
## L(train_data.Volume.ardl, 91:122)97      4.150e-02  8.684e-02   0.478 0.634317
## L(train_data.Volume.ardl, 91:122)98     -1.046e-01  8.850e-02  -1.182 0.241254
## L(train_data.Volume.ardl, 91:122)99      4.530e-02  8.940e-02   0.507 0.614042
## L(train_data.Volume.ardl, 91:122)100    -3.760e-04  8.924e-02  -0.004 0.996650
## L(train_data.Volume.ardl, 91:122)101    -4.087e-02  8.981e-02  -0.455 0.650533
## L(train_data.Volume.ardl, 91:122)102    -4.015e-03  8.715e-02  -0.046 0.963387
## L(train_data.Volume.ardl, 91:122)103    -2.044e-02  8.539e-02  -0.239 0.811558
## L(train_data.Volume.ardl, 91:122)104    -1.014e-01  9.194e-02  -1.102 0.274215
## L(train_data.Volume.ardl, 91:122)105    -3.503e-02  9.144e-02  -0.383 0.702794
## L(train_data.Volume.ardl, 91:122)106    -1.317e-01  9.240e-02  -1.425 0.158765
## L(train_data.Volume.ardl, 91:122)107     3.751e-02  9.327e-02   0.402 0.688811
## L(train_data.Volume.ardl, 91:122)108     6.157e-02  9.226e-02   0.667 0.506798
## L(train_data.Volume.ardl, 91:122)109    -5.158e-02  9.193e-02  -0.561 0.576545
## L(train_data.Volume.ardl, 91:122)110     8.279e-03  8.939e-02   0.093 0.926473
## L(train_data.Volume.ardl, 91:122)111    -5.627e-02  8.957e-02  -0.628 0.531938
## L(train_data.Volume.ardl, 91:122)112     2.979e-01  8.906e-02   3.345 0.001341
## L(train_data.Volume.ardl, 91:122)113    -2.036e-01  9.520e-02  -2.139 0.036048
## L(train_data.Volume.ardl, 91:122)114    -5.171e-03  9.798e-02  -0.053 0.958068
## L(train_data.Volume.ardl, 91:122)115     2.620e-02  8.967e-02   0.292 0.771078
## L(train_data.Volume.ardl, 91:122)116    -6.009e-02  8.775e-02  -0.685 0.495818
## L(train_data.Volume.ardl, 91:122)117    -3.109e-02  9.120e-02  -0.341 0.734228
## L(train_data.Volume.ardl, 91:122)118    -2.455e-02  9.223e-02  -0.266 0.790886
## L(train_data.Volume.ardl, 91:122)119    -2.338e-01  9.247e-02  -2.528 0.013789
## L(train_data.Volume.ardl, 91:122)120     6.854e-02  9.496e-02   0.722 0.472916
## L(train_data.Volume.ardl, 91:122)121    -7.957e-02  9.380e-02  -0.848 0.399216
## L(train_data.Volume.ardl, 91:122)122    -9.246e-03  9.278e-02  -0.100 0.920909
## L(train_data.Close.diff.ardl, 1:110)1   -1.864e+02  2.138e+03  -0.087 0.930780
## L(train_data.Close.diff.ardl, 1:110)2   -8.623e+02  2.094e+03  -0.412 0.681747
## L(train_data.Close.diff.ardl, 1:110)3   -3.295e+01  2.083e+03  -0.016 0.987425
## L(train_data.Close.diff.ardl, 1:110)4    4.613e+01  2.083e+03   0.022 0.982394
## L(train_data.Close.diff.ardl, 1:110)5    2.470e+03  2.078e+03   1.189 0.238720
## L(train_data.Close.diff.ardl, 1:110)6   -2.226e+03  2.078e+03  -1.071 0.287851
## L(train_data.Close.diff.ardl, 1:110)7    1.855e+01  2.120e+03   0.009 0.993044
## L(train_data.Close.diff.ardl, 1:110)8   -5.544e+01  2.111e+03  -0.026 0.979124
## L(train_data.Close.diff.ardl, 1:110)9    4.047e+03  2.105e+03   1.923 0.058710
## L(train_data.Close.diff.ardl, 1:110)10  -2.293e+03  2.178e+03  -1.053 0.296018
## L(train_data.Close.diff.ardl, 1:110)11   1.293e+03  2.187e+03   0.591 0.556418
## L(train_data.Close.diff.ardl, 1:110)12  -6.345e+02  1.665e+03  -0.381 0.704421
## L(train_data.Close.diff.ardl, 1:110)13   1.967e+02  2.011e+03   0.098 0.922363
## L(train_data.Close.diff.ardl, 1:110)14   1.941e+03  2.017e+03   0.962 0.339377
## L(train_data.Close.diff.ardl, 1:110)15  -2.669e+02  2.030e+03  -0.131 0.895771
## L(train_data.Close.diff.ardl, 1:110)16   1.797e+03  2.026e+03   0.887 0.378123
## L(train_data.Close.diff.ardl, 1:110)17   5.709e+02  2.033e+03   0.281 0.779766
## L(train_data.Close.diff.ardl, 1:110)18   1.703e+02  2.020e+03   0.084 0.933082
## L(train_data.Close.diff.ardl, 1:110)19   3.298e+02  1.894e+03   0.174 0.862258
## L(train_data.Close.diff.ardl, 1:110)20   7.297e+02  1.872e+03   0.390 0.697898
## L(train_data.Close.diff.ardl, 1:110)21   7.410e+02  1.872e+03   0.396 0.693529
## L(train_data.Close.diff.ardl, 1:110)22   4.823e+02  1.903e+03   0.253 0.800660
## L(train_data.Close.diff.ardl, 1:110)23   2.391e+03  1.881e+03   1.272 0.207872
## L(train_data.Close.diff.ardl, 1:110)24  -1.293e+02  1.876e+03  -0.069 0.945252
## L(train_data.Close.diff.ardl, 1:110)25   8.300e+02  1.856e+03   0.447 0.656107
## L(train_data.Close.diff.ardl, 1:110)26   1.083e+03  1.856e+03   0.584 0.561272
## L(train_data.Close.diff.ardl, 1:110)27  -1.635e+04  1.882e+03  -8.687 1.24e-12
## L(train_data.Close.diff.ardl, 1:110)28   3.695e+03  2.680e+03   1.379 0.172376
## L(train_data.Close.diff.ardl, 1:110)29   8.454e+02  2.691e+03   0.314 0.754346
## L(train_data.Close.diff.ardl, 1:110)30   2.065e+03  2.718e+03   0.760 0.449992
## L(train_data.Close.diff.ardl, 1:110)31   1.418e+03  2.696e+03   0.526 0.600485
## L(train_data.Close.diff.ardl, 1:110)32  -2.006e+03  2.699e+03  -0.743 0.459892
## L(train_data.Close.diff.ardl, 1:110)33  -4.036e+03  2.717e+03  -1.485 0.142124
## L(train_data.Close.diff.ardl, 1:110)34   2.189e+03  2.740e+03   0.799 0.427205
## L(train_data.Close.diff.ardl, 1:110)35  -1.552e+03  2.735e+03  -0.568 0.572231
## L(train_data.Close.diff.ardl, 1:110)36   1.622e+02  2.779e+03   0.058 0.953625
## L(train_data.Close.diff.ardl, 1:110)37  -1.178e+03  2.807e+03  -0.420 0.675957
## L(train_data.Close.diff.ardl, 1:110)38   3.017e+03  2.716e+03   1.111 0.270691
## L(train_data.Close.diff.ardl, 1:110)39  -6.022e+01  2.710e+03  -0.022 0.982334
## L(train_data.Close.diff.ardl, 1:110)40  -2.035e+02  2.718e+03  -0.075 0.940543
## L(train_data.Close.diff.ardl, 1:110)41   3.367e+03  2.751e+03   1.224 0.225260
## L(train_data.Close.diff.ardl, 1:110)42  -8.092e+02  2.797e+03  -0.289 0.773266
## L(train_data.Close.diff.ardl, 1:110)43  -2.715e+03  2.833e+03  -0.958 0.341410
## L(train_data.Close.diff.ardl, 1:110)44   1.512e+03  2.839e+03   0.532 0.596234
## L(train_data.Close.diff.ardl, 1:110)45   3.607e+03  2.837e+03   1.271 0.207996
## L(train_data.Close.diff.ardl, 1:110)46   1.565e+03  2.848e+03   0.549 0.584476
## L(train_data.Close.diff.ardl, 1:110)47   1.458e+03  2.907e+03   0.501 0.617762
## L(train_data.Close.diff.ardl, 1:110)48  -2.255e+03  2.836e+03  -0.795 0.429320
## L(train_data.Close.diff.ardl, 1:110)49   1.033e+02  2.845e+03   0.036 0.971140
## L(train_data.Close.diff.ardl, 1:110)50   2.800e+02  2.842e+03   0.099 0.921810
## L(train_data.Close.diff.ardl, 1:110)51  -1.380e+03  2.818e+03  -0.490 0.625962
## L(train_data.Close.diff.ardl, 1:110)52  -1.696e+03  2.833e+03  -0.599 0.551485
## L(train_data.Close.diff.ardl, 1:110)53  -2.296e+03  2.826e+03  -0.812 0.419383
## L(train_data.Close.diff.ardl, 1:110)54  -3.790e+03  2.809e+03  -1.349 0.181750
## L(train_data.Close.diff.ardl, 1:110)55   1.982e+03  2.554e+03   0.776 0.440371
## L(train_data.Close.diff.ardl, 1:110)56  -3.814e+03  2.581e+03  -1.478 0.144134
## L(train_data.Close.diff.ardl, 1:110)57   5.306e+02  2.665e+03   0.199 0.842788
## L(train_data.Close.diff.ardl, 1:110)58  -3.314e+03  2.604e+03  -1.273 0.207484
## L(train_data.Close.diff.ardl, 1:110)59  -4.520e+02  2.486e+03  -0.182 0.856252
## L(train_data.Close.diff.ardl, 1:110)60   3.302e+03  2.063e+03   1.601 0.114108
## L(train_data.Close.diff.ardl, 1:110)61   5.937e+02  2.103e+03   0.282 0.778602
## L(train_data.Close.diff.ardl, 1:110)62   6.651e+01  2.089e+03   0.032 0.974698
## L(train_data.Close.diff.ardl, 1:110)63  -1.414e+03  2.058e+03  -0.687 0.494469
## L(train_data.Close.diff.ardl, 1:110)64  -2.271e+03  2.077e+03  -1.093 0.278187
## L(train_data.Close.diff.ardl, 1:110)65  -1.340e+03  2.068e+03  -0.648 0.519139
## L(train_data.Close.diff.ardl, 1:110)66   3.765e+02  2.080e+03   0.181 0.856927
## L(train_data.Close.diff.ardl, 1:110)67   1.266e+03  2.111e+03   0.600 0.550815
## L(train_data.Close.diff.ardl, 1:110)68  -5.516e+02  2.097e+03  -0.263 0.793355
## L(train_data.Close.diff.ardl, 1:110)69  -3.151e+03  2.111e+03  -1.492 0.140234
## L(train_data.Close.diff.ardl, 1:110)70   1.034e+03  2.167e+03   0.477 0.634870
## L(train_data.Close.diff.ardl, 1:110)71  -2.791e+03  2.138e+03  -1.306 0.196120
## L(train_data.Close.diff.ardl, 1:110)72   1.434e+03  2.164e+03   0.663 0.509867
## L(train_data.Close.diff.ardl, 1:110)73  -4.576e+03  2.134e+03  -2.144 0.035580
## L(train_data.Close.diff.ardl, 1:110)74   4.076e+02  2.210e+03   0.184 0.854215
## L(train_data.Close.diff.ardl, 1:110)75  -6.363e+02  2.193e+03  -0.290 0.772597
## L(train_data.Close.diff.ardl, 1:110)76  -3.382e+02  2.192e+03  -0.154 0.877868
## L(train_data.Close.diff.ardl, 1:110)77  -2.239e+03  2.133e+03  -1.050 0.297510
## L(train_data.Close.diff.ardl, 1:110)78   2.598e+03  2.145e+03   1.211 0.230036
## L(train_data.Close.diff.ardl, 1:110)79  -4.744e+03  2.151e+03  -2.205 0.030836
## L(train_data.Close.diff.ardl, 1:110)80  -1.698e+03  2.168e+03  -0.783 0.436203
## L(train_data.Close.diff.ardl, 1:110)81  -1.734e+03  2.118e+03  -0.819 0.415812
## L(train_data.Close.diff.ardl, 1:110)82  -2.664e+03  2.147e+03  -1.241 0.218965
## L(train_data.Close.diff.ardl, 1:110)83  -1.014e+04  2.127e+03  -4.767 1.03e-05
## L(train_data.Close.diff.ardl, 1:110)84   8.292e+01  2.456e+03   0.034 0.973169
## L(train_data.Close.diff.ardl, 1:110)85  -2.393e+03  2.391e+03  -1.001 0.320477
## L(train_data.Close.diff.ardl, 1:110)86   2.911e+02  2.429e+03   0.120 0.904969
## L(train_data.Close.diff.ardl, 1:110)87   6.290e+02  2.383e+03   0.264 0.792636
## L(train_data.Close.diff.ardl, 1:110)88  -1.739e+03  2.400e+03  -0.724 0.471265
## L(train_data.Close.diff.ardl, 1:110)89  -3.828e+03  2.268e+03  -1.688 0.096077
## L(train_data.Close.diff.ardl, 1:110)90   3.149e+02  2.275e+03   0.138 0.890323
## L(train_data.Close.diff.ardl, 1:110)91  -1.414e+03  2.234e+03  -0.633 0.528845
## L(train_data.Close.diff.ardl, 1:110)92   5.441e+02  2.294e+03   0.237 0.813209
## L(train_data.Close.diff.ardl, 1:110)93   9.802e+02  2.230e+03   0.440 0.661675
## L(train_data.Close.diff.ardl, 1:110)94  -2.523e+02  2.240e+03  -0.113 0.910676
## L(train_data.Close.diff.ardl, 1:110)95  -7.200e+02  2.245e+03  -0.321 0.749438
## L(train_data.Close.diff.ardl, 1:110)96   1.301e+02  2.235e+03   0.058 0.953774
## L(train_data.Close.diff.ardl, 1:110)97   1.145e+03  2.253e+03   0.508 0.612873
## L(train_data.Close.diff.ardl, 1:110)98  -1.235e+02  2.259e+03  -0.055 0.956578
## L(train_data.Close.diff.ardl, 1:110)99   1.420e+02  2.266e+03   0.063 0.950230
## L(train_data.Close.diff.ardl, 1:110)100  1.962e+03  2.252e+03   0.871 0.386675
## L(train_data.Close.diff.ardl, 1:110)101  2.256e+03  2.251e+03   1.002 0.319961
## L(train_data.Close.diff.ardl, 1:110)102 -6.477e+02  2.243e+03  -0.289 0.773658
## L(train_data.Close.diff.ardl, 1:110)103 -3.308e+01  2.246e+03  -0.015 0.988293
## L(train_data.Close.diff.ardl, 1:110)104  1.348e+02  2.245e+03   0.060 0.952311
## L(train_data.Close.diff.ardl, 1:110)105 -7.424e+02  2.219e+03  -0.335 0.738983
## L(train_data.Close.diff.ardl, 1:110)106  1.158e+03  2.221e+03   0.521 0.603924
## L(train_data.Close.diff.ardl, 1:110)107 -1.228e+03  2.208e+03  -0.556 0.579709
## L(train_data.Close.diff.ardl, 1:110)108 -3.935e+03  2.196e+03  -1.792 0.077601
## L(train_data.Close.diff.ardl, 1:110)109 -8.357e+02  2.259e+03  -0.370 0.712594
## L(train_data.Close.diff.ardl, 1:110)110 -9.165e+02  2.226e+03  -0.412 0.681801
##                                            
## (Intercept)                             .  
## L(train_data.Volume.ardl, 1:32)1        ***
## L(train_data.Volume.ardl, 1:32)2           
## L(train_data.Volume.ardl, 1:32)3           
## L(train_data.Volume.ardl, 1:32)4           
## L(train_data.Volume.ardl, 1:32)5           
## L(train_data.Volume.ardl, 1:32)6        .  
## L(train_data.Volume.ardl, 1:32)7        .  
## L(train_data.Volume.ardl, 1:32)8        .  
## L(train_data.Volume.ardl, 1:32)9           
## L(train_data.Volume.ardl, 1:32)10          
## L(train_data.Volume.ardl, 1:32)11          
## L(train_data.Volume.ardl, 1:32)12          
## L(train_data.Volume.ardl, 1:32)13          
## L(train_data.Volume.ardl, 1:32)14          
## L(train_data.Volume.ardl, 1:32)15          
## L(train_data.Volume.ardl, 1:32)16          
## L(train_data.Volume.ardl, 1:32)17          
## L(train_data.Volume.ardl, 1:32)18          
## L(train_data.Volume.ardl, 1:32)19          
## L(train_data.Volume.ardl, 1:32)20          
## L(train_data.Volume.ardl, 1:32)21          
## L(train_data.Volume.ardl, 1:32)22          
## L(train_data.Volume.ardl, 1:32)23          
## L(train_data.Volume.ardl, 1:32)24          
## L(train_data.Volume.ardl, 1:32)25          
## L(train_data.Volume.ardl, 1:32)26          
## L(train_data.Volume.ardl, 1:32)27          
## L(train_data.Volume.ardl, 1:32)28          
## L(train_data.Volume.ardl, 1:32)29          
## L(train_data.Volume.ardl, 1:32)30          
## L(train_data.Volume.ardl, 1:32)31          
## L(train_data.Volume.ardl, 1:32)32          
## L(train_data.Volume.ardl, 91:122)91        
## L(train_data.Volume.ardl, 91:122)92        
## L(train_data.Volume.ardl, 91:122)93        
## L(train_data.Volume.ardl, 91:122)94     *  
## L(train_data.Volume.ardl, 91:122)95        
## L(train_data.Volume.ardl, 91:122)96        
## L(train_data.Volume.ardl, 91:122)97        
## L(train_data.Volume.ardl, 91:122)98        
## L(train_data.Volume.ardl, 91:122)99        
## L(train_data.Volume.ardl, 91:122)100       
## L(train_data.Volume.ardl, 91:122)101       
## L(train_data.Volume.ardl, 91:122)102       
## L(train_data.Volume.ardl, 91:122)103       
## L(train_data.Volume.ardl, 91:122)104       
## L(train_data.Volume.ardl, 91:122)105       
## L(train_data.Volume.ardl, 91:122)106       
## L(train_data.Volume.ardl, 91:122)107       
## L(train_data.Volume.ardl, 91:122)108       
## L(train_data.Volume.ardl, 91:122)109       
## L(train_data.Volume.ardl, 91:122)110       
## L(train_data.Volume.ardl, 91:122)111       
## L(train_data.Volume.ardl, 91:122)112    ** 
## L(train_data.Volume.ardl, 91:122)113    *  
## L(train_data.Volume.ardl, 91:122)114       
## L(train_data.Volume.ardl, 91:122)115       
## L(train_data.Volume.ardl, 91:122)116       
## L(train_data.Volume.ardl, 91:122)117       
## L(train_data.Volume.ardl, 91:122)118       
## L(train_data.Volume.ardl, 91:122)119    *  
## L(train_data.Volume.ardl, 91:122)120       
## L(train_data.Volume.ardl, 91:122)121       
## L(train_data.Volume.ardl, 91:122)122       
## L(train_data.Close.diff.ardl, 1:110)1      
## L(train_data.Close.diff.ardl, 1:110)2      
## L(train_data.Close.diff.ardl, 1:110)3      
## L(train_data.Close.diff.ardl, 1:110)4      
## L(train_data.Close.diff.ardl, 1:110)5      
## L(train_data.Close.diff.ardl, 1:110)6      
## L(train_data.Close.diff.ardl, 1:110)7      
## L(train_data.Close.diff.ardl, 1:110)8      
## L(train_data.Close.diff.ardl, 1:110)9   .  
## L(train_data.Close.diff.ardl, 1:110)10     
## L(train_data.Close.diff.ardl, 1:110)11     
## L(train_data.Close.diff.ardl, 1:110)12     
## L(train_data.Close.diff.ardl, 1:110)13     
## L(train_data.Close.diff.ardl, 1:110)14     
## L(train_data.Close.diff.ardl, 1:110)15     
## L(train_data.Close.diff.ardl, 1:110)16     
## L(train_data.Close.diff.ardl, 1:110)17     
## L(train_data.Close.diff.ardl, 1:110)18     
## L(train_data.Close.diff.ardl, 1:110)19     
## L(train_data.Close.diff.ardl, 1:110)20     
## L(train_data.Close.diff.ardl, 1:110)21     
## L(train_data.Close.diff.ardl, 1:110)22     
## L(train_data.Close.diff.ardl, 1:110)23     
## L(train_data.Close.diff.ardl, 1:110)24     
## L(train_data.Close.diff.ardl, 1:110)25     
## L(train_data.Close.diff.ardl, 1:110)26     
## L(train_data.Close.diff.ardl, 1:110)27  ***
## L(train_data.Close.diff.ardl, 1:110)28     
## L(train_data.Close.diff.ardl, 1:110)29     
## L(train_data.Close.diff.ardl, 1:110)30     
## L(train_data.Close.diff.ardl, 1:110)31     
## L(train_data.Close.diff.ardl, 1:110)32     
## L(train_data.Close.diff.ardl, 1:110)33     
## L(train_data.Close.diff.ardl, 1:110)34     
## L(train_data.Close.diff.ardl, 1:110)35     
## L(train_data.Close.diff.ardl, 1:110)36     
## L(train_data.Close.diff.ardl, 1:110)37     
## L(train_data.Close.diff.ardl, 1:110)38     
## L(train_data.Close.diff.ardl, 1:110)39     
## L(train_data.Close.diff.ardl, 1:110)40     
## L(train_data.Close.diff.ardl, 1:110)41     
## L(train_data.Close.diff.ardl, 1:110)42     
## L(train_data.Close.diff.ardl, 1:110)43     
## L(train_data.Close.diff.ardl, 1:110)44     
## L(train_data.Close.diff.ardl, 1:110)45     
## L(train_data.Close.diff.ardl, 1:110)46     
## L(train_data.Close.diff.ardl, 1:110)47     
## L(train_data.Close.diff.ardl, 1:110)48     
## L(train_data.Close.diff.ardl, 1:110)49     
## L(train_data.Close.diff.ardl, 1:110)50     
## L(train_data.Close.diff.ardl, 1:110)51     
## L(train_data.Close.diff.ardl, 1:110)52     
## L(train_data.Close.diff.ardl, 1:110)53     
## L(train_data.Close.diff.ardl, 1:110)54     
## L(train_data.Close.diff.ardl, 1:110)55     
## L(train_data.Close.diff.ardl, 1:110)56     
## L(train_data.Close.diff.ardl, 1:110)57     
## L(train_data.Close.diff.ardl, 1:110)58     
## L(train_data.Close.diff.ardl, 1:110)59     
## L(train_data.Close.diff.ardl, 1:110)60     
## L(train_data.Close.diff.ardl, 1:110)61     
## L(train_data.Close.diff.ardl, 1:110)62     
## L(train_data.Close.diff.ardl, 1:110)63     
## L(train_data.Close.diff.ardl, 1:110)64     
## L(train_data.Close.diff.ardl, 1:110)65     
## L(train_data.Close.diff.ardl, 1:110)66     
## L(train_data.Close.diff.ardl, 1:110)67     
## L(train_data.Close.diff.ardl, 1:110)68     
## L(train_data.Close.diff.ardl, 1:110)69     
## L(train_data.Close.diff.ardl, 1:110)70     
## L(train_data.Close.diff.ardl, 1:110)71     
## L(train_data.Close.diff.ardl, 1:110)72     
## L(train_data.Close.diff.ardl, 1:110)73  *  
## L(train_data.Close.diff.ardl, 1:110)74     
## L(train_data.Close.diff.ardl, 1:110)75     
## L(train_data.Close.diff.ardl, 1:110)76     
## L(train_data.Close.diff.ardl, 1:110)77     
## L(train_data.Close.diff.ardl, 1:110)78     
## L(train_data.Close.diff.ardl, 1:110)79  *  
## L(train_data.Close.diff.ardl, 1:110)80     
## L(train_data.Close.diff.ardl, 1:110)81     
## L(train_data.Close.diff.ardl, 1:110)82     
## L(train_data.Close.diff.ardl, 1:110)83  ***
## L(train_data.Close.diff.ardl, 1:110)84     
## L(train_data.Close.diff.ardl, 1:110)85     
## L(train_data.Close.diff.ardl, 1:110)86     
## L(train_data.Close.diff.ardl, 1:110)87     
## L(train_data.Close.diff.ardl, 1:110)88     
## L(train_data.Close.diff.ardl, 1:110)89  .  
## L(train_data.Close.diff.ardl, 1:110)90     
## L(train_data.Close.diff.ardl, 1:110)91     
## L(train_data.Close.diff.ardl, 1:110)92     
## L(train_data.Close.diff.ardl, 1:110)93     
## L(train_data.Close.diff.ardl, 1:110)94     
## L(train_data.Close.diff.ardl, 1:110)95     
## L(train_data.Close.diff.ardl, 1:110)96     
## L(train_data.Close.diff.ardl, 1:110)97     
## L(train_data.Close.diff.ardl, 1:110)98     
## L(train_data.Close.diff.ardl, 1:110)99     
## L(train_data.Close.diff.ardl, 1:110)100    
## L(train_data.Close.diff.ardl, 1:110)101    
## L(train_data.Close.diff.ardl, 1:110)102    
## L(train_data.Close.diff.ardl, 1:110)103    
## L(train_data.Close.diff.ardl, 1:110)104    
## L(train_data.Close.diff.ardl, 1:110)105    
## L(train_data.Close.diff.ardl, 1:110)106    
## L(train_data.Close.diff.ardl, 1:110)107    
## L(train_data.Close.diff.ardl, 1:110)108 .  
## L(train_data.Close.diff.ardl, 1:110)109    
## L(train_data.Close.diff.ardl, 1:110)110    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1585000 on 68 degrees of freedom
## Multiple R-squared:  0.833,  Adjusted R-squared:  0.4056 
## F-statistic: 1.949 on 174 and 68 DF,  p-value: 0.001004
Volume.Close.testing.4 <- predict(Volume.Close.training.4, n.ahead = length(test_data.Volume.ardl, test_data.Close.diff.ardl))
head(Volume.Close.testing.4)
## 2015(123) 2015(124) 2015(125) 2015(126) 2015(127) 2015(128) 
## 3032093.7 3346910.8 2038769.9  821872.1 2431253.8 2127891.0
Volume.Close.fitted_training.4 <- fitted(Volume.Close.training.4)
head(Volume.Close.fitted_training.4)
## Time Series:
## Start = c(2015, 123) 
## End = c(2015, 128) 
## Frequency = 365 
## [1] 3032093.7 3346910.8 2038769.9  821872.1 2431253.8 2127891.0
Volume.Close.4.training.mse_value <- mse(train_data.Volume.ardl, Volume.Close.fitted_training.4)
Volume.Close.4.training.rmse_value <- rmse(train_data.Volume.ardl, Volume.Close.fitted_training.4)

Volume.testing.n.4 = as.numeric(Volume.Close.testing.4)


Volume.Close.4.testing.mse_value <- mse(test_data.Volume.ardl, Volume.testing.n.4)
Volume.Close.4.testing.rmse_value <- rmse(test_data.Volume.ardl, Volume.testing.n.4)

cat("Training Model MSE:", Volume.Close.4.training.mse_value, "\n Training Model RMSE:", Volume.Close.4.training.rmse_value , "\n Testing Model MSE:", Volume.Close.4.testing.mse_value, "\n Testing Model RMSE:", Volume.Close.4.testing.rmse_value , "\n")
## Training Model MSE: 703209226609 
##  Training Model RMSE: 838575.7 
##  Testing Model MSE: 7.571737e+12 
##  Testing Model RMSE: 2751679
cat(" Training Model AIC:", AIC(Volume.Close.training.4), "\n Training Model BIC:", BIC(Volume.Close.training.4), "\n")
##  Training Model AIC: 7670.382 
##  Training Model BIC: 8285.161

This training model has a R-squared of 0.833, meaning a good portion of the model can be explained well by the independent variable here. The high MSE value of the testing model does not really point to a good fit though. The RMSE of the testing model is also a lot higher than that of the training model, suggesting that the accuracy of the testing model is much worse than that of the training model. The AIC and BIC of this model also result in similar values to that of the previous model.

Volume and Open

Size

train_size.Volume.ardl <- floor (2/3 * length(Volume.ts))
train_size.Open.diff.ardl <- floor (2/3 * length(Open.ts.diff))
#### Data
train_data.Volume.ardl <- Volume.ts[1:train_size.Volume.ardl]
train_data.Volume.ardl = ts(train_data.Volume.ardl,
                            start=c(2015,1),
                            end=c(2015,365),
                            frequency=365)
train_data.Open.diff.ardl <- Open.ts.diff[1:train_size.Open.diff.ardl]
train_data.Open.diff.ardl = ts(train_data.Open.diff.ardl,
                               start=c(2015,1),
                               end=c(2015,365),
                               frequency=365)
#### Test
test_data.Volume.ardl <- Volume.ts[(train_size.Volume.ardl + 1):length(Volume.ts)] 
test_data.Volume.ardl = ts(test_data.Volume.ardl, start=c(2015,1), end=c(2015,365), frequency=365)

test_data.Open.diff.ardl <- Open.ts.diff[(train_size.Open.diff.ardl + 1):length(Open.ts.diff)] 
test_data.Open.diff.ardl = ts(test_data.Open.diff.ardl, start=c(2015,1), end=c(2015,365), frequency=365)

length(train_data.Volume.ardl)  
## [1] 365
length(test_data.Open.diff.ardl)
## [1] 365

Testing and Training for Volume with lag (1:32) and Open lag (110)

Volume.open.training.1 <- dynlm(train_data.Volume.ardl ~ L(train_data.Volume.ardl, 1:32) + L(train_data.Open.diff.ardl, 110))
summary(Volume.open.training.1)
## 
## Time series regression with "ts" data:
## Start = 2015(111), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Volume.ardl ~ L(train_data.Volume.ardl, 
##     1:32) + L(train_data.Open.diff.ardl, 110))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2274160  -868517  -208084   411518 16578331 
## 
## Coefficients:
##                                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        5.595e+05  3.910e+05   1.431   0.1538    
## L(train_data.Volume.ardl, 1:32)1   3.216e-01  6.711e-02   4.792 3.03e-06 ***
## L(train_data.Volume.ardl, 1:32)2   6.621e-02  7.059e-02   0.938   0.3493    
## L(train_data.Volume.ardl, 1:32)3  -4.357e-02  7.068e-02  -0.617   0.5382    
## L(train_data.Volume.ardl, 1:32)4   1.073e-01  7.054e-02   1.521   0.1298    
## L(train_data.Volume.ardl, 1:32)5  -2.366e-04  7.048e-02  -0.003   0.9973    
## L(train_data.Volume.ardl, 1:32)6   3.998e-02  7.085e-02   0.564   0.5732    
## L(train_data.Volume.ardl, 1:32)7   9.598e-02  7.052e-02   1.361   0.1749    
## L(train_data.Volume.ardl, 1:32)8  -2.614e-03  7.093e-02  -0.037   0.9706    
## L(train_data.Volume.ardl, 1:32)9  -5.988e-04  7.019e-02  -0.009   0.9932    
## L(train_data.Volume.ardl, 1:32)10  5.243e-02  6.969e-02   0.752   0.4527    
## L(train_data.Volume.ardl, 1:32)11 -5.164e-02  6.974e-02  -0.740   0.4598    
## L(train_data.Volume.ardl, 1:32)12  1.670e-02  6.978e-02   0.239   0.8111    
## L(train_data.Volume.ardl, 1:32)13 -2.925e-02  6.971e-02  -0.420   0.6752    
## L(train_data.Volume.ardl, 1:32)14 -2.703e-02  6.971e-02  -0.388   0.6986    
## L(train_data.Volume.ardl, 1:32)15  4.979e-02  6.975e-02   0.714   0.4761    
## L(train_data.Volume.ardl, 1:32)16 -4.019e-02  6.981e-02  -0.576   0.5653    
## L(train_data.Volume.ardl, 1:32)17 -7.987e-03  6.982e-02  -0.114   0.9090    
## L(train_data.Volume.ardl, 1:32)18  2.025e-02  6.966e-02   0.291   0.7716    
## L(train_data.Volume.ardl, 1:32)19 -2.686e-02  6.966e-02  -0.386   0.7001    
## L(train_data.Volume.ardl, 1:32)20  3.377e-02  6.965e-02   0.485   0.6282    
## L(train_data.Volume.ardl, 1:32)21 -3.482e-02  6.973e-02  -0.499   0.6180    
## L(train_data.Volume.ardl, 1:32)22  1.683e-03  7.007e-02   0.024   0.9809    
## L(train_data.Volume.ardl, 1:32)23  1.823e-02  7.011e-02   0.260   0.7951    
## L(train_data.Volume.ardl, 1:32)24  1.588e-01  7.005e-02   2.267   0.0243 *  
## L(train_data.Volume.ardl, 1:32)25 -1.489e-02  7.074e-02  -0.211   0.8335    
## L(train_data.Volume.ardl, 1:32)26  4.765e-02  7.044e-02   0.676   0.4994    
## L(train_data.Volume.ardl, 1:32)27  2.449e-02  7.581e-02   0.323   0.7470    
## L(train_data.Volume.ardl, 1:32)28 -1.158e-01  7.071e-02  -1.637   0.1030    
## L(train_data.Volume.ardl, 1:32)29  7.143e-02  7.055e-02   1.012   0.3124    
## L(train_data.Volume.ardl, 1:32)30  1.081e-02  7.076e-02   0.153   0.8787    
## L(train_data.Volume.ardl, 1:32)31  2.168e-02  7.054e-02   0.307   0.7589    
## L(train_data.Volume.ardl, 1:32)32  5.713e-02  6.717e-02   0.851   0.3959    
## L(train_data.Open.diff.ardl, 110)  9.287e+02  1.833e+03   0.507   0.6130    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1836000 on 221 degrees of freedom
## Multiple R-squared:  0.2741, Adjusted R-squared:  0.1657 
## F-statistic: 2.529 on 33 and 221 DF,  p-value: 3.482e-05
Volume.open.testing.1 <- predict(Volume.open.training.1, n.ahead = length(test_data.Volume.ardl, test_data.Close.diff.ardl))
head(Volume.open.testing.1)
## 2015(111) 2015(112) 2015(113) 2015(114) 2015(115) 2015(116) 
##   2297320   2181412   2420314   2322166   2630299   2186327
Volume.open.fitted_training.1 <- fitted(Volume.open.training.1)
head(Volume.open.fitted_training.1)
## Time Series:
## Start = c(2015, 111) 
## End = c(2015, 116) 
## Frequency = 365 
## [1] 2297320 2181412 2420314 2322166 2630299 2186327
Volume.open.1.training.mse_value <- mse(train_data.Volume.ardl, Volume.open.fitted_training.1)
Volume.open.1.training.rmse_value <- rmse(train_data.Volume.ardl, Volume.open.fitted_training.1)

Volume.testing.n.1 = as.numeric(Volume.open.testing.1)

Volume.open.1.testing.mse_value <- mse(test_data.Volume.ardl, Volume.testing.n.1)
Volume.open.1.testing.rmse_value <- rmse(test_data.Volume.ardl, Volume.testing.n.1)

cat("Training Model MSE:", Volume.open.1.training.mse_value, "\n Training Model RMSE:", Volume.open.1.training.rmse_value , "\n Testing Model MSE:", Volume.open.1.testing.mse_value, "\n Testing Model RMSE:", Volume.open.1.testing.rmse_value , "\n")
## Training Model MSE: 2.92166e+12 
##  Training Model RMSE: 1709286 
##  Testing Model MSE: 4.251657e+12 
##  Testing Model RMSE: 2061955
cat(" Training Model AIC:", AIC(Volume.open.training.1), "\n Training Model BIC:", BIC(Volume.open.training.1), "\n")
##  Training Model AIC: 8112.968 
##  Training Model BIC: 8236.912

The R-squared value of this training model is 0.2741, not the most ideal value. And the MSE of both the training and testing are very high. The RMSE results in slightly lower result but they are still not the lowest out of the ones observed here. The same apply to the AIC and BIC, which are not the lowest observed here, so we can conclude that this ARDL model is not a good fit.

Testing and Training for Volume with lag (1:32) and Open lag (1:110)

Volume.open.training.2 <- dynlm(train_data.Volume.ardl ~ L(train_data.Volume.ardl, 1:32) + L(train_data.Open.diff.ardl, 35) + L(train_data.Open.diff.ardl, 110), data = infy_stock)
summary(Volume.open.training.2)
## 
## Time series regression with "ts" data:
## Start = 2015(111), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Volume.ardl ~ L(train_data.Volume.ardl, 
##     1:32) + L(train_data.Open.diff.ardl, 35) + L(train_data.Open.diff.ardl, 
##     110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2288291  -859533  -190270   390955 16581904 
## 
## Coefficients:
##                                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        5.638e+05  3.916e+05   1.440    0.151    
## L(train_data.Volume.ardl, 1:32)1   3.180e-01  6.748e-02   4.712 4.34e-06 ***
## L(train_data.Volume.ardl, 1:32)2   6.883e-02  7.083e-02   0.972    0.332    
## L(train_data.Volume.ardl, 1:32)3  -4.808e-02  7.117e-02  -0.676    0.500    
## L(train_data.Volume.ardl, 1:32)4   1.094e-01  7.073e-02   1.547    0.123    
## L(train_data.Volume.ardl, 1:32)5   3.336e-04  7.058e-02   0.005    0.996    
## L(train_data.Volume.ardl, 1:32)6   4.444e-02  7.133e-02   0.623    0.534    
## L(train_data.Volume.ardl, 1:32)7   9.777e-02  7.068e-02   1.383    0.168    
## L(train_data.Volume.ardl, 1:32)8  -2.906e-02  8.332e-02  -0.349    0.728    
## L(train_data.Volume.ardl, 1:32)9   1.030e-02  7.255e-02   0.142    0.887    
## L(train_data.Volume.ardl, 1:32)10  5.605e-02  7.005e-02   0.800    0.425    
## L(train_data.Volume.ardl, 1:32)11 -5.293e-02  6.987e-02  -0.758    0.450    
## L(train_data.Volume.ardl, 1:32)12  1.852e-02  6.994e-02   0.265    0.791    
## L(train_data.Volume.ardl, 1:32)13 -3.061e-02  6.985e-02  -0.438    0.662    
## L(train_data.Volume.ardl, 1:32)14 -2.594e-02  6.984e-02  -0.371    0.711    
## L(train_data.Volume.ardl, 1:32)15  5.165e-02  6.992e-02   0.739    0.461    
## L(train_data.Volume.ardl, 1:32)16 -4.405e-02  7.020e-02  -0.627    0.531    
## L(train_data.Volume.ardl, 1:32)17 -7.803e-03  6.992e-02  -0.112    0.911    
## L(train_data.Volume.ardl, 1:32)18  2.317e-02  6.993e-02   0.331    0.741    
## L(train_data.Volume.ardl, 1:32)19 -2.810e-02  6.979e-02  -0.403    0.688    
## L(train_data.Volume.ardl, 1:32)20  3.653e-02  6.990e-02   0.523    0.602    
## L(train_data.Volume.ardl, 1:32)21 -3.368e-02  6.986e-02  -0.482    0.630    
## L(train_data.Volume.ardl, 1:32)22 -1.693e-04  7.024e-02  -0.002    0.998    
## L(train_data.Volume.ardl, 1:32)23  2.079e-02  7.033e-02   0.296    0.768    
## L(train_data.Volume.ardl, 1:32)24  1.584e-01  7.016e-02   2.257    0.025 *  
## L(train_data.Volume.ardl, 1:32)25 -1.294e-02  7.091e-02  -0.182    0.855    
## L(train_data.Volume.ardl, 1:32)26  4.676e-02  7.056e-02   0.663    0.508    
## L(train_data.Volume.ardl, 1:32)27  2.217e-02  7.602e-02   0.292    0.771    
## L(train_data.Volume.ardl, 1:32)28 -1.147e-01  7.083e-02  -1.620    0.107    
## L(train_data.Volume.ardl, 1:32)29  7.100e-02  7.066e-02   1.005    0.316    
## L(train_data.Volume.ardl, 1:32)30  8.148e-03  7.100e-02   0.115    0.909    
## L(train_data.Volume.ardl, 1:32)31  2.355e-02  7.071e-02   0.333    0.739    
## L(train_data.Volume.ardl, 1:32)32  5.959e-02  6.739e-02   0.884    0.378    
## L(train_data.Open.diff.ardl, 35)  -1.217e+03  2.005e+03  -0.607    0.544    
## L(train_data.Open.diff.ardl, 110)  8.448e+02  1.841e+03   0.459    0.647    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1839000 on 220 degrees of freedom
## Multiple R-squared:  0.2753, Adjusted R-squared:  0.1633 
## F-statistic: 2.458 on 34 and 220 DF,  p-value: 5.07e-05
Volume.open.testing.2 <- predict(Volume.open.training.2, n.ahead = length(test_data.Volume.ardl, test_data.Close.diff.ardl))
head(Volume.open.testing.2)
## 2015(111) 2015(112) 2015(113) 2015(114) 2015(115) 2015(116) 
##   2325093   2336453   2445838   2353241   2630145   2189706
Volume.open.fitted_training.2 <- fitted(Volume.open.training.2)
head(Volume.open.fitted_training.2)
## Time Series:
## Start = c(2015, 111) 
## End = c(2015, 116) 
## Frequency = 365 
## [1] 2325093 2336453 2445838 2353241 2630145 2189706
Volume.open.2.training.mse_value <- mse(train_data.Volume.ardl, Volume.open.fitted_training.2)
Volume.open.2.training.rmse_value <- rmse(train_data.Volume.ardl, Volume.open.fitted_training.2)

Volume.testing.n.2 = as.numeric(Volume.open.testing.2)

Volume.open.2.testing.mse_value <- mse(test_data.Volume.ardl, Volume.testing.n.2)
Volume.open.2.testing.rmse_value <- rmse(test_data.Volume.ardl, Volume.testing.n.2)

cat("Training Model MSE:", Volume.open.2.training.mse_value, "\n Training Model RMSE:", Volume.open.2.training.rmse_value , "\n Testing Model MSE:", Volume.open.2.testing.mse_value, "\n Testing Model RMSE:", Volume.open.2.testing.rmse_value , "\n")
## Training Model MSE: 2.916772e+12 
##  Training Model RMSE: 1707856 
##  Testing Model MSE: 4.263623e+12 
##  Testing Model RMSE: 2064854
cat(" Training Model AIC:", AIC(Volume.open.training.2), "\n Training Model BIC:", BIC(Volume.open.training.2), "\n")
##  Training Model AIC: 8114.541 
##  Training Model BIC: 8242.026

The same conclusion applies to this model too. Because as observed, the values of R-squared and the MSE and RMSE of both the training and the testing models are all of similar values to the previous ARDL model. The AIC and BIC are also similar, thus this ARDL model is not a good fit.

Testing and Training for Volume with lag (1:32)n(91:122) and Open lag (110)

Volume.open.training.3 <- dynlm(train_data.Volume.ardl ~ L(train_data.Volume.ardl, 1:32) + L(train_data.Volume.ardl, 91:122) + L(train_data.Open.diff.ardl, 110), data = infy_stock)
summary(Volume.open.training.3)
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Volume.ardl ~ L(train_data.Volume.ardl, 
##     1:32) + L(train_data.Volume.ardl, 91:122) + L(train_data.Open.diff.ardl, 
##     110), data = infy_stock)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2794576  -849697  -135411   510257 16089470 
## 
## Coefficients:
##                                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                           2.500e+06  1.020e+06   2.452   0.0152 *  
## L(train_data.Volume.ardl, 1:32)1      3.043e-01  7.493e-02   4.062 7.31e-05 ***
## L(train_data.Volume.ardl, 1:32)2      4.457e-02  7.829e-02   0.569   0.5699    
## L(train_data.Volume.ardl, 1:32)3     -4.073e-02  7.906e-02  -0.515   0.6071    
## L(train_data.Volume.ardl, 1:32)4      6.475e-02  7.879e-02   0.822   0.4123    
## L(train_data.Volume.ardl, 1:32)5     -1.766e-02  7.882e-02  -0.224   0.8230    
## L(train_data.Volume.ardl, 1:32)6      1.808e-02  7.895e-02   0.229   0.8191    
## L(train_data.Volume.ardl, 1:32)7      1.117e-01  7.860e-02   1.421   0.1571    
## L(train_data.Volume.ardl, 1:32)8     -3.371e-02  7.907e-02  -0.426   0.6704    
## L(train_data.Volume.ardl, 1:32)9     -6.424e-03  7.882e-02  -0.081   0.9351    
## L(train_data.Volume.ardl, 1:32)10     5.578e-02  7.856e-02   0.710   0.4787    
## L(train_data.Volume.ardl, 1:32)11    -7.420e-02  7.799e-02  -0.951   0.3427    
## L(train_data.Volume.ardl, 1:32)12     4.890e-02  7.825e-02   0.625   0.5328    
## L(train_data.Volume.ardl, 1:32)13    -9.257e-02  7.842e-02  -1.181   0.2394    
## L(train_data.Volume.ardl, 1:32)14     1.567e-04  7.889e-02   0.002   0.9984    
## L(train_data.Volume.ardl, 1:32)15     9.153e-03  7.889e-02   0.116   0.9078    
## L(train_data.Volume.ardl, 1:32)16    -3.981e-02  7.876e-02  -0.505   0.6139    
## L(train_data.Volume.ardl, 1:32)17    -1.150e-02  7.866e-02  -0.146   0.8839    
## L(train_data.Volume.ardl, 1:32)18    -3.204e-03  7.851e-02  -0.041   0.9675    
## L(train_data.Volume.ardl, 1:32)19    -2.457e-02  7.842e-02  -0.313   0.7544    
## L(train_data.Volume.ardl, 1:32)20     2.717e-02  7.834e-02   0.347   0.7291    
## L(train_data.Volume.ardl, 1:32)21    -3.681e-02  7.893e-02  -0.466   0.6415    
## L(train_data.Volume.ardl, 1:32)22     6.077e-03  7.960e-02   0.076   0.9392    
## L(train_data.Volume.ardl, 1:32)23     2.975e-02  7.957e-02   0.374   0.7089    
## L(train_data.Volume.ardl, 1:32)24     9.621e-02  7.937e-02   1.212   0.2270    
## L(train_data.Volume.ardl, 1:32)25     3.506e-02  7.961e-02   0.440   0.6602    
## L(train_data.Volume.ardl, 1:32)26     1.570e-02  7.940e-02   0.198   0.8435    
## L(train_data.Volume.ardl, 1:32)27     6.737e-02  8.669e-02   0.777   0.4381    
## L(train_data.Volume.ardl, 1:32)28    -1.205e-01  7.967e-02  -1.512   0.1323    
## L(train_data.Volume.ardl, 1:32)29     3.898e-02  7.923e-02   0.492   0.6233    
## L(train_data.Volume.ardl, 1:32)30     5.800e-02  7.998e-02   0.725   0.4693    
## L(train_data.Volume.ardl, 1:32)31     1.043e-02  8.022e-02   0.130   0.8967    
## L(train_data.Volume.ardl, 1:32)32     6.865e-02  7.555e-02   0.909   0.3648    
## L(train_data.Volume.ardl, 91:122)91  -7.376e-02  7.574e-02  -0.974   0.3314    
## L(train_data.Volume.ardl, 91:122)92   1.556e-02  8.020e-02   0.194   0.8464    
## L(train_data.Volume.ardl, 91:122)93  -1.177e-01  7.991e-02  -1.473   0.1425    
## L(train_data.Volume.ardl, 91:122)94   8.838e-02  7.923e-02   1.115   0.2662    
## L(train_data.Volume.ardl, 91:122)95  -6.068e-02  7.939e-02  -0.764   0.4457    
## L(train_data.Volume.ardl, 91:122)96   1.451e-02  7.937e-02   0.183   0.8551    
## L(train_data.Volume.ardl, 91:122)97  -4.039e-02  7.936e-02  -0.509   0.6114    
## L(train_data.Volume.ardl, 91:122)98  -2.708e-02  7.962e-02  -0.340   0.7342    
## L(train_data.Volume.ardl, 91:122)99   5.681e-02  7.929e-02   0.716   0.4746    
## L(train_data.Volume.ardl, 91:122)100 -5.560e-02  7.938e-02  -0.700   0.4846    
## L(train_data.Volume.ardl, 91:122)101  1.215e-02  7.959e-02   0.153   0.8788    
## L(train_data.Volume.ardl, 91:122)102 -1.994e-03  7.892e-02  -0.025   0.9799    
## L(train_data.Volume.ardl, 91:122)103  1.052e-02  7.832e-02   0.134   0.8933    
## L(train_data.Volume.ardl, 91:122)104 -5.039e-02  7.845e-02  -0.642   0.5215    
## L(train_data.Volume.ardl, 91:122)105 -1.219e-02  7.861e-02  -0.155   0.8770    
## L(train_data.Volume.ardl, 91:122)106 -9.619e-02  7.859e-02  -1.224   0.2226    
## L(train_data.Volume.ardl, 91:122)107  6.355e-02  7.904e-02   0.804   0.4225    
## L(train_data.Volume.ardl, 91:122)108 -3.665e-02  7.883e-02  -0.465   0.6426    
## L(train_data.Volume.ardl, 91:122)109 -4.076e-02  7.892e-02  -0.516   0.6062    
## L(train_data.Volume.ardl, 91:122)110 -4.346e-02  7.839e-02  -0.554   0.5800    
## L(train_data.Volume.ardl, 91:122)111 -2.694e-02  7.829e-02  -0.344   0.7312    
## L(train_data.Volume.ardl, 91:122)112  1.553e-01  7.804e-02   1.989   0.0482 *  
## L(train_data.Volume.ardl, 91:122)113 -8.173e-02  7.856e-02  -1.040   0.2996    
## L(train_data.Volume.ardl, 91:122)114 -5.770e-02  7.863e-02  -0.734   0.4641    
## L(train_data.Volume.ardl, 91:122)115 -1.327e-02  7.968e-02  -0.166   0.8680    
## L(train_data.Volume.ardl, 91:122)116  1.985e-02  7.858e-02   0.253   0.8009    
## L(train_data.Volume.ardl, 91:122)117  8.518e-02  7.858e-02   1.084   0.2799    
## L(train_data.Volume.ardl, 91:122)118 -3.335e-02  7.890e-02  -0.423   0.6730    
## L(train_data.Volume.ardl, 91:122)119 -1.100e-01  7.901e-02  -1.393   0.1655    
## L(train_data.Volume.ardl, 91:122)120  7.825e-02  7.998e-02   0.978   0.3292    
## L(train_data.Volume.ardl, 91:122)121 -5.101e-02  7.822e-02  -0.652   0.5152    
## L(train_data.Volume.ardl, 91:122)122 -1.084e-02  7.491e-02  -0.145   0.8851    
## L(train_data.Open.diff.ardl, 110)     1.652e+03  2.025e+03   0.816   0.4157    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1930000 on 177 degrees of freedom
## Multiple R-squared:  0.3555, Adjusted R-squared:  0.1188 
## F-statistic: 1.502 on 65 and 177 DF,  p-value: 0.01932
Volume.open.testing.3 <- predict(Volume.open.training.3, n.ahead = length(test_data.Volume.ardl, test_data.Close.diff.ardl))
head(Volume.open.testing.3)
## 2015(123) 2015(124) 2015(125) 2015(126) 2015(127) 2015(128) 
##   3435267   4153205   3079545   2197886   3204746   2469964
Volume.open.fitted_training.3 <- fitted(Volume.open.training.3)
head(Volume.open.fitted_training.3)
## Time Series:
## Start = c(2015, 123) 
## End = c(2015, 128) 
## Frequency = 365 
## [1] 3435267 4153205 3079545 2197886 3204746 2469964
Volume.open.3.training.mse_value <- mse(train_data.Volume.ardl, Volume.open.fitted_training.3)
Volume.open.3.training.rmse_value <- rmse(train_data.Volume.ardl, Volume.open.fitted_training.3)

Volume.testing.n.3 = as.numeric(Volume.open.testing.3)

Volume.open.3.testing.mse_value <- mse(test_data.Volume.ardl, Volume.testing.n.3)
Volume.open.3.testing.rmse_value <- rmse(test_data.Volume.ardl, Volume.testing.n.3)

cat("Training Model MSE:", Volume.open.3.training.mse_value, "\n Training Model RMSE:", Volume.open.3.training.rmse_value , "\n Testing Model MSE:", Volume.open.3.testing.mse_value, "\n Testing Model RMSE:", Volume.open.3.testing.rmse_value , "\n")
## Training Model MSE: 2.713427e+12 
##  Training Model RMSE: 1647248 
##  Testing Model MSE: 4.68818e+12 
##  Testing Model RMSE: 2165221
cat(" Training Model AIC:", AIC(Volume.open.training.3), "\n Training Model BIC:", BIC(Volume.open.training.3), "\n")
##  Training Model AIC: 7780.508 
##  Training Model BIC: 8014.543

The R-squared value is 0.3555, suggesting that only a small portion of the model can be explained by the independent variable. The AIC and BIC values are also not the lowest we have observed, so this model is not a good fit. This is supported by the high MSE and high RMSE values of both the training and the testing model.

Testing and Training for Volume with lag (1:32)n(91:122) and Open lag (35)n(110)

Volume.open.training.4 <- dynlm(train_data.Volume.ardl ~ L(train_data.Volume.ardl, 1:32) + L(train_data.Volume.ardl, 91:122) + L(train_data.Open.diff.ardl, 35) + L(train_data.Open.diff.ardl, 110))
summary(Volume.open.training.4)
## 
## Time series regression with "ts" data:
## Start = 2015(123), End = 2015(365)
## 
## Call:
## dynlm(formula = train_data.Volume.ardl ~ L(train_data.Volume.ardl, 
##     1:32) + L(train_data.Volume.ardl, 91:122) + L(train_data.Open.diff.ardl, 
##     35) + L(train_data.Open.diff.ardl, 110))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2804521  -830848  -123819   520158 16106631 
## 
## Coefficients:
##                                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                           2.455e+06  1.026e+06   2.393   0.0178 *  
## L(train_data.Volume.ardl, 1:32)1      3.029e-01  7.515e-02   4.031 8.27e-05 ***
## L(train_data.Volume.ardl, 1:32)2      4.710e-02  7.864e-02   0.599   0.5500    
## L(train_data.Volume.ardl, 1:32)3     -4.467e-02  7.966e-02  -0.561   0.5757    
## L(train_data.Volume.ardl, 1:32)4      6.700e-02  7.910e-02   0.847   0.3981    
## L(train_data.Volume.ardl, 1:32)5     -1.626e-02  7.905e-02  -0.206   0.8373    
## L(train_data.Volume.ardl, 1:32)6      2.178e-02  7.951e-02   0.274   0.7844    
## L(train_data.Volume.ardl, 1:32)7      1.148e-01  7.905e-02   1.453   0.1481    
## L(train_data.Volume.ardl, 1:32)8     -6.011e-02  9.674e-02  -0.621   0.5351    
## L(train_data.Volume.ardl, 1:32)9      4.885e-03  8.249e-02   0.059   0.9528    
## L(train_data.Volume.ardl, 1:32)10     5.843e-02  7.893e-02   0.740   0.4601    
## L(train_data.Volume.ardl, 1:32)11    -7.442e-02  7.816e-02  -0.952   0.3423    
## L(train_data.Volume.ardl, 1:32)12     5.061e-02  7.850e-02   0.645   0.5200    
## L(train_data.Volume.ardl, 1:32)13    -9.308e-02  7.859e-02  -1.184   0.2379    
## L(train_data.Volume.ardl, 1:32)14     1.043e-03  7.908e-02   0.013   0.9895    
## L(train_data.Volume.ardl, 1:32)15     1.088e-02  7.914e-02   0.137   0.8908    
## L(train_data.Volume.ardl, 1:32)16    -4.246e-02  7.913e-02  -0.537   0.5922    
## L(train_data.Volume.ardl, 1:32)17    -1.158e-02  7.884e-02  -0.147   0.8833    
## L(train_data.Volume.ardl, 1:32)18     1.135e-03  7.921e-02   0.014   0.9886    
## L(train_data.Volume.ardl, 1:32)19    -2.573e-02  7.863e-02  -0.327   0.7439    
## L(train_data.Volume.ardl, 1:32)20     3.064e-02  7.884e-02   0.389   0.6980    
## L(train_data.Volume.ardl, 1:32)21    -3.726e-02  7.910e-02  -0.471   0.6382    
## L(train_data.Volume.ardl, 1:32)22     4.854e-03  7.982e-02   0.061   0.9516    
## L(train_data.Volume.ardl, 1:32)23     3.178e-02  7.985e-02   0.398   0.6911    
## L(train_data.Volume.ardl, 1:32)24     9.566e-02  7.955e-02   1.202   0.2308    
## L(train_data.Volume.ardl, 1:32)25     3.731e-02  7.992e-02   0.467   0.6412    
## L(train_data.Volume.ardl, 1:32)26     1.356e-02  7.970e-02   0.170   0.8651    
## L(train_data.Volume.ardl, 1:32)27     6.598e-02  8.692e-02   0.759   0.4488    
## L(train_data.Volume.ardl, 1:32)28    -1.198e-01  7.986e-02  -1.500   0.1353    
## L(train_data.Volume.ardl, 1:32)29     3.838e-02  7.941e-02   0.483   0.6295    
## L(train_data.Volume.ardl, 1:32)30     5.650e-02  8.022e-02   0.704   0.4822    
## L(train_data.Volume.ardl, 1:32)31     1.269e-02  8.053e-02   0.158   0.8750    
## L(train_data.Volume.ardl, 1:32)32     6.939e-02  7.573e-02   0.916   0.3608    
## L(train_data.Volume.ardl, 91:122)91  -7.343e-02  7.591e-02  -0.967   0.3347    
## L(train_data.Volume.ardl, 91:122)92   1.546e-02  8.037e-02   0.192   0.8477    
## L(train_data.Volume.ardl, 91:122)93  -1.174e-01  8.009e-02  -1.465   0.1446    
## L(train_data.Volume.ardl, 91:122)94   9.082e-02  7.957e-02   1.141   0.2553    
## L(train_data.Volume.ardl, 91:122)95  -6.292e-02  7.970e-02  -0.789   0.4309    
## L(train_data.Volume.ardl, 91:122)96   2.041e-02  8.050e-02   0.254   0.8002    
## L(train_data.Volume.ardl, 91:122)97  -4.156e-02  7.957e-02  -0.522   0.6021    
## L(train_data.Volume.ardl, 91:122)98  -2.705e-02  7.979e-02  -0.339   0.7350    
## L(train_data.Volume.ardl, 91:122)99   5.619e-02  7.948e-02   0.707   0.4805    
## L(train_data.Volume.ardl, 91:122)100 -5.448e-02  7.959e-02  -0.684   0.4946    
## L(train_data.Volume.ardl, 91:122)101  7.324e-03  8.041e-02   0.091   0.9275    
## L(train_data.Volume.ardl, 91:122)102  3.481e-03  7.992e-02   0.044   0.9653    
## L(train_data.Volume.ardl, 91:122)103  8.331e-03  7.863e-02   0.106   0.9157    
## L(train_data.Volume.ardl, 91:122)104 -5.250e-02  7.875e-02  -0.667   0.5058    
## L(train_data.Volume.ardl, 91:122)105 -1.028e-02  7.888e-02  -0.130   0.8965    
## L(train_data.Volume.ardl, 91:122)106 -9.849e-02  7.891e-02  -1.248   0.2136    
## L(train_data.Volume.ardl, 91:122)107  6.538e-02  7.931e-02   0.824   0.4109    
## L(train_data.Volume.ardl, 91:122)108 -3.570e-02  7.903e-02  -0.452   0.6520    
## L(train_data.Volume.ardl, 91:122)109 -3.946e-02  7.914e-02  -0.499   0.6187    
## L(train_data.Volume.ardl, 91:122)110 -4.112e-02  7.872e-02  -0.522   0.6021    
## L(train_data.Volume.ardl, 91:122)111 -2.545e-02  7.852e-02  -0.324   0.7463    
## L(train_data.Volume.ardl, 91:122)112  1.538e-01  7.827e-02   1.965   0.0510 .  
## L(train_data.Volume.ardl, 91:122)113 -8.162e-02  7.873e-02  -1.037   0.3013    
## L(train_data.Volume.ardl, 91:122)114 -5.866e-02  7.883e-02  -0.744   0.4578    
## L(train_data.Volume.ardl, 91:122)115 -1.177e-02  7.992e-02  -0.147   0.8830    
## L(train_data.Volume.ardl, 91:122)116  1.963e-02  7.875e-02   0.249   0.8035    
## L(train_data.Volume.ardl, 91:122)117  8.645e-02  7.880e-02   1.097   0.2741    
## L(train_data.Volume.ardl, 91:122)118 -3.529e-02  7.918e-02  -0.446   0.6564    
## L(train_data.Volume.ardl, 91:122)119 -1.098e-01  7.919e-02  -1.386   0.1675    
## L(train_data.Volume.ardl, 91:122)120  8.284e-02  8.074e-02   1.026   0.3063    
## L(train_data.Volume.ardl, 91:122)121 -5.339e-02  7.855e-02  -0.680   0.4976    
## L(train_data.Volume.ardl, 91:122)122 -1.077e-02  7.507e-02  -0.143   0.8861    
## L(train_data.Open.diff.ardl, 35)     -1.078e+03  2.265e+03  -0.476   0.6348    
## L(train_data.Open.diff.ardl, 110)     1.581e+03  2.035e+03   0.777   0.4381    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1934000 on 176 degrees of freedom
## Multiple R-squared:  0.3563, Adjusted R-squared:  0.1149 
## F-statistic: 1.476 on 66 and 176 DF,  p-value: 0.02348
Volume.open.testing.4 <- predict(Volume.open.training.4, n.ahead = length(test_data.Volume.ardl, test_data.Close.diff.ardl))
head(Volume.open.testing.4)
## 2015(123) 2015(124) 2015(125) 2015(126) 2015(127) 2015(128) 
##   3484569   4115900   3072290   2134982   3193647   2376375
Volume.open.fitted_training.4 <- fitted(Volume.open.training.4)
head(Volume.open.fitted_training.4)
## Time Series:
## Start = c(2015, 123) 
## End = c(2015, 128) 
## Frequency = 365 
## [1] 3484569 4115900 3072290 2134982 3193647 2376375
Volume.open.4.training.mse_value <- mse(train_data.Volume.ardl, Volume.open.fitted_training.4)
Volume.open.4.training.rmse_value <- rmse(train_data.Volume.ardl, Volume.open.fitted_training.4)

Volume.testing.n.4 = as.numeric(Volume.open.testing.4)

Volume.open.4.testing.mse_value <- mse(test_data.Volume.ardl, Volume.testing.n.4)
Volume.open.4.testing.rmse_value <- rmse(test_data.Volume.ardl, Volume.testing.n.4)

cat("Training Model MSE:", Volume.open.4.training.mse_value, "\n Training Model RMSE:", Volume.open.4.training.rmse_value , "\n Testing Model MSE:", Volume.open.4.testing.mse_value, "\n Testing Model RMSE:", Volume.open.4.testing.rmse_value , "\n")
## Training Model MSE: 2.70994e+12 
##  Training Model RMSE: 1646190 
##  Testing Model MSE: 4.676164e+12 
##  Testing Model RMSE: 2162444
cat(" Training Model AIC:", AIC(Volume.open.training.4), "\n Training Model BIC:", BIC(Volume.open.training.4), "\n")
##  Training Model AIC: 7782.195 
##  Training Model BIC: 8019.724

This model has very similar values to that of the previous model, so we can apply the same conclusion here. The R-squared value is not high enough for a good portion to be attributed to the independent variable. The AIC and BIC are also not the lowest we have observed. And the same applies to the MSE and RMSE values. Thus, this ARDL model is not a good fit.

ARDL 10-steps Forecasting

Computation and Plot of 10 steps ahead forecast for Turnover with lag (1:4) and Close with lag (110)

Turnover.Close.forecast.1 <- predict(ardl.turnover.close.1, n.ahead = 10)
forecast_start_time <- end(Turnover.ts)[1] + 1
Turnover.Close.forecast.ts.1 <- ts(Turnover.Close.forecast.1, start = forecast_start_time, frequency = frequency(Turnover.ts))
ts.plot(Turnover.ts, Turnover.Close.forecast.ts.1, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Turnover")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Turnover.Close.forecast.ts.1)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 254) 
## Frequency = 365 
##    2015(112)    2015(113)    2015(114)    2015(115)    2015(116)    2015(117) 
## 4.437920e+14 3.590315e+14 3.620933e+14 3.909650e+14 3.246154e+14 3.745337e+14 
##    2015(118)    2015(119)    2015(120)    2015(121)    2015(122)    2015(123) 
## 3.710251e+14 3.704318e+14 3.919642e+14 3.854421e+14 3.614446e+14 3.635212e+14 
##    2015(124)    2015(125)    2015(126)    2015(127)    2015(128)    2015(129) 
## 3.752945e+14 3.811698e+14 3.351593e+14 3.100042e+14 3.347392e+14 3.170406e+14 
##    2015(130)    2015(131)    2015(132)    2015(133)    2015(134)    2015(135) 
## 3.625859e+14 3.976113e+14 3.751243e+14 3.729413e+14 3.633673e+14 3.404775e+14 
##    2015(136)    2015(137)    2015(138)    2015(139)    2015(140)    2015(141) 
## 3.251657e+14 3.199807e+14 3.314726e+14 9.479715e+14 5.525683e+14 3.824260e+14 
##    2015(142)    2015(143)    2015(144)    2015(145)    2015(146)    2015(147) 
## 5.040927e+14 4.193220e+14 4.329106e+14 3.922072e+14 4.851816e+14 4.327322e+14 
##    2015(148)    2015(149)    2015(150)    2015(151)    2015(152)    2015(153) 
## 4.172771e+14 4.573051e+14 3.687993e+14 4.062537e+14 3.787211e+14 3.346747e+14 
##    2015(154)    2015(155)    2015(156)    2015(157)    2015(158)    2015(159) 
## 4.113077e+14 4.608366e+14 4.525145e+14 3.812207e+14 3.458313e+14 3.692174e+14 
##    2015(160)    2015(161)    2015(162)    2015(163)    2015(164)    2015(165) 
## 4.015904e+14 4.215053e+14 4.704729e+14 5.421397e+14 5.401602e+14 5.083112e+14 
##    2015(166)    2015(167)    2015(168)    2015(169)    2015(170)    2015(171) 
## 5.865801e+14 4.519231e+14 4.699137e+14 4.830027e+14 4.849823e+14 4.542668e+14 
##    2015(172)    2015(173)    2015(174)    2015(175)    2015(176)    2015(177) 
## 4.160292e+14 3.856024e+14 3.771246e+14 4.400400e+14 4.240618e+14 4.481253e+14 
##    2015(178)    2015(179)    2015(180)    2015(181)    2015(182)    2015(183) 
## 4.108513e+14 3.756762e+14 4.230231e+14 4.881105e+14 3.563481e+14 4.458845e+14 
##    2015(184)    2015(185)    2015(186)    2015(187)    2015(188)    2015(189) 
## 3.960527e+14 5.080770e+14 4.852697e+14 4.204788e+14 4.905673e+14 5.049441e+14 
##    2015(190)    2015(191)    2015(192)    2015(193)    2015(194)    2015(195) 
## 4.258490e+14 4.532405e+14 4.792659e+14 4.504049e+14 5.118087e+14 8.700899e+14 
##    2015(196)    2015(197)    2015(198)    2015(199)    2015(200)    2015(201) 
## 6.080644e+14 4.573935e+14 5.386391e+14 4.341377e+14 4.174722e+14 4.481885e+14 
##    2015(202)    2015(203)    2015(204)    2015(205)    2015(206)    2015(207) 
## 4.156525e+14 3.932977e+14 3.470123e+14 3.735766e+14 3.740249e+14 3.681005e+14 
##    2015(208)    2015(209)    2015(210)    2015(211)    2015(212)    2015(213) 
## 3.455459e+14 3.298103e+14 3.400630e+14 3.219426e+14 3.026353e+14 3.120304e+14 
##    2015(214)    2015(215)    2015(216)    2015(217)    2015(218)    2015(219) 
## 3.712733e+14 3.442781e+14 2.679878e+14 3.275805e+14 3.870523e+14 3.771940e+14 
##    2015(220)    2015(221)    2015(222)    2015(223)    2015(224)    2015(225) 
## 4.307596e+14 4.258112e+14 3.392821e+14 3.840412e+14 3.551018e+14 4.386042e+14 
##    2015(226)    2015(227)    2015(228)    2015(229)    2015(230)    2015(231) 
## 3.670212e+14 5.804866e+14 4.163807e+14 3.665166e+14 4.250935e+14 4.142598e+14 
##    2015(232)    2015(233)    2015(234)    2015(235)    2015(236)    2015(237) 
## 3.546830e+14 3.621149e+14 3.989168e+14 3.603930e+14 3.611433e+14 3.573641e+14 
##    2015(238)    2015(239)    2015(240)    2015(241)    2015(242)    2015(243) 
## 3.624491e+14 3.656992e+14 3.541474e+14 3.960535e+14 3.513301e+14 3.370141e+14 
##    2015(244)    2015(245)    2015(246)    2015(247)    2015(248)    2015(249) 
## 3.279602e+14 2.824516e+14 3.575968e+14 3.216693e+14 3.420263e+14 4.142269e+14 
##    2015(250)    2015(251)    2015(252)    2015(253)    2015(254)    2015(255) 
## 2.964342e+14 3.688935e+14 4.485723e+14 4.125687e+14 3.927391e+14 5.039927e+14 
##    2015(256)    2015(257)    2015(258)    2015(259)    2015(260)    2015(261) 
## 1.045558e+15 5.567517e+14 4.282874e+14 6.149903e+14 4.527169e+14 4.012254e+14 
##    2015(262)    2015(263)    2015(264)    2015(265)    2015(266)    2015(267) 
## 3.582119e+14 3.971289e+14 4.288457e+14 4.457264e+14 4.505221e+14 5.275339e+14 
##    2015(268)    2015(269)    2015(270)    2015(271)    2015(272)    2015(273) 
## 5.338871e+14 5.650003e+14 5.071548e+14 4.584967e+14 4.046570e+14 3.804098e+14 
##    2015(274)    2015(275)    2015(276)    2015(277)    2015(278)    2015(279) 
## 4.954814e+14 4.170701e+14 3.860293e+14 4.578714e+14 3.926612e+14 3.917814e+14 
##    2015(280)    2015(281)    2015(282)    2015(283)    2015(284)    2015(285) 
## 3.937339e+14 3.873751e+14 4.365719e+14 4.612613e+14 4.124841e+14 3.797717e+14 
##    2015(286)    2015(287)    2015(288)    2015(289)    2015(290)    2015(291) 
## 4.107911e+14 3.957199e+14 3.889268e+14 4.216451e+14 3.373282e+14 4.004273e+14 
##    2015(292)    2015(293)    2015(294)    2015(295)    2015(296)    2015(297) 
## 3.797836e+14 3.387465e+14 3.830787e+14 4.117118e+14 3.840553e+14 3.945863e+14 
##    2015(298)    2015(299)    2015(300)    2015(301)    2015(302)    2015(303) 
## 3.866629e+14 3.850456e+14 4.018236e+14 3.736394e+14 3.616918e+14 4.031274e+14 
##    2015(304)    2015(305)    2015(306)    2015(307)    2015(308)    2015(309) 
## 3.904986e+14 3.600572e+14 3.976735e+14 3.895698e+14 5.460838e+14 4.769233e+14 
##    2015(310)    2015(311)    2015(312)    2015(313)    2015(314)    2015(315) 
## 3.564974e+14 4.576607e+14 4.178561e+14 4.029019e+14 4.361262e+14 4.615378e+14 
##    2015(316)    2015(317)    2015(318)    2015(319)    2015(320)    2015(321) 
## 4.765425e+14 4.183803e+14 3.792048e+14 4.050745e+14 4.406099e+14 3.871836e+14 
##    2015(322)    2015(323)    2015(324)    2015(325)    2015(326)    2015(327) 
## 4.961077e+14 4.539445e+14 4.866502e+14 5.193706e+14 1.028338e+15 6.826244e+14 
##    2015(328)    2015(329)    2015(330)    2015(331)    2015(332)    2015(333) 
## 4.529853e+14 5.665577e+14 5.388527e+14 5.135767e+14 4.368859e+14 4.638655e+14 
##    2015(334)    2015(335)    2015(336)    2015(337)    2015(338)    2015(339) 
## 4.133909e+14 3.740741e+14 3.648945e+14 4.022098e+14 3.851128e+14 3.618532e+14 
##    2015(340)    2015(341)    2015(342)    2015(343)    2015(344)    2015(345) 
## 3.602555e+14 3.765526e+14 4.404926e+14 3.703149e+14 4.366466e+14 4.114143e+14 
##    2015(346)    2015(347)    2015(348)    2015(349)    2015(350)    2015(351) 
## 3.457302e+14 3.507511e+14 4.084549e+14 4.500691e+14 5.810884e+14 3.950694e+14 
##    2015(352)    2015(353)    2015(354)    2015(355)    2015(356)    2015(357) 
## 3.552690e+14 4.167579e+14 3.937858e+14 3.686837e+14 3.667677e+14 3.990900e+14 
##    2015(358)    2015(359)    2015(360)    2015(361)    2015(362)    2015(363) 
## 3.787501e+14 4.593848e+14 4.437920e+14 3.590315e+14 3.620933e+14 3.909650e+14 
##    2015(364)    2015(365) 
## 3.246154e+14 3.745337e+14

Computation and Plot of 10 steps ahead forecast for Turnover with lag (1:4) and Close with lag (1:110)

Turnover.Close.forecast.2 <- predict(ardl.turnover.close.2, n.ahead = 10)
forecast_start_time <- end(Turnover.ts)[1] + 1
Turnover.Close.forecast.ts.2 <- ts(Turnover.Close.forecast.2, start = forecast_start_time, frequency = frequency(Turnover.ts))
ts.plot(Turnover.ts, Turnover.Close.forecast.ts.2, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Turnover")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Turnover.Close.forecast.ts.2)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 254) 
## Frequency = 365 
##     2015(112)     2015(113)     2015(114)     2015(115)     2015(116) 
##  3.401318e+14  2.338932e+14  3.218303e+14  2.833377e+14  3.651541e+14 
##     2015(117)     2015(118)     2015(119)     2015(120)     2015(121) 
##  2.219469e+14 -4.063762e+14  6.053470e+14  4.259575e+14  2.325385e+14 
##     2015(122)     2015(123)     2015(124)     2015(125)     2015(126) 
##  3.774172e+14  3.654971e+14  4.658795e+14  2.924806e+14  2.012625e+14 
##     2015(127)     2015(128)     2015(129)     2015(130)     2015(131) 
##  3.092900e+14  1.665426e+14  1.283406e+14  3.476191e+14  2.612407e+14 
##     2015(132)     2015(133)     2015(134)     2015(135)     2015(136) 
##  3.638963e+14  3.279538e+14  3.326071e+14  2.365600e+14  1.992948e+14 
##     2015(137)     2015(138)     2015(139)     2015(140)     2015(141) 
##  2.877062e+14  1.279493e+15  7.316489e+14  6.560582e+14  3.539934e+14 
##     2015(142)     2015(143)     2015(144)     2015(145)     2015(146) 
##  4.690115e+14  4.888085e+14  3.702461e+14  4.599903e+14  4.817456e+14 
##     2015(147)     2015(148)     2015(149)     2015(150)     2015(151) 
##  4.181520e+14  4.150561e+14  3.889017e+14  4.639659e+14  2.733587e+14 
##     2015(152)     2015(153)     2015(154)     2015(155)     2015(156) 
##  4.074308e+14  3.968737e+14  5.610284e+14  6.292885e+14  3.128268e+14 
##     2015(157)     2015(158)     2015(159)     2015(160)     2015(161) 
##  2.252509e+14  3.195387e+14  3.941305e+14  5.438637e+14  4.892449e+14 
##     2015(162)     2015(163)     2015(164)     2015(165)     2015(166) 
##  5.542212e+14  6.924154e+14  5.047103e+14  6.752668e+14  5.295086e+14 
##     2015(167)     2015(168)     2015(169)     2015(170)     2015(171) 
##  6.037651e+14  3.908516e+14  5.401445e+14  2.116612e+14  5.167922e+14 
##     2015(172)     2015(173)     2015(174)     2015(175)     2015(176) 
##  4.638438e+14  2.949771e+14  4.571745e+14  3.713810e+14  5.263416e+14 
##     2015(177)     2015(178)     2015(179)     2015(180)     2015(181) 
##  4.168483e+14  3.161120e+14  2.933597e+14  5.588356e+14  3.030180e+14 
##     2015(182)     2015(183)     2015(184)     2015(185)     2015(186) 
##  4.195073e+14  3.948893e+14  4.959634e+14  5.916616e+14  4.025041e+14 
##     2015(187)     2015(188)     2015(189)     2015(190)     2015(191) 
##  3.103091e+14 -2.897176e+14  4.941712e+14  5.636584e+14  4.793889e+14 
##     2015(192)     2015(193)     2015(194)     2015(195)     2015(196) 
##  4.330206e+14  6.047243e+14  1.211725e+15  8.827551e+14  6.444576e+14 
##     2015(197)     2015(198)     2015(199)     2015(200)     2015(201) 
##  5.634722e+14  4.933624e+14  3.816110e+14  3.494870e+14  4.460652e+14 
##     2015(202)     2015(203)     2015(204)     2015(205)     2015(206) 
##  5.075020e+14  3.023381e+14  3.093278e+14  3.512729e+14  2.391573e+14 
##     2015(207)     2015(208)     2015(209)     2015(210)     2015(211) 
##  3.694466e+14  3.722383e+14  3.287333e+14  2.653437e+14  2.147208e+14 
##     2015(212)     2015(213)     2015(214)     2015(215)     2015(216) 
##  4.651823e+13  3.469738e+14  4.532338e+14  2.315970e+14  2.528970e+14 
##     2015(217)     2015(218)     2015(219)     2015(220)     2015(221) 
##  4.600565e+14  4.624728e+14  4.519861e+14  4.867926e+14  4.170756e+14 
##     2015(222)     2015(223)     2015(224)     2015(225)     2015(226) 
##  2.746649e+14  3.599082e+14  3.805839e+14  4.239167e+14  3.917796e+14 
##     2015(227)     2015(228)     2015(229)     2015(230)     2015(231) 
##  5.989828e+14  4.106937e+14  3.176133e+14  4.784136e+14  3.912381e+14 
##     2015(232)     2015(233)     2015(234)     2015(235)     2015(236) 
##  4.098479e+14  3.258567e+14  3.940063e+14  3.531199e+14  2.922597e+14 
##     2015(237)     2015(238)     2015(239)     2015(240)     2015(241) 
##  3.988944e+14  3.172690e+14  3.387928e+14  3.655594e+14  3.980951e+14 
##     2015(242)     2015(243)     2015(244)     2015(245)     2015(246) 
##  4.157989e+14  3.040309e+14  3.841061e+14  3.405772e+14  2.987049e+14 
##     2015(247)     2015(248)     2015(249)     2015(250)     2015(251) 
##  3.473829e+14  2.815203e+14  4.722176e+14  3.920950e+14  4.680052e+14 
##     2015(252)     2015(253)     2015(254)     2015(255)     2015(256) 
##  5.001279e+14  3.863022e+14  5.572186e+14  1.235517e+15  9.203286e+14 
##     2015(257)     2015(258)     2015(259)     2015(260)     2015(261) 
##  5.466057e+14  4.855513e+14  5.655980e+14  4.518870e+14  3.854507e+14 
##     2015(262)     2015(263)     2015(264)     2015(265)     2015(266) 
##  4.991845e+14  5.311499e+14  5.428926e+14  5.433652e+14  6.380419e+14 
##     2015(267)     2015(268)     2015(269)     2015(270)     2015(271) 
##  5.569238e+14  7.007459e+14  6.262436e+14  5.176750e+14  4.564542e+14 
##     2015(272)     2015(273)     2015(274)     2015(275)     2015(276) 
##  3.074841e+14  6.064131e+14  5.831553e+14 -3.733846e+14  5.696591e+14 
##     2015(277)     2015(278)     2015(279)     2015(280)     2015(281) 
##  5.171614e+14  5.840178e+14  4.196395e+14  3.217152e+14  4.593648e+14 
##     2015(282)     2015(283)     2015(284)     2015(285)     2015(286) 
##  3.938961e+14  4.203784e+14  3.696770e+14  2.836953e+14  4.659271e+14 
##     2015(287)     2015(288)     2015(289)     2015(290)     2015(291) 
##  3.993479e+14  5.175903e+14  3.700409e+14  1.826432e+14  2.600416e+14 
##     2015(292)     2015(293)     2015(294)     2015(295)     2015(296) 
##  4.467488e+14  3.895244e+14  4.539219e+14  5.307667e+14  3.947257e+14 
##     2015(297)     2015(298)     2015(299)     2015(300)     2015(301) 
##  3.438271e+14  2.923120e+14  2.997643e+14  3.284397e+14  3.229284e+14 
##     2015(302)     2015(303)     2015(304)     2015(305)     2015(306) 
##  2.604943e+14  4.518745e+14  3.163975e+14  4.242480e+14  2.674341e+14 
##     2015(307)     2015(308)     2015(309)     2015(310)     2015(311) 
##  5.855468e+14  5.121757e+14  4.665105e+14  3.268455e+14  3.003736e+14 
##     2015(312)     2015(313)     2015(314)     2015(315)     2015(316) 
##  4.343443e+14  3.176732e+14  4.792547e+14  5.930795e+14  4.538558e+14 
##     2015(317)     2015(318)     2015(319)     2015(320)     2015(321) 
##  2.558052e+14  5.317786e+14  4.019139e+14  5.485712e+14  3.174179e+14 
##     2015(322)     2015(323)     2015(324)     2015(325)     2015(326) 
##  5.048048e+14  4.982860e+14  4.739946e+14  1.240262e+15  1.086516e+15 
##     2015(327)     2015(328)     2015(329)     2015(330)     2015(331) 
##  5.850297e+14  2.799910e+14  6.216133e+14  5.390908e+14 -8.904842e+13 
##     2015(332)     2015(333)     2015(334)     2015(335)     2015(336) 
##  4.597660e+14  4.933691e+14  2.719443e+14  3.993112e+14  4.389179e+14 
##     2015(337)     2015(338)     2015(339)     2015(340)     2015(341) 
##  3.029156e+14  3.245496e+14  3.644563e+14  3.398786e+14  4.389719e+14 
##     2015(342)     2015(343)     2015(344)     2015(345)     2015(346) 
##  3.493992e+14  4.810205e+14  4.540564e+14  3.594387e+14  3.342953e+14 
##     2015(347)     2015(348)     2015(349)     2015(350)     2015(351) 
##  4.671252e+14  6.304051e+14  7.416571e+14  5.291028e+14  4.976106e+14 
##     2015(352)     2015(353)     2015(354)     2015(355)     2015(356) 
##  4.220819e+14  4.332032e+14  3.288699e+14  3.436884e+14  1.939856e+14 
##     2015(357)     2015(358)     2015(359)     2015(360)     2015(361) 
##  3.132441e+14  4.865139e+14  4.749024e+14  3.401318e+14  2.338932e+14 
##     2015(362)     2015(363)     2015(364)     2015(365) 
##  3.218303e+14  2.833377e+14  3.651541e+14  2.219469e+14

Computation and Plot of 10 steps ahead forecast for Turnover with lag (2)n(61)n(75)n(117) and Close with lag (110)

Turnover.Close.forecast.3 <- predict(ardl.turnover.close.3, n.ahead = 10)
forecast_start_time <- end(Turnover.ts)[1] + 1
Turnover.Close.forecast.ts.3 <- ts(Turnover.Close.forecast.3, start = forecast_start_time, frequency = frequency(Turnover.ts))
ts.plot(Turnover.ts, Turnover.Close.forecast.ts.3, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Turnover")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Turnover.Close.forecast.ts.3)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 248) 
## Frequency = 365 
##    2015(118)    2015(119)    2015(120)    2015(121)    2015(122)    2015(123) 
## 2.993358e+14 3.424255e+14 5.533546e+14 4.644747e+14 3.394110e+14 4.699272e+14 
##    2015(124)    2015(125)    2015(126)    2015(127)    2015(128)    2015(129) 
## 9.178562e+14 4.755188e+14 4.323567e+14 4.495136e+14 4.100094e+14 3.594849e+14 
##    2015(130)    2015(131)    2015(132)    2015(133)    2015(134)    2015(135) 
## 2.750868e+14 3.621403e+14 4.464236e+14 4.201277e+14 5.263830e+14 5.118804e+14 
##    2015(136)    2015(137)    2015(138)    2015(139)    2015(140)    2015(141) 
## 5.300383e+14 5.579184e+14 9.469680e+14 5.588236e+14 6.981194e+14 4.264417e+14 
##    2015(142)    2015(143)    2015(144)    2015(145)    2015(146)    2015(147) 
## 5.550406e+14 4.582600e+14 4.046873e+14 4.612465e+14 3.637817e+14 4.010729e+14 
##    2015(148)    2015(149)    2015(150)    2015(151)    2015(152)    2015(153) 
## 3.589673e+14 3.949535e+14 4.420203e+14 4.125223e+14 4.410374e+14 3.547213e+14 
##    2015(154)    2015(155)    2015(156)    2015(157)    2015(158)    2015(159) 
## 3.999649e+14 3.626841e+14 4.615483e+14 4.437806e+14 2.790812e+14 3.197936e+14 
##    2015(160)    2015(161)    2015(162)    2015(163)    2015(164)    2015(165) 
## 3.455595e+14 4.052593e+14 5.446783e+14 4.224418e+14 4.062744e+14 4.206241e+14 
##    2015(166)    2015(167)    2015(168)    2015(169)    2015(170)    2015(171) 
## 4.032920e+14 4.304905e+14 3.804402e+14 3.845161e+14 3.748008e+14 4.565436e+14 
##    2015(172)    2015(173)    2015(174)    2015(175)    2015(176)    2015(177) 
## 4.242760e+14 3.172440e+14 3.379287e+14 3.512434e+14 5.157952e+14 4.366808e+14 
##    2015(178)    2015(179)    2015(180)    2015(181)    2015(182)    2015(183) 
## 3.513108e+14 3.920194e+14 3.597629e+14 3.937062e+14 4.206607e+14 3.831284e+14 
##    2015(184)    2015(185)    2015(186)    2015(187)    2015(188)    2015(189) 
## 4.530551e+14 3.669344e+14 3.747754e+14 3.173511e+14 3.855212e+14 3.450803e+14 
##    2015(190)    2015(191)    2015(192)    2015(193)    2015(194)    2015(195) 
## 5.005760e+14 4.236303e+14 4.837062e+14 4.618615e+14 9.127143e+14 5.639316e+14 
##    2015(196)    2015(197)    2015(198)    2015(199)    2015(200)    2015(201) 
## 5.966362e+14 4.160945e+14 4.279849e+14 9.717044e+14 4.882173e+14 4.366226e+14 
##    2015(202)    2015(203)    2015(204)    2015(205)    2015(206)    2015(207) 
## 3.519394e+14 3.566232e+14 3.635864e+14 3.650158e+14 4.397052e+14 3.592529e+14 
##    2015(208)    2015(209)    2015(210)    2015(211)    2015(212)    2015(213) 
## 3.530103e+14 3.635518e+14 3.600454e+14 3.328395e+14 3.603215e+14 3.621291e+14 
##    2015(214)    2015(215)    2015(216)    2015(217)    2015(218)    2015(219) 
## 3.386232e+14 3.905192e+14 4.242200e+14 3.539140e+14 4.694705e+14 3.272764e+14 
##    2015(220)    2015(221)    2015(222)    2015(223)    2015(224)    2015(225) 
## 3.626280e+14 4.104918e+14 3.543657e+14 4.783784e+14 4.519571e+14 4.313185e+14 
##    2015(226)    2015(227)    2015(228)    2015(229)    2015(230)    2015(231) 
## 5.192597e+14 3.979175e+14 5.692709e+14 3.856867e+14 4.222453e+14 3.816882e+14 
##    2015(232)    2015(233)    2015(234)    2015(235)    2015(236)    2015(237) 
## 3.336741e+14 3.152080e+14 3.266081e+14 4.123661e+14 3.975051e+14 4.273883e+14 
##    2015(238)    2015(239)    2015(240)    2015(241)    2015(242)    2015(243) 
## 3.451792e+14 3.278574e+14 3.807209e+14 4.354202e+14 3.077227e+14 3.469943e+14 
##    2015(244)    2015(245)    2015(246)    2015(247)    2015(248)    2015(249) 
## 2.927580e+14 4.046257e+14 3.729873e+14 4.096422e+14 4.036148e+14 4.300341e+14 
##    2015(250)    2015(251)    2015(252)    2015(253)    2015(254)    2015(255) 
## 3.734793e+14 3.314382e+14 3.603737e+14 3.839090e+14 4.477716e+14 1.278971e+15 
##    2015(256)    2015(257)    2015(258)    2015(259)    2015(260)    2015(261) 
## 6.557623e+14 7.659356e+14 4.127118e+14 4.094517e+14 4.495113e+14 4.390027e+14 
##    2015(262)    2015(263)    2015(264)    2015(265)    2015(266)    2015(267) 
## 4.769693e+14 3.778427e+14 3.496903e+14 4.169691e+14 3.650255e+14 4.099932e+14 
##    2015(268)    2015(269)    2015(270)    2015(271)    2015(272)    2015(273) 
## 3.921768e+14 4.060034e+14 4.416359e+14 4.313085e+14 3.836057e+14 2.867643e+14 
##    2015(274)    2015(275)    2015(276)    2015(277)    2015(278)    2015(279) 
## 3.018158e+14 3.687440e+14 3.103200e+14 3.583629e+14 4.637363e+14 4.950742e+14 
##    2015(280)    2015(281)    2015(282)    2015(283)    2015(284)    2015(285) 
## 5.280309e+14 4.622608e+14 4.908684e+14 3.830377e+14 4.200616e+14 4.569787e+14 
##    2015(286)    2015(287)    2015(288)    2015(289)    2015(290)    2015(291) 
## 4.023625e+14 5.767081e+14 3.697263e+14 3.408638e+14 3.345542e+14 3.983192e+14 
##    2015(292)    2015(293)    2015(294)    2015(295)    2015(296)    2015(297) 
## 3.729820e+14 3.976482e+14 3.623777e+14 3.266335e+14 3.808458e+14 4.255464e+14 
##    2015(298)    2015(299)    2015(300)    2015(301)    2015(302)    2015(303) 
## 3.173479e+14 4.087073e+14 3.113900e+14 5.270556e+14 3.819742e+14 3.601227e+14 
##    2015(304)    2015(305)    2015(306)    2015(307)    2015(308)    2015(309) 
## 3.658938e+14 3.724856e+14 3.528047e+14 3.657665e+14 3.958323e+14 5.230748e+14 
##    2015(310)    2015(311)    2015(312)    2015(313)    2015(314)    2015(315) 
## 4.233677e+14 7.455155e+14 5.644300e+14 4.415689e+14 4.052912e+14 4.779988e+14 
##    2015(316)    2015(317)    2015(318)    2015(319)    2015(320)    2015(321) 
## 9.616208e+14 5.309058e+14 4.147107e+14 3.897701e+14 3.413010e+14 3.691361e+14 
##    2015(322)    2015(323)    2015(324)    2015(325)    2015(326)    2015(327) 
## 3.125221e+14 4.249688e+14 3.680676e+14 4.301466e+14 4.263919e+14 7.553376e+14 
##    2015(328)    2015(329)    2015(330)    2015(331)    2015(332)    2015(333) 
## 5.087690e+14 4.847141e+14 5.251415e+14 4.363118e+14 3.133273e+14 3.249105e+14 
##    2015(334)    2015(335)    2015(336)    2015(337)    2015(338)    2015(339) 
## 4.884309e+14 3.917118e+14 4.046629e+14 4.107162e+14 3.633998e+14 3.607975e+14 
##    2015(340)    2015(341)    2015(342)    2015(343)    2015(344)    2015(345) 
## 3.208510e+14 4.157505e+14 3.935066e+14 6.546537e+14 3.749315e+14 3.798673e+14 
##    2015(346)    2015(347)    2015(348)    2015(349)    2015(350)    2015(351) 
## 3.527997e+14 3.699050e+14 3.269045e+14 3.932108e+14 3.508768e+14 4.760852e+14 
##    2015(352)    2015(353)    2015(354)    2015(355)    2015(356)    2015(357) 
## 3.142466e+14 2.935245e+14 3.265106e+14 3.834052e+14 3.419004e+14 3.843322e+14 
##    2015(358)    2015(359)    2015(360)    2015(361)    2015(362)    2015(363) 
## 3.320231e+14 4.220975e+14 3.448166e+14 2.950392e+14 3.117432e+14 3.175334e+14 
##    2015(364)    2015(365) 
## 3.388220e+14 3.567706e+14

Computation and Plot of 10 steps ahead forecast for Turnover with lag (2)n(61)n(75)n(117) and Close with lag (1:110)

Turnover.Close.forecast.4 <- predict(ardl.turnover.close.4, n.ahead = 10)
forecast_start_time <- end(Turnover.ts)[1] + 1
Turnover.Close.forecast.ts.4 <- ts(Turnover.Close.forecast.4, start = forecast_start_time, frequency = frequency(Turnover.ts))
ts.plot(Turnover.ts, Turnover.Close.forecast.ts.4, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Turnover")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Turnover.Close.forecast.ts.4)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 248) 
## Frequency = 365 
##     2015(118)     2015(119)     2015(120)     2015(121)     2015(122) 
## -9.147030e+13  4.403750e+14  6.046233e+14  2.777610e+14  2.179252e+14 
##     2015(123)     2015(124)     2015(125)     2015(126)     2015(127) 
##  3.719387e+14  7.185031e+14  4.311034e+14  2.383161e+14  2.995433e+14 
##     2015(128)     2015(129)     2015(130)     2015(131)     2015(132) 
##  2.229374e+14  1.108457e+14  2.314214e+14  1.882900e+14  3.095181e+14 
##     2015(133)     2015(134)     2015(135)     2015(136)     2015(137) 
##  3.309998e+14  3.788567e+14  3.132979e+14  2.559364e+14  3.652272e+14 
##     2015(138)     2015(139)     2015(140)     2015(141)     2015(142) 
##  1.548984e+15  4.907873e+14  6.344545e+14  4.245207e+14  5.391988e+14 
##     2015(143)     2015(144)     2015(145)     2015(146)     2015(147) 
##  5.811916e+14  4.032530e+14  5.367854e+14  3.898940e+14  4.489059e+14 
##     2015(148)     2015(149)     2015(150)     2015(151)     2015(152) 
##  4.508467e+14  3.547310e+14  6.159453e+14  3.156500e+14  3.411791e+14 
##     2015(153)     2015(154)     2015(155)     2015(156)     2015(157) 
##  4.140186e+14  5.381934e+14  5.522653e+14  3.350037e+14  2.096803e+14 
##     2015(158)     2015(159)     2015(160)     2015(161)     2015(162) 
##  2.498324e+14  3.200976e+14  4.992254e+14  4.673539e+14  5.747430e+14 
##     2015(163)     2015(164)     2015(165)     2015(166)     2015(167) 
##  5.749941e+14  5.139565e+14  6.509135e+14  4.330582e+14  5.867444e+14 
##     2015(168)     2015(169)     2015(170)     2015(171)     2015(172) 
##  3.857493e+14  4.474500e+14  1.720903e+14  4.026393e+14  4.869282e+14 
##     2015(173)     2015(174)     2015(175)     2015(176)     2015(177) 
##  2.998815e+14  5.953239e+14  3.844186e+14  5.208964e+14  3.762367e+14 
##     2015(178)     2015(179)     2015(180)     2015(181)     2015(182) 
##  2.992070e+14  5.004656e+14  5.266785e+14  2.629731e+14  4.235755e+14 
##     2015(183)     2015(184)     2015(185)     2015(186)     2015(187) 
##  2.914328e+14  4.917572e+14  4.443714e+14  3.346386e+14  2.410550e+14 
##     2015(188)     2015(189)     2015(190)     2015(191)     2015(192) 
## -4.184867e+14  1.276395e+14  6.116869e+14  5.340968e+14  3.941923e+14 
##     2015(193)     2015(194)     2015(195)     2015(196)     2015(197) 
##  5.331480e+14  1.388134e+15  6.747306e+14  5.578641e+14  5.863145e+14 
##     2015(198)     2015(199)     2015(200)     2015(201)     2015(202) 
##  4.803876e+14  6.446622e+14  4.067566e+14  3.967562e+14  4.761292e+14 
##     2015(203)     2015(204)     2015(205)     2015(206)     2015(207) 
##  2.771771e+14  3.394609e+14  3.327748e+14  3.642557e+14  2.600836e+14 
##     2015(208)     2015(209)     2015(210)     2015(211)     2015(212) 
##  3.730842e+14  3.541572e+14  2.723214e+14  1.511876e+14  4.823182e+13 
##     2015(213)     2015(214)     2015(215)     2015(216)     2015(217) 
##  2.386355e+14  3.937506e+14  2.431307e+14  2.773690e+14  4.582915e+14 
##     2015(218)     2015(219)     2015(220)     2015(221)     2015(222) 
##  5.129609e+14  4.614766e+14  4.971942e+14  4.024065e+14  3.436348e+14 
##     2015(223)     2015(224)     2015(225)     2015(226)     2015(227) 
##  4.538218e+14  4.913408e+14  4.667623e+14  5.242541e+14  4.288990e+14 
##     2015(228)     2015(229)     2015(230)     2015(231)     2015(232) 
##  5.238341e+14  3.475917e+14  4.431891e+14  3.713087e+14  3.625285e+14 
##     2015(233)     2015(234)     2015(235)     2015(236)     2015(237) 
##  3.143252e+14  3.257242e+14  4.006202e+14  3.330893e+14  4.424127e+14 
##     2015(238)     2015(239)     2015(240)     2015(241)     2015(242) 
##  3.125682e+14  2.674639e+14  3.358967e+14  4.301060e+14  3.465891e+14 
##     2015(243)     2015(244)     2015(245)     2015(246)     2015(247) 
##  3.071548e+14  2.864968e+14  4.416045e+14  3.513442e+14  4.154959e+14 
##     2015(248)     2015(249)     2015(250)     2015(251)     2015(252) 
##  3.790797e+14  4.406329e+14  4.071465e+14  4.186857e+14  3.739816e+14 
##     2015(253)     2015(254)     2015(255)     2015(256)     2015(257) 
##  3.698146e+14  6.000223e+14  1.625510e+15  6.380908e+14  7.372395e+14 
##     2015(258)     2015(259)     2015(260)     2015(261)     2015(262) 
##  6.145148e+14  4.106967e+14  4.796788e+14  6.535050e+14  6.215954e+14 
##     2015(263)     2015(264)     2015(265)     2015(266)     2015(267) 
##  6.095984e+14  5.572123e+14  5.630313e+14  5.957813e+14  4.957548e+14 
##     2015(268)     2015(269)     2015(270)     2015(271)     2015(272) 
##  5.838089e+14  5.318563e+14  5.290662e+14  5.075131e+14  3.949088e+14 
##     2015(273)     2015(274)     2015(275)     2015(276)     2015(277) 
##  6.223171e+14  5.753717e+14 -1.048621e+14  3.590423e+14  5.102263e+14 
##     2015(278)     2015(279)     2015(280)     2015(281)     2015(282) 
##  6.452785e+14  5.617793e+14  4.392773e+14  4.770711e+14  4.633024e+14 
##     2015(283)     2015(284)     2015(285)     2015(286)     2015(287) 
##  3.482793e+14  3.778459e+14  3.299432e+14  4.364918e+14  5.076061e+14 
##     2015(288)     2015(289)     2015(290)     2015(291)     2015(292) 
##  5.347325e+14  3.526911e+14  1.981527e+14  2.115810e+14  3.366601e+14 
##     2015(293)     2015(294)     2015(295)     2015(296)     2015(297) 
##  4.870974e+14  4.492811e+14  4.196700e+14  4.125640e+14  3.584261e+14 
##     2015(298)     2015(299)     2015(300)     2015(301)     2015(302) 
##  2.712473e+14  3.726914e+14  2.898720e+14  3.408801e+14  2.454108e+14 
##     2015(303)     2015(304)     2015(305)     2015(306)     2015(307) 
##  3.684715e+14  2.841402e+14  3.451856e+14  2.146926e+14  4.957966e+14 
##     2015(308)     2015(309)     2015(310)     2015(311)     2015(312) 
##  4.371230e+14  4.570339e+14  3.790095e+14  4.294267e+14  4.296512e+14 
##     2015(313)     2015(314)     2015(315)     2015(316)     2015(317) 
##  3.897813e+14  4.866330e+14  5.765523e+14  7.241087e+14  2.788757e+14 
##     2015(318)     2015(319)     2015(320)     2015(321)     2015(322) 
##  4.928411e+14  4.493955e+14  4.615065e+14  3.665243e+14  2.979141e+14 
##     2015(323)     2015(324)     2015(325)     2015(326)     2015(327) 
##  4.161927e+14  3.702440e+14  1.146765e+15  6.764946e+14  6.196437e+14 
##     2015(328)     2015(329)     2015(330)     2015(331)     2015(332) 
##  3.765359e+14  5.447062e+14  4.631560e+14  4.844542e+13  2.423842e+14 
##     2015(333)     2015(334)     2015(335)     2015(336)     2015(337) 
##  3.991684e+14  3.305506e+14  3.615911e+14  6.738273e+14  3.358504e+14 
##     2015(338)     2015(339)     2015(340)     2015(341)     2015(342) 
##  3.154553e+14  2.789261e+14  3.165390e+14  4.152743e+14  3.288897e+14 
##     2015(343)     2015(344)     2015(345)     2015(346)     2015(347) 
##  6.126519e+14  4.107958e+14  3.532214e+14  3.499391e+14  5.049943e+14 
##     2015(348)     2015(349)     2015(350)     2015(351)     2015(352) 
##  5.353002e+14  7.443162e+14  3.841729e+14  5.424194e+14  4.800150e+14 
##     2015(353)     2015(354)     2015(355)     2015(356)     2015(357) 
##  4.143659e+14  3.310731e+14  4.059762e+14  1.651102e+14  2.419692e+14 
##     2015(358)     2015(359)     2015(360)     2015(361)     2015(362) 
##  4.238055e+14  4.603549e+14  2.978738e+14  2.965341e+14  3.143829e+14 
##     2015(363)     2015(364)     2015(365) 
##  3.014766e+14  4.011378e+14  2.204975e+14

Computation and Plot of 10 steps ahead forecast for Turnover with lag (1:4) and Close with lag (110)

Turnover.open.forecast.1 <- predict(ardl.turnover.open.1, n.ahead = 10)
forecast_start_time <- end(Turnover.ts)[1] + 1
Turnover.open.forecast.ts.1 <- ts(Turnover.open.forecast.1, start = forecast_start_time, frequency = frequency(Turnover.ts))
ts.plot(Turnover.ts, Turnover.open.forecast.ts.1, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Turnover")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Turnover.open.forecast.ts.1)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 254) 
## Frequency = 365 
##    2015(112)    2015(113)    2015(114)    2015(115)    2015(116)    2015(117) 
## 4.423260e+14 3.624325e+14 3.617921e+14 3.895377e+14 3.255622e+14 3.695919e+14 
##    2015(118)    2015(119)    2015(120)    2015(121)    2015(122)    2015(123) 
## 3.770848e+14 3.725887e+14 3.895356e+14 3.877218e+14 3.630154e+14 3.621858e+14 
##    2015(124)    2015(125)    2015(126)    2015(127)    2015(128)    2015(129) 
## 3.733937e+14 3.808184e+14 3.369872e+14 3.108711e+14 3.396013e+14 3.115649e+14 
##    2015(130)    2015(131)    2015(132)    2015(133)    2015(134)    2015(135) 
## 3.620167e+14 3.988557e+14 3.738195e+14 3.732631e+14 3.626084e+14 3.389633e+14 
##    2015(136)    2015(137)    2015(138)    2015(139)    2015(140)    2015(141) 
## 3.273047e+14 3.187181e+14 3.330901e+14 9.501986e+14 5.519596e+14 3.838995e+14 
##    2015(142)    2015(143)    2015(144)    2015(145)    2015(146)    2015(147) 
## 5.044042e+14 4.193877e+14 4.319534e+14 3.964002e+14 4.839019e+14 4.310338e+14 
##    2015(148)    2015(149)    2015(150)    2015(151)    2015(152)    2015(153) 
## 4.159601e+14 4.613683e+14 3.661942e+14 4.048584e+14 3.809970e+14 3.333738e+14 
##    2015(154)    2015(155)    2015(156)    2015(157)    2015(158)    2015(159) 
## 4.130037e+14 4.596674e+14 4.544125e+14 3.765946e+14 3.462817e+14 3.666225e+14 
##    2015(160)    2015(161)    2015(162)    2015(163)    2015(164)    2015(165) 
## 4.046877e+14 4.183638e+14 4.755102e+14 5.418117e+14 5.388181e+14 5.077213e+14 
##    2015(166)    2015(167)    2015(168)    2015(169)    2015(170)    2015(171) 
## 5.886867e+14 4.518798e+14 4.687702e+14 4.854254e+14 4.794297e+14 4.561899e+14 
##    2015(172)    2015(173)    2015(174)    2015(175)    2015(176)    2015(177) 
## 4.192661e+14 3.844025e+14 3.755426e+14 4.405701e+14 4.227695e+14 4.494641e+14 
##    2015(178)    2015(179)    2015(180)    2015(181)    2015(182)    2015(183) 
## 4.100194e+14 3.774158e+14 4.240765e+14 4.879249e+14 3.540645e+14 4.475800e+14 
##    2015(184)    2015(185)    2015(186)    2015(187)    2015(188)    2015(189) 
## 3.938254e+14 5.083526e+14 4.859973e+14 4.250275e+14 4.816392e+14 5.048204e+14 
##    2015(190)    2015(191)    2015(192)    2015(193)    2015(194)    2015(195) 
## 4.244347e+14 4.540426e+14 4.771648e+14 4.546106e+14 5.118956e+14 8.655124e+14 
##    2015(196)    2015(197)    2015(198)    2015(199)    2015(200)    2015(201) 
## 6.103675e+14 4.563340e+14 5.433974e+14 4.310056e+14 4.190420e+14 4.452841e+14 
##    2015(202)    2015(203)    2015(204)    2015(205)    2015(206)    2015(207) 
## 4.167466e+14 3.932237e+14 3.496722e+14 3.741149e+14 3.737521e+14 3.697302e+14 
##    2015(208)    2015(209)    2015(210)    2015(211)    2015(212)    2015(213) 
## 3.437577e+14 3.305052e+14 3.356533e+14 3.236392e+14 3.033931e+14 3.146886e+14 
##    2015(214)    2015(215)    2015(216)    2015(217)    2015(218)    2015(219) 
## 3.684949e+14 3.446771e+14 2.685515e+14 3.272826e+14 3.861913e+14 3.745439e+14 
##    2015(220)    2015(221)    2015(222)    2015(223)    2015(224)    2015(225) 
## 4.351523e+14 4.246367e+14 3.098851e+14 3.849170e+14 3.564493e+14 4.378779e+14 
##    2015(226)    2015(227)    2015(228)    2015(229)    2015(230)    2015(231) 
## 3.676504e+14 5.786998e+14 4.190774e+14 3.658346e+14 4.245107e+14 4.135336e+14 
##    2015(232)    2015(233)    2015(234)    2015(235)    2015(236)    2015(237) 
## 3.544970e+14 3.624676e+14 3.983017e+14 3.614258e+14 3.601901e+14 3.574233e+14 
##    2015(238)    2015(239)    2015(240)    2015(241)    2015(242)    2015(243) 
## 3.624946e+14 3.662178e+14 3.533992e+14 3.953361e+14 3.502414e+14 3.369625e+14 
##    2015(244)    2015(245)    2015(246)    2015(247)    2015(248)    2015(249) 
## 3.284399e+14 2.833569e+14 3.571266e+14 3.223331e+14 3.392851e+14 4.195412e+14 
##    2015(250)    2015(251)    2015(252)    2015(253)    2015(254)    2015(255) 
## 2.964982e+14 3.686012e+14 4.490048e+14 4.112463e+14 3.921047e+14 5.058266e+14 
##    2015(256)    2015(257)    2015(258)    2015(259)    2015(260)    2015(261) 
## 1.044564e+15 5.570631e+14 4.290904e+14 6.136135e+14 4.551233e+14 3.998447e+14 
##    2015(262)    2015(263)    2015(264)    2015(265)    2015(266)    2015(267) 
## 3.599875e+14 3.961550e+14 4.284444e+14 4.473074e+14 4.521825e+14 5.268226e+14 
##    2015(268)    2015(269)    2015(270)    2015(271)    2015(272)    2015(273) 
## 5.330641e+14 5.660047e+14 5.084218e+14 4.566835e+14 4.052310e+14 3.800447e+14 
##    2015(274)    2015(275)    2015(276)    2015(277)    2015(278)    2015(279) 
## 4.957130e+14 4.161692e+14 3.856353e+14 4.610774e+14 3.897713e+14 3.918333e+14 
##    2015(280)    2015(281)    2015(282)    2015(283)    2015(284)    2015(285) 
## 3.946467e+14 3.879329e+14 4.359462e+14 4.596314e+14 4.129456e+14 3.799983e+14 
##    2015(286)    2015(287)    2015(288)    2015(289)    2015(290)    2015(291) 
## 4.108707e+14 3.958644e+14 3.889108e+14 4.221271e+14 3.374639e+14 3.994995e+14 
##    2015(292)    2015(293)    2015(294)    2015(295)    2015(296)    2015(297) 
## 3.807877e+14 3.376722e+14 3.824249e+14 4.150548e+14 3.806042e+14 3.950479e+14 
##    2015(298)    2015(299)    2015(300)    2015(301)    2015(302)    2015(303) 
## 3.887074e+14 3.848354e+14 4.039927e+14 3.723457e+14 3.603010e+14 4.015287e+14 
##    2015(304)    2015(305)    2015(306)    2015(307)    2015(308)    2015(309) 
## 3.968668e+14 3.545491e+14 3.965910e+14 3.901722e+14 5.460525e+14 4.765067e+14 
##    2015(310)    2015(311)    2015(312)    2015(313)    2015(314)    2015(315) 
## 3.565801e+14 4.581458e+14 4.186661e+14 4.035651e+14 4.360027e+14 4.609767e+14 
##    2015(316)    2015(317)    2015(318)    2015(319)    2015(320)    2015(321) 
## 4.775493e+14 4.182829e+14 3.783851e+14 4.047568e+14 4.421792e+14 3.872525e+14 
##    2015(322)    2015(323)    2015(324)    2015(325)    2015(326)    2015(327) 
## 4.939625e+14 4.540338e+14 4.884648e+14 5.187509e+14 1.027418e+15 6.829801e+14 
##    2015(328)    2015(329)    2015(330)    2015(331)    2015(332)    2015(333) 
## 4.534678e+14 5.665889e+14 5.371813e+14 5.147538e+14 4.369961e+14 4.645168e+14 
##    2015(334)    2015(335)    2015(336)    2015(337)    2015(338)    2015(339) 
## 4.124217e+14 3.746613e+14 3.648395e+14 4.038099e+14 3.853149e+14 3.605378e+14 
##    2015(340)    2015(341)    2015(342)    2015(343)    2015(344)    2015(345) 
## 3.597770e+14 3.770696e+14 4.398022e+14 3.708458e+14 4.352603e+14 4.125210e+14 
##    2015(346)    2015(347)    2015(348)    2015(349)    2015(350)    2015(351) 
## 3.445887e+14 3.521046e+14 4.083198e+14 4.506997e+14 5.823034e+14 3.924480e+14 
##    2015(352)    2015(353)    2015(354)    2015(355)    2015(356)    2015(357) 
## 3.575202e+14 4.161328e+14 3.944164e+14 3.673918e+14 3.674740e+14 3.998689e+14 
##    2015(358)    2015(359)    2015(360)    2015(361)    2015(362)    2015(363) 
## 3.771010e+14 4.832270e+14 4.423260e+14 3.624325e+14 3.617921e+14 3.895377e+14 
##    2015(364)    2015(365) 
## 3.255622e+14 3.695919e+14

Computation and Plot of 10 steps ahead forecast for Turnover with lag (1:4) and Close with lag (35)n(110)

Turnover.open.forecast.2 <- predict(ardl.turnover.open.2, n.ahead = 10)
forecast_start_time <- end(Turnover.ts)[1] + 1
Turnover.open.forecast.ts.2 <- ts(Turnover.open.forecast.2, start = forecast_start_time, frequency = frequency(Turnover.ts))
ts.plot(Turnover.ts, Turnover.open.forecast.ts.2, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Turnover")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Turnover.open.forecast.ts.2)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 254) 
## Frequency = 365 
##    2015(112)    2015(113)    2015(114)    2015(115)    2015(116)    2015(117) 
## 4.428011e+14 3.683766e+14 3.626447e+14 3.904003e+14 3.256125e+14 3.697454e+14 
##    2015(118)    2015(119)    2015(120)    2015(121)    2015(122)    2015(123) 
## 3.752713e+14 3.737980e+14 3.918321e+14 3.861827e+14 3.627108e+14 3.609727e+14 
##    2015(124)    2015(125)    2015(126)    2015(127)    2015(128)    2015(129) 
## 3.752209e+14 3.804938e+14 3.381004e+14 3.094434e+14 3.388987e+14 3.092743e+14 
##    2015(130)    2015(131)    2015(132)    2015(133)    2015(134)    2015(135) 
## 3.617614e+14 3.990582e+14 3.735752e+14 3.746318e+14 3.631745e+14 3.403870e+14 
##    2015(136)    2015(137)    2015(138)    2015(139)    2015(140)    2015(141) 
## 3.260730e+14 3.175593e+14 3.325085e+14 9.516748e+14 5.504302e+14 3.846733e+14 
##    2015(142)    2015(143)    2015(144)    2015(145)    2015(146)    2015(147) 
## 5.041592e+14 4.200472e+14 4.324661e+14 3.943957e+14 4.852940e+14 4.758273e+14 
##    2015(148)    2015(149)    2015(150)    2015(151)    2015(152)    2015(153) 
## 4.152998e+14 4.605092e+14 3.663474e+14 4.047450e+14 3.811031e+14 3.325980e+14 
##    2015(154)    2015(155)    2015(156)    2015(157)    2015(158)    2015(159) 
## 4.134680e+14 4.602906e+14 4.543924e+14 3.770623e+14 3.461819e+14 3.666355e+14 
##    2015(160)    2015(161)    2015(162)    2015(163)    2015(164)    2015(165) 
## 4.042658e+14 4.188421e+14 4.756730e+14 5.417125e+14 5.389215e+14 5.085435e+14 
##    2015(166)    2015(167)    2015(168)    2015(169)    2015(170)    2015(171) 
## 5.889727e+14 4.518604e+14 4.682618e+14 4.844631e+14 4.786477e+14 4.558933e+14 
##    2015(172)    2015(173)    2015(174)    2015(175)    2015(176)    2015(177) 
## 4.188211e+14 3.828334e+14 3.724839e+14 4.406012e+14 4.230613e+14 4.499054e+14 
##    2015(178)    2015(179)    2015(180)    2015(181)    2015(182)    2015(183) 
## 4.106976e+14 3.772281e+14 4.233333e+14 4.883671e+14 3.539605e+14 4.477790e+14 
##    2015(184)    2015(185)    2015(186)    2015(187)    2015(188)    2015(189) 
## 3.942115e+14 5.071757e+14 4.862655e+14 4.243601e+14 4.814118e+14 5.039874e+14 
##    2015(190)    2015(191)    2015(192)    2015(193)    2015(194)    2015(195) 
## 4.228992e+14 4.532919e+14 4.776340e+14 4.545812e+14 5.109536e+14 8.658599e+14 
##    2015(196)    2015(197)    2015(198)    2015(199)    2015(200)    2015(201) 
## 6.104606e+14 4.579758e+14 5.433777e+14 4.312290e+14 4.191161e+14 4.446112e+14 
##    2015(202)    2015(203)    2015(204)    2015(205)    2015(206)    2015(207) 
## 4.152493e+14 3.952025e+14 3.492999e+14 3.736518e+14 3.740085e+14 3.706044e+14 
##    2015(208)    2015(209)    2015(210)    2015(211)    2015(212)    2015(213) 
## 3.447555e+14 3.294853e+14 3.357704e+14 3.234122e+14 3.031601e+14 3.147773e+14 
##    2015(214)    2015(215)    2015(216)    2015(217)    2015(218)    2015(219) 
## 3.681835e+14 3.445221e+14 2.691875e+14 3.267592e+14 3.864944e+14 3.743306e+14 
##    2015(220)    2015(221)    2015(222)    2015(223)    2015(224)    2015(225) 
## 4.340797e+14 4.262033e+14 3.082298e+14 3.833546e+14 3.562878e+14 4.373319e+14 
##    2015(226)    2015(227)    2015(228)    2015(229)    2015(230)    2015(231) 
## 3.688693e+14 5.797805e+14 4.186071e+14 3.634571e+14 4.282125e+14 4.142850e+14 
##    2015(232)    2015(233)    2015(234)    2015(235)    2015(236)    2015(237) 
## 3.540418e+14 3.626483e+14 3.981022e+14 3.609711e+14 3.597207e+14 3.566921e+14 
##    2015(238)    2015(239)    2015(240)    2015(241)    2015(242)    2015(243) 
## 3.620085e+14 3.664086e+14 3.536750e+14 3.950092e+14 3.505484e+14 3.377433e+14 
##    2015(244)    2015(245)    2015(246)    2015(247)    2015(248)    2015(249) 
## 3.282852e+14 2.827194e+14 3.575677e+14 3.231718e+14 3.396293e+14 4.192124e+14 
##    2015(250)    2015(251)    2015(252)    2015(253)    2015(254)    2015(255) 
## 2.968921e+14 3.696175e+14 4.495614e+14 4.114320e+14 3.938242e+14 5.063112e+14 
##    2015(256)    2015(257)    2015(258)    2015(259)    2015(260)    2015(261) 
## 1.043639e+15 5.560024e+14 4.297634e+14 6.132252e+14 4.541981e+14 3.993007e+14 
##    2015(262)    2015(263)    2015(264)    2015(265)    2015(266)    2015(267) 
## 3.591661e+14 3.965495e+14 4.292068e+14 4.478568e+14 4.518555e+14 5.272400e+14 
##    2015(268)    2015(269)    2015(270)    2015(271)    2015(272)    2015(273) 
## 5.329408e+14 5.662267e+14 5.073944e+14 4.568283e+14 4.040150e+14 3.795929e+14 
##    2015(274)    2015(275)    2015(276)    2015(277)    2015(278)    2015(279) 
## 4.949545e+14 4.158412e+14 3.869476e+14 4.600858e+14 3.897649e+14 3.916053e+14 
##    2015(280)    2015(281)    2015(282)    2015(283)    2015(284)    2015(285) 
## 3.950995e+14 3.874708e+14 4.359359e+14 4.600479e+14 3.744355e+14 3.798779e+14 
##    2015(286)    2015(287)    2015(288)    2015(289)    2015(290)    2015(291) 
## 4.091805e+14 3.971131e+14 3.896066e+14 4.212170e+14 3.376526e+14 3.947440e+14 
##    2015(292)    2015(293)    2015(294)    2015(295)    2015(296)    2015(297) 
## 3.799376e+14 3.382205e+14 3.808204e+14 4.145051e+14 3.818001e+14 3.956896e+14 
##    2015(298)    2015(299)    2015(300)    2015(301)    2015(302)    2015(303) 
## 3.875875e+14 3.829777e+14 4.028723e+14 3.714108e+14 3.634473e+14 4.017602e+14 
##    2015(304)    2015(305)    2015(306)    2015(307)    2015(308)    2015(309) 
## 3.961215e+14 3.554459e+14 3.968234e+14 3.899885e+14 5.456499e+14 4.738345e+14 
##    2015(310)    2015(311)    2015(312)    2015(313)    2015(314)    2015(315) 
## 3.569394e+14 4.562060e+14 4.168321e+14 4.035476e+14 4.352053e+14 4.617954e+14 
##    2015(316)    2015(317)    2015(318)    2015(319)    2015(320)    2015(321) 
## 4.770180e+14 4.180522e+14 3.768664e+14 4.059707e+14 4.430527e+14 3.867685e+14 
##    2015(322)    2015(323)    2015(324)    2015(325)    2015(326)    2015(327) 
## 4.932372e+14 4.552050e+14 4.885886e+14 5.172567e+14 1.028013e+15 6.814411e+14 
##    2015(328)    2015(329)    2015(330)    2015(331)    2015(332)    2015(333) 
## 4.554023e+14 5.662889e+14 5.396218e+14 5.147340e+14 4.376055e+14 4.624728e+14 
##    2015(334)    2015(335)    2015(336)    2015(337)    2015(338)    2015(339) 
## 4.128761e+14 3.722505e+14 3.653279e+14 4.047324e+14 3.849746e+14 3.600905e+14 
##    2015(340)    2015(341)    2015(342)    2015(343)    2015(344)    2015(345) 
## 3.605657e+14 3.776312e+14 4.404526e+14 3.727003e+14 4.335782e+14 4.106021e+14 
##    2015(346)    2015(347)    2015(348)    2015(349)    2015(350)    2015(351) 
## 3.467090e+14 3.529687e+14 4.085332e+14 4.503227e+14 5.810565e+14 3.922018e+14 
##    2015(352)    2015(353)    2015(354)    2015(355)    2015(356)    2015(357) 
## 3.565640e+14 4.159535e+14 3.950669e+14 3.692215e+14 3.677280e+14 4.010882e+14 
##    2015(358)    2015(359)    2015(360)    2015(361)    2015(362)    2015(363) 
## 3.769461e+14 4.836075e+14 4.428011e+14 3.683766e+14 3.626447e+14 3.904003e+14 
##    2015(364)    2015(365) 
## 3.256125e+14 3.697454e+14

Computation and Plot of 10 steps ahead forecast for Turnover with lag (2)n(61)n(75)n(117) and Close with lag (110)

Turnover.open.forecast.3 <- predict(ardl.turnover.open.3, n.ahead = 10)
forecast_start_time <- end(Turnover.ts)[1] + 1
Turnover.open.forecast.ts.3 <- ts(Turnover.open.forecast.3, start = forecast_start_time, frequency = frequency(Turnover.ts))
ts.plot(Turnover.ts, Turnover.open.forecast.ts.3, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Turnover")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Turnover.open.forecast.ts.3)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 248) 
## Frequency = 365 
##    2015(118)    2015(119)    2015(120)    2015(121)    2015(122)    2015(123) 
## 3.083939e+14 3.475449e+14 5.471139e+14 4.684545e+14 3.429746e+14 4.684314e+14 
##    2015(124)    2015(125)    2015(126)    2015(127)    2015(128)    2015(129) 
## 9.160187e+14 4.735396e+14 4.347671e+14 4.504672e+14 4.217490e+14 3.492652e+14 
##    2015(130)    2015(131)    2015(132)    2015(133)    2015(134)    2015(135) 
## 2.741138e+14 3.646252e+14 4.444103e+14 4.216012e+14 5.241131e+14 5.075960e+14 
##    2015(136)    2015(137)    2015(138)    2015(139)    2015(140)    2015(141) 
## 5.327146e+14 5.553482e+14 9.474126e+14 5.623414e+14 6.955905e+14 4.303001e+14 
##    2015(142)    2015(143)    2015(144)    2015(145)    2015(146)    2015(147) 
## 5.547322e+14 4.571885e+14 4.016375e+14 4.705903e+14 3.621531e+14 3.976283e+14 
##    2015(148)    2015(149)    2015(150)    2015(151)    2015(152)    2015(153) 
## 3.550502e+14 4.043182e+14 4.371504e+14 4.091608e+14 4.457240e+14 3.523134e+14 
##    2015(154)    2015(155)    2015(156)    2015(157)    2015(158)    2015(159) 
## 4.037839e+14 3.616575e+14 4.672434e+14 4.351924e+14 2.802653e+14 3.137111e+14 
##    2015(160)    2015(161)    2015(162)    2015(163)    2015(164)    2015(165) 
## 3.509756e+14 3.975593e+14 5.543224e+14 4.223796e+14 4.037774e+14 4.184064e+14 
##    2015(166)    2015(167)    2015(168)    2015(169)    2015(170)    2015(171) 
## 4.075957e+14 4.308704e+14 3.780648e+14 3.911060e+14 3.624947e+14 4.587968e+14 
##    2015(172)    2015(173)    2015(174)    2015(175)    2015(176)    2015(177) 
## 4.303193e+14 3.164820e+14 3.349105e+14 3.529127e+14 5.128276e+14 4.389284e+14 
##    2015(178)    2015(179)    2015(180)    2015(181)    2015(182)    2015(183) 
## 3.488269e+14 3.950708e+14 3.624760e+14 3.941270e+14 4.173253e+14 3.884134e+14 
##    2015(184)    2015(185)    2015(186)    2015(187)    2015(188)    2015(189) 
## 4.485515e+14 3.679068e+14 3.764638e+14 3.308625e+14 3.695638e+14 3.457320e+14 
##    2015(190)    2015(191)    2015(192)    2015(193)    2015(194)    2015(195) 
## 4.982666e+14 4.258072e+14 4.780045e+14 4.710508e+14 9.168485e+14 5.555129e+14 
##    2015(196)    2015(197)    2015(198)    2015(199)    2015(200)    2015(201) 
## 6.003463e+14 4.130915e+14 4.376372e+14 9.638915e+14 4.915918e+14 4.302655e+14 
##    2015(202)    2015(203)    2015(204)    2015(205)    2015(206)    2015(207) 
## 3.527688e+14 3.552082e+14 3.671066e+14 3.659607e+14 4.389502e+14 3.633705e+14 
##    2015(208)    2015(209)    2015(210)    2015(211)    2015(212)    2015(213) 
## 3.499238e+14 3.661697e+14 3.504311e+14 3.356298e+14 3.611475e+14 3.690727e+14 
##    2015(214)    2015(215)    2015(216)    2015(217)    2015(218)    2015(219) 
## 3.330709e+14 3.907332e+14 4.259269e+14 3.541493e+14 4.691827e+14 3.214205e+14 
##    2015(220)    2015(221)    2015(222)    2015(223)    2015(224)    2015(225) 
## 3.717533e+14 4.089722e+14 3.382342e+14 4.790594e+14 4.540025e+14 4.295730e+14 
##    2015(226)    2015(227)    2015(228)    2015(229)    2015(230)    2015(231) 
## 5.201246e+14 3.938404e+14 5.747718e+14 3.847419e+14 4.203725e+14 3.796680e+14 
##    2015(232)    2015(233)    2015(234)    2015(235)    2015(236)    2015(237) 
## 3.335735e+14 3.162065e+14 3.248470e+14 4.145853e+14 3.957011e+14 4.276572e+14 
##    2015(238)    2015(239)    2015(240)    2015(241)    2015(242)    2015(243) 
## 3.453821e+14 3.297432e+14 3.801631e+14 4.339080e+14 3.052114e+14 3.457735e+14 
##    2015(244)    2015(245)    2015(246)    2015(247)    2015(248)    2015(249) 
## 2.930322e+14 4.055880e+14 3.715575e+14 4.109000e+14 3.944611e+14 4.397778e+14 
##    2015(250)    2015(251)    2015(252)    2015(253)    2015(254)    2015(255) 
## 3.737662e+14 3.311458e+14 3.614332e+14 3.814156e+14 4.453209e+14 1.283807e+15 
##    2015(256)    2015(257)    2015(258)    2015(259)    2015(260)    2015(261) 
## 6.534567e+14 7.661852e+14 4.150609e+14 4.040246e+14 4.536640e+14 4.360176e+14 
##    2015(262)    2015(263)    2015(264)    2015(265)    2015(266)    2015(267) 
## 4.807811e+14 3.752662e+14 3.478192e+14 4.196957e+14 3.683328e+14 4.089956e+14 
##    2015(268)    2015(269)    2015(270)    2015(271)    2015(272)    2015(273) 
## 3.896921e+14 4.075523e+14 4.454718e+14 4.276561e+14 3.869366e+14 2.862528e+14 
##    2015(274)    2015(275)    2015(276)    2015(277)    2015(278)    2015(279) 
## 3.026959e+14 3.663657e+14 3.090643e+14 3.648590e+14 4.588824e+14 4.953188e+14 
##    2015(280)    2015(281)    2015(282)    2015(283)    2015(284)    2015(285) 
## 5.298868e+14 4.645288e+14 4.909099e+14 3.801481e+14 4.200997e+14 4.576230e+14 
##    2015(286)    2015(287)    2015(288)    2015(289)    2015(290)    2015(291) 
## 4.022920e+14 5.760733e+14 3.698655e+14 3.415171e+14 3.345929e+14 3.967386e+14 
##    2015(292)    2015(293)    2015(294)    2015(295)    2015(296)    2015(297) 
## 3.747755e+14 3.958526e+14 3.602335e+14 3.340958e+14 3.741406e+14 4.253666e+14 
##    2015(298)    2015(299)    2015(300)    2015(301)    2015(302)    2015(303) 
## 3.204343e+14 4.083311e+14 3.162859e+14 5.261592e+14 3.798546e+14 3.561148e+14 
##    2015(304)    2015(305)    2015(306)    2015(307)    2015(308)    2015(309) 
## 3.796252e+14 3.640881e+14 3.509658e+14 3.671744e+14 3.962333e+14 5.216580e+14 
##    2015(310)    2015(311)    2015(312)    2015(313)    2015(314)    2015(315) 
## 4.237794e+14 7.472870e+14 5.656820e+14 4.428686e+14 4.051716e+14 4.765233e+14 
##    2015(316)    2015(317)    2015(318)    2015(319)    2015(320)    2015(321) 
## 9.619183e+14 5.308652e+14 4.131753e+14 3.882021e+14 3.440975e+14 3.697392e+14 
##    2015(322)    2015(323)    2015(324)    2015(325)    2015(326)    2015(327) 
## 3.081242e+14 4.250510e+14 3.723335e+14 4.281314e+14 4.245817e+14 7.556479e+14 
##    2015(328)    2015(329)    2015(330)    2015(331)    2015(332)    2015(333) 
## 5.100271e+14 4.839759e+14 5.205958e+14 4.379170e+14 3.131504e+14 3.262665e+14 
##    2015(334)    2015(335)    2015(336)    2015(337)    2015(338)    2015(339) 
## 4.856832e+14 3.921666e+14 4.037541e+14 4.139813e+14 3.644819e+14 3.586025e+14 
##    2015(340)    2015(341)    2015(342)    2015(343)    2015(344)    2015(345) 
## 3.201529e+14 4.170880e+14 3.921725e+14 6.570054e+14 3.717262e+14 3.815159e+14 
##    2015(346)    2015(347)    2015(348)    2015(349)    2015(350)    2015(351) 
## 3.500779e+14 3.720097e+14 3.258364e+14 3.938364e+14 3.543075e+14 4.703184e+14 
##    2015(352)    2015(353)    2015(354)    2015(355)    2015(356)    2015(357) 
## 3.190981e+14 2.910725e+14 3.278027e+14 3.806619e+14 3.432078e+14 3.864848e+14 
##    2015(358)    2015(359)    2015(360)    2015(361)    2015(362)    2015(363) 
## 3.282010e+14 4.322171e+14 3.403185e+14 3.016090e+14 3.127493e+14 3.141802e+14 
##    2015(364)    2015(365) 
## 3.400957e+14 3.441979e+14

Computation and Plot of 10 steps ahead forecast for Turnover with lag (2)n(61)n(75)n(117) and Open with lag (35)n(110)

Turnover.open.forecast.4 <- predict(ardl.turnover.open.4, n.ahead = 10)
forecast_start_time <- end(Turnover.ts)[1] + 1
Turnover.open.forecast.ts.4 <- ts(Turnover.open.forecast.4, start = forecast_start_time, frequency = frequency(Turnover.ts))
ts.plot(Turnover.ts, Turnover.open.forecast.ts.4, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Turnover")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Turnover.open.forecast.ts.4)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 248) 
## Frequency = 365 
##    2015(118)    2015(119)    2015(120)    2015(121)    2015(122)    2015(123) 
## 3.052734e+14 3.497444e+14 5.511955e+14 4.657055e+14 3.426099e+14 4.666037e+14 
##    2015(124)    2015(125)    2015(126)    2015(127)    2015(128)    2015(129) 
## 9.213501e+14 4.733431e+14 4.368447e+14 4.480973e+14 4.207413e+14 3.453013e+14 
##    2015(130)    2015(131)    2015(132)    2015(133)    2015(134)    2015(135) 
## 2.735640e+14 3.652154e+14 4.439557e+14 4.242640e+14 5.246819e+14 5.103209e+14 
##    2015(136)    2015(137)    2015(138)    2015(139)    2015(140)    2015(141) 
## 5.309552e+14 5.536280e+14 9.456003e+14 5.645535e+14 6.931615e+14 4.298194e+14 
##    2015(142)    2015(143)    2015(144)    2015(145)    2015(146)    2015(147) 
## 5.554125e+14 4.584705e+14 4.028343e+14 4.671394e+14 3.644429e+14 4.769369e+14 
##    2015(148)    2015(149)    2015(150)    2015(151)    2015(152)    2015(153) 
## 3.534381e+14 4.029285e+14 4.373564e+14 4.089037e+14 4.442410e+14 3.501854e+14 
##    2015(154)    2015(155)    2015(156)    2015(157)    2015(158)    2015(159) 
## 4.045129e+14 3.628787e+14 4.667888e+14 4.357720e+14 2.799544e+14 3.139846e+14 
##    2015(160)    2015(161)    2015(162)    2015(163)    2015(164)    2015(165) 
## 3.503396e+14 3.983241e+14 5.543400e+14 4.223341e+14 4.040741e+14 4.199972e+14 
##    2015(166)    2015(167)    2015(168)    2015(169)    2015(170)    2015(171) 
## 4.082842e+14 4.311935e+14 3.769178e+14 3.898963e+14 3.608529e+14 4.584394e+14 
##    2015(172)    2015(173)    2015(174)    2015(175)    2015(176)    2015(177) 
## 4.296104e+14 3.140838e+14 3.296599e+14 3.529330e+14 5.133983e+14 4.399205e+14 
##    2015(178)    2015(179)    2015(180)    2015(181)    2015(182)    2015(183) 
## 3.502771e+14 3.949395e+14 3.613705e+14 3.951731e+14 4.174301e+14 3.888182e+14 
##    2015(184)    2015(185)    2015(186)    2015(187)    2015(188)    2015(189) 
## 4.500176e+14 3.655352e+14 3.772314e+14 3.296054e+14 3.697348e+14 3.445628e+14 
##    2015(190)    2015(191)    2015(192)    2015(193)    2015(194)    2015(195) 
## 4.961974e+14 4.245917e+14 4.795222e+14 4.713537e+14 9.172015e+14 5.568857e+14 
##    2015(196)    2015(197)    2015(198)    2015(199)    2015(200)    2015(201) 
## 6.011673e+14 4.154528e+14 4.388352e+14 9.639674e+14 4.919191e+14 4.296116e+14 
##    2015(202)    2015(203)    2015(204)    2015(205)    2015(206)    2015(207) 
## 3.504167e+14 3.588634e+14 3.664771e+14 3.652370e+14 4.394679e+14 3.648656e+14 
##    2015(208)    2015(209)    2015(210)    2015(211)    2015(212)    2015(213) 
## 3.517526e+14 3.644776e+14 3.512193e+14 3.354741e+14 3.611777e+14 3.674684e+14 
##    2015(214)    2015(215)    2015(216)    2015(217)    2015(218)    2015(219) 
## 3.320956e+14 3.901920e+14 4.270689e+14 3.535436e+14 4.705755e+14 3.210081e+14 
##    2015(220)    2015(221)    2015(222)    2015(223)    2015(224)    2015(225) 
## 3.693560e+14 4.116309e+14 3.348713e+14 4.760203e+14 4.537517e+14 4.285068e+14 
##    2015(226)    2015(227)    2015(228)    2015(229)    2015(230)    2015(231) 
## 5.222780e+14 3.957440e+14 5.743916e+14 3.795727e+14 4.270644e+14 3.810152e+14 
##    2015(232)    2015(233)    2015(234)    2015(235)    2015(236)    2015(237) 
## 3.329433e+14 3.166171e+14 3.246740e+14 4.136198e+14 3.945672e+14 4.259316e+14 
##    2015(238)    2015(239)    2015(240)    2015(241)    2015(242)    2015(243) 
## 3.440959e+14 3.298707e+14 3.801068e+14 4.331685e+14 3.056070e+14 3.466446e+14 
##    2015(244)    2015(245)    2015(246)    2015(247)    2015(248)    2015(249) 
## 2.926032e+14 4.040117e+14 3.722590e+14 4.126443e+14 3.948982e+14 4.390305e+14 
##    2015(250)    2015(251)    2015(252)    2015(253)    2015(254)    2015(255) 
## 3.743043e+14 3.323854e+14 3.625114e+14 3.814719e+14 4.479584e+14 1.285354e+15 
##    2015(256)    2015(257)    2015(258)    2015(259)    2015(260)    2015(261) 
## 6.521200e+14 7.644452e+14 4.148535e+14 4.042931e+14 4.521954e+14 4.349132e+14 
##    2015(262)    2015(263)    2015(264)    2015(265)    2015(266)    2015(267) 
## 4.795432e+14 3.758557e+14 3.495076e+14 4.206574e+14 3.675575e+14 4.096230e+14 
##    2015(268)    2015(269)    2015(270)    2015(271)    2015(272)    2015(273) 
## 3.892930e+14 4.063221e+14 4.434782e+14 4.280923e+14 3.853277e+14 2.856726e+14 
##    2015(274)    2015(275)    2015(276)    2015(277)    2015(278)    2015(279) 
## 3.013383e+14 3.657682e+14 3.113338e+14 3.636206e+14 4.594826e+14 4.953669e+14 
##    2015(280)    2015(281)    2015(282)    2015(283)    2015(284)    2015(285) 
## 5.312685e+14 4.640074e+14 4.916397e+14 3.812267e+14 3.526209e+14 4.576874e+14 
##    2015(286)    2015(287)    2015(288)    2015(289)    2015(290)    2015(291) 
## 4.000692e+14 5.784302e+14 3.711987e+14 3.400576e+14 3.353746e+14 3.885919e+14 
##    2015(292)    2015(293)    2015(294)    2015(295)    2015(296)    2015(297) 
## 3.737789e+14 3.969086e+14 3.574063e+14 3.331272e+14 3.764495e+14 4.269040e+14 
##    2015(298)    2015(299)    2015(300)    2015(301)    2015(302)    2015(303) 
## 3.187172e+14 4.051561e+14 3.145085e+14 5.242861e+14 3.857546e+14 3.568858e+14 
##    2015(304)    2015(305)    2015(306)    2015(307)    2015(308)    2015(309) 
## 3.788459e+14 3.660245e+14 3.516764e+14 3.673374e+14 3.957155e+14 5.173793e+14 
##    2015(310)    2015(311)    2015(312)    2015(313)    2015(314)    2015(315) 
## 4.246700e+14 7.456383e+14 5.632958e+14 4.429000e+14 4.041239e+14 4.778004e+14 
##    2015(316)    2015(317)    2015(318)    2015(319)    2015(320)    2015(321) 
## 9.601308e+14 5.306174e+14 4.107836e+14 3.907760e+14 3.456698e+14 3.691010e+14 
##    2015(322)    2015(323)    2015(324)    2015(325)    2015(326)    2015(327) 
## 3.068867e+14 4.273035e+14 3.724578e+14 4.255649e+14 4.250615e+14 7.529925e+14 
##    2015(328)    2015(329)    2015(330)    2015(331)    2015(332)    2015(333) 
## 5.117695e+14 4.837529e+14 5.230849e+14 4.376166e+14 3.138030e+14 3.224314e+14 
##    2015(334)    2015(335)    2015(336)    2015(337)    2015(338)    2015(339) 
## 4.865171e+14 3.879552e+14 4.051668e+14 4.157264e+14 3.639128e+14 3.574972e+14 
##    2015(340)    2015(341)    2015(342)    2015(343)    2015(344)    2015(345) 
## 3.213908e+14 4.179358e+14 3.928967e+14 6.603604e+14 3.683399e+14 3.783634e+14 
##    2015(346)    2015(347)    2015(348)    2015(349)    2015(350)    2015(351) 
## 3.537506e+14 3.739240e+14 3.259215e+14 3.931507e+14 3.521170e+14 4.697975e+14 
##    2015(352)    2015(353)    2015(354)    2015(355)    2015(356)    2015(357) 
## 3.171117e+14 2.913342e+14 3.290748e+14 3.838682e+14 3.434351e+14 3.885816e+14 
##    2015(358)    2015(359)    2015(360)    2015(361)    2015(362)    2015(363) 
## 3.278987e+14 4.330557e+14 3.410997e+14 3.118720e+14 3.142782e+14 3.156899e+14 
##    2015(364)    2015(365) 
## 3.404182e+14 3.445406e+14

Computation and Plot of 10 steps ahead forecast for Volume with lag (1:32) and Close lag (110)

Volume.Close.forecast.1 <- predict(ardl.volume.close.1, n.ahead = 10)
forecast_start_time <- end(Volume.ts)[1] + 1
Volume.Close.forecast.ts.1 <- ts(Volume.Close.forecast.1, start = forecast_start_time, frequency = frequency(Volume.ts))
ts.plot(Volume.ts, Volume.Close.forecast.ts.1, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Volume")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Volume.Close.forecast.ts.1)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 254) 
## Frequency = 365 
## 2015(112) 2015(113) 2015(114) 2015(115) 2015(116) 2015(117) 2015(118) 2015(119) 
##   1994992   2457637   2298166   2573195   2149188   2609977   2652780   2875449 
## 2015(120) 2015(121) 2015(122) 2015(123) 2015(124) 2015(125) 2015(126) 2015(127) 
##   2928882   2741523   2493924   2605516   2970943   3156726   2716471   2017789 
## 2015(128) 2015(129) 2015(130) 2015(131) 2015(132) 2015(133) 2015(134) 2015(135) 
##   2364431   2024631   2961938   3051374   2772822   2566865   2668419   2242096 
## 2015(136) 2015(137) 2015(138) 2015(139) 2015(140) 2015(141) 2015(142) 2015(143) 
##   2477745   2605670   2552585   8063245   4695041   2373198   3896998   3194042 
## 2015(144) 2015(145) 2015(146) 2015(147) 2015(148) 2015(149) 2015(150) 2015(151) 
##   4081485   5461897   4255647   3618670   4209851   2977700   3021281   2669715 
## 2015(152) 2015(153) 2015(154) 2015(155) 2015(156) 2015(157) 2015(158) 2015(159) 
##   2663439   3893860   3085251   3732704   4085081   2593574   2541105   1917414 
## 2015(160) 2015(161) 2015(162) 2015(163) 2015(164) 2015(165) 2015(166) 2015(167) 
##   3577992   3354666   5272785   5462280   4793086   4333853   3298395   5673696 
## 2015(168) 2015(169) 2015(170) 2015(171) 2015(172) 2015(173) 2015(174) 2015(175) 
##   4195765   5734370   5443032   4563309   4287539   3001770   3551993   3807175 
## 2015(176) 2015(177) 2015(178) 2015(179) 2015(180) 2015(181) 2015(182) 2015(183) 
##   3371657   4337684   3245622   3328977   3732761   3808110   2847535   3792346 
## 2015(184) 2015(185) 2015(186) 2015(187) 2015(188) 2015(189) 2015(190) 2015(191) 
##   3552277   4379356   4735457   4091315   4158507   4806219   3687993   4452498 
## 2015(192) 2015(193) 2015(194) 2015(195) 2015(196) 2015(197) 2015(198) 2015(199) 
##   4812646   3901122   5819742   7617383   5547978   3905064   4893640   4121615 
## 2015(200) 2015(201) 2015(202) 2015(203) 2015(204) 2015(205) 2015(206) 2015(207) 
##   4883630   5248194   4038551   3424150   3331796   2518833   3347746   2620881 
## 2015(208) 2015(209) 2015(210) 2015(211) 2015(212) 2015(213) 2015(214) 2015(215) 
##   2592350   3784841   2189646   2861794   2577967   2704544   3119001   2635347 
## 2015(216) 2015(217) 2015(218) 2015(219) 2015(220) 2015(221) 2015(222) 2015(223) 
##   2303283   2902475   3914475   4052924   4421223   3713099   2430633   4399493 
## 2015(224) 2015(225) 2015(226) 2015(227) 2015(228) 2015(229) 2015(230) 2015(231) 
##   3443604   4325496   4202173   5028381   3634232   2902791   3260849   3633501 
## 2015(232) 2015(233) 2015(234) 2015(235) 2015(236) 2015(237) 2015(238) 2015(239) 
##   2921815   3273011   3179645   2518553   3002345   2342002   2645152   2555586 
## 2015(240) 2015(241) 2015(242) 2015(243) 2015(244) 2015(245) 2015(246) 2015(247) 
##   2202543   3030884   2633400   2555925   2656138   1983187   2717873   2059380 
## 2015(248) 2015(249) 2015(250) 2015(251) 2015(252) 2015(253) 2015(254) 2015(255) 
##   2864547   3156567   2572807   2345633   2914705   2762866   1816571   4147167 
## 2015(256) 2015(257) 2015(258) 2015(259) 2015(260) 2015(261) 2015(262) 2015(263) 
##   5040642   3639674   2586489   3299111   2721730   2766800   3348094   2508307 
## 2015(264) 2015(265) 2015(266) 2015(267) 2015(268) 2015(269) 2015(270) 2015(271) 
##   2359728   2903129   1929201   2600214   2047834   2735397   3261108   2210836 
## 2015(272) 2015(273) 2015(274) 2015(275) 2015(276) 2015(277) 2015(278) 2015(279) 
##   2480150   2373644   2829942   2286551   1775212   2748923   1770066   2647553 
## 2015(280) 2015(281) 2015(282) 2015(283) 2015(284) 2015(285) 2015(286) 2015(287) 
##   2578688   2240218   2175857   1864270   3019386   1718476   2272523   2273135 
## 2015(288) 2015(289) 2015(290) 2015(291) 2015(292) 2015(293) 2015(294) 2015(295) 
##   2284738   2188287   1748631   2170225   2053274   1818487   1871547   2135176 
## 2015(296) 2015(297) 2015(298) 2015(299) 2015(300) 2015(301) 2015(302) 2015(303) 
##   1771392   2219482   2007993   1929956   2196424   1694388   1907722   1907820 
## 2015(304) 2015(305) 2015(306) 2015(307) 2015(308) 2015(309) 2015(310) 2015(311) 
##   1776118   1938542   1962444   1821306   2570834   2263684   1609642   2146330 
## 2015(312) 2015(313) 2015(314) 2015(315) 2015(316) 2015(317) 2015(318) 2015(319) 
##   2132628   1963827   2486799   2203961   2077798   2271774   1569471   1972678 
## 2015(320) 2015(321) 2015(322) 2015(323) 2015(324) 2015(325) 2015(326) 2015(327) 
##   2227294   1818028   2577998   2219534   2086387   2659434   4892082   3566430 
## 2015(328) 2015(329) 2015(330) 2015(331) 2015(332) 2015(333) 2015(334) 2015(335) 
##   2325334   2956092   2899666   3504095   3526304   2820279   2222501   2044136 
## 2015(336) 2015(337) 2015(338) 2015(339) 2015(340) 2015(341) 2015(342) 2015(343) 
##   1896649   2278607   1862108   2006582   2297716   1679841   1917760   2189515 
## 2015(344) 2015(345) 2015(346) 2015(347) 2015(348) 2015(349) 2015(350) 2015(351) 
##   2235688   2332459   1591579   2079181   2394806   2918016   3827048   2469599 
## 2015(352) 2015(353) 2015(354) 2015(355) 2015(356) 2015(357) 2015(358) 2015(359) 
##   1924078   1647966   3187724   2457207   2792567   2335366   2129153   2183032 
## 2015(360) 2015(361) 2015(362) 2015(363) 2015(364) 2015(365) 
##   1994992   2457637   2298166   2573195   2149188   2609977

Computation and Plot of 10 steps ahead forecast for Volume with lag (1:32) and Close lag (1:110)

Volume.Close.forecast.2 <- predict(ardl.volume.close.2, n.ahead = 10)
forecast_start_time <- end(Volume.ts)[1] + 1
Volume.Close.forecast.ts.2 <- ts(Volume.Close.forecast.2, start = forecast_start_time, frequency = frequency(Volume.ts))
ts.plot(Volume.ts, Volume.Close.forecast.ts.2, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Volume")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Volume.Close.forecast.ts.2)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 254) 
## Frequency = 365 
##    2015(112)    2015(113)    2015(114)    2015(115)    2015(116)    2015(117) 
##  1912063.773  2499281.714  3252154.662  2122389.630  3551780.953  2587263.604 
##    2015(118)    2015(119)    2015(120)    2015(121)    2015(122)    2015(123) 
##   420676.995  4724265.492  4234223.257  3554583.128  2994853.499  3421436.168 
##    2015(124)    2015(125)    2015(126)    2015(127)    2015(128)    2015(129) 
##  4736130.609  3609176.453  2352799.675  2793897.441  2432217.114  2098509.696 
##    2015(130)    2015(131)    2015(132)    2015(133)    2015(134)    2015(135) 
##  3935279.406  2960330.195  2509168.007  3217567.820  2627478.195  2951698.101 
##    2015(136)    2015(137)    2015(138)    2015(139)    2015(140)    2015(141) 
##  2817103.474  2913778.356 13111129.244  6411075.199  5082967.443  2194986.326 
##    2015(142)    2015(143)    2015(144)    2015(145)    2015(146)    2015(147) 
##  3760810.127  4103327.222  4282832.754  5716494.549  4239413.755  4616209.108 
##    2015(148)    2015(149)    2015(150)    2015(151)    2015(152)    2015(153) 
##  4208190.945  2901286.822  4518277.522  2740789.895  2688483.965  3794274.463 
##    2015(154)    2015(155)    2015(156)    2015(157)    2015(158)    2015(159) 
##  4727678.037  5593126.322  2782211.382  1691292.182  3403312.136  2877441.356 
##    2015(160)    2015(161)    2015(162)    2015(163)    2015(164)    2015(165) 
##  4214343.390  3690962.065  5889715.225  6956572.017  3776316.732  6421678.847 
##    2015(166)    2015(167)    2015(168)    2015(169)    2015(170)    2015(171) 
##  3681235.434  5656781.768  4435752.129  5211715.138  3860181.931  5013363.599 
##    2015(172)    2015(173)    2015(174)    2015(175)    2015(176)    2015(177) 
##  3931995.880  2600530.710  4278597.664  3228594.638  4504763.205  3943163.445 
##    2015(178)    2015(179)    2015(180)    2015(181)    2015(182)    2015(183) 
##  2583486.540  2866211.732  5146892.036  2942180.602  4490894.166  3338243.394 
##    2015(184)    2015(185)    2015(186)    2015(187)    2015(188)    2015(189) 
##  4465140.928  5301191.504  4144999.431  3008636.952   530867.115  3457203.624 
##    2015(190)    2015(191)    2015(192)    2015(193)    2015(194)    2015(195) 
##  4294628.962  3934065.341  3851795.316  5250077.075 12191000.897  8266224.512 
##    2015(196)    2015(197)    2015(198)    2015(199)    2015(200)    2015(201) 
##  5391288.855  4665504.737  3788654.537  3383442.633  4345395.154  3759525.810 
##    2015(202)    2015(203)    2015(204)    2015(205)    2015(206)    2015(207) 
##  3338059.455  1930970.612  2736742.323  2209239.967  2624166.516  2517821.557 
##    2015(208)    2015(209)    2015(210)    2015(211)    2015(212)    2015(213) 
##  2874614.138  2506456.639  1464516.306  2056608.439  1698244.574  2891764.213 
##    2015(214)    2015(215)    2015(216)    2015(217)    2015(218)    2015(219) 
##  3603935.098  1352176.710  1577014.077  3466792.708  4605386.828  4809847.222 
##    2015(220)    2015(221)    2015(222)    2015(223)    2015(224)    2015(225) 
##  4750722.025  3582786.124  2245114.655  4068057.064  4126882.148  4473005.735 
##    2015(226)    2015(227)    2015(228)    2015(229)    2015(230)    2015(231) 
##  5477211.476  4965480.865  3502421.022  2397349.880  3806042.191  2603830.179 
##    2015(232)    2015(233)    2015(234)    2015(235)    2015(236)    2015(237) 
##  3786437.722  3316424.261  3014721.580  2455954.242  2721845.758  2874989.257 
##    2015(238)    2015(239)    2015(240)    2015(241)    2015(242)    2015(243) 
##  2724097.765  2394260.238  1925493.884  2739076.013  2822737.037  2433343.187 
##    2015(244)    2015(245)    2015(246)    2015(247)    2015(248)    2015(249) 
##  3231792.239  2160248.252  3446459.499  1829585.276  1844830.668  2908929.907 
##    2015(250)    2015(251)    2015(252)    2015(253)    2015(254)    2015(255) 
##  1900705.795  2447286.806  2243146.340  2146604.599  3110501.319  6825422.651 
##    2015(256)    2015(257)    2015(258)    2015(259)    2015(260)    2015(261) 
##  4039776.049  2865049.522  2792956.663  2639311.947  2170571.839  2656682.902 
##    2015(262)    2015(263)    2015(264)    2015(265)    2015(266)    2015(267) 
##  4060874.976  3135304.842  2607104.355  3203130.103  2350526.822  2246831.334 
##    2015(268)    2015(269)    2015(270)    2015(271)    2015(272)    2015(273) 
##  2454789.904  1902768.568  2818170.114  2147906.375  2378575.906  3594492.211 
##    2015(274)    2015(275)    2015(276)    2015(277)    2015(278)    2015(279) 
##  3560676.524 -3891471.602  2657093.057  2550936.727  2026863.963  2060075.441 
##    2015(280)    2015(281)    2015(282)    2015(283)    2015(284)    2015(285) 
##   699173.724  2184373.757  2200132.405  1214206.310  1790037.969  1195359.402 
##    2015(286)    2015(287)    2015(288)    2015(289)    2015(290)    2015(291) 
##  1892186.019  2673745.460  2530556.321  1766990.958   805628.489   608801.087 
##    2015(292)    2015(293)    2015(294)    2015(295)    2015(296)    2015(297) 
##  2748110.609  2293192.014  1931068.835  3566826.219  1594285.189  1987075.969 
##    2015(298)    2015(299)    2015(300)    2015(301)    2015(302)    2015(303) 
##     6385.402   973762.660  2093339.570   250505.780   451689.793  1416469.512 
##    2015(304)    2015(305)    2015(306)    2015(307)    2015(308)    2015(309) 
##  1928141.151  2675496.470  1129739.997  3532194.303  3064926.113  2582263.794 
##    2015(310)    2015(311)    2015(312)    2015(313)    2015(314)    2015(315) 
##  1330815.088  1005928.342  1716445.790   965060.310  2521355.662  2614221.136 
##    2015(316)    2015(317)    2015(318)    2015(319)    2015(320)    2015(321) 
##  2022283.102   875460.388  2846514.054  2095023.808  3428460.666   767046.662 
##    2015(322)    2015(323)    2015(324)    2015(325)    2015(326)    2015(327) 
##  2249372.038  2695777.607  1447475.929  5159899.039  4848886.681  2776225.240 
##    2015(328)    2015(329)    2015(330)    2015(331)    2015(332)    2015(333) 
##  1149403.967  2829604.687  2474545.306  -350805.779  2795732.943  2554959.966 
##    2015(334)    2015(335)    2015(336)    2015(337)    2015(338)    2015(339) 
##   976138.003  2004998.140  1783085.526  2244437.721  1818920.702  1311660.640 
##    2015(340)    2015(341)    2015(342)    2015(343)    2015(344)    2015(345) 
##  1699177.559  2203778.907  1140181.445  2343533.386  1767527.693  1870533.796 
##    2015(346)    2015(347)    2015(348)    2015(349)    2015(350)    2015(351) 
##  2023219.856  2060507.377  3636949.097  4596058.028  2859504.558  3100633.677 
##    2015(352)    2015(353)    2015(354)    2015(355)    2015(356)    2015(357) 
##  1985959.567  1774211.155  1607160.166  1999972.933   694989.881  1305698.924 
##    2015(358)    2015(359)    2015(360)    2015(361)    2015(362)    2015(363) 
##  2563110.297  2047685.302  1912063.773  2499281.714  3252154.662  2122389.630 
##    2015(364)    2015(365) 
##  3551780.953  2587263.604

Computation and Plot of 10 steps ahead forecast for Volume with lag (1:32)n(91:122) and Close lag (110)

Volume.Close.forecast.3 <- predict(ardl.volume.close.3, n.ahead = 10)
forecast_start_time <- end(Volume.ts)[1] + 1
Volume.Close.forecast.ts.3 <- ts(Volume.Close.forecast.3, start = forecast_start_time, frequency = frequency(Volume.ts))
ts.plot(Volume.ts, Volume.Close.forecast.ts.3, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Volume")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Volume.Close.forecast.ts.3)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 243) 
## Frequency = 365 
## 2015(123) 2015(124) 2015(125) 2015(126) 2015(127) 2015(128) 2015(129) 2015(130) 
## 3968635.8 5703498.3 2376786.5 2403605.3 2948639.6 2425389.5 1594387.1 2783332.9 
## 2015(131) 2015(132) 2015(133) 2015(134) 2015(135) 2015(136) 2015(137) 2015(138) 
## 3398401.4 3342289.0 3006934.2 2949834.9 3024290.6 2870849.0 3207191.2 3309724.8 
## 2015(139) 2015(140) 2015(141) 2015(142) 2015(143) 2015(144) 2015(145) 2015(146) 
## 8263316.5 5207646.7 2546113.1 3724938.9 3614248.3 4403769.5 5620606.3 4409449.4 
## 2015(147) 2015(148) 2015(149) 2015(150) 2015(151) 2015(152) 2015(153) 2015(154) 
## 4267306.4 4546899.2 2824306.1 3974193.3 2601531.0 3083577.6 3940657.6 3367020.0 
## 2015(155) 2015(156) 2015(157) 2015(158) 2015(159) 2015(160) 2015(161) 2015(162) 
## 3832846.7 3914452.3 3066298.8 2724452.3 2527933.6 3803190.6 3700081.8 5118041.1 
## 2015(163) 2015(164) 2015(165) 2015(166) 2015(167) 2015(168) 2015(169) 2015(170) 
## 5854603.9 5243285.7 4965316.4 3560692.3 5045018.9 4340095.6 5420260.4 5514500.1 
## 2015(171) 2015(172) 2015(173) 2015(174) 2015(175) 2015(176) 2015(177) 2015(178) 
## 4499105.5 4217909.9 2349313.3 2927421.5 3356569.8 4433651.1 3910921.3 3038501.3 
## 2015(179) 2015(180) 2015(181) 2015(182) 2015(183) 2015(184) 2015(185) 2015(186) 
## 3259693.4 3894872.2 3947783.9 3141738.5 3827965.4 3917164.1 4170361.2 4130435.3 
## 2015(187) 2015(188) 2015(189) 2015(190) 2015(191) 2015(192) 2015(193) 2015(194) 
## 4290231.7 3172963.1 4713945.8 4671175.2 3648221.7 4009798.0 4277929.7 8331800.2 
## 2015(195) 2015(196) 2015(197) 2015(198) 2015(199) 2015(200) 2015(201) 2015(202) 
## 7339045.2 4781257.9 3850135.2 4445860.4 3796687.7 5012442.2 5189263.3 4085518.7 
## 2015(203) 2015(204) 2015(205) 2015(206) 2015(207) 2015(208) 2015(209) 2015(210) 
## 3435890.9 3301789.0 2552101.4 3792481.5 2232479.0 2501918.0 3610165.6 2429881.9 
## 2015(211) 2015(212) 2015(213) 2015(214) 2015(215) 2015(216) 2015(217) 2015(218) 
## 2444083.6 2749958.4 2959083.0 3381294.0 2524742.6 2490166.5 3555562.0 4815587.8 
## 2015(219) 2015(220) 2015(221) 2015(222) 2015(223) 2015(224) 2015(225) 2015(226) 
## 3788428.2 4360925.5 4459971.3 2688641.7 4003313.1 4077292.7 4132405.4 4532059.0 
## 2015(227) 2015(228) 2015(229) 2015(230) 2015(231) 2015(232) 2015(233) 2015(234) 
## 4946906.4 3765351.5 1989643.3 3529425.3 3636751.3 3057076.1 2429246.8 2774018.2 
## 2015(235) 2015(236) 2015(237) 2015(238) 2015(239) 2015(240) 2015(241) 2015(242) 
## 1664150.9 1766777.0 3549598.8 1431947.2 2732397.1 2330232.9 2337720.1 2427339.8 
## 2015(243) 2015(244) 2015(245) 2015(246) 2015(247) 2015(248) 2015(249) 2015(250) 
## 2352995.2 1864877.3 2163505.6 2362227.4 2126257.1 3019145.0 1375112.3 2304665.1 
## 2015(251) 2015(252) 2015(253) 2015(254) 2015(255) 2015(256) 2015(257) 2015(258) 
## 3107666.6 1455567.4  698323.3 2257232.8 8152802.6 3586870.7 2054670.9 2310496.9 
## 2015(259) 2015(260) 2015(261) 2015(262) 2015(263) 2015(264) 2015(265) 2015(266) 
## 1831866.2 1708884.4 2062083.3 3133495.4 2100513.9 2495945.5 2426848.2 1422381.2 
## 2015(267) 2015(268) 2015(269) 2015(270) 2015(271) 2015(272) 2015(273) 2015(274) 
## 2831407.7 1731855.1 1821672.6 3168255.7 1915604.2 2281377.4  945564.4 2113708.7 
## 2015(275) 2015(276) 2015(277) 2015(278) 2015(279) 2015(280) 2015(281) 2015(282) 
## 2028824.1  972048.9 1973433.6 2262911.3 2420796.7 2062289.8 2431572.6 2150673.6 
## 2015(283) 2015(284) 2015(285) 2015(286) 2015(287) 2015(288) 2015(289) 2015(290) 
## 1062764.5 1863530.4 1168776.8 1978508.7 2193375.6 1470244.5 1419251.1  706434.0 
## 2015(291) 2015(292) 2015(293) 2015(294) 2015(295) 2015(296) 2015(297) 2015(298) 
## 1054769.5 1526999.1 2398976.5 1108491.8 1683645.9 1967625.9 2539258.9 1447221.2 
## 2015(299) 2015(300) 2015(301) 2015(302) 2015(303) 2015(304) 2015(305) 2015(306) 
## 1978014.9 1944390.4 2834862.8 1079820.8 1220435.3 2224380.0 1033915.1 1514388.6 
## 2015(307) 2015(308) 2015(309) 2015(310) 2015(311) 2015(312) 2015(313) 2015(314) 
## 2955765.4 1940923.8 1351759.3 2310369.6 4846883.9 1951520.9 1369598.5 2699907.8 
## 2015(315) 2015(316) 2015(317) 2015(318) 2015(319) 2015(320) 2015(321) 2015(322) 
## 1579743.0 1561267.4 2036847.5 2299664.1 1735467.9 2306827.2 1840890.9 2698756.5 
## 2015(323) 2015(324) 2015(325) 2015(326) 2015(327) 2015(328) 2015(329) 2015(330) 
## 2561978.7 1565112.0 3245359.6 5055206.6 3909953.7 1376718.9 2981801.7 3388906.9 
## 2015(331) 2015(332) 2015(333) 2015(334) 2015(335) 2015(336) 2015(337) 2015(338) 
## 3612036.4 2618933.3 3069584.7 2710839.0 1867995.2 2192483.0 2415720.2 1359316.6 
## 2015(339) 2015(340) 2015(341) 2015(342) 2015(343) 2015(344) 2015(345) 2015(346) 
## 2463860.6 2042361.6 1706502.6 2175694.2 3452935.2 2009400.7 1972418.8 1763115.1 
## 2015(347) 2015(348) 2015(349) 2015(350) 2015(351) 2015(352) 2015(353) 2015(354) 
## 3004041.0 1638858.4 3172892.2 3970008.7 2460697.1 1939097.0 1598985.9 3574430.0 
## 2015(355) 2015(356) 2015(357) 2015(358) 2015(359) 2015(360) 2015(361) 2015(362) 
## 3141217.1 2984408.2 3253807.0 2758387.3 2309903.7 2520866.5 2286902.0 2783683.2 
## 2015(363) 2015(364) 2015(365) 
## 2234192.1 2299501.6 3464905.4

Computation and Plot of 10 steps ahead forecast for Volume with lag (1:32)n(91:122) and Close lag (1:110)

Volume.Close.forecast.4 <- predict(ardl.volume.close.4, n.ahead = 10)
forecast_start_time <- end(Volume.ts)[1] + 1
Volume.Close.forecast.ts.4 <- ts(Volume.Close.forecast.4, start = forecast_start_time, frequency = frequency(Volume.ts))
ts.plot(Volume.ts, Volume.Close.forecast.ts.4, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Volume")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Volume.Close.forecast.ts.4)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 243) 
## Frequency = 365 
##   2015(123)   2015(124)   2015(125)   2015(126)   2015(127)   2015(128) 
##  2952175.90  5027214.29  2569285.67  2061319.89  2695701.70  2603725.16 
##   2015(129)   2015(130)   2015(131)   2015(132)   2015(133)   2015(134) 
##  2431804.86  4178376.88  3228708.26  2969411.84  3788839.08  2624603.13 
##   2015(135)   2015(136)   2015(137)   2015(138)   2015(139)   2015(140) 
##  2948661.41  2813787.05  2354234.34 14589626.81  6105660.97  5228664.83 
##   2015(141)   2015(142)   2015(143)   2015(144)   2015(145)   2015(146) 
##  2050217.16  3988561.07  3626334.58  4595217.70  5376960.71  4371675.68 
##   2015(147)   2015(148)   2015(149)   2015(150)   2015(151)   2015(152) 
##  3948517.03  4007658.26  2489464.24  4677373.23  2054610.15  2459456.53 
##   2015(153)   2015(154)   2015(155)   2015(156)   2015(157)   2015(158) 
##  3306065.59  4665665.90  5142800.66  3120934.06  1542705.29  3928324.45 
##   2015(159)   2015(160)   2015(161)   2015(162)   2015(163)   2015(164) 
##  3303915.44  4354288.49  4584279.85  6045573.77  7095385.45  4606785.68 
##   2015(165)   2015(166)   2015(167)   2015(168)   2015(169)   2015(170) 
##  6510335.11  3800374.93  5167434.94  4887667.00  5241427.49  4360989.08 
##   2015(171)   2015(172)   2015(173)   2015(174)   2015(175)   2015(176) 
##  4489845.94  3266803.00  2515216.11  4912979.25  3111422.45  3611155.05 
##   2015(177)   2015(178)   2015(179)   2015(180)   2015(181)   2015(182) 
##  3260726.30  2240435.38  2729717.01  5474738.46  3240382.34  4887942.36 
##   2015(183)   2015(184)   2015(185)   2015(186)   2015(187)   2015(188) 
##  2980944.86  5243967.21  5190890.81  4573590.72  3842582.48  1197536.32 
##   2015(189)   2015(190)   2015(191)   2015(192)   2015(193)   2015(194) 
##  4360674.17  4198434.11  3852129.18  4220547.52  5306336.81 13547944.85 
##   2015(195)   2015(196)   2015(197)   2015(198)   2015(199)   2015(200) 
##  7378986.23  4922759.87  4570184.78  3518176.74  3559540.62  4591618.17 
##   2015(201)   2015(202)   2015(203)   2015(204)   2015(205)   2015(206) 
##  4298164.25  3806583.79  2424807.41  2508134.78  2286012.44  3244193.02 
##   2015(207)   2015(208)   2015(209)   2015(210)   2015(211)   2015(212) 
##  2533765.64  2505837.19  2618659.49  1624760.89  1644869.17   724273.22 
##   2015(213)   2015(214)   2015(215)   2015(216)   2015(217)   2015(218) 
##  3352762.34  3068183.41  1281802.84  1037812.49  3099432.48  4739076.67 
##   2015(219)   2015(220)   2015(221)   2015(222)   2015(223)   2015(224) 
##  4267552.02  5219743.57  3687771.04  2596618.54  2381476.87  4380789.00 
##   2015(225)   2015(226)   2015(227)   2015(228)   2015(229)   2015(230) 
##  3706044.66  6066507.33  5399426.22  4511006.46  3781994.02  3785157.61 
##   2015(231)   2015(232)   2015(233)   2015(234)   2015(235)   2015(236) 
##  3501482.92  2265145.97  3399725.40  2623439.05  1464991.73  1585517.35 
##   2015(237)   2015(238)   2015(239)   2015(240)   2015(241)   2015(242) 
##  3295186.65   677438.82  1525135.14  3001798.66  1224132.19  2629571.19 
##   2015(243)   2015(244)   2015(245)   2015(246)   2015(247)   2015(248) 
##  2830341.36  2268743.45  2601634.88  2177138.32  1315573.96  3279533.72 
##   2015(249)   2015(250)   2015(251)   2015(252)   2015(253)   2015(254) 
##  2110890.19  1714689.83  2699749.64  1423293.16   977644.99  3699820.76 
##   2015(255)   2015(256)   2015(257)   2015(258)   2015(259)   2015(260) 
## 10353001.18  2778303.20  2123405.33  1653518.70  2395375.82  2058398.20 
##   2015(261)   2015(262)   2015(263)   2015(264)   2015(265)   2015(266) 
##  3106232.76  3052961.32  2975548.82  3073668.47  3290282.46  2552427.27 
##   2015(267)   2015(268)   2015(269)   2015(270)   2015(271)   2015(272) 
##  2588230.84  3108192.31  1930232.77  3683498.07  1920763.04  2224023.96 
##   2015(273)   2015(274)   2015(275)   2015(276)   2015(277)   2015(278) 
##  3662616.59  2443658.64 -2585799.41  2191649.73  2430592.36  1761700.95 
##   2015(279)   2015(280)   2015(281)   2015(282)   2015(283)   2015(284) 
##  2448750.32   -88357.02  2759285.56  1760537.02  2067807.03  1095727.16 
##   2015(285)   2015(286)   2015(287)   2015(288)   2015(289)   2015(290) 
##  1183501.94  1855882.56  2697305.63  2192041.45  1374414.74   812113.83 
##   2015(291)   2015(292)   2015(293)   2015(294)   2015(295)   2015(296) 
##   254764.67  1924469.11  2135967.90  1804789.46  3907447.86  1895436.81 
##   2015(297)   2015(298)   2015(299)   2015(300)   2015(301)   2015(302) 
##  1943692.43   676224.94   998681.98  2067202.59   722134.03   763572.12 
##   2015(303)   2015(304)   2015(305)   2015(306)   2015(307)   2015(308) 
##  1769461.59  1719396.91  2887507.08  1268746.02  4365848.68  3028222.68 
##   2015(309)   2015(310)   2015(311)   2015(312)   2015(313)   2015(314) 
##  2353509.94  1232780.97  1517642.10  1069730.38  -137573.35  2398786.91 
##   2015(315)   2015(316)   2015(317)   2015(318)   2015(319)   2015(320) 
##  1873566.81  1670416.40   496757.29  3017259.04  2647425.58  2636620.54 
##   2015(321)   2015(322)   2015(323)   2015(324)   2015(325)   2015(326) 
##  1738624.87  2103173.92  3177654.80  2122573.70  5773901.45  5833228.97 
##   2015(327)   2015(328)   2015(329)   2015(330)   2015(331)   2015(332) 
##  2763886.66  1458356.03  2877059.53  2697121.65   816539.08  2177419.41 
##   2015(333)   2015(334)   2015(335)   2015(336)   2015(337)   2015(338) 
##  1869609.19  1066284.41  1906189.24  2280993.88  2555063.28  2424332.54 
##   2015(339)   2015(340)   2015(341)   2015(342)   2015(343)   2015(344) 
##  1512514.87  2694846.07  1962670.05  1154809.08  2873412.95  1891846.87 
##   2015(345)   2015(346)   2015(347)   2015(348)   2015(349)   2015(350) 
##  1377648.05  2014985.23  2460452.64  3081201.17  4092980.42  2994542.47 
##   2015(351)   2015(352)   2015(353)   2015(354)   2015(355)   2015(356) 
##  1814382.35  2202806.93  1171283.21  1155312.25  2472069.34   -55872.57 
##   2015(357)   2015(358)   2015(359)   2015(360)   2015(361)   2015(362) 
##  2344243.16  2878704.04  2342698.39  2699071.31  2196467.92  3278785.47 
##   2015(363)   2015(364)   2015(365) 
##  1268452.16  2529815.59  3425681.04

Computation and Plot of 10 steps ahead forecast for Volume with lag (1:32) and Open lag (110)

Volume.open.forecast.1 <- predict(ardl.volume.open.1, n.ahead = 10)
forecast_start_time <- end(Volume.ts)[1] + 1
Volume.open.forecast.ts.1 <- ts(Volume.open.forecast.1, start = forecast_start_time, frequency = frequency(Volume.ts))
ts.plot(Volume.ts, Volume.open.forecast.ts.1, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Volume")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Volume.open.forecast.ts.1)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 254) 
## Frequency = 365 
## 2015(112) 2015(113) 2015(114) 2015(115) 2015(116) 2015(117) 2015(118) 2015(119) 
##   2002594   2442619   2303508   2583932   2139049   2634302   2617877   2871069 
## 2015(120) 2015(121) 2015(122) 2015(123) 2015(124) 2015(125) 2015(126) 2015(127) 
##   2939799   2727932   2488495   2616460   2982951   3160216   2708017   2011351 
## 2015(128) 2015(129) 2015(130) 2015(131) 2015(132) 2015(133) 2015(134) 2015(135) 
##   2341959   2048535   2975390   3050091   2783392   2563201   2676453   2246945 
## 2015(136) 2015(137) 2015(138) 2015(139) 2015(140) 2015(141) 2015(142) 2015(143) 
##   2464957   2613733   2542231   8054520   4699881   2363079   3897000   3185036 
## 2015(144) 2015(145) 2015(146) 2015(147) 2015(148) 2015(149) 2015(150) 2015(151) 
##   4078311   5462295   4251230   3614160   4231110   2974342   3035704   2673866 
## 2015(152) 2015(153) 2015(154) 2015(155) 2015(156) 2015(157) 2015(158) 2015(159) 
##   2650870   3897023   3080569   3736671   4098250   2610834   2533740   1922910 
## 2015(160) 2015(161) 2015(162) 2015(163) 2015(164) 2015(165) 2015(166) 2015(167) 
##   3570920   3366923   5258286   5459704   4801182   4338238   3234790   5678651 
## 2015(168) 2015(169) 2015(170) 2015(171) 2015(172) 2015(173) 2015(174) 2015(175) 
##   4197454   5734038   5460465   4547650   4279560   3002886   3563427   3808821 
## 2015(176) 2015(177) 2015(178) 2015(179) 2015(180) 2015(181) 2015(182) 2015(183) 
##   3374641   4333655   3244543   3319685   3730163   3809734   2851197   3785597 
## 2015(184) 2015(185) 2015(186) 2015(187) 2015(188) 2015(189) 2015(190) 2015(191) 
##   3564669   4382693   4738594   4075988   4197783   4803738   3681332   4444026 
## 2015(192) 2015(193) 2015(194) 2015(195) 2015(196) 2015(197) 2015(198) 2015(199) 
##   4817766   3863551   5829207   7640031   5529012   3896781   4876632   4123971 
## 2015(200) 2015(201) 2015(202) 2015(203) 2015(204) 2015(205) 2015(206) 2015(207) 
##   4880576   5273322   4025181   3413319   3327995   2523242   3359020   2608413 
## 2015(208) 2015(209) 2015(210) 2015(211) 2015(212) 2015(213) 2015(214) 2015(215) 
##   2595223   3782792   2200496   2852702   2569416   2686383   3127287   2628839 
## 2015(216) 2015(217) 2015(218) 2015(219) 2015(220) 2015(221) 2015(222) 2015(223) 
##   2298149   2902058   3920374   4055918   4394406   3709388   2606718   4391714 
## 2015(224) 2015(225) 2015(226) 2015(227) 2015(228) 2015(229) 2015(230) 2015(231) 
##   3438368   4323875   4196407   5034046   3616482   2904101   3267597   3642540 
## 2015(232) 2015(233) 2015(234) 2015(235) 2015(236) 2015(237) 2015(238) 2015(239) 
##   2920495   3274863   3178384   2513868   3017084   2350581   2646443   2555774 
## 2015(240) 2015(241) 2015(242) 2015(243) 2015(244) 2015(245) 2015(246) 2015(247) 
##   2213942   3029894   2641773   2558372   2661185   1968641   2719209   2048354 
## 2015(248) 2015(249) 2015(250) 2015(251) 2015(252) 2015(253) 2015(254) 2015(255) 
##   2877693   3123205   2577262   2345037   2908081   2769516   1796632   4147501 
## 2015(256) 2015(257) 2015(258) 2015(259) 2015(260) 2015(261) 2015(262) 2015(263) 
##   5042372   3639162   2579585   3309816   2699240   2773764   3350408   2506544 
## 2015(264) 2015(265) 2015(266) 2015(267) 2015(268) 2015(269) 2015(270) 2015(271) 
##   2358209   2905924   1929618   2603576   2046309   2734348   3255183   2218109 
## 2015(272) 2015(273) 2015(274) 2015(275) 2015(276) 2015(277) 2015(278) 2015(279) 
##   2482639   2380973   2832125   2290703   1774320   2747980   1785611   2652630 
## 2015(280) 2015(281) 2015(282) 2015(283) 2015(284) 2015(285) 2015(286) 2015(287) 
##   2572427   2238890   2175729   1845225   3023774   1718639   2275010   2270974 
## 2015(288) 2015(289) 2015(290) 2015(291) 2015(292) 2015(293) 2015(294) 2015(295) 
##   2288243   2190074   1748142   2176777   2049646   1823416   1871713   2118248 
## 2015(296) 2015(297) 2015(298) 2015(299) 2015(300) 2015(301) 2015(302) 2015(303) 
##   1783865   2217237   1997391   1932562   2190253   1699813   1916830   1917132 
## 2015(304) 2015(305) 2015(306) 2015(307) 2015(308) 2015(309) 2015(310) 2015(311) 
##   1745506   1973564   1972574   1819536   2573824   2266794   1607148   2144578 
## 2015(312) 2015(313) 2015(314) 2015(315) 2015(316) 2015(317) 2015(318) 2015(319) 
##   2132145   1959933   2494320   2208092   2071995   2282048   1577671   1976506 
## 2015(320) 2015(321) 2015(322) 2015(323) 2015(324) 2015(325) 2015(326) 2015(327) 
##   2223531   1822026   2589499   2222459   2078888   2670575   4903087   3565908 
## 2015(328) 2015(329) 2015(330) 2015(331) 2015(332) 2015(333) 2015(334) 2015(335) 
##   2324180   2964511   2903359   3501509   3540924   2817664   2225886   2044143 
## 2015(336) 2015(337) 2015(338) 2015(339) 2015(340) 2015(341) 2015(342) 2015(343) 
##   1907921   2278758   1860425   2018337   2298800   1677516   1917432   2197950 
## 2015(344) 2015(345) 2015(346) 2015(347) 2015(348) 2015(349) 2015(350) 2015(351) 
##   2241344   2328506   1595258   2077501   2396288   2914107   3823031   2480243 
## 2015(352) 2015(353) 2015(354) 2015(355) 2015(356) 2015(357) 2015(358) 2015(359) 
##   1910477   1623164   3187808   2465935   2793767   2323819   2133924   2007182 
## 2015(360) 2015(361) 2015(362) 2015(363) 2015(364) 2015(365) 
##   2002594   2442619   2303508   2583932   2139049   2634302

Computation and Plot of 10 steps ahead forecast for Volume with lag (1:32) and Open lag (1:110)

Volume.open.forecast.2 <- predict(ardl.volume.open.2, n.ahead = 10)
forecast_start_time <- end(Volume.ts)[1] + 1
Volume.open.forecast.ts.2 <- ts(Volume.open.forecast.2, start = forecast_start_time, frequency = frequency(Volume.ts))
ts.plot(Volume.ts, Volume.open.forecast.ts.2, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Volume")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Volume.open.forecast.ts.2)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 254) 
## Frequency = 365 
## 2015(112) 2015(113) 2015(114) 2015(115) 2015(116) 2015(117) 2015(118) 2015(119) 
##   2054172   2639728   2331332   2620081   2145456   2650603   2539472   2906786 
## 2015(120) 2015(121) 2015(122) 2015(123) 2015(124) 2015(125) 2015(126) 2015(127) 
##   3004928   2660789   2472216   2523678   3071728   3115897   2724541   1941983 
## 2015(128) 2015(129) 2015(130) 2015(131) 2015(132) 2015(133) 2015(134) 2015(135) 
##   2283887   1970416   3026035   3031287   2755735   2569290   2715919   2323144 
## 2015(136) 2015(137) 2015(138) 2015(139) 2015(140) 2015(141) 2015(142) 2015(143) 
##   2400364   2602392   2488901   8034690   4655085   2357789   3818517   3226654 
## 2015(144) 2015(145) 2015(146) 2015(147) 2015(148) 2015(149) 2015(150) 2015(151) 
##   4092804   5476447   4371882   4553258   4319301   3062915   3012895   2668694 
## 2015(152) 2015(153) 2015(154) 2015(155) 2015(156) 2015(157) 2015(158) 2015(159) 
##   2564902   3933353   3089609   3701208   4113694   2617697   2582724   1931378 
## 2015(160) 2015(161) 2015(162) 2015(163) 2015(164) 2015(165) 2015(166) 2015(167) 
##   3555581   3374740   5240770   5354475   4813048   4350896   3193187   5910609 
## 2015(168) 2015(169) 2015(170) 2015(171) 2015(172) 2015(173) 2015(174) 2015(175) 
##   4125155   5669757   5395427   4455340   4223249   2917153   3403609   3863920 
## 2015(176) 2015(177) 2015(178) 2015(179) 2015(180) 2015(181) 2015(182) 2015(183) 
##   3355777   4338824   3209652   3325239   3730214   3862409   2873456   3770446 
## 2015(184) 2015(185) 2015(186) 2015(187) 2015(188) 2015(189) 2015(190) 2015(191) 
##   3590573   4284449   4735232   4070928   4145515   4699616   3713243   4403007 
## 2015(192) 2015(193) 2015(194) 2015(195) 2015(196) 2015(197) 2015(198) 2015(199) 
##   4894414   3760446   5824349   7672561   5501348   3879292   4893099   4103796 
## 2015(200) 2015(201) 2015(202) 2015(203) 2015(204) 2015(205) 2015(206) 2015(207) 
##   4891573   5272142   3939461   3156705   3347553   2598890   3351890   2630958 
## 2015(208) 2015(209) 2015(210) 2015(211) 2015(212) 2015(213) 2015(214) 2015(215) 
##   2621105   3779915   2247104   2861192   2600143   2773045   3134687   2632440 
## 2015(216) 2015(217) 2015(218) 2015(219) 2015(220) 2015(221) 2015(222) 2015(223) 
##   2348427   2879608   3933628   4062509   4429383   3776015   2561404   4490218 
## 2015(224) 2015(225) 2015(226) 2015(227) 2015(228) 2015(229) 2015(230) 2015(231) 
##   3531087   4293663   4222861   5049506   3537460   2823845   3388023   3662848 
## 2015(232) 2015(233) 2015(234) 2015(235) 2015(236) 2015(237) 2015(238) 2015(239) 
##   2928857   3222412   3222801   2320066   3057424   2358525   2613794   2526741 
## 2015(240) 2015(241) 2015(242) 2015(243) 2015(244) 2015(245) 2015(246) 2015(247) 
##   2246556   3000205   2658475   2584109   2622102   1981872   2745870   2066640 
## 2015(248) 2015(249) 2015(250) 2015(251) 2015(252) 2015(253) 2015(254) 2015(255) 
##   2935677   3048840   2634476   2375392   2943893   2866578   1788113   4285189 
## 2015(256) 2015(257) 2015(258) 2015(259) 2015(260) 2015(261) 2015(262) 2015(263) 
##   4997858   3545223   2682350   3309928   2623572   2786011   3376365   2520375 
## 2015(264) 2015(265) 2015(266) 2015(267) 2015(268) 2015(269) 2015(270) 2015(271) 
##   2111629   3001346   2013460   2587747   2042604   2766962   3268674   2276295 
## 2015(272) 2015(273) 2015(274) 2015(275) 2015(276) 2015(277) 2015(278) 2015(279) 
##   2415473   2352447   2879229   2238438   1813144   2695517   1727281   2666162 
## 2015(280) 2015(281) 2015(282) 2015(283) 2015(284) 2015(285) 2015(286) 2015(287) 
##   2606996   2279584   2120904   1873925   1907359   1691618   2229144   2340425 
## 2015(288) 2015(289) 2015(290) 2015(291) 2015(292) 2015(293) 2015(294) 2015(295) 
##   2332834   2176103   1724515   1993987   2051239   1868747   1825160   2125389 
## 2015(296) 2015(297) 2015(298) 2015(299) 2015(300) 2015(301) 2015(302) 2015(303) 
##   1840213   2257988   2002737   1865365   2162937   1691604   2052486   1915626 
## 2015(304) 2015(305) 2015(306) 2015(307) 2015(308) 2015(309) 2015(310) 2015(311) 
##   1723184   2019984   1994975   1820426   2549945   2198398   1638351   2072717 
## 2015(312) 2015(313) 2015(314) 2015(315) 2015(316) 2015(317) 2015(318) 2015(319) 
##   2082865   1972102   2482072   2254989   1979484   2285323   1566325   1999074 
## 2015(320) 2015(321) 2015(322) 2015(323) 2015(324) 2015(325) 2015(326) 2015(327) 
##   2260599   1807177   2560741   2277392   2056812   2633190   4950252   3527479 
## 2015(328) 2015(329) 2015(330) 2015(331) 2015(332) 2015(333) 2015(334) 2015(335) 
##   2365900   2957510   2929111   3531319   3568420   2758117   1978174   1965051 
## 2015(336) 2015(337) 2015(338) 2015(339) 2015(340) 2015(341) 2015(342) 2015(343) 
##   2033595   2311253   1804953   1984941   2371190   1738685   1946294   2297010 
## 2015(344) 2015(345) 2015(346) 2015(347) 2015(348) 2015(349) 2015(350) 2015(351) 
##   2241321   2264858   1667142   2110193   2393451   2907809   3756500   2526619 
## 2015(352) 2015(353) 2015(354) 2015(355) 2015(356) 2015(357) 2015(358) 2015(359) 
##   1848881   1583648   3366250   2572108   2792501   2353583   2067529   2028551 
## 2015(360) 2015(361) 2015(362) 2015(363) 2015(364) 2015(365) 
##   2054172   2639728   2331332   2620081   2145456   2650603

Computation and Plot of 10 steps ahead forecast for Volume with lag (1:32)n(91:122) and Open lag (110)

Volume.open.forecast.3 <- predict(ardl.volume.open.3, n.ahead = 10)
forecast_start_time <- end(Volume.ts)[1] + 1
Volume.open.forecast.ts.3 <- ts(Volume.open.forecast.3, start = forecast_start_time, frequency = frequency(Volume.ts))
ts.plot(Volume.ts, Volume.open.forecast.ts.3, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Volume")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Volume.open.forecast.ts.3)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 243) 
## Frequency = 365 
## 2015(123) 2015(124) 2015(125) 2015(126) 2015(127) 2015(128) 2015(129) 2015(130) 
## 3992428.9 5709725.5 2381194.8 2404348.3 2948087.7 2389716.1 1624118.8 2795122.9 
## 2015(131) 2015(132) 2015(133) 2015(134) 2015(135) 2015(136) 2015(137) 2015(138) 
## 3390025.4 3352731.0 2995435.8 2960545.1 3030967.7 2859752.6 3215877.5 3303243.8 
## 2015(139) 2015(140) 2015(141) 2015(142) 2015(143) 2015(144) 2015(145) 2015(146) 
## 8258305.5 5204895.3 2535872.7 3727712.2 3606139.3 4403099.2 5613502.2 4405288.4 
## 2015(147) 2015(148) 2015(149) 2015(150) 2015(151) 2015(152) 2015(153) 2015(154) 
## 4268760.9 4562085.4 2821223.7 3987203.0 2606177.5 3074654.0 3941715.9 3362426.1 
## 2015(155) 2015(156) 2015(157) 2015(158) 2015(159) 2015(160) 2015(161) 2015(162) 
## 3831271.9 3924717.5 3079564.8 2718239.3 2530218.4 3804251.0 3709632.6 5102301.7 
## 2015(163) 2015(164) 2015(165) 2015(166) 2015(167) 2015(168) 2015(169) 2015(170) 
## 5855541.5 5245239.9 4978011.9 3504766.4 5053289.5 4339535.8 5414718.8 5536392.0 
## 2015(171) 2015(172) 2015(173) 2015(174) 2015(175) 2015(176) 2015(177) 2015(178) 
## 4486090.4 4210330.0 2348035.0 2936441.3 3354931.3 4435461.5 3900524.6 3044591.8 
## 2015(179) 2015(180) 2015(181) 2015(182) 2015(183) 2015(184) 2015(185) 2015(186) 
## 3250296.9 3886480.2 3957493.0 3147662.8 3816677.9 3937981.1 4169263.9 4132039.5 
## 2015(187) 2015(188) 2015(189) 2015(190) 2015(191) 2015(192) 2015(193) 2015(194) 
## 4260138.8 3212968.0 4715743.9 4660122.3 3643704.2 4016135.7 4246598.9 8334112.6 
## 2015(195) 2015(196) 2015(197) 2015(198) 2015(199) 2015(200) 2015(201) 2015(202) 
## 7363997.8 4769238.8 3851033.8 4426100.1 3801380.5 5008351.7 5215444.3 4081988.4 
## 2015(203) 2015(204) 2015(205) 2015(206) 2015(207) 2015(208) 2015(209) 2015(210) 
## 3424248.2 3301310.2 2559779.7 3803272.0 2216888.0 2511325.8 3604135.0 2442235.6 
## 2015(211) 2015(212) 2015(213) 2015(214) 2015(215) 2015(216) 2015(217) 2015(218) 
## 2434455.3 2745072.9 2937455.3 3389402.4 2521744.2 2484211.1 3557803.7 4823023.7 
## 2015(219) 2015(220) 2015(221) 2015(222) 2015(223) 2015(224) 2015(225) 2015(226) 
## 3799277.2 4332146.5 4465041.6 2807191.6 4002679.9 4069616.9 4137996.0 4522641.8 
## 2015(227) 2015(228) 2015(229) 2015(230) 2015(231) 2015(232) 2015(233) 2015(234) 
## 4956782.1 3743161.8 1990841.9 3526752.6 3643564.5 3052644.2 2438404.2 2775227.2 
## 2015(235) 2015(236) 2015(237) 2015(238) 2015(239) 2015(240) 2015(241) 2015(242) 
## 1650991.4 1780997.5 3547719.9 1424557.4 2737763.3 2330710.8 2332451.2 2454272.9 
## 2015(243) 2015(244) 2015(245) 2015(246) 2015(247) 2015(248) 2015(249) 2015(250) 
## 2352536.8 1869992.4 2161183.6 2358141.4 2114614.2 3033929.6 1341636.9 2307743.3 
## 2015(251) 2015(252) 2015(253) 2015(254) 2015(255) 2015(256) 2015(257) 2015(258) 
## 3100648.4 1454429.9  691058.9 2261040.1 8139586.5 3579203.9 2064138.0 2312034.5 
## 2015(259) 2015(260) 2015(261) 2015(262) 2015(263) 2015(264) 2015(265) 2015(266) 
## 1845057.1 1683310.7 2066146.4 3132251.2 2097144.7 2499537.0 2425377.1 1427030.2 
## 2015(267) 2015(268) 2015(269) 2015(270) 2015(271) 2015(272) 2015(273) 2015(274) 
## 2836459.7 1730405.8 1830583.6 3159539.5 1920546.2 2276225.1  949940.1 2112385.0 
## 2015(275) 2015(276) 2015(277) 2015(278) 2015(279) 2015(280) 2015(281) 2015(282) 
## 2031379.3  964066.4 1969481.0 2273145.9 2428098.0 2054364.4 2433123.7 2150716.8 
## 2015(283) 2015(284) 2015(285) 2015(286) 2015(287) 2015(288) 2015(289) 2015(290) 
## 1052876.9 1871544.0 1169038.6 1977013.5 2188671.2 1475520.3 1428697.1  699805.9 
## 2015(291) 2015(292) 2015(293) 2015(294) 2015(295) 2015(296) 2015(297) 2015(298) 
## 1064331.8 1517071.1 2397258.5 1104993.3 1670446.1 1981821.3 2530805.4 1451964.3 
## 2015(299) 2015(300) 2015(301) 2015(302) 2015(303) 2015(304) 2015(305) 2015(306) 
## 1978898.0 1937446.5 2846778.9 1081794.1 1232448.5 2185448.6 1059341.7 1523568.2 
## 2015(307) 2015(308) 2015(309) 2015(310) 2015(311) 2015(312) 2015(313) 2015(314) 
## 2949249.5 1945780.7 1348648.8 2318635.8 4839369.4 1945801.4 1375145.7 2716820.9 
## 2015(315) 2015(316) 2015(317) 2015(318) 2015(319) 2015(320) 2015(321) 2015(322) 
## 1580457.5 1552906.8 2046976.6 2302352.1 1737069.8 2304350.5 1846731.5 2709449.8 
## 2015(323) 2015(324) 2015(325) 2015(326) 2015(327) 2015(328) 2015(329) 2015(330) 
## 2562256.6 1554987.5 3256769.0 5063799.5 3903159.7 1368994.0 2987132.3 3399022.9 
## 2015(331) 2015(332) 2015(333) 2015(334) 2015(335) 2015(336) 2015(337) 2015(338) 
## 3603389.2 2625901.5 3075546.3 2707428.5 1866850.1 2202662.7 2411736.8 1353872.8 
## 2015(339) 2015(340) 2015(341) 2015(342) 2015(343) 2015(344) 2015(345) 2015(346) 
## 2475402.6 2042375.4 1700339.2 2181310.6 3456455.7 2015793.5 1967556.4 1776572.9 
## 2015(347) 2015(348) 2015(349) 2015(350) 2015(351) 2015(352) 2015(353) 2015(354) 
## 2993770.6 1638744.2 3178375.9 3965304.8 2466385.9 1932879.7 1574995.9 3576042.1 
## 2015(355) 2015(356) 2015(357) 2015(358) 2015(359) 2015(360) 2015(361) 2015(362) 
## 3143488.9 2991736.1 3237882.8 2763479.6 2202661.8 2528740.3 2268930.7 2792843.0 
## 2015(363) 2015(364) 2015(365) 
## 2237084.7 2290776.4 3486417.5

Computation and Plot of 10 steps ahead forecast for Volume with lag (1:32)n(91:122) and Open lag (35)n(110)

Volume.open.forecast.4 <- predict(ardl.volume.open.4, n.ahead = 10)
forecast_start_time <- end(Volume.ts)[1] + 1
Volume.open.forecast.ts.4 <- ts(Volume.open.forecast.4, start = forecast_start_time, frequency = frequency(Volume.ts))
ts.plot(Volume.ts, Volume.open.forecast.ts.4, col = c("black", "red"), lty = c(1, 2),
        xlab = "Time", ylab = "Volume")
legend("topleft", legend = c("Actual", "Forecast"), col = c("black", "red"), lty = c(1, 2))

print(Volume.open.forecast.ts.4)
## Time Series:
## Start = c(2016, 1) 
## End = c(2016, 243) 
## Frequency = 365 
## 2015(123) 2015(124) 2015(125) 2015(126) 2015(127) 2015(128) 2015(129) 2015(130) 
## 3992753.8 5709610.8 2381343.9 2404180.1 2948450.8 2389893.2 1624257.0 2795027.8 
## 2015(131) 2015(132) 2015(133) 2015(134) 2015(135) 2015(136) 2015(137) 2015(138) 
## 3390147.7 3352948.7 2995505.2 2960537.9 3030853.4 2860001.4 3215938.2 3303511.5 
## 2015(139) 2015(140) 2015(141) 2015(142) 2015(143) 2015(144) 2015(145) 2015(146) 
## 8258296.1 5205134.0 2535965.6 3727886.6 3606129.0 4403070.5 5613521.1 4404955.2 
## 2015(147) 2015(148) 2015(149) 2015(150) 2015(151) 2015(152) 2015(153) 2015(154) 
## 4266312.2 4561884.7 2821020.9 3987315.2 2606127.5 3075015.2 3941612.1 3362553.3 
## 2015(155) 2015(156) 2015(157) 2015(158) 2015(159) 2015(160) 2015(161) 2015(162) 
## 3831414.7 3924628.3 3079564.6 2718166.5 2530251.6 3804409.9 3709666.1 5102324.6 
## 2015(163) 2015(164) 2015(165) 2015(166) 2015(167) 2015(168) 2015(169) 2015(170) 
## 5855871.6 5245229.3 4978112.3 3504920.7 5052678.2 4339738.4 5414950.8 5536563.5 
## 2015(171) 2015(172) 2015(173) 2015(174) 2015(175) 2015(176) 2015(177) 2015(178) 
## 4486433.6 4210503.3 2348261.5 2936731.7 3354687.0 4435566.0 3900478.8 3044709.0 
## 2015(179) 2015(180) 2015(181) 2015(182) 2015(183) 2015(184) 2015(185) 2015(186) 
## 3250276.0 3886571.4 3957241.6 3147599.3 3816778.0 3937992.6 4169516.4 4131953.7 
## 2015(187) 2015(188) 2015(189) 2015(190) 2015(191) 2015(192) 2015(193) 2015(194) 
## 4260123.7 3213058.2 4716136.7 4660097.3 3643922.1 4015804.9 4246859.6 8334182.7 
## 2015(195) 2015(196) 2015(197) 2015(198) 2015(199) 2015(200) 2015(201) 2015(202) 
## 7363808.9 4769114.8 3851032.2 4425847.2 3801296.9 5008281.3 5215353.3 4082258.7 
## 2015(203) 2015(204) 2015(205) 2015(206) 2015(207) 2015(208) 2015(209) 2015(210) 
## 3425004.5 3301257.6 2559532.0 3803334.8 2216753.1 2511262.9 3604109.4 2442158.2 
## 2015(211) 2015(212) 2015(213) 2015(214) 2015(215) 2015(216) 2015(217) 2015(218) 
## 2434443.6 2745010.2 2937263.9 3389395.8 2521749.9 2484078.1 3557926.5 4822992.4 
## 2015(219) 2015(220) 2015(221) 2015(222) 2015(223) 2015(224) 2015(225) 2015(226) 
## 3799290.2 4332005.9 4464944.2 2807347.7 4002522.4 4069465.3 4138161.6 4522590.9 
## 2015(227) 2015(228) 2015(229) 2015(230) 2015(231) 2015(232) 2015(233) 2015(234) 
## 4956678.0 3743456.0 1990929.8 3526585.1 3643675.1 3052637.3 2438481.7 2775117.0 
## 2015(235) 2015(236) 2015(237) 2015(238) 2015(239) 2015(240) 2015(241) 2015(242) 
## 1651128.6 1780894.9 3547750.2 1424479.3 2737908.1 2330505.1 2332553.7 2454112.0 
## 2015(243) 2015(244) 2015(245) 2015(246) 2015(247) 2015(248) 2015(249) 2015(250) 
## 2352420.9 1870192.4 2161222.9 2357978.4 2114569.8 3033691.2 1341729.6 2307669.1 
## 2015(251) 2015(252) 2015(253) 2015(254) 2015(255) 2015(256) 2015(257) 2015(258) 
## 3100647.7 1454307.4  690736.5 2260949.3 8139301.7 3579326.8 2064084.0 2311723.3 
## 2015(259) 2015(260) 2015(261) 2015(262) 2015(263) 2015(264) 2015(265) 2015(266) 
## 1844756.9 1683235.1 2065987.4 3132035.1 2097100.4 2500153.0 2424996.9 1426740.1 
## 2015(267) 2015(268) 2015(269) 2015(270) 2015(271) 2015(272) 2015(273) 2015(274) 
## 2836424.4 1730467.5 1830411.6 3159428.1 1920332.7 2276416.7  949876.1 2112241.8 
## 2015(275) 2015(276) 2015(277) 2015(278) 2015(279) 2015(280) 2015(281) 2015(282) 
## 2031546.0  963922.4 1969586.5 2273353.4 2427907.4 2054239.1 2432863.5 2150790.2 
## 2015(283) 2015(284) 2015(285) 2015(286) 2015(287) 2015(288) 2015(289) 2015(290) 
## 1052719.4 1874411.3 1168971.4 1977063.3 2188451.5 1475266.8 1428670.2  699717.1 
## 2015(291) 2015(292) 2015(293) 2015(294) 2015(295) 2015(296) 2015(297) 2015(298) 
## 1064528.0 1517014.0 2397152.6 1105097.3 1670439.7 1981626.5 2530776.7 1451892.3 
## 2015(299) 2015(300) 2015(301) 2015(302) 2015(303) 2015(304) 2015(305) 2015(306) 
## 1979056.1 1937683.6 2846828.4 1081367.9 1232337.4 2185453.5 1059170.4 1523590.2 
## 2015(307) 2015(308) 2015(309) 2015(310) 2015(311) 2015(312) 2015(313) 2015(314) 
## 2949347.1 1945900.5 1348787.0 2318384.1 4839630.9 1946033.9 1374858.3 2716840.8 
## 2015(315) 2015(316) 2015(317) 2015(318) 2015(319) 2015(320) 2015(321) 2015(322) 
## 1580150.2 1552918.4 2046848.2 2302463.7 1737050.6 2304326.2 1846690.3 2709609.3 
## 2015(323) 2015(324) 2015(325) 2015(326) 2015(327) 2015(328) 2015(329) 2015(330) 
## 2561993.0 1555125.1 3257002.9 5063655.5 3903364.4 1368859.9 2987208.2 3399017.4 
## 2015(331) 2015(332) 2015(333) 2015(334) 2015(335) 2015(336) 2015(337) 2015(338) 
## 3603461.9 2625876.7 3075836.1 2708222.7 1867064.0 2202300.0 2411667.3 1354018.1 
## 2015(339) 2015(340) 2015(341) 2015(342) 2015(343) 2015(344) 2015(345) 2015(346) 
## 2475549.3 2042191.5 1700253.3 2181163.5 3456188.6 2015852.9 1967508.2 1776445.8 
## 2015(347) 2015(348) 2015(349) 2015(350) 2015(351) 2015(352) 2015(353) 2015(354) 
## 2993759.6 1638739.7 3178359.2 3965500.4 2466286.2 1932914.6 1575201.6 3575657.1 
## 2015(355) 2015(356) 2015(357) 2015(358) 2015(359) 2015(360) 2015(361) 2015(362) 
## 3143224.2 2991802.7 3237849.3 2763870.9 2202668.2 2528729.7 2268475.0 2792873.7 
## 2015(363) 2015(364) 2015(365) 
## 2236961.0 2290754.4 3486490.6

VAR Model

library(vars)
library(tseries)
library(ggplot2)
library(gridExtra)
## 
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
## 
##     combine
library(forecast)

Turnover.and.Close = cbind(Turnover.ts,Close.ts.diff)
Turnover.and.Close_tot = data.frame(Turnover.and.Close)
Turnover.and.Close_tot <- na.omit(Turnover.and.Close_tot)
Turnover.and.Close_tot <- scale(Turnover.and.Close_tot)
VARselect(Turnover.and.Close_tot,lag.max=10)
## $selection
## AIC(n)  HQ(n)  SC(n) FPE(n) 
##      1      1      1      1 
## 
## $criteria
##                 1           2            3           4           5           6
## AIC(n) -0.1969958 -0.18075835 -0.161994050 -0.15150978 -0.13226251 -0.18036993
## HQ(n)  -0.1709031 -0.13727050 -0.101111067 -0.07323166 -0.03658926 -0.06730153
## SC(n)  -0.1314145 -0.07145618 -0.008971008  0.04523413  0.10820227  0.10381572
## FPE(n)  0.8211947  0.83464016  0.850455035  0.85942832  0.87614604  0.83501646
##                  7            8           9          10
## AIC(n) -0.16611271 -0.150455587 -0.13882774 -0.11732548
## HQ(n)  -0.03564918 -0.002596916  0.02642607  0.06532347
## SC(n)   0.16179381  0.221171800  0.27652052  0.34174364
## FPE(n)  0.84703678  0.860443162  0.87055771  0.88954379
Turnover.and.Close.VAR = VAR(Turnover.and.Close_tot, p=1)
summary(Turnover.and.Close.VAR)
## 
## VAR Estimation Results:
## ========================= 
## Endogenous variables: Turnover.ts, Close.ts.diff 
## Deterministic variables: const 
## Sample size: 363 
## Log Likelihood: -1007.532 
## Roots of the characteristic polynomial:
## 0.3394 0.02485
## Call:
## VAR(y = Turnover.and.Close_tot, p = 1)
## 
## 
## Estimation results for equation Turnover.ts: 
## ============================================ 
## Turnover.ts = Turnover.ts.l1 + Close.ts.diff.l1 + const 
## 
##                   Estimate Std. Error t value Pr(>|t|)    
## Turnover.ts.l1   0.3393548  0.0495697   6.846 3.29e-11 ***
## Close.ts.diff.l1 0.0254277  0.0495593   0.513    0.608    
## const            0.0004657  0.0495509   0.009    0.993    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
## Residual standard error: 0.9441 on 360 degrees of freedom
## Multiple R-Squared: 0.1158,  Adjusted R-squared: 0.1109 
## F-statistic: 23.58 on 2 and 360 DF,  p-value: 2.385e-10 
## 
## 
## Estimation results for equation Close.ts.diff: 
## ============================================== 
## Close.ts.diff = Turnover.ts.l1 + Close.ts.diff.l1 + const 
## 
##                    Estimate Std. Error t value Pr(>|t|)
## Turnover.ts.l1    0.0006793  0.0526931   0.013    0.990
## Close.ts.diff.l1  0.0249030  0.0526819   0.473    0.637
## const            -0.0012379  0.0526731  -0.024    0.981
## 
## 
## Residual standard error: 1.004 on 360 degrees of freedom
## Multiple R-Squared: 0.0006209,   Adjusted R-squared: -0.004931 
## F-statistic: 0.1118 on 2 and 360 DF,  p-value: 0.8942 
## 
## 
## 
## Covariance matrix of residuals:
##               Turnover.ts Close.ts.diff
## Turnover.ts      0.891270      0.002571
## Close.ts.diff    0.002571      1.007124
## 
## Correlation matrix of residuals:
##               Turnover.ts Close.ts.diff
## Turnover.ts      1.000000      0.002714
## Close.ts.diff    0.002714      1.000000

Granger-Causality Test

Testing if Turnover.ts Granger-causes

Close.ts.diff
## Time Series:
## Start = c(2015, 2) 
## End = c(2015, 365) 
## Frequency = 365 
##   [1]   38.80  -17.30  -41.70    9.35    9.90  101.00   41.50  -27.05   39.75
##  [10]    5.60  -15.95  -15.80   21.70   45.70   26.55   18.60  -78.55    8.05
##  [19]    0.95   -3.60   -5.05  -15.95   21.95   50.95   36.70   18.40   29.40
##  [28]    6.55   26.35  -15.10  -17.35   17.75   28.20  -41.60  -17.50    7.20
##  [37]   44.80  -59.50    7.65   30.70   -4.75    6.15  -23.20  -27.05  -57.55
##  [46]    7.95  -15.80   36.10    2.10   46.25  -26.15  -11.00    0.95   27.00
##  [55]  -24.00  -22.00    7.65  -72.75   55.80   25.85   -9.65  -44.40    4.25
##  [64]  -18.70   41.05   14.45   18.95    4.85  -25.10  -19.05  -15.40  -47.10
##  [73]   10.45   -4.90  -15.70 -126.80  -10.55  -23.75    0.25  -18.90   50.85
##  [82]  -30.35  -40.70   21.95   13.95   35.70  -46.55    9.60  -21.90   26.95
##  [91]   31.30   29.30   24.95    1.15   -2.00  -29.65   -9.50  -38.80   48.10
## [100]    6.55   24.65  -39.15   12.25    7.15  -16.40  -11.60   -7.95   34.40
## [109]  -28.85  -22.60 -984.60    8.90   -3.65    6.25   -6.60   28.50  -23.45
## [118]   -5.30   -4.65   14.80  -15.10   -5.80   13.05   -9.40    2.30   -7.00
## [127]   -2.80  -23.00  -19.50   -0.50   12.65   21.10   12.75    5.05   12.80
## [136]   -0.60  111.40   -9.50   -5.15  -10.40  -22.30   -2.45   22.55  -15.40
## [145]    7.05    1.90  -21.70   29.10    0.60    8.65   -9.60   23.15   35.25
## [154]   13.60   -8.75   -7.10   22.20   11.20  -41.00   15.35  -57.85   -6.40
## [163]  -21.05   18.20   28.25  -16.65   -5.40   10.45   -0.10  -25.40  -15.20
## [172]    0.05   29.90   -8.25   10.30    9.00   -0.55    2.45    2.80    0.20
## [181]    2.80    8.80   24.30  -35.00   16.30   40.10   11.10    8.70  -27.15
## [190]  -21.40   -1.05   35.25  -44.50  -23.50   -1.80   -0.25   -2.45   17.05
## [199]   14.00   12.45   11.50    2.25   -2.75    3.80   -8.15   -9.60   -4.25
## [208]   14.30   -8.70  -13.90   15.40   -3.70  -30.75    3.75   -6.80  -20.60
## [217]  -18.70  -41.50   27.80    4.60    1.30  -12.55   11.25   13.95   21.55
## [226]   -8.90  -18.30   -2.95   -8.70   -2.80   -1.85  -16.20   19.15    5.45
## [235]   16.70    8.05   18.30   11.25  -23.95   20.30  -19.70   17.10   -4.50
## [244]    8.40   -0.05  -18.40   19.10  869.00   38.80  -17.30  -41.70    9.35
## [253]    9.90  101.00   41.50  -27.05   39.75    5.60  -15.95  -15.80   21.70
## [262]   45.70   26.55   18.60  -78.55    8.05    0.95   -3.60   -5.05  -15.95
## [271]   21.95   50.95   36.70   18.40   29.40    6.55   26.35  -15.10  -17.35
## [280]   17.75   28.20  -41.60  -17.50    7.20   44.80  -59.50    7.65   30.70
## [289]   -4.75    6.15  -23.20  -27.05  -57.55    7.95  -15.80   36.10    2.10
## [298]   46.25  -26.15  -11.00    0.95   27.00  -24.00  -22.00    7.65  -72.75
## [307]   55.80   25.85   -9.65  -44.40    4.25  -18.70   41.05   14.45   18.95
## [316]    4.85  -25.10  -19.05  -15.40  -47.10   10.45   -4.90  -15.70 -126.80
## [325]  -10.55  -23.75    0.25  -18.90   50.85  -30.35  -40.70   21.95   13.95
## [334]   35.70  -46.55    9.60  -21.90   26.95   31.30   29.30   24.95    1.15
## [343]   -2.00  -29.65   -9.50  -38.80   48.10    6.55   24.65  -39.15   12.25
## [352]    7.15  -16.40  -11.60   -7.95   34.40  -28.85  -22.60 -984.60    8.90
## [361]   -3.65    6.25   -6.60   28.50
causality_test1 <- causality(Turnover.and.Close.VAR, cause = "Turnover.ts")
print(causality_test1)
## $Granger
## 
##  Granger causality H0: Turnover.ts do not Granger-cause Close.ts.diff
## 
## data:  VAR object Turnover.and.Close.VAR
## F-Test = 0.00016621, df1 = 1, df2 = 720, p-value = 0.9897
## 
## 
## $Instant
## 
##  H0: No instantaneous causality between: Turnover.ts and Close.ts.diff
## 
## data:  VAR object Turnover.and.Close.VAR
## Chi-squared = 0.002674, df = 1, p-value = 0.9588

According to the Granger-Causality test for testing if Turnover is Granger-causing Close price, we can see from the test result that the p-value for the test is 0.9588. Since the p-value is too large, we fail to reject the null that Turnover does not Granger-cause the close price and conclude that we can not establish Granger causality.

Testing if Close.ts.diff Granger-causes Turnover.ts

causality_test2 <- causality(Turnover.and.Close.VAR, cause = "Close.ts.diff")
print(causality_test2)
## $Granger
## 
##  Granger causality H0: Close.ts.diff do not Granger-cause Turnover.ts
## 
## data:  VAR object Turnover.and.Close.VAR
## F-Test = 0.26325, df1 = 1, df2 = 720, p-value = 0.6081
## 
## 
## $Instant
## 
##  H0: No instantaneous causality between: Close.ts.diff and Turnover.ts
## 
## data:  VAR object Turnover.and.Close.VAR
## Chi-squared = 0.002674, df = 1, p-value = 0.9588

According to the Granger-Causality test for testing if the difference in Close price is Granger-causing Turnover, we can see from the test result that the p-value for the test is 0.9588. Since the p-value is too large, we fail to reject the null that the Close price does not Granger-cause turnover and conclude that we can not establish Granger causality.

Plots

library(vars)
library(tseries)
library(ggplot2)
library(gridExtra)

1. Cross-Correlation Function (CCF) plot

ccf(Turnover.and.Close_tot[,1], Turnover.and.Close_tot[,2], main="Cross-Correlation Function (CCF)")

There is a significant positive peak around lag +10: This suggests that the yt1, which is Turnover here, leads the second yt2, which is Close here, by about 10 time lags. The correlation of this lag is around 0.2, which is relatively weak but still noteworthy. Additionally, there is a significant negative spike around lag -10: This means that the second series yts, Close.diff, may lead the firs yt1, Turnover by about 10 time units but in an inverse relationship. The correlation is slightly below -0.1, indicating a weak negative effect. The majority of bars are within the blue threshold, meaning their correlation are not statistically significant. However, it’s worth noting that the correlation is very small, therefore is likely not statistically significant.

Impulse Response Functions (IRFs)

irf_result <- irf(Turnover.and.Close.VAR, impulse="Turnover.ts", response="Close.ts.diff", boot=TRUE)
plot(irf_result)

Initially, the response of Close.ts.diff is very close to zero, indicating that a shock in Turnover.ts has little to no immediate impact on Close.ts.diff. In the short term, the response begins to diverge, with an upper bound peaking slightly above 0.05 and a lower bound dropping to around -0.15. This suggests that Close.ts.diff could react in either direction, implying some uncertainty in the short-term response. Over time, The response gradually returns to zero, indicating that the effect of the Turnover.ts shock is temporary. The confidence bands (red dashed lines) shrink, meaning the uncertainty in the impact also decreases over time. However, it’s worth noting that the correlation is very small, therefore is likely not statistically significant.

irf_result.1 <- irf(Turnover.and.Close.VAR, impulse="Close.ts.diff", response="Turnover.ts", boot=TRUE)
plot(irf_result.1)

Initially, the response of Turnover is very close to zero, indicating that a shock in difference in close price.ts has little immediate impact on Turnover the short term, the response begins to diverge, with an upper bound peaking approximately around 0.05 and a lower bound dropping to below -0.05. This suggests that Close.ts.diff could react in either direction, implying uncertainty in the short-term response. Over time, The response gradually returns to zero at around lag 6, indicating that the effect of the Close.diff shock is temporary and doesn’t last long. The confidence bands (red dashed lines) also shrink, meaning the uncertainty in the impact also decreases over time.

Data, Fitted Values, ACF, and PACF in one figure

library(vars)
library(ggplot2)
library(gridExtra)
library(forecast)

fitted_values <- fitted(Turnover.and.Close.VAR)

n_obs <- nrow(Turnover.and.Close_tot)
optimal_lag <- 1  # Based on your VAR selection
plot_data <- data.frame(
  Time = 1:n_obs,
  Actual_Turnover = Turnover.and.Close_tot[, 1],
  Fitted_Turnover = c(rep(NA, optimal_lag), fitted_values[, 1]),
  Actual_Close = Turnover.and.Close_tot[, 2],
  Fitted_Close = c(rep(NA, optimal_lag), fitted_values[, 2])
)

Time Series Plot

Turnover_plot <- ggplot(plot_data, aes(x=Time)) +
  geom_line(aes(y=Actual_Turnover, color="Actual Turnover")) +
  geom_line(aes(y=Fitted_Turnover, color="Fitted Turnover"), linetype="dashed") +
  labs(title="Actual vs. Fitted Turnover") + theme_minimal()

Close_plot <- ggplot(plot_data, aes(x=Time)) +
  geom_line(aes(y=Actual_Close, color="Actual Close")) +
  geom_line(aes(y=Fitted_Close, color="Fitted Close"), linetype="dashed") +
  labs(title="Actual vs. Fitted Close") + theme_minimal()

# ACF and PACF for Residuals of VAR Model
VAR_residuals <- residuals(Turnover.and.Close.VAR)

acf_residuals_plot <- function(series, title) {
  par(mfrow=c(2,1))  # Arrange in 2-row figure (ACF, PACF)
  acf(series, main=paste("ACF of Residuals -", title))
  pacf(series, main=paste("PACF of Residuals -", title))
}

# Save ACF/PACF residuals plot
png("acf_pacf_residuals.png", width=800, height=600)
par(mfrow=c(2,2))  # Arrange plots in a 2x2 grid

acf(VAR_residuals[,1], main="ACF of Residuals (Turnover.ts)")
pacf(VAR_residuals[,1], main="PACF of Residuals (Turnover.ts)")
acf(VAR_residuals[,2], main="ACF of Residuals (Close.ts.diff)")
pacf(VAR_residuals[,2], main="PACF of Residuals (Close.ts.diff)")

dev.off()
## quartz_off_screen 
##                 2
library(png)
acf_pacf_image <- ggplot() + 
  annotation_raster(readPNG("acf_pacf_residuals.png"), xmin=-Inf, xmax=Inf, ymin=-Inf, ymax=Inf) +
  theme_void()

# Arrange All Plots in One Figure
library(grid)
grid.newpage()
grid.arrange(
  Turnover_plot, 
  Close_plot, 
  acf_pacf_image,
  ncol=1,
  heights=c(1, 1, 2))

For the Actual vs. Fitted value plot, we can see that the fitted value of the VAR model captures the dynamic of the actual value for Turnover, including the small turbulences and the peaks. The fitted value shows less variances across time. For the Close.diff variable (difference in close price), the fitted value doesn’t capture the outlier peaks as well as that of Turnover. The fitted value of Close.diff also has smaller variance compared to the actual values.

For the Residuals ACF and PACF, we can see that in the ACFs there are no values over the statistically significant boundaries other than lag 0, which indicates that the residuals don’t have a specific pattern and it can be deemed as white noise. In the PACF, there’s on value at around lag 18 that is reaching the statistical significance line, but the rest exhibits no patterns and no significance, we can also conclude from them that the model does not exhibit serial correlation.

Training and Testing of the VAR Model

library(vars)
library(forecast)

train_size <- floor(2/3 * nrow(Turnover.and.Close_tot))
train_data.Turnover.and.Close_tot <- Turnover.and.Close_tot[1:train_size, ]
test_data.Turnover.and.Close_tot <- Turnover.and.Close_tot[(train_size + 1):nrow(Turnover.and.Close_tot), ]

lag_selection <- VARselect(train_data.Turnover.and.Close_tot, lag.max = 10)
optimal_lag <- lag_selection$selection["AIC(n)"]

Turnover.and.Close.training.VAR <- VAR(train_data.Turnover.and.Close_tot, p = optimal_lag)

fitted_values <- fitted(Turnover.and.Close.training.VAR)

adjusted_train_data <- train_data.Turnover.and.Close_tot[(optimal_lag + 1):nrow(train_data.Turnover.and.Close_tot), ]

VAR.training_mse <- colMeans((adjusted_train_data - fitted_values)^2)
VAR.training_rmse <- sqrt(VAR.training_mse)

test_length <- nrow(test_data.Turnover.and.Close_tot)
Turnover.and.Close.testing.VAR <- predict(Turnover.and.Close.training.VAR, n.ahead = test_length)

forecasted_values <- sapply(Turnover.and.Close.testing.VAR$fcst, function(x) x[, "fcst"])

VAR.testing_mse <- colMeans((test_data.Turnover.and.Close_tot - forecasted_values)^2)
VAR.testing_rmse <- sqrt(VAR.testing_mse)

VAR.AIC <- AIC(Turnover.and.Close.training.VAR)
VAR.BIC <- BIC(Turnover.and.Close.training.VAR)

cat("Training MSE:", VAR.training_mse, "\n")
## Training MSE: 0.8594865 0.5723925
cat("Training RMSE:", VAR.training_rmse, "\n")
## Training RMSE: 0.9270849 0.7565662
cat("Testing MSE:", VAR.testing_mse, "\n")
## Testing MSE: 1.053269 1.843219
cat("Testing RMSE:", VAR.testing_rmse, "\n")
## Testing RMSE: 1.026289 1.357652
cat("Model AIC:", VAR.AIC, "\n")
## Model AIC: 1208.189
cat("Model BIC:", VAR.BIC, "\n")
## Model BIC: 1229.098

The MSE for the training model for Turnover (y1t) and Closing Price (y2t) are respectively 0.8594865 and 0.5723925. The MSE for y2t has a lower value, thus we can assume the model predicts y2t more accurately than y1t. For the RMSE of the training model, again, y2t has a lower value than that of y1t. However, the MSE for the testing model shows that y1t has a lower value than y2t and here, it suggests that the model could be better for testing for Turnover than it is for Closing Price. Then, we have AIC at 1208.189 and BIC at 1229.098. These are high AIC and BIC values but compared to the previous models we have run, these are the lowest observed and might suggest that the VAR is a better fit.

VAR Forecast

forecast_horizon <- 10
VAR_forecast <- predict(Turnover.and.Close.VAR, n.ahead = forecast_horizon)
Turnover_forecast <- VAR_forecast$fcst[[1]][, "fcst"]
Close_forecast <- VAR_forecast$fcst[[2]][, "fcst"]
forecast_time <- (nrow(Turnover.and.Close_tot) + 1):(nrow(Turnover.and.Close_tot) + forecast_horizon)
plot_forecast_data <- data.frame(
  Time = 1:(nrow(Turnover.and.Close_tot) + forecast_horizon),
  Actual_Turnover = c(Turnover.and.Close_tot[, 1], rep(NA, forecast_horizon)),
  Forecasted_Turnover = c(rep(NA, nrow(Turnover.and.Close_tot)), Turnover_forecast),
  Actual_Close = c(Turnover.and.Close_tot[, 2], rep(NA, forecast_horizon)),
  Forecasted_Close = c(rep(NA, nrow(Turnover.and.Close_tot)), Close_forecast)
)
Turnover_plot <- ggplot(plot_forecast_data, aes(x = Time)) +
  geom_line(aes(y = Actual_Turnover, color = "Actual Turnover")) +
  geom_line(aes(y = Forecasted_Turnover, color = "Forecasted Turnover"), linetype = "dashed") +
  labs(title = "Actual and 10-Step-Ahead Forecast for Turnover", y = "Turnover") +
  theme_minimal()
Close_plot <- ggplot(plot_forecast_data, aes(x = Time)) +
  geom_line(aes(y = Actual_Close, color = "Actual Close")) +
  geom_line(aes(y = Forecasted_Close, color = "Forecasted Close"), linetype = "dashed") +
  labs(title = "Actual and 10-Step-Ahead Forecast for Close", y = "Close") +
  theme_minimal()
grid.arrange(Turnover_plot, Close_plot, ncol = 1)

FEVD

fevd_result <- fevd(Turnover.and.Close.VAR, n.ahead = forecast_horizon)
plot(fevd_result)

The FEVD results indicate that both Turnover.ts and Close.ts.diff are primarily driven by their own past values, with minimal influence from each other. The top plot shows that Turnover.ts explains nearly 100% of its own forecast error variance, suggesting that trading volume is largely self-driven and not significantly affected by stock price changes. Similarly, the bottom plot reveals that Close.ts.diff also explains nearly all of its own variance, meaning that price movements are not strongly influenced by trading volume. This suggests that, within the chosen VAR framework, the interaction between these two variables is weak, and their fluctuations are likely determined by external factors not included in this model.

CUSUM

residuals_VAR <- residuals(Turnover.and.Close.VAR)
cusum_test_turnover <- efp(residuals_VAR[, 1] ~ 1, type = "Rec-CUSUM")
cusum_test_close <- efp(residuals_VAR[, 2] ~ 1, type = "Rec-CUSUM")
plot(cusum_test_turnover, main = "CUSUM Test for Turnover Residuals")

plot(cusum_test_close, main = "CUSUM Test for Close Residuals")

The CUSUM test results confirm that the model exhibits structural stability over time, as the black CUSUM line remains within the red confidence bands throughout the observation period. This indicates that there are no significant structural breaks or parameter instabilities in the residuals of the VAR model. Since the relationship between the variables remains stable, the model’s predictions and interpretations are consistent over time, making it a reliable tool for analyzing the dynamics between Turnover.ts and Close.ts.diff.

Conclusion

Looking back on our findings and the test run on our models, AR and ARDL models exhibit extremely high MSE and RMSE values for the training and the testing models, suggesting that the models might not be a good fit for our variables.

Comparing the three different models conducted, the VAR model is observed to be the best suited model for both of the response variables. Among all three models, the VAR model results in much lower values for MSE and RMSE for both the training and the testing models. The lower values of MSE and RMSE suggest that the VAR model provides more accurate estimates. The AIC and BIC values of the VAR model are also lowest of all observed, suggesting a better model fit.

Initially, by setting the two response variables Turnover and Close (closing price), we wanted to see if turnover will increase as there’s positive indifference to close price - if the trend can increase “popularity” of a stock. However, upon doing these analysis, we have realized that none of the variables (Open, close, volume, and turnover) ae good for AR and ARDL model, this suggests that although there is dynamics in the variables themselves, we can not argue that they are statistically correlated with their own lags or lags of another variable. Although VAR is a better fit among them, we can’t establish Granger causality between the two response variables. Meaning that our intuition that a positive difference in close can drive up turnover, vice-versa. It stands true to what can be happening in real life - the market.