LOADING ALL REQUIRED LIBRARIES

library(ggplot2)
library(readr)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tseries)
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
library(forecast)
library(TSA)
## Registered S3 methods overwritten by 'TSA':
##   method       from    
##   fitted.Arima forecast
##   plot.Arima   forecast
## 
## Attaching package: 'TSA'
## The following object is masked from 'package:readr':
## 
##     spec
## The following objects are masked from 'package:stats':
## 
##     acf, arima
## The following object is masked from 'package:utils':
## 
##     tar
library(dLagM)
## Loading required package: nardl
## Loading required package: dynlm
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## 
## Attaching package: 'dLagM'
## The following object is masked from 'package:forecast':
## 
##     forecast
library(dynlm)
library(AER)
## Loading required package: car
## Loading required package: carData
## 
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
## 
##     recode
## Loading required package: lmtest
## Loading required package: sandwich
## Loading required package: survival
library(expsmooth)

DATA DESCRIPTION

The dataset selected for this assessment is a collection of monthly averages of the ASX All Ordinaries (Ords) Price Index, Gold price (AUD), Crude Oil (Brent, USD/bbl), and Copper (USD/tonne). The data spans from January 2004 and has 161 entries. The getwd() function fetches the default directory while the setwd()function returns the directory path for our dataset.We use the read_csv function from the readr package to read the file named “ASX_data.csv” into a Dataframe called “ASXdata”.

getwd()
## [1] "C:/Users/adeyi/Documents/RMIT classes/2nd_Forecasting/Assignment"
setwd("C:/Users/adeyi/Documents/RMIT classes/2nd_Forecasting/Assignment")

ASXdata <- read_csv("C:/Users/adeyi/Documents/RMIT classes/2nd_Forecasting/Assignment/ASX_data.csv")
## Rows: 161 Columns: 4
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (2): ASX price, Crude Oil (Brent)_USD/bbl
## num (2): Gold price, Copper_USD/tonne
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

VIEWING, INSPECTING THE DATASET AND CONVERTING TO TIME SERIES

head(ASXdata)
class(ASXdata)
## [1] "spec_tbl_df" "tbl_df"      "tbl"         "data.frame"
str(ASXdata)
## spc_tbl_ [161 × 4] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
##  $ ASX price                : num [1:161] 2935 2778 2849 2971 2980 ...
##  $ Gold price               : num [1:161] 612 603 566 539 549 ...
##  $ Crude Oil (Brent)_USD/bbl: num [1:161] 31.3 32.6 30.3 25 25.8 ...
##  $ Copper_USD/tonne         : num [1:161] 1650 1682 1656 1588 1651 ...
##  - attr(*, "spec")=
##   .. cols(
##   ..   `ASX price` = col_double(),
##   ..   `Gold price` = col_number(),
##   ..   `Crude Oil (Brent)_USD/bbl` = col_double(),
##   ..   `Copper_USD/tonne` = col_number()
##   .. )
##  - attr(*, "problems")=<externalptr>
## converting dataframe to time series
ASXdata_ts <- ts(ASXdata, start=c(2004,1), frequency=12)

# Summary statistics
summary(ASXdata_ts) 
##    ASX price      Gold price     Crude Oil (Brent)_USD/bbl Copper_USD/tonne
##  Min.   :2778   Min.   : 520.9   Min.   : 25.02            Min.   :1588    
##  1st Qu.:4325   1st Qu.: 825.9   1st Qu.: 47.23            1st Qu.:4642    
##  Median :4929   Median :1363.6   Median : 70.80            Median :6650    
##  Mean   :4813   Mean   :1202.0   Mean   : 73.63            Mean   :5989    
##  3rd Qu.:5448   3rd Qu.:1546.8   3rd Qu.:106.98            3rd Qu.:7623    
##  Max.   :6779   Max.   :1776.3   Max.   :133.90            Max.   :9881

#VISUALIZATION OF TIME SERIES AND TREND CONFIRMATION Plotting the time series for ASX All Ordinaries (Ords) Price Index, Gold price (AUD), Crude Oil (Brent, USD/bbl) and Copper (USD/tonne) starting from January 2004 and investigating for the existence of a Trend

Visualization of ASX Price Index Time series

Key observations: - There is an overall upward trend in the ASX price over time - Observable periods of volatility and fluctuations in the price - notably around 2008-2009 (this could be alluded to an event/intervention) - From 2016 onwards, there is a steep incline with some minor fluctuations. - There is evidence of seasonality.

# Visualizing ASX Price over time
plot(ASXdata_ts[,1], type = "o", 
     main = "ASX All Ordinaries (Ord) Price Peformance (2004 - 2016)",
     xlab = "Period",
     ylab = "ASX All Ordinaries (Ords) Price Index")

Autocorrelation function verification for the ASX Price Index.

We have a slowly decreasing pattern in ACF, we infer that there is a trend in the series which dominates the series correlation properties of the series. There is a short term persistence and momentum, This indicates that the ASX price series exhibits trending, momentum and mean reversion type behavior at different timescales along with seasonal effects. For the PACF, The ASX price has a short term persistence and momentum for 1-2 months. longer term predictability diminishes rapidly. The ACF kept slowly decaying while PACF drops off reflecting the lack of long term autoregressive predictability once short term is accounted for.

# Identifying/confirming the existing of a trend
acf(ASXdata_ts[,1], main = "ASX All Ordinaries (Ord) price performance (2004 - 2016)")

pacf(ASXdata_ts[,1], main = "ASX All Ordinaries (Ord) price performance (2004 - 2016)")

Plot the time series for each column - Gold Price and investigating for a trend

This time series appears to have an upward trend, indicating an intervention. There was a decline in 2012-2015 period. Recovery occurred from 2015

# Visualizing Gold Price over time
plot(ASXdata_ts[,2], type = "o", 
     main = "Gold Price Performance (2004 - 2016)",
     xlab = "Period",
     ylab = "Gold price (AUD)")

Autocorrelation function verification for the Gold price performance.

We have a slow decay in ACF, we can infer that there is a trend in the series which dominates the series correlation properties of the series. The PACF, shows short term persistence for a couple lags but no long term autocorrelation.

# Identifying/confirming the existing of a trend
acf(ASXdata_ts[,2], main = "Gold price performance (2004 - 2016)")

pacf(ASXdata_ts[,2], main = "Gold price performance (2004 - 2016)")

Plot the time series for each column - Crude.Oil..Brent._USD.bbl

There was an overall increase in trend from 2004 to 2008. An observable sharp decline in 2008 - 2009 (external intervention). A gradual recovery was observed from 2010 to 2014. Decline in 2015-2016 corresponding to oil glut. The series shows cyclicality, mean reversion and reaction to intervention.

# Visualizing Crude oil Price over time

plot(ASXdata_ts[,3], type = "o", 
     main = "Crude Oil (Brent, USD/bbl) Price Peformance (2004 - 2016)",
     xlab = "Period",
     ylab = "Crude Oil (Brent, USD/bbl)")

Autocorrelation function verification for the Crude Oil price performance.

We have a slowly decreasing pattern in ACF, we can infer that there is a decays showing some short term persistence and no evidence of seasonality. The PACF shows a significant spike only at lag 1, which then drops to zero

acf(ASXdata_ts[,3], main = "Crude Oil (Brent, USD/bbl) price performance (2004 - 2016)")

pacf(ASXdata_ts[,3], main = "Crude Oil (Brent, USD/bbl) price performance (2004 - 2016)")

Plot the time series for each column - Copper_USD.tonne

There was an overall increase in trend from 2004 to 2006. an observable decline from 2006 to 2009 (intervention). There was a gradual recovery from 2009 to 2011. There has been a decline from 2010.

# Visualizing Copper_USD.tonne over time
plot(ASXdata_ts[,4], type = "o", 
     main = "Copper (USD/tonne) Price Peformance (2004 - 2016)",
     xlab = "Period",
     ylab = "Copper (USD/tonne)")

Autocorrelation function verification for the Copper (USD/tonne) price performance.

We have a slowly decreasing pattern in ACF, we infer no prominent seasonality patterns. Many lags are above significance level indicating long memory. The PACF has significant spikes at lags 1-2, which drop off after that. This indicates short term persistence but not long memory

acf(ASXdata_ts[,4], main = "Copper (USD/tonne) price performance (2004 - 2016)")

pacf(ASXdata_ts[,4], main = "Copper (USD/tonne) price performance (2004 - 2016)")

##THE EXISTENCE OF NONSTATIONARITY IN THE DATASET USING AUGMENTED DICKEY - FULLER TEST - To determine the stationarity, we identify the k, - We use the Augmented Dickey-Fuller test

#To determine the Lag length 
k = trunc(12*((length(ASXdata_ts[,1])/100)^(1/4)))
print(k)
## [1] 13
k = trunc(12*((length(ASXdata_ts[,2])/100)^(1/4)))
print(k)
## [1] 13
k = trunc(12*((length(ASXdata_ts[,3])/100)^(1/4)))
print(k)
## [1] 13
#The Augmented Dickey - FUller Test - ASX
adf_ASX <- adf.test(ASXdata_ts[,1], k=k) 

adf_ASX
## 
##  Augmented Dickey-Fuller Test
## 
## data:  ASXdata_ts[, 1]
## Dickey-Fuller = -2.8677, Lag order = 13, p-value = 0.2144
## alternative hypothesis: stationary
#The Augmented Dickey - FUller Test -  Gold
adf_Gold <- adf.test(ASXdata_ts[,2], k=k) 

adf_Gold
## 
##  Augmented Dickey-Fuller Test
## 
## data:  ASXdata_ts[, 2]
## Dickey-Fuller = -1.4051, Lag order = 13, p-value = 0.8245
## alternative hypothesis: stationary
#The Augmented Dickey - FUller Test -  
adf_Crude <- adf.test(ASXdata_ts[,3], k=k) 

adf_Crude
## 
##  Augmented Dickey-Fuller Test
## 
## data:  ASXdata_ts[, 3]
## Dickey-Fuller = -1.4909, Lag order = 13, p-value = 0.7887
## alternative hypothesis: stationary
#The Augmented Dickey - FUller Test - 
adf_Copper <- adf.test(ASXdata_ts[,4], k=k) 

adf_Copper
## 
##  Augmented Dickey-Fuller Test
## 
## data:  ASXdata_ts[, 4]
## Dickey-Fuller = -1.9739, Lag order = 13, p-value = 0.5872
## alternative hypothesis: stationary

Gold Price: p-value = 0.8245 > 0.05 Fail to reject null hypothesis

Oil Price: p-value = 0.7887 > 0.05 Fail to reject null hypothesis

Copper Price: p-value = 0.5872 > 0.05 Fail to reject null hypothesis

So in summary, the ADF tests indicate non-stationarity in all four time series based on the inability to reject the null hypothesis at the 5% significance level with the specified lag length.

##DIFFERENCING TO ACHIEVE STATIONARITY FOR THE TIME SERIES

# Difference each series
tasx <- diff(ASXdata_ts[,1]) # ASX
tgold <- diff(ASXdata_ts[,2]) # Gold 
toil <- diff(ASXdata_ts[,3]) # Oil
tcopper <- diff(ASXdata_ts[,4]) # Copper

# Check for stationarity
adf.test(tasx)  
## Warning in adf.test(tasx): p-value smaller than printed p-value
## 
##  Augmented Dickey-Fuller Test
## 
## data:  tasx
## Dickey-Fuller = -4.5543, Lag order = 5, p-value = 0.01
## alternative hypothesis: stationary
adf.test(tgold)
## Warning in adf.test(tgold): p-value smaller than printed p-value
## 
##  Augmented Dickey-Fuller Test
## 
## data:  tgold
## Dickey-Fuller = -5.8718, Lag order = 5, p-value = 0.01
## alternative hypothesis: stationary
adf.test(toil)
## Warning in adf.test(toil): p-value smaller than printed p-value
## 
##  Augmented Dickey-Fuller Test
## 
## data:  toil
## Dickey-Fuller = -5.4261, Lag order = 5, p-value = 0.01
## alternative hypothesis: stationary
adf.test(tcopper)
## Warning in adf.test(tcopper): p-value smaller than printed p-value
## 
##  Augmented Dickey-Fuller Test
## 
## data:  tcopper
## Dickey-Fuller = -5.478, Lag order = 5, p-value = 0.01
## alternative hypothesis: stationary

##THE MOST ACCURATE AND SUITABLE DISTRIBUTED LAG MODEL FOR THE ASX PRICE INDEX - The oil-copper interaction model outperforms other models because both of the interaction terms are substantial and the model’s R-squared are larger. This suggests that copper and oil prices have some same characteristics in understanding the tasx. - The 3-way interaction term in the model with copper, gold, and oil exhibits marginal significance (p=0.08). Higher R-squared further enhances model fit. - Based on the importance of their interaction terms, the prices of oil, gold, and copper aid in the explanation of changes in tasx. - The autoregressive structure is provided by the basic ARDL terms with tasx lags. - Commodity price effects can change depending on one another and tasx volatility due to interactions. - Based on diagnostics, the model with a three-way interaction between oil, gold, and copper seems to offer the best fit.

# Fit ARDL model
ardl <- dynlm(tasx ~ L(tasx, 1:5) + toil + I(toil*L(tasx,2)), 
                      data = ASXdata_ts)

# Try different tasx lag interactions
ardl1 <- dynlm(tasx ~ L(tasx, 1:5) + toil + I(toil*L(tasx,1)), data = ASXdata_ts)
ardl2 <- dynlm(tasx ~ L(tasx, 1:5) + toil + I(toil*L(tasx,3)), data = ASXdata_ts) 
ardl3 <- dynlm(tasx ~ L(tasx, 1:5) + toil + I(toil*L(tasx,5)), data = ASXdata_ts)

# Try logging oil price  
ardl4 <- dynlm(tasx ~ L(tasx, 1:5) + log(toil), data = ASXdata_ts)
## Warning in log(toil): NaNs produced
# Try oil/gold interaction
ardl5 <- dynlm(tasx ~ L(tasx, 1:5) + toil + tgold + I(toil*tgold), data = ASXdata_ts)

# Try oil-copper interaction  
ardl7 <- dynlm(tasx ~ L(tasx, 1:5) + toil + tcopper + I(toil*tcopper), data = ASXdata_ts)


# Try 3-way interaction
ardl8 <- dynlm(tasx ~ L(tasx, 1:5) + toil + tgold + tcopper + I(toil*tgold*tcopper), data = ASXdata_ts)  


# Compare model fits
summary(ardl1)
## 
## Time series regression with "ts" data:
## Start = 2004(7), End = 2017(5)
## 
## Call:
## dynlm(formula = tasx ~ L(tasx, 1:5) + toil + I(toil * L(tasx, 
##     1)), data = ASXdata_ts)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -750.16 -126.57    6.41  150.72  747.96 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)   
## (Intercept)          16.378476  17.098230   0.958  0.33968   
## L(tasx, 1:5)1        -0.035133   0.087040  -0.404  0.68706   
## L(tasx, 1:5)2         0.107619   0.080790   1.332  0.18489   
## L(tasx, 1:5)3         0.065709   0.081068   0.811  0.41894   
## L(tasx, 1:5)4         0.018862   0.081355   0.232  0.81698   
## L(tasx, 1:5)5         0.006849   0.080587   0.085  0.93238   
## toil                  7.444927   2.797067   2.662  0.00864 **
## I(toil * L(tasx, 1)) -0.005783   0.008809  -0.657  0.51253   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 201.1 on 147 degrees of freedom
## Multiple R-squared:  0.08393,    Adjusted R-squared:  0.0403 
## F-statistic: 1.924 on 7 and 147 DF,  p-value: 0.06966
summary(ardl2)
## 
## Time series regression with "ts" data:
## Start = 2004(7), End = 2017(5)
## 
## Call:
## dynlm(formula = tasx ~ L(tasx, 1:5) + toil + I(toil * L(tasx, 
##     3)), data = ASXdata_ts)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -750.28 -124.86   11.25  134.97  756.90 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)   
## (Intercept)          13.88268   16.22467   0.856  0.39358   
## L(tasx, 1:5)1        -0.02710    0.08524  -0.318  0.75095   
## L(tasx, 1:5)2         0.10750    0.07987   1.346  0.18037   
## L(tasx, 1:5)3         0.07283    0.08031   0.907  0.36598   
## L(tasx, 1:5)4         0.02986    0.07979   0.374  0.70876   
## L(tasx, 1:5)5         0.02751    0.08018   0.343  0.73202   
## toil                  7.37552    2.70673   2.725  0.00721 **
## I(toil * L(tasx, 3)) -0.01976    0.01041  -1.898  0.05964 . 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 199 on 147 degrees of freedom
## Multiple R-squared:  0.1032, Adjusted R-squared:  0.06052 
## F-statistic: 2.417 on 7 and 147 DF,  p-value: 0.02265
summary(ardl3)
## 
## Time series regression with "ts" data:
## Start = 2004(7), End = 2017(5)
## 
## Call:
## dynlm(formula = tasx ~ L(tasx, 1:5) + toil + I(toil * L(tasx, 
##     5)), data = ASXdata_ts)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -738.64 -125.22    8.95  134.97  740.27 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)   
## (Intercept)          13.368082  16.386944   0.816   0.4159   
## L(tasx, 1:5)1        -0.023124   0.086251  -0.268   0.7890   
## L(tasx, 1:5)2         0.132010   0.085608   1.542   0.1252   
## L(tasx, 1:5)3         0.053066   0.082470   0.643   0.5209   
## L(tasx, 1:5)4         0.019208   0.081064   0.237   0.8130   
## L(tasx, 1:5)5         0.015375   0.080783   0.190   0.8493   
## toil                  7.816502   2.722541   2.871   0.0047 **
## I(toil * L(tasx, 5))  0.008863   0.011541   0.768   0.4437   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 201 on 147 degrees of freedom
## Multiple R-squared:  0.08491,    Adjusted R-squared:  0.04134 
## F-statistic: 1.949 on 7 and 147 DF,  p-value: 0.06596
summary(ardl4) 
## 
## Time series regression with "zooreg" data:
## Start = Jul 2004, End = Apr 2017
## 
## Call:
## dynlm(formula = tasx ~ L(tasx, 1:5) + log(toil), data = ASXdata_ts)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -640.30 -101.93    2.18  125.46  757.07 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)
## (Intercept)    6.37828   27.02610   0.236    0.814
## L(tasx, 1:5)1  0.03179    0.11051   0.288    0.774
## L(tasx, 1:5)2  0.14052    0.11900   1.181    0.241
## L(tasx, 1:5)3 -0.01069    0.10188  -0.105    0.917
## L(tasx, 1:5)4 -0.11057    0.10402  -1.063    0.291
## L(tasx, 1:5)5  0.03541    0.11499   0.308    0.759
## log(toil)     28.84944   17.77090   1.623    0.108
## 
## Residual standard error: 199 on 85 degrees of freedom
##   (33 observations deleted due to missingness)
## Multiple R-squared:  0.05153,    Adjusted R-squared:  -0.01542 
## F-statistic: 0.7697 on 6 and 85 DF,  p-value: 0.5958
summary(ardl5)
## 
## Time series regression with "ts" data:
## Start = 2004(7), End = 2017(5)
## 
## Call:
## dynlm(formula = tasx ~ L(tasx, 1:5) + toil + tgold + I(toil * 
##     tgold), data = ASXdata_ts)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -646.41 -111.94   23.27  121.12  717.61 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     24.97212   16.04111   1.557 0.121693    
## L(tasx, 1:5)1   -0.07539    0.08312  -0.907 0.365929    
## L(tasx, 1:5)2    0.12699    0.07724   1.644 0.102311    
## L(tasx, 1:5)3    0.04635    0.07823   0.592 0.554451    
## L(tasx, 1:5)4   -0.02076    0.07952  -0.261 0.794427    
## L(tasx, 1:5)5    0.03405    0.07727   0.441 0.660062    
## toil             5.95162    2.77480   2.145 0.033617 *  
## tgold           -1.13634    0.30955  -3.671 0.000338 ***
## I(toil * tgold)  0.02822    0.03834   0.736 0.462898    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 191.9 on 146 degrees of freedom
## Multiple R-squared:  0.1712, Adjusted R-squared:  0.1258 
## F-statistic: 3.771 on 8 and 146 DF,  p-value: 0.0004793
summary(ardl7)
## 
## Time series regression with "ts" data:
## Start = 2004(7), End = 2017(5)
## 
## Call:
## dynlm(formula = tasx ~ L(tasx, 1:5) + toil + tcopper + I(toil * 
##     tcopper), data = ASXdata_ts)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -780.25 -117.35   15.71  122.46  769.96 
## 
## Coefficients:
##                    Estimate Std. Error t value Pr(>|t|)  
## (Intercept)       25.054746  17.300427   1.448   0.1497  
## L(tasx, 1:5)1     -0.046548   0.085226  -0.546   0.5858  
## L(tasx, 1:5)2      0.108135   0.079753   1.356   0.1772  
## L(tasx, 1:5)3      0.052707   0.079425   0.664   0.5080  
## L(tasx, 1:5)4     -0.012757   0.080078  -0.159   0.8736  
## L(tasx, 1:5)5     -0.011275   0.079414  -0.142   0.8873  
## toil               1.882544   3.409739   0.552   0.5817  
## tcopper            0.085318   0.039407   2.165   0.0320 *
## I(toil * tcopper) -0.006672   0.003339  -1.998   0.0476 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 196.7 on 146 degrees of freedom
## Multiple R-squared:  0.1291, Adjusted R-squared:  0.08135 
## F-statistic: 2.705 on 8 and 146 DF,  p-value: 0.008341
summary(ardl8)
## 
## Time series regression with "ts" data:
## Start = 2004(7), End = 2017(5)
## 
## Call:
## dynlm(formula = tasx ~ L(tasx, 1:5) + toil + tgold + tcopper + 
##     I(toil * tgold * tcopper), data = ASXdata_ts)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -670.99 -107.42   18.75   99.48  730.86 
## 
## Coefficients:
##                             Estimate Std. Error t value Pr(>|t|)   
## (Intercept)                2.506e+01  1.562e+01   1.604  0.11088   
## L(tasx, 1:5)1             -7.501e-02  8.149e-02  -0.921  0.35883   
## L(tasx, 1:5)2              1.497e-01  7.611e-02   1.966  0.05115 . 
## L(tasx, 1:5)3              3.265e-02  7.638e-02   0.427  0.66971   
## L(tasx, 1:5)4             -4.956e-02  7.755e-02  -0.639  0.52383   
## L(tasx, 1:5)5              1.909e-02  7.630e-02   0.250  0.80283   
## toil                       2.065e+00  3.091e+00   0.668  0.50514   
## tgold                     -1.018e+00  3.128e-01  -3.255  0.00141 **
## tcopper                    7.872e-02  3.755e-02   2.096  0.03779 * 
## I(toil * tgold * tcopper) -4.040e-05  2.303e-05  -1.754  0.08155 . 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 188 on 145 degrees of freedom
## Multiple R-squared:  0.2102, Adjusted R-squared:  0.1612 
## F-statistic: 4.287 on 9 and 145 DF,  p-value: 5.915e-05
# Check residuals
checkresiduals(ardl)

## 
##  Breusch-Godfrey test for serial correlation of order up to 24
## 
## data:  Residuals
## LM test = 20.747, df = 24, p-value = 0.6536

OBSERVATION AND CONCLUSION

Trend: - The Augmented Dickey-Fuller test results on the differenced time series (tasx, tgold, toil, tcopper) provide strong evidence for rejecting the null hypothesis of a unit root. Key points: - The test statistics are large negative values for all series, indicating stationarity. - The printed p-values are 0.01 for all tests. - The warning message indicates the true p-values are even smaller than 0.01. - At the 5% significance level, p-values below 0.05 lead to rejecting the null hypothesis. - Since the p-values are well below the 0.05 cutoff, we can strongly reject the null hypothesis of a unit root and conclude the differenced series are stationary. - This suggests the differencing was effective in removing the non-stationary stochastic trends present in the original undifferenced series. - Taking first differences has induced stationarity, making the time series appropriate for ARIMA modeling to capture the autocorrelation structure. - The diagnostics indicate the test regressions properly capture the dynamics with the chosen lag length. - There is an upward trend in all four series over the full time period. This reflects the long-term growth and appreciation in the underlying assets. - Technological change, demand growth, limited supply are likely drivers of the upward trend in equities, commodities, and precious metals. detrending or differencing removes this long-term increase when fitting models. Failing to account for the trend will bias forecasts.

Seasonality: - No strong monthly seasonality observed. May be minor seasonality that is overwhelmed by trend and noise. - Monthly data makes it difficult to identify weekly or daily seasonal patterns. - Seasonality more likely for fundamental demand/supply factors.

Cyclicity: - Booms and busts of the business cycle are apparent. e.g. declines during the 2008 recession. - Cycles reflect alternating macroeconomic expansions and contractions. - Commodity cycles tend to be more pronounced than broader markets.

Outliers: - Spikes in copper prices around 2006 likely reflect supply disruptions. - Oil price volatility introduces some outliers that impact means and variance. - Changes in gold prices also exhibit outliers, perhaps due to economic uncertainty. - Outliers should be examined to determine if they should be retained or adjusted.

So in summary, the components all leave an imprint on the time series that must be considered when modeling. The trend and cyclicity seem most dominant in these macroeconomic and financial indicators.

REFERENCES

Concept of Stationarity test ADF-1.pdf (2019) Instructure.com, https://rmit.instructure.com/courses/112639/files/30914858?wrap=1, accessed 25 August 2023.

Module 1 - Online Notes.html (2019), https://rmit.instructure.com/courses/112639/files/30915167?module_item_id=5127049&fd_cookie_set=1, accessed 25 August 2023.

Module 2 - Online Notes.html (2019), https://rmit.instructure.com/courses/112639/files/30915171?module_item_id=5127054&fd_cookie_set=1, accessed 25 August 2023.

Module 3 - Online notes.html (2019) Instructure.com, https://rmit.instructure.com/courses/112639/files/30915173?module_item_id=5127059&fd_cookie_set=1, accessed 25 August 2023.