hw6
hw6
Initially, our analysis will center on two prominent U.S. time series: data pertaining to
output and unemployment. This information is contained within the file designated as
T7-varBQus.R. To facilitate a rigorous examination, we shall commence by
eradicating any pre-existing variables from the workspace and terminating any active
graphical representations.
We will now employ two R packages, namely vars and tsm, which we previously
installed. These packages furnish functionalities essential for the manipulation of time
series data.
The data is stored in a CSV file. For R to retrieve this information, it is imperative to
modify the provided path to reflect the directory housing your particular CSV file.
Upon completion of this step, we can import the data from the CSV file and instantiate
two time series objects: one identified as "gdp" and the other as "une".
To ascertain the accuracy of our procedures, we can visualize the data graphically.
To investigate the persistence present within the data, we will employ the
autocorrelation function.
In order to merge our "gdp" and "une" datasets into a singular entity for examination,
we can simply align them laterally. Subsequently, we will apply statistical criteria to
determine the appropriate number of lags to incorporate.
All information criteria suggest a lag length of 2. This necessitates setting the
autoregressive parameter (p) to 2 during the model estimation process, as illustrated
below.
Our evaluation indicates that the model exhibits stability and the variables appear to
exert mutual influence (historical unemployment impacts output, and historical output
and unemployment affect unemployment).
To assess the model's goodness-of-fit, we will scrutinize the residual errors. We will
utilize the Portmanteau test to ascertain whether these errors are distributed randomly,
as demonstrated below.
A p-value exceeding 5% generally indicates that there are no concerns regarding the
clustering or patterning of residuals (serial correlation). Furthermore, we will conduct
an additional test to assess the presence of unequal variances among the residuals
(heteroscedasticity).
A p-value above 5% implies that there are no issues related to unequal variances in the
residuals (heteroscedasticity). Lastly, we can evaluate whether the residuals
themselves conform to a normal distribution through a normality assessment.
The results indicate that the residuals are likely to be normally distributed. As a
concluding measure, we will employ a CUSUM test to investigate any abrupt changes
in the behavior of the residuals over the temporal dimension (structural breaks).