SlideShare a Scribd company logo
The Effect of Energy Shocks on Labour Flows in Canada
by
Keith Yacucha
BA Economics, UBC, 2014
An Extended Essay Submitted in Partial Fulfillment
of the Requirements for the Degree of
MASTER OF ARTS
in the Department of Economics
We accept this extended essay as conforming
to the required standard
Dr. David Giles, Co-Supervisor (Department of Economics)
Dr. Graham Voss, Co-Supervisor (Department of Economics)
 Keith Yacucha, 2016
University of Victoria
All rights reserved. This extended essay may not be reproduced in whole or in part, by
photocopy or other means, without the permission of the author.
2
Abstract
This essay aims to explore the impacts of energy price shocks on labour flows in Canada,
Alberta and Ontario through the utilization of a Vector Smooth Auto-Regressive model. In
general, it is found that labour flows react non-linearly and asymmetrically around energy price
shocks with these effects being most apparent on the national level, while Alberta and Ontario
display less noticeable asymmetric effects.
3
Table of Contents
1.Introduction ...............................................................................................................................................4
2. Literature Review......................................................................................................................................6
3. Data and Methodology ...........................................................................................................................13
3.1 Data...................................................................................................................................................13
3.2 Methodology.....................................................................................................................................16
4. Discussion of Results...............................................................................................................................43
5. Conclusions .........................................................................................................................................73
References ..................................................................................................................................................76
Appendix: IRFs by Region for VAR...........................................................................................................78
Appendix: Non-cumulative IRFs for differenced labour flows from VSTAR models...............................81
Appendix: R Code, Region: Canada.........................................................................................................85
4
1.Introduction
The effect of oil price shocks on large oil importing economies such as the United States
is a vastly researched topic, however the effects of such shocks on smaller, oil exporting
economies, such as Canada is much less documented. This essay aims to add to the literature
by exploring these dynamics for the Canadian case. Using a Vector Smooth Transition Auto-
Regressive (VSTAR) model and through the corresponding Impulse Response Functions (IRF) we
explore how labour flows, specifically, unemployment, job finding and separation rates, adjust
to simulated shocks to the price of energy in Canada, Alberta, and Ontario.
The focus on the effect of energy prices on the Canadian economy is due to the relative
importance of this sector. That is, oil and gas extraction combined with support services
amount to just over 5% of Canada’s gross output1, which places this sector as the third largest
contributor to output behind the finance (just over 10%) and manufacturing sectors (just over
20%). The important distinction is that the outputs from the oil and gas sector, which are
processed into forms of energy, are then utilized by every other industry and consumer for
their daily production or consumption needs. Thus while the oil and gas sector is subject to the
price of energy for its own profitability, so too then is much of the economy as they utilize the
energy for their production and consumption processes. Thus price changes have the potential
to disrupt levels of planned production or consumption, which then has reverberating effects
through the economy which filters through to impact employment levels.
1
Statistics Canada, Table 381-0031 Provincial gross output, by sector and industry. Regions: Canada, Alberta and
Ontario. Industries: all major industry (3 digit) industry classifications, Time Frame: Annual 2008 to 2012. own
calculation.
5
The choice to further include Alberta and Ontario in this analysis stems from the
classical geo-political and economic divide in Canada between the east and west. That is
specifically, oil and gas extraction and support services account for over 20% of Alberta’s
output, conversely, Ontario is predominantly involved in manufacturing, with this notably
broad sector accounting for close to 25% of Ontario’s output.2 Thus by including Ontario and
Alberta in addition to Canada in aggregate, the hope is to have a window into how energy price
shocks effect the country on whole, as well as identify potential distinctions in the effect on
regional labour flows.
It is found that labour flows adjust asymmetrically and non-linearly to shocks in the
price of energy. Particularly labour flows react differently to positive and negative oil shocks,
and similarly the magnitude of the shock is also important as a scaled up shock does not
necessarily translate into an equally scaled up impact. However, this level of asymmetry is very
different depending on region, with Canada having the most visible asymmetry, while Alberta
and Ontario appear to have less apparent asymmetric effects to energy shocks,
The rest of the paper is outlined as follows. Section 2 will discuss and relate the relevant
literature to this topic. Section 3 will outline the data used as well as the econometric
methodology used in building this model. Section 4 will present, interpret and discuss the
results before completing in section 5 with the conclusions.
2
Statistics Canada, Table 381-0031 Provincial gross output, by sector and industry. Regions: Canada, Alberta and
Ontario. Industries: all major industry (3 digit) industry classifications, Time Frame: Annual 2008 to 2012. own
calculation.
6
2. Literature Review
As mentioned the effects of an energy shock on the US macro economy has been an
extremely well researched subject. There are of course key differences between the structure
of the US and the Canadian economies, it is these distinctions in which we aim to extrapolate
from the following literature.
Tatom (1987) explores the effect of the then recent fall in oil prices on the macro
economy. Using an aggregate demand, aggregate supply (AD-AS) frame work, Tatom explores
the theoretical effect of an energy shock on the macroeconomic environment for a handful of
countries including Canada. Primarily Tatom finds that energy shocks impact the economy
through the aggregate supply side through the adjustment of factor prices and the disruption in
productivity due to the price shock altering firms optimal level of capital labour ratios. Tatom,
further finds that both positive and negative shocks have an estimated symmetric effect on the
economy.3
Davis and Haltiwanger (2001) investigate the transmission mechanism of oil price shocks
through to labour markets. They argue that large oil price shocks cause disruptions in the
production process, causing an upset in production. 4 Davis and Haltiwanger continue to
identify two processes by which this may occur; (i) Aggregate channels referring to potential
output, and (ii) Allocative channels referring to the impact of changing oil prices on the desired
ratio of capital and labour. 5 In identifying between these processes empirically, Davis and
Haltiwanger state that with aggregate channels one would expect that under unfavourable oil
3
Tatom 1987, 44.
4
Davis and Haltiwanger, 2001, 467.
5
Davis and Haltiwanger, 2001, 467.
7
price shocks job creation will be reduced and job destruction would be increased, while under
allocative channels one would expect to see both job destruction and creation to increase. 6
Additionally, one would expect employment to respond symmetrically to oil price shocks under
aggregate channels, and asymmetrically in the case of allocative channels, with only the
magnitude of the oil price shock being of relevance. 7
The rationale for this asymmetric impact under allocative channels is due to this price
change causing a disruption in the capital to labour ratio coupled with the potential inability for
capital and labour to relocate to sectors or regions in order to be fully utilized. That is, under
either a favourable or unfavourable oil price shock, the match of capital to labour is disrupted
resulting in increased frictional unemployment until capital and labour are able to relocate to
suitable industries or regions.
Although Shimer (2012) never explores the relationship of labour flows with oil price
shocks, Shimer provides tremendous insight into the role labour flows play in the determination
of unemployment rates, stating that in the US since 1987, ninety percent of the fluctuations in
unemployment rates were due to changes in the job finding rate. 8 Further, it is Shimer in this
work who provides us with the methodology used to later construct the job finding and job
separation rates for Canada.
Ordonez, Sala and Silva (2011) explore the effects of real oil price shocks on labour flows
in the United States. Using a Vector Smooth Transition Autoregressive (VSTAR) model Ordonez
6
Davis and Haltiwanger, 2001, 468.
7
Davis and Haltiwanger, 2001, 468.
8
Shimer, 2012, 127.
8
et al. find that unemployment rates are sensitive to oil price shocks, and further that there are
larger responses in the job finding rate supporting that the job finding rate is the driving force
for unemployment rather than the separation rate. 9 It is primarily Ordonez, Sala and Silva’s
methodology which is followed in this paper in order to evaluate the effect of energy price
shocks on Canadian labour flows.
Uri (1996) takes an aggregate channel approach in identifying the effects of oil price
shocks on the US unemployment rate. Uri argues that rising energy prices increase the cost of
production, thereby reducing aggregate supply due to the reduction of goods and services
produced. Thus this decline in aggregate output results in a falling demand for labour supply
and a rise in unemployment rates. 10 Uri finds that it takes about three years for the effects of a
percentage change in real oil price to be fully absorbed by the unemployment rate in a
simulated environment.11
Dissou (2010) provides a level of Canadian context to the research, although Dissou’s
focus is on the effects of increasing oil prices on sectoral employment. Dissou discusses the
possibility that increasing oil prices could result in Dutch disease for the Canadian economy.
Specifically, that rising oil prices would hit energy intensive producers with a supply shock, and
then a further hit with an unfavorable real exchange rate resulting in their goods no longer
being priced competitively in the global market. 12
9
Ordonez, Sala and Silva, 2010, 92.
10
Uri, 1998, 29.
11
Uri, 1998, 35.
12
Dissou, 2010, 562.
9
Hamilton (2003) discusses the negative relationship in the US between oil prices and
real output, primarily however he discusses a mechanism by which the effect of oil price shocks
on real output through aggregate demand, may be asymmetric. Hamilton proposes that the
price of energy must be important in the decision to purchase durables, that is, if energy prices
are expected to be high, one may shift their consumption towards energy efficient products, or
hold off on their purchase all together. From an investment view point, if a firm is considering
building a new factory, the expected price of energy plays into what industrial techniques and
equipment are used. Ultimately then, if consumers and firms are uncertain about energy prices
then they may post-pone purchases of big ticket items until they feel prices have stabilized. 13
Thus while an unfavourable shock may depress the economy, a favourable shock may have
little benefit due to the disruptions caused by uncertainty around energy prices.14
In Hamilton (2011) the effects of oil price shocks are examined further, this time
primarily through the supply side. While the case for oil price shocks having asymmetric
impacts on the economy is stressed, Hamilton outlines key potential causes for this impact
through allocative channels. These causes include increased unemployment due to rising
frictional unemployment due to specialized labour and capital, as well as resulting from idle
labour and capital as these factors of production attempt to wait out the disruptions caused by
the price change.15
13
Hamilton,2003,366.
14
Hamilton,2003,366.
15
Hamilton,2011,3.
10
Kilian (2014) echoes the comments already made regarding the effects of an oil price
shock on the economy. Stating that they result in allocative disturbances between capital and
labour causing sectoral shifts throughout the economy. However, depending on how specific
the given capital or labour is, it may not be able to be easily relocated, resulting in
unemployment.16 Of specific note is Kilian’s statement that previous studies identifying
asymmetries arising from oil price shocks have been miss-specified due to their inclusion of oil
price increases as a variable in the structural VAR model, which Kilian argues leads to
inconsistent impulse response estimates and thus cannot be used to quantify asymmetry.17
Kilian further shows, that when he reworks these studies he finds no evidence of an asymmetric
effect in the US for anything less than extreme shocks of two standard deviations or more.18 By
utilizing a VSTAR model we are able to avoid the misspecification noted by Kilian, as we
primarily do not include a variable for oil or energy price increases, and further, a VSTAR allows
for an infinite number of states between regimes, and collapses to a linear model under specific
circumstances, as a result an explicit component of the modeling process is testing this linear
specification against a VSTAR alternative.
Lian, Jin, and Ren (2014) further confirm Kilian’s results with a similar conclusion, where
they find that in the US, impulse response functions tend to show little if any asymmetry in the
US economy for ± 1 standard deviation oil price shocks. However, Lian et al. find that with
higher level shocks of ± 2 or 3 standard deviations the asymmetries become very apparent. 19
16
Kilian,2014,143-144.
17
Kilian, 2014, 147.
18
Kilian, 2014, 147.
19
Lian, Xiaoze and Xiaomei, 2014, 224.
11
Finally, Cox, and Harvie (2010) provide an excellent overview of the assumed impact of a
positive resource price shock for a resource exporter, like Canada. Cox and Harvie argue that a
positive price shock would impact the economy through five primary channels. First through an
income effect, by which the resource adds directly to the nations real income. Second through
a revenue effect from higher revenue capacity of the government through royalties on the
resource. Third is the spending effect where private and public sector spending increases due to
increased current and expected future income, wealth, and in the case of public sector, tax
revenue. Fourth is the effect on the current account, as the value of resource exports increase
the current account is enhanced. Lastly the exchange rate effect, where higher valued resource
exports result in a stronger domestic currency. 20 Additionally, Cox and Harvie find that a
resource price increase will tend to reduce non-resource industry supply and demand,
deteriorate the non-resource trade balance due to lack of competitiveness, potentially cause
unstable financial markets and lastly, loss of non-resource output leads to lower employment
and capital investment in non-resource sectors which may have long term growth effects. 21
Although the vast majority of the above literature is focused on the US economy, the
primary take-away is the set of potential mechanisms by which an energy price shock impacts
aggregate supply and aggregate demand.
From the aggregate supply side, we would expect very similar effects as outlined above
following a price shock. That is following the outline of Davis and Haltiwanger (2001) where if
an unfavourable oil shock reduces job creation and increases job separation, then this shock is
20
Cox and Harvie, 2010, 471.
21
Cox and Harvie, 2010, 487.
12
influencing the economy through aggregate channels. That is, the standard text book story of
how the economy would adjust following a negative aggregate supply shock. Alternatively, if
following this unfavourable shock, both job creation and separation rates increase, then the
resultant shock has had an allocative effect on the economy, disrupting the optimal ratios of
labour and capital, and thus we would expect if the effect was due to this allocative disturbance
that the impacts of energy shocks would by asymmetric, as any shock of a large enough
magnitude would cause such disruptions and a drop in productivity, and increase in
unemployment.
From the aggregate demand side, we would expect a very different story from the
consensus provided above. That is, an increase in energy prices would generally follow the
mechanisms proposed by Cox and Harvie (2010). That is, an increase in energy prices would
increase over all income and wealth, while a decrease would have the opposite effect. This
result is of course in direct contradiction to the proposed effect in the US, which of course is a
net importer of oil for its energy needs. Despite the expectation that the prevalent pressures on
the Canadian economy would be opposite that of the US economy, the issue brought up by
Hamilton (2003) still stands. That being that any large disruption in the price of energy is going
to cause a disruption in consumption and investment decisions, and thus even favourable
shocks, may have little positive effect on the economy.
Although we are not explicitly modeling the effects that an energy shock will have on
aggregate demand and aggregate supply, it is still important to recognize the dynamics by
which an energy shock would flow through these two processes as this ultimately has an effect
13
on labour flows depending on if a given shock pushes us into an inflationary or recessionary
output gap.
3. Data and Methodology
3.1 Data
All of the data used is sourced from Statistics Canada, where our variables of interest
are the Real energy commodity index22 and unemployment rate23 while our other variables for
labour flows, job separation and job finding rates are derived as no such data exists in Canada.
These rates are derived based off the methodology proposed by Shimer (2012) and utilized by
the Bank of Canada. 24 Following Shimer’s methodology, we can easily construct the job finding
and separation rates using readily available data. First we construct the probability of finding a
job which is the probability that any currently unemployed worker becomes employed within a
given month, this probability is constructed using the following sequence, first we have the
following equation to estimate next periods unemployment rate:
𝑢 𝑡+1 = (1 − 𝐹𝑡)𝑢 𝑡 + 𝑢 𝑡+1
𝑠
(1)
where ‘Ft’ is the probability of an unemployed worker becoming employed within the month,
while ‘u’ is the number of unemployed25 in the month subscripted t and t+1. Finally, ‘us’ is the
22
Statistics Canada, Table 176-0075 Fisher commodity price index, United States dollar terms, Bank of Canada,
monthly (index, 1972=100). Region: Canada. Commodity: Index. Time Frame: Monthly, Jan. 1972 – Jan. 2016.
23
Statistics Canada, Table 282-0087 Labour force survey estimates (LFS), by sex and age group, seasonally adjusted
and unadjusted. Region: Canada, Alberta Ontario. Labour force characteristic: unemployment rate (percent). sex:
both sexes. Age group: 15 years and over. Statistic: Estimate. Data type: Unadjusted. Time Frame: Monthly, Jan.
1976 – Jan 2016
24
Zmitrowicz, 2014.
25
Statistics Canada, Table 282-0087 Labour force survey estimates (LFS), by sex and age group, seasonally adjusted
and unadjusted. Region: Canada, Alberta Ontario. Labour force characteristic: unemployment. sex: both sexes. Age
group: 15 years and over. Statistic: Estimate. Data type: Unadjusted. Time Frame: Monthly, Jan. 1976 – Jan 2016
14
number of short term unemployed, 26 those whose length of unemployment has lasted less
than a month. That is, from (1), the number of unemployed in the next period is equal to the
number of workers in the present period who have not found a job (1-Ft)ut plus the short term
unemployed who held a job in the present period but have become unemployed in the next.
Re-arranging (1) we can obtain an expression of the probability of finding a job in any given
period as a function of the number of unemployed,27 note that this probability can only be
calculated ex-post.
𝐹𝑡 = 1 −
𝑢 𝑡+1 − 𝑢 𝑡+1
𝑠
𝑢 𝑡
(2)
while ‘Ft’ is the probability of finding a job, Shimer assumes that in period t, all
unemployed workers find a job according to a poisson process thus, ‘ft’, is the rate at which
workers find employment, derived as28:
𝑓𝑡 = −ln(1 − 𝐹𝑡) (3)
Continuing with Shimer’s methodology, we can also calculate the probability of being
separated from employment within a period as the difference between next periods
unemployed and the present periods unemployed who have been unable to find work, as a
ratio over the total number of employed29:
𝑆𝑡 =
𝑢 𝑡+1 − (1 − 𝐹𝑡)𝑢 𝑡
𝑒𝑡
(4)
26
Statistics Canada. Table 282-0047 - Labour force survey estimates (LFS) – Short Term Unemployment. Region:
Canada, Alberta, Ontario. Duration of unemployment: 1 to 4 weeks. Sex: both sexes. Age Group: 15 and over. Time
Frame: Monthly, Jan. 1972 – Jan 2016.
27
Shimer, 2012, 130.
28
Shimer, 2012, 130.
29
Shimer, 2012, 131.
15
where ‘ut’ and ‘Ft’ are as previously defined, ‘et’ is the number of employed30 in period t,
resulting in ‘St’, the probability of being separated from a job in period t. As with Ft and ft, we
can get from the probability of being separated to the rates of separation through the same
assumptions and methods, giving us the job separation rate as:
𝑠𝑡 = −ln(1 − 𝑆𝑡) (5)
With the variables for labour flows defined, which are assumed to be similar to the job
creation and destruction rates as defined by Davis and Haltiwanger (2001), we move to define
our variable for energy prices. The series of interest to explore the role of energy shocks is the
Bank of Canada Commodity Index for Energy. 31 This index is weighted through the price and
production volumes of crude oil32, natural gas, and coal. The Bank of Canada Commodity Index
for energy (simply the energy index going forward) is then converted into real terms using the
Consumer Price Index for each region33, after this conversion, January 1972 is reset as the base
period with a value of 100.
Where previous studies focus strictly on the price of oil, typically WTI34, we have chosen
to utilize the energy index as a measure of energy prices in order to better capture changes in
the cost of energy as faced by firms and consumers. Specifically, oil is not the only energy input
30
Statistics Canada, Table 282-0087 Labour force survey estimates (LFS), by sex and age group, seasonally adjusted
and unadjusted. Region: Canada, Alberta Ontario. Labour force characteristic: Employment. sex: both sexes. Age
group: 15 years and over. Statistic: Estimate. Data type: Unadjusted. Time Frame: Monthly, Jan. 1976 – Jan 2016
31
Statistics Canada, Table 176-0075 Fisher commodity price index, United States dollar terms, Bank of Canada,
monthly (index, 1972=100). Region: Canada. Commodity: Index. Time Frame: Monthly, Jan. 1972 – Jan. 2016.
32
Western Texas Intermediate, Brent and Western Canada Crude.
33
Statistics Canada. CANSIM 326-0020 - Consumer Price Index, by province, monthly (2002=100). Regions: Canada,
Alberta, Ontario, Products and product groups: All-items, Time Frame: Monthly, Sept. 1978 – Nov 2015.
34
Kilian & Vigfusson, 2010, 7.
16
being faced by firms, thus by incorporating a weighted index of energy inputs, this is able to
better capture the true energy costs being faced by producers and consumers, as well as how
these filter through to the macro-economy on whole. Ultimately, the use of this index in
practice should not make a large difference, as over the time period evaluated, the real energy
index has a correlation with the WTI spot price of 0.964.
All data have been collected and manipulated using monthly data, going forward to
allow for greater ease in dealing with seasonal unit roots, all series are transformed into
quarterly data. This transformation is achieved by taking the average of the observations within
each quarter. As a result, the corresponding data has a time range of 1978 Q4 to 2015 Q4, for a
total of 149 observations in each of the 4 series. These series have the following naming
convention for all graphs and tables: Rnrg for the real energy index, unemp.rate for the
unemployment rate, f.rate for the Finding rate and s.rate for the Separation rate. The graphs
for these series against time, as well as their summary statistics are displayed in figures 1-3 and
tables 1-3 below.
3.2 Methodology
The modeling sequence of a VSTAR as proposed by Teräsvirta and Yang (2014) involves
first specifying a VAR model35, thus the order of this section will be as follows. First the
methodology used to construct a linear VAR model, second a discussion of VSTAR models
outlining their functional form and what they allow in modeling, finally, the constructed VAR
model will be subjected to tests of linearity, and expanded into a VSTAR model following the
aforementioned modeling sequence.
35
Teräsvirta and Yang, 2014, 7.
17
First, each series is tested for the presence of a seasonal unit root using the test of
Hylleberg, Engle, Granger, and Yoo (HEGY) (1990). Before testing for seasonal unit roots the
energy index series is first transformed by taking the natural logarithm, where the
unemployment rate as well as the job finding and separation rates enter as they were
presented. Given that all series show a significant trend through time and further more as the
data is not seasonally adjusted, the following HEGY test is conducted with seasonal dummies as
well as a constant and time trend. The results of these tests are presented in table 4 for each
region, while selected critical values for the HEGY test are displayed in table 5 for reference.36
Thus from the above HEGY tests we can conclude that at the 5% significance level, all
variables except for selected regions’ unemployment rate should be first or quarterly
differenced in order to be made stationary, while the unemployment rates for Canada and
Ontario are stationary over this given time period and do not need to be differenced. Thus,
after transforming our series to ensure that all variables are stationary, our new series now
contains 148 observations from 1979 Q1 to 2015 Q4. The corresponding updated graphs of
each variable against time, as well as the summary statistics for each are presented in figures 4-
6 and tables 6-8, where if the series was differenced the series name is pre-fixed with “D_”.
With our series being transformed to be stationary we can begin building our VAR
model. In essence a VAR is a system of equations, that is, in our case, each of our 4 series is the
dependent variable, while the lag of all other series enter in as explanatory variables as well as
36
Hylleberg, Engle, Granger, and Yoo ,1990, 227.
18
Figure 1
Table 1
Series over time:
Min Mean Max
Standard
Deviation
Rnrg 39.300 99.518 238.407 43.718
unemp.rate 0.055 0.084 0.135 0.017
f.rate 0.206 0.322 0.448 0.053
s.rate 0.023 0.029 0.036 0.003
Summary Statistics: Canada 1978:Q4 - 2015:Q4
19
Figure 2
Table 2
Series over time:
Min Mean Max
Standard
Deviation
Rnrg 40.095 98.633 222.969 41.010
unemp.rate 0.031 0.064 0.122 0.023
f.rate 0.236 0.417 0.669 0.103
s.rate 0.018 0.026 0.039 0.005
Summary Statistics: Alberta 1978:Q4 - 2015:Q4
20
Figure 3
Table 3
Series over time:
Min Mean Max
Standard
Deviation
Rnrg 38.393 97.462 233.184 43.089
unemp.rate 0.046 0.076 0.125 0.016
f.rate 0.193 0.329 0.437 0.058
s.rate 0.017 0.026 0.035 0.003
Summary Statistics: Ontario 1978:Q4 - 2015:Q4
21
Table 4
Table 5
HEGY Test, Levels α=5%
HEGY Coef T-Stats: Conclusion:
Canada
l.Rnrg -1.961 -8.690 *** 41.123 *** Quarterly Difference
unemp.rate -4.198 *** -4.745 *** 20.852 *** Stationary
F.rate -2.871 -4.354 *** 21.263 *** Quarterly Difference
S.rate -3.366 * -5.816 *** 52.750 *** Quarterly Difference
Alberta
l.Rnrg -2.016 -8.898 *** 41.704 *** Quarterly Difference
unemp.rate -3.157 -7.983 *** 66.595 *** Quarterly Difference
F.rate -2.482 -4.638 *** 68.770 *** Quarterly Difference
S.rate -3.263 * -7.348 *** 43.650 *** Quarterly Difference
Ontario
l.Rnrg -1.946 -8.976 *** 40.970 *** Quarterly Difference
unemp.rate -3.855 ** -5.455 *** 17.820 *** Stationary
F.rate -2.716 -4.184 *** 19.788 *** Quarterly Difference
S.rate -2.760 -5.683 *** 38.785 *** Quarterly Difference
Notes:
Significance Levels: * 10%, **5%, ***1%
Tstat: π1 Tstat: π2 Fstat: π3,π4
H0: πi =0 (Unit Root) HA: πi ≠ 0 (No Unit Root)
N = 144, Intercept, Trend, Seasonal Dummies
HEGY Test, Differenced α=5%
HEGY Coef T-Stats: Conclusion:
Canada
D_l.Rnrg -6.795 *** -8.449 *** 40.061 *** Stationary
unemp.rate
D_F.rate -6.024 *** -4.506 *** 22.700 *** Stationary
D_S.rate -6.127 *** -4.245 *** 21.349 *** Stationary
Alberta
D_l.Rnrg -6.794 *** -8.357 *** 39.990 *** Stationary
D_unemp.rate -3.990 *** -5.343 *** 25.082 *** Stationary
D_F.rate -5.114 *** -4.651 *** 34.210 *** Stationary
D_S.rate -6.465 *** -5.778 *** 31.890 *** Stationary
Ontario
D_l.Rnrg -6.789 *** -8.438 *** 39.946 *** Stationary
unemp.rate
D_F.rate -5.987 *** -4.313 *** 20.757 *** Stationary
D_S.rate -6.578 *** -4.358 *** 17.510 *** Stationary
Notes:
N = 144, Intercept, No Trend, Seasonal Dummies
Significance Levels: * 10%, **5%, ***1%
-
-
Tstat: π1 Tstat: π2 Fstat: π3,π4
H0: πi =0 (Unit Root) HA: πi ≠ 0 (No Unit Root)
CV 1% CV 5% CV 10% CV 1% CV 5% CV 10%
π1 -4.15 -3.52 -3.21 -3.56 -2.94 -2.62
π2 -3.57 -2.93 -2.61 -3.49 -2.9 -2.59
π3,π4 8.77 6.62 5.55 8.92 6.63 5.56
Seasonal, Intercept, Trend, T=136 Seasonal, Intercept, No Trend, T=136
HEGY Selected Citical Values
22
deterministic variables such as the constant, trend and seasonal dummies. In functional form
our VAR takes the following form:
𝑌𝑡 = 𝑋𝑡 𝛽0 + ∑ 𝑌𝑡−𝑖 𝛽1,𝑖
𝑃
𝑖=1
+ 𝜀
(6)
Where Yt-i from 0 ... P is a (1 X 4) vector lagged P periods. Xt is a (1 X 5) vector of deterministic
regressors including a constant, trend and seasonal dummies, 𝜀 is a (1 X 4) vector of residuals,
lastly β0, (5 X 4) and β1 (4 X 4) are matrices of coefficients.
The next step is to build a VAR model, each of our four series will be included in
the VAR in their stationary form, and thus it becomes a process of choosing an appropriate
maximum lag length ‘P’ through a process of choosing the model with the smallest information
criterion, while jointly ensuring no serial correlation amongst the residuals. In selecting a
model, we test for a range of possible maximum lags from one to twelve. From these tests we
begin with the lag length as chosen by the Schwarz criterion (SC), From this starting point the
lag length is increased until either (A) the inverse roots of the characteristic polynomial for the
model’s lag structure are no longer within the unit circle, that meaning the model is
dynamically unstable; or preferably (B) until we are no longer able to reject the null of serial
correlation by the Breusch-Godfrey test. In this way we are able to select the model with the
lowest SC with no serial-correlation in the residuals. In our case, across all models, the SC has
been minimized with no serial-correlation in the residuals at a lag length in which all inverse
roots are still well within the unit circle which has resulted in a lag length of 3 for Canada and
Ontario, and a lag length of 2 for Alberta.
23
Figure 4
Table 6
Differenced
Series over Min Mean Max
Standard
Deviation
D_Rnrg -0.496 -0.003 0.324 0.127
unemp.rate 0.055 0.084 0.135 0.017
D_f.rate -0.078 0.000 0.075 0.031
D_s.rate -0.006 0.000 0.006 0.002
Summary Statistics: Canada 1979:Q1 - 2015:Q4
24
Figure 5
Table 7
Differenced
Series over
time:
Min Mean Max
Standard
Deviation
D_Rnrg -0.501 -0.003 0.321 0.126
D_unemp.rate -0.017 0.000 0.024 0.007
D_f.rate -0.139 -0.001 0.189 0.055
D_s.rate -0.007 0.000 0.006 0.003
Summary Statistics: Alberta 1979:Q1 - 2015:Q4
25
Figure 6
Table 8
Differenced
Series over
time:
Min Mean Max
Standard
Deviation
D_Rnrg -0.497 -0.003 0.325 0.127
unemp.rate 0.046 0.076 0.125 0.016
D_f.rate -0.094 0.000 0.082 0.033
D_s.rate -0.008 0.000 0.007 0.003
Summary Statistics: Ontario 1979:Q1 - 2015:Q4
26
With the VAR model identified, we can test under the VAR frame work for the existence
of co-integration between our series, where in order for a group of series to be seasonally co-
integrated they must have a unit root at the same frequency. Thus, depending on the region,
there may be co-integration between all variables, or alternatively, all but the unemployment
rate. Using the Johansen method to test for co-integration in the VAR framework, we find no
co-integration between any of these series, the results of this test for each region can be found
in tables 9-11.
With the VAR model now fully specified we can now continue by discussing the role of a
VSTAR model before moving on to test for linearity against a STAR alternative. For reference
the impulse response functions from the above specified linear VAR models are available in the
appendix to refer to the ones to be later constructed with the VSTAR model.
The VSTAR model allows for a modeling processes which spans from a linear VAR to a
discrete Threshold VAR (TVAR) where all parameters are dependent upon the regime in which
the model finds itself in given a threshold or switching parameter. In a TVAR the model has the
same amount of states as regimes, that is if a given observation is above a certain threshold
then the threshold component of the model is activated (multiplied by 1) alternatively if a given
observation is below a certain threshold then the threshold component of the model is not
activated (multiplied by 0). A VSTAR model responds extremely similarly in the fact that there
are a fixed number of regimes in which the model switches between, but a VSTAR is different in
that there are an infinite number of states in which the model could be in between regimes.
Thus the key for the VSTAR model is the transition function which controls the rate at which the
27
Table 9
Table 10
Test Stat CV 10%
r ≤ 0 25.75 29.12
r ≤ 1 10.90 23.11
r ≤ 2 7.09 16.85
r ≤ 3 6.50 10.49
Test Stat CV 10%
r ≤ 0 50.24 59.14
r ≤ 1 24.49 39.06
r ≤ 2 13.59 22.76
r ≤ 3 6.50 10.49
Notes:
Lag Length = 4, Including Intercept, Trend and Seasonal Dummies
Fail to reject null, no cointegrating vectors
Conclusion:
HA: r > r₀H₀: r ≤ r₀
"r" represents potential number of co-integrating vectors
"
Fail to reject null, no cointegrating vectors
Conclusion:
Trace Test
Max Eigenvalue
H₀: r ≤ r₀ HA: r=r₀+1
Johansen test for co-integration (Canada)
"
"
"
"
"
Test Stat CV 10%
r ≤ 0 21.62 29.12
r ≤ 1 17.03 23.11
r ≤ 2 10.05 16.85
r ≤ 3 6.61 10.49
Test Stat CV 10%
r ≤ 0 55.32 59.14
r ≤ 1 33.70 39.06
r ≤ 2 16.66 22.76
r ≤ 3 6.61 10.49
Notes:
Lag Length = 3, Including Intercept, Trend and Seasonal Dummies
Fail to reject null, no cointegrating vectors
"
"
"
"r" represents potential number of co-integrating vectors
"
"
"
Trace Test
H₀: r ≤ r₀ HA: r > r₀
Conclusion:
Johansen test for co-integration (Alberta)
Max Eigenvalue
H₀: r ≤ r₀ HA: r=r₀+1
Conclusion:
Fail to reject null, no cointegrating vectors
28
Table 11
model transitions between regimes as opposed to the TVAR model which discretely jumps
between regimes. Typically, this transition function takes the form of a logistic function, in
which case the model is referred to as an LSTAR model, which allows for a smooth transition
between 0 and 1 with an infinite number of states occurring between the two regimes.
Alternatively, the transition function can take the form of an exponential function, in which
case the response is symmetric around the threshold, and again allows for an infinite number of
states between the regimes. The graphical representations of both LSTAR and ESTAR transition
functions are presented below in figure 7.
Test Stat CV 10%
r ≤ 0 22.81 29.12
r ≤ 1 16.11 23.11
r ≤ 2 10.37 16.85
r ≤ 3 4.02 10.49
Test Stat CV 10%
r ≤ 0 53.31 59.14
r ≤ 1 30.50 39.06
r ≤ 2 14.39 22.76
r ≤ 3 4.02 10.49
Lag Length = 4, Including Intercept, Trend and Seasonal Dummies
Fail to reject null, no cointegrating vectors
"
"
"
"r" represents potential number of co-integrating vectors
Notes:
"
"
Trace Test
H₀: r ≤ r₀ HA: r > r₀
Conclusion:
Max Eigenvalue
H₀: r ≤ r₀ HA: r=r₀+1
Conclusion:
Fail to reject null, no cointegrating vectors
"
Johansen test for co-integration (Ontario)
29
Functionally the LSTAR and ESTAR models contain the same variables:
𝐿𝑆𝑇𝐴𝑅: 𝐺(𝑆𝑡; 𝛾, 𝑐) =
1
(1 + 𝑒−𝛾(𝑆 𝑡−𝑑−𝐶))
(7)
𝐸𝑆𝑇𝐴𝑅: 𝐸(𝑆𝑡; 𝛾, 𝑐) = 1 − 𝑒−𝛾(𝑆 𝑡−𝑑−𝐶)2
(8)
where in both equations (7), LSTAR, and (8), ESTAR, γ is a parameter which controls the speed
at which each respective function transitions between regimes. In the case of an LSTAR as γ
approaches 0, G(St; γ, c) collapses to a value of 0.5, leaving us with a linear model; and as γ
approaches ∞, G(St; γ, c) discretely jumps between regimes, in essence becoming a threshold
model with two regimes. Alternatively, in the case of an ESTAR, E(St; γ, c) collapses to a linear
model when γ approaches either 0 or ∞.
In each case St-d is a switching variable which is the variable that triggers the change
between regimes. St-d can be an endogenous variable in which case d, the delay factor is
between 1, and the maximum lag length chosen. Alternatively, St-d may be an exogenous factor
such a time trend allowing the model to react differently as it moves through time. In the case
of an LSTAR, G(St; γ, c) approaches 0 and 1 as St-d approaches -∞ and ∞ respectively. For an
ESTAR, E(St;γ,c) approaches 1 as St-d approaches either ± ∞ and approaches 0 as St-d
approaches c, the threshold. In our case the switching variable, St-d, is a lagged value of the
difference of the log of the real energy index, while the threshold, c, and γ are estimated for
each equation.
30
Figure 7
In the case of our VAR, any given equation can be viewed as:
𝑦 𝑘,𝑡 = 𝑋𝑡 𝛽0 + ∑ ∑ 𝑦 𝑘,𝑡−𝑗 𝛽 𝑘,𝑡−𝑖 + 𝜀𝑖
𝑝
𝑖=1
4
𝑘=1
(9)
Where ykt is the dependent variable for equation k, for k in 1 to 4, Xt is a (1 x 5) vector of
deterministic variables including an intercept, trend and seasonal dummy variables, yk,t-i is the
lagged value for each of our 4 series from i to P, finally β is the coefficient for each respective
variable. Extending this model to a STAR involves the addition of a given transition function to
be multiplied by our right hand side, the result would be an equation as can be seen below.
31
𝑦𝑖,𝑡 = ( 𝑋𝑡 𝛽0 + ∑ ∑ 𝑦𝑖,𝑡−𝑗 𝛽𝑖,𝑡−𝑗
𝑝
𝑗=1
4
𝑖=1
) + ( 𝑋𝑡 𝜃0 + ∑ ∑ 𝑦𝑖,𝑡−𝑗 𝜃𝑖,𝑡−𝑗
𝑝
𝑗=1
4
𝑖=1
) ∗ 𝑓(𝑆𝑖,𝑡−𝑑; 𝛾𝑖, 𝑐𝑖) + 𝜀𝑖
(10)
Thus in each equation, all terms enter in linearly as well as being multiplied by the transition
function which is bounded between 0 and 1 and allows the model to react differently as shocks
push the model into various states between the regimes. Particularly, the transition function
completely alters the model based on where the transition function falls on the continuum
from 0 to 1. Specifically, for each of the infinite possible states there are different coefficient
values for the intercept, trend, seasonal effects, as well as the coefficients on each of the
variables as each has been multiplied by the respective value of the transition function. Such a
model allows for an extremely flexible modeling process which allows these parameters to
change based off of where a switching variable ‘St-d’ finds itself in relation to the threshold.
With the purpose and functionality of the VSTAR model laid out, we can now begin the
modeling process as proposed by Teräsvirta and Yang (2014). This modeling process as
previously eluded to is outlined below: 37
1. Estimating a linear stationary VAR model.
2. Testing the linear VAR against an LSTAR alternative.
a. This implies selecting the transition variable(s) and delay factors (St-d)
3. If linearity is rejected, estimating the VSTAR model by non-linear least squares
4. Evaluation of the model through misspecification tests for
37
Teräsvirta and Yang, 2014, 7-8.
32
a. Serial correlation
b. Dynamic instability.
With the Linear VAR identified, the next step is to test the null of linearity against an LSTAR
alternative. This can be done equation be equation, in order to allow each equation to have a
separate transition function, or alternatively, enter linearly into the VSTAR model.38
Recalling the transition function G(St;γ,c) which collapsed to a linear model as γ
approached zero, the test for linearity against a STAR alternative should be as simple as testing
H0: γ=0 for each of the k equations. Unfortunately, this testing procedure is complicated by the
presence of unidentified nuisance parameters.39 The solution as proposed by Luukkonen,
Saikkonen and Teräsvirta (1988) is to replace the transition function G(St;γ,c) with a suitable
Taylor series approximation around γ=0.40 Through this approach there is no longer an
identification problem, and linearity can be tested by means of a Lagrange Multiplier test
whose statistic has a standard χ2 asymptotic distribution under the null.41 Where a 3rd order
Taylor series approximation is recommended42, any given equation in (10) can be expressed as:
𝑦 𝑘𝑡 = 𝑧𝑡 𝛽0 + 𝑧𝑡 𝑠𝑡−𝑑 𝛽1 + 𝑧𝑡 𝑠𝑡−𝑑
2
𝛽2 + 𝑧𝑡 𝑠𝑡−𝑑
3
𝛽3 + 𝑒𝑡 (11)
where ykt is a given dependent variable for the kth equation, Zt is a (1 x (5+kp)) vector of all
regressors including deterministic variables and lagged dependent variables; and finally st-d is
38
Teräsvirta and Yang, 2014, 7-8.
39
Van Dijk, Teräsvirta and Franses, 2002 ,10.
40
Luukkonen, Saikkonen and Teräsvirta, 1988, 494.
41
Van Dijk, Teräsvirta and Franses, 2002,11.
42
Van Dijk, Teräsvirta and Franses, 2002,11.
33
the switching variable for d from 0 to p. As such the null of linearity that γ=0 can be tested as
H0
’’: β1= β2= β3=0, and the test statistic is denoted as LM3 which has a standard χ2 asymptotic
distribution under the null. Where this LM3 statistic is calculated for all possible delay factors on
St-d where d can be between 1 and the maximum lag length, p, the choice of ‘d’ is the resulting
LM3 statistic which is most significant. 43
If linearity is rejected in favour of a STAR alternative, the following auxiliary regressions
based off the Taylor series approximation in (11) and series of tests are proposed to
differentiate between an ESTAR and LSTAR model. 44
𝐻01: 𝛽3 = 0
𝐻02: 𝛽1 = 𝛽2 = 0 | 𝛽3 = 0
𝐻03: 𝛽1 = 0 | 𝛽2 = 𝛽3 = 0
Where the notation for H02 and likewise H03 can be thought of as a restriction of the Taylor
series approximation in (11), that is for H02 we are testing that β1 and β2 are jointly zero given
that β3 is restricted to be zero. If H02 is the most significant of the three nulls, then the model is
ESTAR over LSTAR45, again this test can be carried out in the same fashion as the test for
linearity with a LM test whose statistic again has a standard χ2 asymptotic distribution under
the null. Of important note, as has been shown and referenced by Teräsvirta (1994), these
above tests can also be carried out as F-tests, where often, the F variant may be preferred. The
43
Teräsvirta, 1994, 211.
44
Teräsvirta, 1994, 211.
45
Teräsvirta, 1994, 212.
34
reason for this preference is that the χ2 version has been found to be over sized in cases of a
large maximum lag length, and short time series.46 In our case however, we are dealing with a
time series of sufficient length, and as will shortly be discussed, a short maximum lag length.
Thus the LM statistic is utilized with extra attention being applied to threshold results.
The tests for linearity are conducted equation by equation47 for each of the regions, for
an array of lag lengths and delay values. In each equation, the rejection of linearity is
dependent on the lag length chosen, typically we are more likely to reject linearity as the lag
length increases, as well these results are sensitive to the region, with some regions more
readily rejecting linearity than others. However, the final lag length is not determined until a
later step, to be parsimonious, the final test results are displayed below in Table 1248 for a lag
length of 2 for the provinces and 3 for Canada, which were the final selected maximum lag
lengths for the respective regions. As can be seen, in all cases the difference of the log of the
real energy index adjusts through an LSTAR process around itself. Alternatively, unemployment
generally adjusts linearly around the energy index, while the job finding rate is generally an
ESTAR process and separation rates a LSTAR, but dependent on the region.
46
Teräsvirta, 1994, 210.
47
Teräsvirta and Yang, 2014, 7.
48
Given the number of tests involved for each of these results, the tests themselves have been omitted to
conserve space, but can be made available upon request.
35
Table 12
With the functional form of each equation now determined, we move on to the process
of estimating the parameters for the STAR model in each region. This process is performed as
outlined in Teräsvirta and Yang (2014). Using non-linear least squares equation by equation we
estimate the starting values for γ and c. However, as non-linear least squares can be sensitive to
the starting values provided, and furthermore can be computationally intensive if many
parameters are in need of being estimated, the following method is utilized. First a grid of
potential values is created for γ and c, for each fixed initial value of γ0 and c0, β0 can then be
estimated by a linear regression, where β is all other coefficients. Then, with β0 estimated,
these values of β0 are then fixed and γ1 and c1 are then estimated using non-linear least
squares, with the starting values for γ1 and c1, being the initial grid values of γ0 and c0, where
this process of recursively estimating γi, ci and βi is continued until the values of the parameters
converge between estimation, that is the difference between γi, ci and γi-1, c i-1 is below a given
tolerance. This whole process is then repeated for each value in the grid with the final
Transition
Function
Delay Factor
Transition
Function
Delay Factor
Transition
Function
Delay Factor
D_l.Rnrg LSTAR 1 LSTAR 1 LSTAR 2
unemp.rate LSTAR 1 Linear - Linear -
D_f.rate ESTAR 3 Linear - ESTAR 2
D_s.rate LSTAR 3 LSTAR 2 Linear -
Resulting Transition Functions and Delay Factors from Linearity Test
Dependent Variable
The unemployment rate is not consistently first differenced across regions, thus the
dependent variable enters as specified following the HEGY test. Notation above is in
levels as this is the case for 2/3 regions. This notation carries on going forward
Notes:
Canada Alberta Ontario
36
estimates of γ and c being chosen by the values which return the lowest sum of squared
residuals for the equation. 49
After each equation is estimated individually, each equation is then combined in a
system of equations, and using Seemingly Unrelated Regressions model (SUR) we estimate this
system of four equations as a whole to obtain our final parameter estimates50, the resulting
values of γk, ck as well as the corresponding graphical representation of the transition function
by equation and region can be found for each region in figures 8-10 as well as the transition and
threshold estimates for each equation and region in table 13.
Table 13
Of particular note with the transition functions as displayed is the speed of transition
between regimes. For Canada we witness an array of speeds and transition functions, the
difference of the log of the real energy index has a slow transition between regimes and given
49
Teräsvirta and Yang, 2014, 10.
50
Given the number of parameters estimated in this model they are not listed in this essay in order to conserve
space, however they can be made available upon request.
Equation by Dependent
Variable: γ c γ c γ c
D_L.Rnrg 4.759 -0.053 1399.775 -0.010 22.609 -0.077
SE 0.256 0.006 22507.349 0.007 13.158 0.027
Unemp.rate 51.936 0.043
SE 22.162 0.011
D_F.rate 25.735 -0.203 268.488 0.079
SE 9.188 0.033 61.899 0.007
D_S.rate 4976.455 0.074 68.835 0.029
SE 16405.120 0.002 37.533 0.010
Notes:
Linear
Linear
Linear
Estimated coeficients for transition variable, γ, and threshold, c
Canada Alberta Ontario
Standard Errors in italics
Linear
37
the time period we have no data point ever actually hits the high or low regime. Conversely the
unemployment rate and job separation rate adjust rapidly between regimes, especially in the
case of the separation rate which has a near discrete jump. Finally, the job finding rate adjusts
through a near symmetric ESTAR process around a threshold of -0.2 giving the threshold the
approximate interpretation of a 20% decrease in the index. This extreme threshold value
however allows the ESTAR to approximate an LSTAR in cases when the change in the index is
Figure 8
38
Figure 9
39
Figure 10
greater than approximately -20%, while at the same time, models that extreme changes in the
index which are greatly less that -20% respond with states, and ultimately a regime which is
similar to large increases in the index.
Looking at the resulting VSTAR estimates for γ and c, as well as the transition functions
for Alberta and Ontario also give us an insight as to how we may expect these models to react
in the case of an energy price shock in each respective region. For example, in Alberta, both
non-linear equations, the difference of the log of the real energy index as well as the job
separation rate adjust fairly rapidly around their given threshold, meaning any shock which
causes a jump around this threshold will have a drastic effect on the model as it could push the
model entirely from one regime to the next. Conversely Ontario’s difference of the log of the
40
real energy index adjusts extremely slowly between the two regimes, and thus any shock to the
price index will likely not cause the model to switch regimes, but just move along the
continuum of states. Finally, is the job finding rate in Ontario which, like Canada, adjusts
through an ESTAR process, the difference in the Ontario case the speed at which this function
transition between regimes, specifically here it only takes about a 10% change in the index from
the threshold value to jump regimes.
Although our results, and discussion so far have centred around the situation where we
have a STAR(2,3) model, this distinction has not yet been made in the modeling process. With a
STAR model estimated we now need to subject each model to specification tests to select the
maximum, lag length, ensure dynamic stability and no serial correlation.
In each case the lag length is chosen by the SC, and in each case a maximum lag-length
of 1 is selected. However, as with the VAR1 model, this results in a model with serial correlation.
Thus following the method used with the linear VAR model, lag length is gradually increased
until serial correlation is eliminated such that the model remains stable. As for stability, in the
case of a VAR model, this is determined through ensuring the inverse roots of the VAR process
remain inside the unit circle. Teräsvirta and Yang (2014) point out, this would be a naïve
approach for a VSTAR model, and instead stability can be tested through an impulse response
function, by ensuring that the system converges to zero.51,52
51
Teräsvirta and Yang, 2014, 13.
52
Van Dijk, Teräsvirta and Franses, 2002, 22.
41
Through these specification tests, we arrive at a lag length of 3 for Canada, and 2 for
both provinces, such that this lag length eliminates serial correlation, while providing a stable
system. In all cases, any longer of lag length yields explosive results when shocked. The results
of the Breusch-Godfrey test for serial correlation, as well as the information criteria and Mean
Squared Error (MSE) for the STAR and VAR model are displayed below in table 13
Table 14
With the models estimated, checked for serial correlation, the next step is to ensure
stability of the model. That is, to ensure that the model does not explode when a shock is
applied to it. The test for stability is conducted using Impulse Response Functions (IRFs) to
ensure that our model converges to zero after a shock. These IRFs are calculated through a dual
H period dynamic forecast, first we dynamically forecast H periods ahead from the mean value
of the variables with the STAR model, this becomes the control case. The second step is to
VAR3 STAR3 VAR2 STAR2 VAR3 STAR2
Schwarz Criterion (SC) -3573.48 -3218.02 -3092.66 -2990.45 -3264.42 -3201.83
Akaike Information Criterion (AIC) -3874.05 -3854.01 -3363.17 -3374.40 -3604.19 -3585.77
Mean Square Error (MSE) 0.0131 0.0102 0.0147 0.0133 0.0137 0.0129
Equation by Dependent
Variable: VAR3 STAR3 VAR2 STAR2 VAR3 STAR2
D_L.Rnrg 0.21 0.39 0.68 0.68 0.21 0.44
Unemp.rate 0.52 0.45 0.93 0.96 0.43 0.77
D_F.rate 0.70 0.70 0.59 0.55 0.37 0.08
D_S.rate 0.92 0.94 0.88 0.61 0.90 0.67
Notes:
Canada Alberta Ontario
Information Critera and MSE for VAR and VSTAR Models by Region
P-Values
Breusch-Godfrey test for Serial correlation of residuals
H0: No serial correlation up to p+1, HA: Serial correlation, α=5%
Canada Alberta Ontario
42
repeat the above dynamic H period forecast, except this time shocking the forecast with a
single period shock of the real energy index, this shock value takes the value of ± 1 and 2
standard deviations of the real energy index variable, translating to approximately a 13% and
26% change in the index in the shocked period.
The next step is to then estimate the confidence intervals for these IRFs, this is done
following the 5 step bootstrap method as proposed by Benkwitz, Lutkepohl and Wolters (2001).
First the model itself is estimated. Second, with no serial correlation of the residuals, we
generate bootstrapped residuals by randomly drawing with replacement from the set of
estimated and re-centered residuals. Third, we generate values of Y* by predicting values using
the original model and bootstrapped residuals. Fourth, we re-estimate the model, obtaining
new parameter estimates from the generated data Y*. Finally, we calculate the bootstrapped
version of the statistic of interest (IRF) based on the parameter estimates in the fourth step. 53
Through this process we obtain an IRF for the STAR models with a confidence interval
around the point estimate. Given the noise associated with a VAR let alone the further loss of
efficiency in estimating the effect of the transition function on all variables, the resultant IRF
confidence interval for the STAR is very large resulting in insignificant effects from all shocks at
a standard 90% or 95% confidence interval. As a result, in order to demonstrate the general
path of the point estimate as well as to portray an understanding of the associated variability,
these IRFS are presented along with an one standard deviation confidence interval of the
estimate at each realization.
53
Benkwitz, Lutkepohl and Wolters 2001, 84.
43
4. Discussion of Results
To bring the discussion back to the question at hand after dealing with the
methodology, the question of study is how do shocks in the price of energy effect labour flows
in Canada, Alberta, and Ontario. Specifically, we looking for the degree of asymmetry, if any,
between positive and negative price shocks, as well as evaluating why there has been a change
in the unemployment rate through observing the changes to the job finding and separation
rates. Following Davis and Haltiwanger (2001), we are specifically looking to see if
unemployment rates are effected through aggregate channels, being the typical macro analysis,
or allocative channels referring to the impact of energy shocks in disrupting the match between
capital and labour.54
The evaluation of the results will be done region by region, starting first with Canada
before moving on to Alberta and finishing with Ontario. For each region a positive and negative
shock was computed for one and two standard deviations of the history of the difference of the
log of the real energy index, this translates into approximately a ±13% and ±26% shock to the
energy price index in a given period. For each of the IRFs a positive energy price shock is
denoted by a blue line and confidence interval, where a negative energy price shock is denoted
by a red line and confidence interval. Additionally, the IRFs for the labour flows which have
been differenced to be made stationary, a cumulative effect IRF is shown in order to
demonstrate how a given shock would impact the rate. Specifically, that is a cumulative IRF is
used for all job finding and separation rates as well as the unemployment rate in Alberta.55
54
Davis and Haltiwanger, 2001, 468.
55
The IRFs for these variables without the cumulative effect can be found in the appendix for reference.
44
For Canada, the resulting IRFs are displayed in figures 11-18, In general we find that
unemployment reacts asymmetrically to shocks in the price of energy with negative shocks
having a greater effect than positive ones. Furthermore, as can be seen in comparing the
difference between a one and two standard deviation shock, the effect is just over doubled as
the magnitude of the shock doubles. Specifically, following a -13% shock to the energy index
the national unemployment rate increases by just over 0.20% points, this effect peaks
approximately a year after the shock hits the system and is sustained for about two years
following the shock before gradually diminishing. Mean while, following a -26% shock to the
energy index, the national unemployment rate increases rapidly, peaking again one year after
the shock at almost a 0.45% point increase in the unemployment rate, where again this effect is
sustained for about two years following the shock before gradually diminishing. Conversely
following a positive shock of +13% to the energy index, we witness the unemployment
temporarily decreasing by about 0.15% points which is maintained for about a year after the
shock, before completely being diminished. The impact of a +26% shock to the energy index has
a slightly larger effect, decreasing the unemployment rate by a maximum of about 0.2% points
for about a year following the shock before increasing the unemployment rate by about the
same amount before gradually diminishing. Importantly however, the effect of a positive shock
on unemployment rates is not significant at any point given our one standard deviation
confidence interval. Given the strong asymmetry in unemployment rates, even at a one
standard deviation shock, this seems to hint towards national unemployment rates being
45
impacted due to these changes causing a mismatch in optimal levels of capital and labour, and
thus through allocative channels.56
56
Davis and Haltiwanger, 2001, 468.
Figure 11
46
Figure 12
47
Figure 13
48
Figure 14
Moving on to evaluating the job finding and separation rates, we further find evidence
that the national unemployment rate is primarily effected through allocative channels due to
energy price shocks, this is especially apparent for positive shocks, while negative shocks seem
to have little if any effect on the job separation rate. For a positive shock, it can be clearly seen
49
that both the job finding and separation rates initially spike in the 3rd quarter following a
positive energy shock, with by far the greater change happening in the job finding rate which
falls in line with the arguments made by Shimer (2012) 57 and the results of Ordonez et al.
(2010) in evaluating the same question for the US economy58
. Thus it seems clear that for
Canada on the national level, employment is primarily altered following an energy price shock,
especially a positive one, due to firms re-optimizing capital to labour ratios.
While positive shocks have very limited effects on the national unemployment rate as
compared to negative shocks, there is still spikes in finding and separation rates, thus it would
appear that such positive shocks result in a lot of movement between industries or sectors,
however at this point this is clearly conjecture and an area for further study.
Conversely negative energy price shocks appear to have a large impact on both the
unemployment rate and job finding rate, but very little if any impact on the job separation rate.
This result seems to suggest that the primary cause for the increasing unemployment rates
following a negative energy price shock is not due to workers being separated from their
employment at higher rates, but rather suggests a greater difficulty for the unemployed to find
work.
57
Shimer, 2012, 127.
58
Ordonez, et al, 2010, 92.
50
Figure 15
51
Figure 16
52
Figure 17
53
Figure 18
For Alberta, we find the resulting IRFs in figures 19-26. First, it is worth recalling that
Alberta was the only region in which the unemployment rate was differenced in order to make
stationary, thus the IRF for the unemployment rate is not showing the time path of the
unemployment rate following a shock, but rather the cumulative effect of the quarterly
54
differences giving us an estimate of how the unemployment rate would adjust following a
shock. Aside from this distinction, it can be observed that Alberta actually tends to react
asymmetrically to energy price shocks, although not as asymmetrically as Canada, with negative
shocks having almost two times the effect on the change in unemployment rates compared to
positive ones. Thus although there is a level of asymmetry, given its less extreme nature, it is
difficult to make a judgement as to the channel by which employment is effected at this point.
Specifically, however, the impact of an approximate -13% energy price shock results in an
increase in the unemployment rate by 0.35% points within a year of the shock, where this
effect carries on eventually stabilizing at an increase in the unemployment rate of 0.5% points,
however this effect is no longer significant given our confidence intervals after 7 quarters. In
the case of an approximate -26% energy price shock, the impact on the Albertan
unemployment rate is an increase by about 0.75% points within a year of the shock, where
again this impact carries on and eventually stabilizes at a level which is about a 0.8% point
increase in the unemployment rate when compared to before the shock.
Looking at the impact of positive energy price shocks we see unemployment rates
following a similar time frame, but with smaller effects. In the case of an approximate +13%
shock to the energy price index, we witness that there is about a -0.3% point change in the
unemployment rate compared to pre-shock within just over a year of the energy price shock
before leveling out at a new unemployment rate which is approximately 0.2% points lower than
before the shock. Following an approximate +26% shock to the energy index the
55
Figure 19
56
Figure 20
57
Figure 21
58
Figure 22
59
Figure 23
60
Figure 24
61
Figure 25
62
Figure 26
unemployment rate decreases by almost 0.6% points within five quarters of the shock, before
leveling out at a new lower unemployment rate which is about 0.4% points lower than pre-
shock. The most obvious impact in the Albertan case regarding energy price shocks on
63
unemployment rates is the difference in the magnitude between positive and negative shocks,
with negative shocks having a much greater impact on unemployment rates.
Turning the attention then to the job finding and separation rates, we further find that
the job finding rate is the biggest mover, similar to what was found for the Canadian case.
Opposite of Canada however is the effect of an energy price shock on these rates, recall that in
the Canadian case, both rates tended to move together in same direction implying that
employment adjusted through allocative channels. Meanwhile in the Albertan case, the job
finding and separation rates clearly diverge, moving in opposite directions following a shock
which is indicative that changes in employment in Alberta around energy shocks are primarily
due to aggregate channels, that being firms changing their demand for factors of production as
the economy moves into either an inflationary or a recessionary output gap.
Finally, the results for Ontario, where the corresponding IRFs can be found in figures 27-
34. Ontario provides results which we found unexpected and which are almost a hybrid
between the results found for Canada and Alberta. Starting with unemployment rates, it can be
seen that the unemployment rate follows a fairly symmetric adjustment process, however
under the larger two standard deviation shock, a positive shock has a slightly larger effect. Thus
from looking at the effect on unemployment rates it would appear as if Ontario is following a
similar path as Alberta. Specifically, following an approximate -13% shock to the real energy
price index we witness the unemployment rate in Ontario peaking at just over a 0.1% point
increase about a year after the shock before gradually returning to zero, with the impact having
virtually disappeared within two years of the shock. Under an approximate -26% shock to the
64
real energy price, we witness an almost identical time path, peaking at just under a 0.25% point
increase in unemployment rates a year after the shock before diminishing to zero, with no real
impact lasting after about two years. In both the Canadian and Albertan case, negative shocks
had a larger effect on the unemployment rate, in Ontario we witness the opposite, where
positive energy shocks have a slightly greater impact on the unemployment rate. Specifically, an
approximate +13% shock to the real energy index translates to about a 0.13% point decrease in
the Ontario unemployment rate, peaking about a year after the shock before very gradually
diminishing, reaching no effect with our confidence interval within two years of the shock.
Following an approximate +26% shock to the real energy index we witness the unemployment
rate dropping by over 0.25% points peaking in the fifth quarter following the shock before
diminishing over the next five years. While in this latter case the impact of the energy price
shock on the unemployment rate does not fully diminish to zero within our confidence interval
over the 5 years displayed, as it takes a full 9 years for this effect to no longer be significant
given our interval, however the magnitude of the impact after 5 years is negligible.
When evaluating the job finding and separation rates however, we see that in fact these rates
again generally move together, as was found for Canada. That is, that this strongly seems to
suggest that changes in employment in Ontario following an energy price shock adjust through
allocative channels, disrupting the optimal capital to labour ratios, however given that
unemployment rates react fairly symmetrically to both positive and negative shocks, it would
also appear that aggregate channels may play an important role in determining employment in
Ontario.
65
Figure 27
66
Figure 28
67
Figure 29
68
Figure 30
The area that we found most surprising with Ontario however is the rough symmetry in
unemployment rates, with positive shocks having a slightly larger impact which is the opposite
of Canada and Alberta. As Ontario’s industry make-up is heavy in manufacturing, we initially
expected a positive energy price shock to have little effect, if not increase unemployment rates
69
due to the flow through provided by Cox and Harvie (2010) following a positive oil price shock.
specifically, we would expect following a positive energy price shock that manufacturing firms,
which are assumed to be capital intensive, begin to face higher capital utilization costs and
unfavourable exchange rates, that this would filter through to see the unemployment rate in
Ontario being negatively impacted. Interestingly however, unemployment rates actually
decrease in light of higher energy prices. This impact could be due to either (a) Ontario’s
manufacturing sector supporting Alberta’s Oil and Gas sector, and thus despite the rise in costs,
Ontario’s manufacturing firms also see increased demand. Another possibility linked to (a) is
that despite the unfavourable exchange rate, higher energy prices are typically related to a
strong US economy and thus due to increased American demand the manufacturing industry in
Ontario still remains strong. Alternatively, (b) capital and labour may be close substitutes in
many of these firms, thus as capital utilization costs increase, firms are able to shift their
production process from capital intensive to labour intensive methods. Although it is unlikely
that the manufacturing production process is flexible enough that capital and labour can be so
readily substituted in the short run. The final possibility, which may be the most likely, (c) is that
the true data generating process for Ontario has a longer lag length than we are able to model.
The reason for the suspicion brought up in (c) is that we are only weakly failing to reject no
serial correlation for this model, meaning that if stability was not an issue, I would much rather
model this process with a longer maximum lag length. Additionally, as our rejection of linearity
has been dependent on lag length, it may be that more variables are found to adjust non-
linearly with a longer lag length chosen which may drastically change the model.
70
Figure 31
71
Figure 32
72
Figure 33
73
Figure 34
5. Conclusions
Although the above results differ as much as the regions they explain, the common
aspects echo and add to previous studies in the US. That is, the job finding rate in all regions is
impacted by a far greater magnitude than the separation rate following an energy price shock,
74
leading to a conclusion which is similar to that of Shimer and Ordonez et al. that changes in job
finding rates appear to account for the majority of changes in the unemployment rate. Further,
following Hamilton, as well as Davis and Haltiwanger, there is evidence that labour flows adjust
non-linearly, and asymmetrically to energy price shocks, however this result is sensitive to the
region evaluated, as the level of asymmetry is clearly greater in some regions over others. As
for Canadian specific results, following this analysis, it seems that Canada and Alberta are far
more sensitive to negative shocks than positive ones regardless of magnitude, where negative
shocks have a far greater adverse effect on unemployment rates. Ontario on the other hand has
a slightly greater beneficial effect following a positive energy shock over a negative, although
both effects are nearly symmetrical.
Thus is seems that generally, with the exception of Ontario, that labour flows are
impacted by decreasing energy prices more than they are by increasing ones. Further it seems
split depending on region as to through which channel employment is impacted following
shocks to the energy price, but that for Canada on whole, it is clear that changes are due to
allocative changes between firms capital and labour mix following a shock, while in Alberta,
changes in labour flows are distinctly through aggregate channels, while Ontario seems to be
impacted by both, with the effect of allocative channels being very clear in the job finding and
separation rates, while aggregate channels can be seen in the fairly symmetric unemployment
response.
As was mentioned through out the essay there are many areas for further research to
be done on this topic for the Canadian case. First would be to extend this analysis to the rest of
75
the provinces to provide a distinctive understanding as to how each province is impacted.
Second would be to repeat the above with a measure to control for migration between
provinces, as presently the results will be affected by this as capital and labour migrate to areas
with work from areas without work following energy price shocks. Third, this process may be
repeated using different modelling techniques to capture the non-linear relationship which may
be able to overcome the issues of serial correlation and stability which may be effecting the
Ontario case. Finally, although not an exhaustive list, this process could be modelled in relation
to the broader macro-economic environment, that is through including variables for regional
price level and real GDP to model not only how labour flows are impacted following an energy
price shock but also how the whole economy adjusts following such a shock under the AD-AS
frame work.
76
References
Benkwitz, Alexander, Helmut Lutkepohl, and Jurgen Wolters. "Comparison of bootstrap
confidence intervals for impulse resonses of German monetary systems."
Macroeconomic Dynamics 5 (2001): 81-100.
Canty, Angelo, and Brian Ripley. "boot: Bootstrap R (S-Plus) Functions." 2016.
Cox, Grant M, and Charles Harvie. "Resource price turbulence and macroeconomic adjustment
for a resource exporter." Energy Economics 32 (2010): 469-489.
Davis, Steven J, and John Haltiwanger. "Sectorial job creation and destruction responses to oil
price changes." Journal of Monetary Economics 48 (2001): 465-512.
Engle, R F, S Hylleberg, C W J Granger, and B S YOO. "Seasonal Integration and Cointegration."
Journal of Econometrics, 1990: 215-238.
Fox, John, and Sanford Weisberg. An R Companion to Applied Regression. Second. Thousand
Oaks: Sage, 2011.
Grosjean, Philippe, and Frederic Ibanez. "pastecs: Package for Analysis of Space-Time Ecological
Series." 2014.
Hamilton, James D. "Nonlinearities and the Macroeconomic Effects of Oil Prices."
Macroeconomic Dynamics 15, no. 3 (2011): 364-378.
Hamilton, James D. "What is an oil shock?" Journal of Econometrics 113 (2003): 363-398.
Henningsen, Arne, and Jeff Hamann. "systemfit: A Package for Estimating Systems of
Simultaneous Equations in R." Journal of Statistical Software 23, no. 4 (2007): 1-40.
Hyndman, Rob, J. "forecast: Forecasting functions for time series and linear models." 2015.
Kilian, Lutz. "Oil Price Shocks: Causes and Consequences." Annual Review of Resource
Economics 6 (2014): 133-154.
Kilian, Lutz, and Robert J Vigfusson. "Nonlinearities in the Oil Price-Output relationship."
Working Paper, University of Michigan., 2010: 1-50.
Lian, An, Jin Xiaoze, and Ren Xiaomei. "Are the macroeconomic effects of oil price shock
symmetric?" Energy Economics 45 (2014): 217-228.
Luukkonen, Ritva, Pentti Saikkonen, and Terasvirta Timo. "Testing Linearity Against Smooth
Transition Autoregressive Models." Biometrika 75, no. 3 (1988): 491-499.
Ordonez , Javier, Hector Sala, and Jose l Silva. "Oil Price Shocks and Labor Market Fluctuations."
The Energy Journal 32, no. 3 (2011): 89-118.
77
Pfaff, Bernhard. "VAR, SVAR and SVEC Models: Implementation Within R Package vars." Journal
of Statistical Software 27, no. 4 (2008).
Pfaff, Bernhard. Analysis of Integrated and Cointegrated Time Series with R. New York: Springer,
2008.
Rmetrics core team, Diethelm Wuertz, Tobias Setz, and Yohan Chalabi. "timeSeries: Rmetrics -
Financial Time Series Objects." 2015.
Shimer, Robert. "Reassessing the ins and outs of unemployment." Review of Economic
Dynamics 15 (2012): 127-148.
Tatom, A John. "The Macroeconomic Effects of the Recent Fall in Oil Prices." Federal Reserve
Bank of St.Louis, 1987: 34-45.
Terasvirta, Timo. "Specification, Estimation, and Evaluation of Smooth Transition
Autoregressive Models." Journal of the American Statistical Association 89, no. 425
(1994): 208-219.
Terasvirta, Timo, and Yukai Yang. "Linearity and Missepcification Tests for Vector Smooth
Transition Regression Models." CREATES Research paper, 2015: 1-37.
Trapletti, Adrian, and Kurt Hornik. "tseries: Time Series Analysis and Computational Finance."
2015.
Uri, Noel D. "Crude oil price volatility and unemployment in the Unites States." Energy 21, no. 1
(1996): 29-38.
Van Dijk, Dick, Timo Terasvirta, and Philip Hans Franses. "Smooth Transition Autoregressive
Models -- A Survey of Recent Developments." Econometric Reviews 21, no. 1 (2002): 1-
47.
Wickham, Hadley. ggplot2: Elegant Graphics for Data Analysis. New York: Springer-Verlag,
2009.
Wickham, Hadley, and Romain Francois. "dplyr: A Grammar of Data Manipulation." 2015.
Wuertz, Diethelm. "fUnitRoots: Trends and Unit Roots." 2013.
Zeileiz, Achim, and Gabor Grothendieck. "zoo: S3 Infrastructure for Regular and Irregular Time
Series." Journal of Statistical Software 14, no. 6 (2005): 1-27.
Zmitrowicz, Konrad, and Mikael Khan. "Beyond the Unemployment Rate: Assessing Canadian
and U.S. Labour Markets Since the Great Recession." Bank of Canada Review, 2014: 42-
53.
78
Appendix: IRFs by Region for VAR
Canada
79
Alberta
80
Ontario
81
Appendix: Non-cumulative IRFs for differenced labour flows from VSTAR models
82
83
84
85
Appendix: R Code, Region: Canada
In regards to the code below: much of the code has been commented out, as many functions
and output take several hours to run the necessary loops, and thus the results were written to
drive and later re-read rather than re-running the entire code file. As a result, most commented
lines, (beginning with ‘#’) will need to have the # removed before running in full. Additionally,
beware of the effect of the text wrap, as some commented lines may have been wrapped when
imported.
#+eval=FALSE
#=== cda CASE
rm(list=ls())
setwd("C:/Users/keith/Google Drive/Essay/Oil/Data/subset/cda")
# install.packages('plyr')
# install.packages("pastecs")
# install.packages("forecast")
# install.packages("seasonal")
# install.packages('tseries')
# install.packages('urca')
# install.packages('devtools')
# install.packages("vars")
# install.packages("fUnitRoots")
# install_github('sinhrks/ggfortify')
# install.packages('ggplot2')
# install.packages('dplyr')
# install.packages('stringi')
# install.packages('tsDyn')
# install.packages('AutoSEARCH')
# install.packages('pdR')
# install.packages('systemfit')
# library(AutoSEARCH)
# library(tsDyn)
# library(dplyr)
library(fUnitRoots)
citation('fUnitRoots')
library(forecast)
citation('forecast')
library(urca)
citation('urca')
library(ggplot2)
citation('ggplot2')
library(vars)
citation('vars')
library(zoo)
citation('zoo')
library(systemfit)
86
citation('systemfit')
library(car)
citation('car')
library(boot)
citation('boot')
library(tseries)
citation('tseries')
library(timeSeries)
citation('timeSeries')
library(pastecs)
citation('pastecs')
library(dplyr)
citation('dplyr')
lag <- timeSeries::lag
#====== import data
cda <- read.csv('C:/Users/keith/Google Drive/Essay/Oil/Data/subset/cda/cda_y.csv') #import
data series
cda <- na.omit(cda) #omit any rows with NA's
names(cda)[1] <- 'date' #rename the first column as the date
head(cda) #View the first rows of data frame
#import GDP Data
#gdp<- read.csv('C:/Users/keith/Google Drive/Essay/Oil/Data/GDP/GDP.csv')
#gdp[,2]<-as.numeric(gdp[,2])
#cpi <- read.csv('C:/Users/keith/Google Drive/Essay/Oil/Data/CPI/cpi.csv')
#cpi <- cpi[,1:2]
# turn into quarterly data, taking average of each qtr. -----------------
cda <- ts(cda[,-1],start=c(1978,9),freq=12) #set cda object to be a TS object
cda.qtr <- aggregate(cda,nfreq=4)/3 #turn from monthly to quarterly by taking quarter average
cda <- as.data.frame(cda.qtr) #set object class
#create zoo version
cda_z <- zooreg(cda,start=c(1978,4),freq=4) #create zoo version for object consistency
index(cda_z) <- as.yearqtr(index(cda_z)) #set index for TS
#create zoo version
cda_z <- zooreg(cda,start=c(1978,4),freq=4)
index(cda_z) <- as.yearqtr(index(cda_z))
cda[,'date'] <- as.numeric(index(cda_z))
head(cda)
head(cda_z)
tail(cda_z)
# obtain plot and summary statistics of each series -----------------------
#Rnrg - deflated with full CPI
summary(cda[,'Rnrg'])
ggplot(cda,aes(y=Rnrg,x=date))+geom_line()+geom_smooth(method='lm')+
ggtitle('Real Energy Index over time n deflated with CPI n 1978=100')
87
#Unemp.rate
summary(cda[,'unemp.rate'])
ggplot(cda,aes(y=unemp.rate,x=date))+geom_line()+geom_smooth(method='lm')+
ggtitle('Unemployment rate over time')
#f.rate
summary(cda[,'f.rate'])
ggplot(cda,aes(y=f.rate,x=date))+geom_line()+geom_smooth(method='lm')+
ggtitle('Job finding rate over time')
#s.rate
summary(cda[,'s.rate'])
ggplot(cda,aes(y=s.rate,x=date))+geom_line()+geom_smooth(method='lm')+
ggtitle('Job separation rate over time')
# Given likliehood data will need to be differenced to make stationary --------
# Log(data) so that in general the result will be roughly the % change.
l.cda <- data.frame(cda[,'date'],log(cda[,'Rnrg']),cda[,2:4])
names(l.cda)[1] <- 'date'
names(l.cda)[2] <- 'Rnrg'
l.cda_z <- merge.zoo(log(cda_z[,'Rnrg']),cda_z[,-1],all=F)
names(l.cda_z)[1] <- 'l.Rnrg'
# obtain plot and summary stats for the log of each series ----------------
#Rnrg
summary(l.cda[,'Rnrg'])
ggplot(l.cda,aes(y=Rnrg,x=date))+geom_line()+geom_smooth(method='lm')+
ggtitle('Log Real Energy Index over time n deflated with CPI')
# TEST FOR SEASONAL UNIT ROOTS USING HEGY TEST ----------------------------
#H0 IS THAT THERE IS A UNIT ROOT AT GIVEN FREQUENCY.
#HA IS STATIONARITY AT GIVEN FR'EQUENCY.
# #CREATE A FUNCTION TO PERFORM HEGY TEST: ------------------------------
hgy <- function(x,I=F,S=F,tr=F,lag_select=T,P=0){
v=x
I=I
S=S
tr=tr
P=P
lag_select=lag_select
xt<-((v-lag(v,-4)))
y1<-((v+lag(v,-1)+lag(v,-2)+lag(v,-3)))
y2<-((-v+lag(v,-1)-lag(v,-2)+lag(v,-3)))
y3<-((-v+lag(v,-2)))
# y<-zooreg(hegy.reg(wts = z))
# index(y) <- index(z)
hegy <- merge.zoo(xt,lag(y1,-1),lag(y2,-1),lag(y3,-2),lag(y3,-1),all=F)
#Create Intercept
int <- zooreg(rep(1,(dim(hegy)[1])))
88
tt <- zooreg(seq(1,dim(hegy)[1],1))
index(int) <- index(hegy)
index(tt) <- index(hegy)
#Create Seasonal Dummies
seas <- rep(c(1,0,0,0),dim(hegy)[1])
seas <- cbind(seas,rep(c(0,1,0,0),dim(hegy)[1]))
seas <- cbind(seas,rep(c(0,0,1,0),dim(hegy)[1]))
seas <- seas[1:dim(hegy)[1],]
seas <- zooreg(seas)
index(seas) <- index(hegy)
#bring it all together
if(I==T){
hegy <- merge.zoo(hegy,int,all=F)}
if(S==T){
hegy <- merge.zoo(hegy,seas,all=F)}
if(tr==T){
hegy <- merge.zoo(hegy,tt,all=F)}
IC <- data.frame(p=NA,BIC=NA,logLik=NA)
IC[1,1] <- 0
IC[1,2] <- BIC(lm(hegy[,1]~hegy[,-1]-1))
IC[1,3] <- logLik(lm(hegy[,1]~hegy[,-1]-1))
for(p in 1:8){
hegy1 <- merge.zoo(hegy,lag(xt,-(1:p)),all=F)
IC[p+1,1]<-p
IC[p+1,2]<-BIC(lm(hegy1[,1]~hegy1[,-1]-1))
IC[p+1,3]<-logLik(lm(hegy1[,1]~hegy1[,-1]-1))
}
paste('value of lag for augmentation is:', IC[IC[,'BIC']==min(IC[,'BIC']),'p'], 'determined by BIC')
if(lag_select==T){
p<-IC[IC[,'BIC']==min(IC[,'BIC']),'p']
if(p==0){
H1 <- lm(hegy[,1]~hegy[,-1]-1)
H1R <- lm(hegy[,1]~hegy[,-c(1,4,5)]-1)
H1 <- lm(hegy[,1]~hegy[,-1]-1)
print( paste('value of lag for augmentation is:', IC[IC[,'BIC']==min(IC[,'BIC']),'p'], 'determined by
BIC'))
print(summary(H1))
print(paste('F-stat for pi3,pi4 jointly zero,',anova(H1,H1R,test='F')$F[2]))
print(paste('n=',nobs(H1)))
print(IC[p+1,])}
if(p>0){
hegy1 <- merge.zoo(hegy,lag(xt,-(1:p)),all=F)
hegy1 <- na.omit(hegy1)
H1<-lm(hegy1[,1]~hegy1[,-1]-1)
89
H1R <- lm(hegy1[,1]~hegy1[,-c(1,4,5)]-1)
print( paste('value of lag for augmentation is:', IC[IC[,'BIC']==min(IC[,'BIC']),'p'], 'determined by
BIC'))
print(summary(H1))
print(paste('F-stat for pi3,pi4 jointly zero,',anova(H1,H1R,test='F')$F[2]))
print(paste('n=',nobs(H1)))
print(IC[p+1,])}}
if(lag_select==F){
p<-P
if(p==0){
H1 <- lm(hegy[,1]~hegy[,-1]-1)
H1R <- lm(hegy[,1]~hegy[,-c(1,4,5)]-1)
H1 <- lm(hegy[,1]~hegy[,-1]-1)
print( paste('value of lag for augmentation is:', IC[IC[,'BIC']==min(IC[,'BIC']),'p'], 'determined by
BIC'))
print(summary(H1))
print(paste('F-stat for pi3,pi4 jointly zero,',anova(H1,H1R,test='F')$F[2]))
print(paste('n=',nobs(H1)))
print(IC[p+1,])}
if(p>0){
hegy1 <- merge.zoo(hegy,lag(xt,-(1:p)),all=F)
hegy1 <- na.omit(hegy1)
H1<-lm(hegy1[,1]~hegy1[,-1]-1)
H1R <- lm(hegy1[,1]~hegy1[,-c(1,4,5)]-1)
print( paste('value of lag for augmentation is:', IC[IC[,'BIC']==min(IC[,'BIC']),'p'], 'determined by
BIC'))
print(summary(H1))
print(paste('F-stat for pi3,pi4 jointly zero,',anova(H1,H1R,test='F')$F[2]))
print(paste('n=',nobs(H1)))
print(IC[p+1,])}}
}
## ALPHA IS 5%
# HEGY FOR l.RNRG -- h0 IS UR AT GIVEN FREQ. ------------------------------
z <- l.cda_z[,'l.Rnrg']
hgy(x = z,I=T,S=T,tr=T,lag_select = T)
#PI1 T= -1.961, CV 5% -3.52 Fail to reject -- UR present
#PI2 T= -8.969, CV 5% -2.93 Reject
#PI3 T= -3.840, CV 5% -3.44 reject
#PI4 T= -7.238, CV 5% -2.78 Reject
#pi3,4 f=41, CV 5% 6.63 Reject.
#Thus UR at zero freq only -- Quarterly Difference!
z <- diff(l.cda_z[,'l.Rnrg'])
hgy(x=z,I=T,S=T,tr = F,lag_select=T)
#pi1 t=-6.7 CV 5% -2.94 Fail to reject -- UR present
90
#pi2 t=-8.4 CV 5% -2.90 Reject
#pi3 t=-8.4 CV 5% -3.44 Reject
#pi4 t=-1.8 CV 5% -1.96, 1.92
#pi3,4 f=40 CV 5% 6.63 Reject
#REJECT UR AT ALL FREQ -- 1ST QUART DIFF MAKES SERIES STATIONARY
# Unemployment Rate -------------------------------------------------------
#HEGY for Unemp.Rate -- H0 is UR at given freq:
z<-l.cda_z[,'unemp.rate']
hgy(x=z,I=T,S=T,tr = T,lag_select = T)
#PI1 T= -4.198, CV 5% -3.52 Reject
#PI2 T= -4.745, CV 5% -2.93 Reject
#PI3 T= -1.770, CV 5% -3.44 reject
#PI4 T= -6.184, CV 5% -2.78 Reject
#jointF, 20.85, CV 5% 6.63 Reject.
#No Unit root present.
# Job Finding Rate --------------------------------------------------------
#HEGY for f.Rate -- H0 is UR at given freq:
z<-l.cda_z[,'f.rate']
hgy(x=z,I=T,S=T,tr = T,lag_select = T)
#pi1 t= -2.871, CV 5% -3.52 Fail to Reject --UR May be Present
#pi2 t= -4.354, CV 5% -2.93 Reject
#pi3 t= -4.740, CV 5% -3.44 reject
#pi4 t= -4.477, CV 5% -2.78 Reject
#pi3,4 f= 21.263, CV 5% 6.63 Reject.
#Thus UR at zero freq only -- QUarterly Difference!
z<- diff(l.cda_z[,'f.rate'])
hgy(x=z,I=T,S=T,tr = F,lag_select = T)
#pi1 t= -6.024
#pi2 t= -4.506
#pi3 t= -6.733
#pi4 t= 0.131
#pi3,4 f= 22.70
#REJECT UR AT ALL FREQ -- 1ST QUART DIFF MAKES SERIES STATIONARY
# Job Separation Rate -----------------------------------------------------
#HEGY for s.Rate -- H0 is UR at given freq:
z<-l.cda_z[,'s.rate']
hgy(x=z,I=T,S=T,tr = T,lag_select = T)
#pi1 t= -3.366, CV 5% -3.52 Reject
#pi2 t= -5.816, CV 5% -2.93 Reject
#pi3 t= -6.152, CV 5% -3.44 reject
#pi4 t= -6.181, CV 5% -2.78 Reject
#pi3,4 f= 52.75, CV 5% 6.63 Reject.
z<- diff(l.cda_z[,'s.rate'])
hgy(x=z,I=T,S=T,tr = F,lag_select = T)
91
#pi1 t= -6.127
#pi2 t= -4.245
#pi3 t= -6.444
#pi4 t= 0.862
#pi3,4 f= 21.349
#REJECT UR AT ALL FREQ -- 1ST QUART DIFF MAKES SERIES STATIONARY
# Differencing Data to make Stationary ------------------------------------
# thus all but Unemployment rate needs to be quarterly differenced, Unemployment Rate is
S.I(0).
names(l.cda_z)
dl.cda <-
merge.zoo(diff(l.cda_z[,'l.Rnrg']),l.cda_z[,'unemp.rate'],diff(l.cda_z[,'f.rate']),diff(l.cda_z[,'s.rate'
]),all=F)
names(dl.cda)
names(dl.cda) <- c('l.Rnrg','unemp.rate','f.rate','s.rate')
dl.cda_z <- dl.cda
head(dl.cda)
head(dl.cda_z)
date <- as.numeric(index(dl.cda))
# Both Rnrg, F.rate and S.rate are I(1) at zero freq. test for co-integration between these
variables --------
#FUNCTION TO SELECT LAG LENGTH FOR adf TEST.
#filter out the seasonal unit roots: (1+L)(1+L^2)Xt <- Xt+Xt-1+Xt-2+Xt-3
Rnrg.s1 <- l.cda_z[,'l.Rnrg']+lag(l.cda_z[,'l.Rnrg'],-1)+lag(l.cda_z[,'l.Rnrg'],-
2)+lag(l.cda_z[,'l.Rnrg'],-3) #filter out all but zero freq for l.Rnrg
f.rate.s1 <- l.cda_z[,'f.rate']+lag(l.cda_z[,'f.rate'],-1)+lag(l.cda_z[,'f.rate'],-
2)+lag(l.cda_z[,'f.rate'],-3) #filter out all but zero freq for F.rate
s.rate.s1 <- l.cda_z[,'s.rate']+lag(l.cda_z[,'s.rate'],-1)+lag(l.cda_z[,'s.rate'],-
2)+lag(l.cda_z[,'s.rate'],-3) #filter out all but zero freq for S.rate
l.cda.S <- merge.zoo(f.rate.s1,Rnrg.s1,all=F)
ut <- resid(lm(l.cda.S[,1]~l.cda.S[,-1]-1)) #regress f.rate on Rnrg, and extract residuals
# Generate Fn to select optimal lags for ADF test -------------------------
adf.L <- function(x,maxlags=12,type=c('none','drift','trend')){
library(AutoSEARCH)
lag<-stats::lag
type <- match.arg(type)
if(is.zoo(x) == F)
stop("x is not of class zoo or zooreg")
if(any(is.na(x)))
stop("NAs in x")
maxlags=maxlags+1
tt <- zooreg(1:length(x[,1]),start=start(x),deltat=deltat(x))
index(tt) = index(x)
sc1 <- data.frame(lags=NA,SC=NA,AIC=NA,HQ=NA)
92
########TYPE = NONE
if (type=='none'){
for(i in 1:maxlags){
z<-merge.zoo(diff(x),lag(x),
diff(lag(x,1:i)),all=F)
res1<-lm(z[,1]~z[,2:(i+1)]-1)
sc1[(i),1] <- i-1
sc1[(i),2] <-
(info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='sc')$value)[1]
sc1[(i),3] <-
(info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='aic')$value)[1]
sc1[(i),4] <-
(info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='hq')$value)[1]
}
}
########TYPE = DRIFT
if (type=='drift'){
for(i in 1:maxlags){
z<-merge.zoo(diff(x),lag(x),
diff(lag(x,1:i)),all=F)
res1<-lm(z[,1]~z[,2:(i+1)]+1)
sc1[(i),1] <- i-1
sc1[(i),2] <-
(info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='sc')$value)[1]
sc1[(i),3] <-
(info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='aic')$value)[1]
sc1[(i),4] <-
(info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='hq')$value)[1]
}
}
########TYPE = TREND
if (type=='trend'){
for(i in 1:maxlags){
z<-merge.zoo(diff(x),tt,lag(x),
diff(lag(x,1:i)),all=F)
res1<-lm(z[,1]~z[,3:(i+1)]+1)
sc1[(i),1] <- i-1
sc1[(i),2] <-
(info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='sc')$value)[1]
sc1[(i),3] <-
(info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='aic')$value)[1]
sc1[(i),4] <-
(info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='hq')$value)[1]
}
93
}
print(head(sc1))
paste("optimal lag order for ADF determined by SIC is", sc1[sc1[,2]==min(sc1[,2]),1],'with SIC',
round(sc1[sc1[,2]==min(sc1[,2]),2],4),". determined by AIC is", sc1[sc1[,3]==min(sc1[,3]),1],'with
AIC',
round(sc1[sc1[,3]==min(sc1[,3]),3],4), ". determined by HQ is",
sc1[sc1[,4]==min(sc1[,4]),1],'with HQ',
round(sc1[sc1[,4]==min(sc1[,4]),4],4))
}a
df.L(x = ut,maxlags = 12,type = 'none')
(ur.df(y = ut,type = 'none',lags = 5)) #Run ADF on residuals and compare the CV of T-stat to
mackinnon table (N=2)
#T-stat: -2.3066 Vs 10% CV of -3.04 -- Fail to reject null of no unit root -- NOT seasonally co-
integrated.
l.cda.S <- merge.zoo(s.rate.s1,Rnrg.s1,all=F)
ut <- resid(lm(l.cda.S[,1]~l.cda.S[,-1]-1)) #regress f.rate on Rnrg, intercept and seasonal
dummies and extract residuals
adf.L(x = ut,maxlags = 12,type = 'none')
ur.df(y = ut,type = 'none',lags = 5) #Run ADF on residuals and compare the CV of T-stat to
mackinnon table (N=2)
#T-stat: -2.8071 Vs 10% CV of -3.04 -- Fail to reject null of no unit root -- NOT seasonally co-
integrated.
l.cda.S <- merge.zoo(s.rate.s1,f.rate.s1,all=F)
ut <- resid(lm(l.cda.S[,1]~l.cda.S[,-1]-1)) #regress f.rate on Rnrg, intercept and seasonal
dummies and extract residuals
adf.L(x = ut,maxlags = 12,type = 'none')
ur.df(y = ut,type = 'none',lags = 5) #Run ADF on residuals and compare the CV of T-stat to
mackinnon table (N=2)
#T-stat: -2.8837 Vs 10% CV of -3.04 -- Fail to reject null of no unit root -- NOT seasonally co-
integrated.
# obtain plot and summary stats for each series ---------------------------
#Rnrg
summary(dl.cda[,'l.Rnrg'])
stdev(dl.cda[,'l.Rnrg'])
ggplot(dl.cda,aes(y=l.Rnrg,x=date))+geom_line()+geom_smooth(method='lm')+
ggtitle('qtr over qtr % change of Real Energy Index over time n deflated with CPI')
#Unemp.rate
summary(dl.cda[,'unemp.rate'])
stdev(dl.cda[,'unemp.rate'])
ggplot(dl.cda,aes(y=unemp.rate,x=date))+geom_line()+geom_smooth(method='lm')+
ggtitle('Unemployment rate over time')
#f.rate
summary(dl.cda[,'f.rate'])
stdev(dl.cda[,'f.rate'])
94
ggplot(dl.cda,aes(y=f.rate,x=date))+geom_line()+geom_smooth(method='lm')+
ggtitle('quarterly change in Job finding rate over time')
#s.rate
summary(dl.cda[,'s.rate'])
stdev(dl.cda[,'s.rate'])
ggplot(dl.cda,aes(y=s.rate,x=date))+geom_line()+geom_smooth(method='lm')+
ggtitle('quarterly change in Job separation over time')
# View series collectively and obtain summary stats -----------------------
# series in levels --------------------------------------------------------
P<-autoplot.zoo(l.cda_z,facets = (Series ~ .))
P<-P+facet_grid(scales='free_y',facets = (Series ~ .))
P<-P+xlab('Time')+scale_x_yearmon()
P<-P+ggtitle('Series over time n Canada')
P
ggsave('series over time.png')
Dstats1 <- stat.desc(cda_z,desc=T)[c('nbr.val','min','mean','max','std.dev'),] #obtain descriptive
statistics
Dstats1
write.csv(Dstats1,'desc stats levels.csv') #save to file
# series differenced ------------------------------------------------------
name_diff <- c('D_l.Rnrg','unemp.rate','D_f.rate','D_s.rate')
names(dl.cda_z) <- name_diff
P<-autoplot.zoo(dl.cda_z,facets = (Series ~ .))
P<-P+facet_grid(scales='free_y',facets = (Series ~ .))
P<-P+xlab('Time')+scale_x_yearmon()
P<-P+ggtitle('Differenced series over time n Canada')
P
ggsave('differenced series over time.png')
names(dl.cda_z) <- names(dl.cda)
Dstats2 <- stat.desc(dl.cda_z,desc=T)[c('nbr.val','min','mean','max','std.dev'),] #obtain
descriptive statistics
zapsmall(Dstats2)
write.csv(Dstats2,'desc stats diff.csv') #save to file
head(dl.cda_z);tail(dl.cda_z)
# using the dl.cda data work out the VAR ---------------------------------------
VARselect(dl.cda,type='both',season=4,lag.max = 12)[1]
#p=1 has serial correlation
#p=2 has serial correlation
Vr <- VAR(y=dl.cda,type='both',season=4,p=3)
roots(Vr,modulus = F) #View Roots
plot(roots(Vr,modulus = F),xlim=c(-1.2,1.2),ylim=c(-1.2,1.2));abline(h = c(1,-1),v=c(1,-
1),col='grey') #Graphically View Roots
summary(ca.jo(x = l.cda_z,type = 'eigen',ecdet = 'trend',K = (Vr$p+1),season = 4)) #Fail to Reject
Null of No-Cointegration.
95
#r <= 3 6.50 Vs 10% 10.49
#r <= 2 7.09 Vs 10% 16.85
#r <= 1 10.90 Vs 10% 23.11
#r <= 0 25.75 Vs 10% 29.12
summary(ca.jo(x = l.cda_z,type = 'trace',ecdet = 'trend',K = (Vr$p+1),season = 4)) #Fail to Reject
Null of No-Cointegration.
#r <= 3 6.50 Vs 10% 10.49
#r <= 2 13.59 Vs 10% 22.76
#r <= 1 24.49 Vs 10% 39.06
#r <= 0 50.24 Vs 10% 59.14
# BG test for serial correlation ---------------------------------
res <- resid(Vr) #obtain residual vector from VAR
lm1 <- lm(res[,1]~1) #regress residual on a constant
layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE));plot(res[,1],type='l'); acf(res[,1],) ; pacf(res[,1],)
#view ACF PACF
bgtest(lm1,order=Vr$p+1,type = 'Chisq') #View BG test results of serial correlation up to P+1
lm2 <- lm(res[,2]~1)
layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE));plot(res[,2],type='l'); acf(res[,2]) ; pacf(res[,2])
bgtest(lm2,order=Vr$p+1,type = 'Chisq')
lm3 <- lm(res[,3]~1)
layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE));plot(res[,3],type='l'); acf(res[,3]) ; pacf(res[,3])
bgtest(lm3,order=Vr$p+1,type = 'Chisq')
lm4 <- lm(res[,4]~1)
layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE));plot(res[,4],type='l'); acf(res[,4]) ; pacf(res[,4])
bgtest(lm4,order=Vr$p+1,type = 'Chisq')
summary(Vr) #View summary for VAR(p)
layout(matrix(c(1), 1, 1, byrow = TRUE)) #reset ploting device
# base VAR package IRF ----------------------------------------------------
H=20
irf0 <- (irf(x = Vr,impulse ='l.Rnrg',n.ahead = H-1,ci = 0.66,runs = 100)) #extract IRF results for
shock to l.Rnrg on all other Variables
VAR.irf1 <-
data.frame(as.data.frame(irf0[[1]])[,1],as.data.frame(irf0[[2]])[,1],as.data.frame(irf0[[3]])[,1]);n
ames(VAR.irf1) <- c('IRF','CIl','CIu') #on
l.Rnrg
VAR.irf2 <-
data.frame(as.data.frame(irf0[[1]])[,2],as.data.frame(irf0[[2]])[,2],as.data.frame(irf0[[3]])[,2]);n
ames(VAR.irf2) <- c('IRF','CIl','CIu') #on
unemp.rate
VAR.irf3 <-
data.frame(as.data.frame(irf0[[1]])[,3],as.data.frame(irf0[[2]])[,3],as.data.frame(irf0[[3]])[,3]);n
ames(VAR.irf3) <- c('IRF','CIl','CIu') #on
f.rate
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research
MA Research

More Related Content

What's hot

Modeling and forecasting energy consumption in ghana
Modeling and forecasting energy consumption in ghanaModeling and forecasting energy consumption in ghana
Modeling and forecasting energy consumption in ghana
Alexander Decker
 
Presentation for web1 4
Presentation for web1 4Presentation for web1 4
Presentation for web1 4richwalker84
 
Summary slides: London's labour market in the recessions
Summary slides: London's labour market in the recessionsSummary slides: London's labour market in the recessions
Summary slides: London's labour market in the recessionsMelisaWickham
 
MACROECONOMICS-CH9
MACROECONOMICS-CH9MACROECONOMICS-CH9
MACROECONOMICS-CH9
kkjjkevin03
 
Economic update (may 2013)
Economic update (may 2013)Economic update (may 2013)
Economic update (may 2013)veredus
 
Economic Update (July 2011)
Economic Update (July 2011)Economic Update (July 2011)
Economic Update (July 2011)cmay930
 
Charleston Commercial Market Forecast | Lawrence Yun Economic Update
Charleston Commercial Market Forecast | Lawrence Yun Economic UpdateCharleston Commercial Market Forecast | Lawrence Yun Economic Update
Charleston Commercial Market Forecast | Lawrence Yun Economic Update
Charleston Trident Association of REALTORS
 
The Egg or the Chicken First? Saving-Growth Nexus in Lesotho
The Egg or the Chicken First? Saving-Growth Nexus in LesothoThe Egg or the Chicken First? Saving-Growth Nexus in Lesotho
The Egg or the Chicken First? Saving-Growth Nexus in Lesotho
paperpublications3
 
US Talent Market Monthly March 2014
US Talent Market Monthly March 2014US Talent Market Monthly March 2014
US Talent Market Monthly March 2014Kelly Services
 
February 2018 U.S. employment update and outlook
February 2018 U.S. employment update and outlookFebruary 2018 U.S. employment update and outlook
February 2018 U.S. employment update and outlook
JLL
 
National Employment Situation: January 2018
National Employment Situation: January 2018National Employment Situation: January 2018
National Employment Situation: January 2018
DavidDominy1
 
Dr. Alejandro Diaz Bautista, Power, Cointegration Model
Dr. Alejandro Diaz Bautista, Power, Cointegration ModelDr. Alejandro Diaz Bautista, Power, Cointegration Model
Dr. Alejandro Diaz Bautista, Power, Cointegration Model
Economist
 
Linear Regression - an 80 year study of the Dow Jones industrial average
Linear Regression - an 80 year study of the Dow Jones industrial averageLinear Regression - an 80 year study of the Dow Jones industrial average
Linear Regression - an 80 year study of the Dow Jones industrial average
courtalecia
 
The Relationship between Wage and Inflation
The Relationship between Wage and InflationThe Relationship between Wage and Inflation
The Relationship between Wage and Inflation
HELIOSPADILLAMAYER
 
Munich personal re p ec archiveshould a government fiscally
Munich personal re p ec archiveshould a government fiscally Munich personal re p ec archiveshould a government fiscally
Munich personal re p ec archiveshould a government fiscally
MARRY7
 

What's hot (16)

Modeling and forecasting energy consumption in ghana
Modeling and forecasting energy consumption in ghanaModeling and forecasting energy consumption in ghana
Modeling and forecasting energy consumption in ghana
 
Presentation for web1 4
Presentation for web1 4Presentation for web1 4
Presentation for web1 4
 
Summary slides: London's labour market in the recessions
Summary slides: London's labour market in the recessionsSummary slides: London's labour market in the recessions
Summary slides: London's labour market in the recessions
 
MACROECONOMICS-CH9
MACROECONOMICS-CH9MACROECONOMICS-CH9
MACROECONOMICS-CH9
 
Economic update (may 2013)
Economic update (may 2013)Economic update (may 2013)
Economic update (may 2013)
 
Economic Update (July 2011)
Economic Update (July 2011)Economic Update (July 2011)
Economic Update (July 2011)
 
Charleston Commercial Market Forecast | Lawrence Yun Economic Update
Charleston Commercial Market Forecast | Lawrence Yun Economic UpdateCharleston Commercial Market Forecast | Lawrence Yun Economic Update
Charleston Commercial Market Forecast | Lawrence Yun Economic Update
 
The Egg or the Chicken First? Saving-Growth Nexus in Lesotho
The Egg or the Chicken First? Saving-Growth Nexus in LesothoThe Egg or the Chicken First? Saving-Growth Nexus in Lesotho
The Egg or the Chicken First? Saving-Growth Nexus in Lesotho
 
US Talent Market Monthly March 2014
US Talent Market Monthly March 2014US Talent Market Monthly March 2014
US Talent Market Monthly March 2014
 
February 2018 U.S. employment update and outlook
February 2018 U.S. employment update and outlookFebruary 2018 U.S. employment update and outlook
February 2018 U.S. employment update and outlook
 
National Employment Situation: January 2018
National Employment Situation: January 2018National Employment Situation: January 2018
National Employment Situation: January 2018
 
Dr. Alejandro Diaz Bautista, Power, Cointegration Model
Dr. Alejandro Diaz Bautista, Power, Cointegration ModelDr. Alejandro Diaz Bautista, Power, Cointegration Model
Dr. Alejandro Diaz Bautista, Power, Cointegration Model
 
Linear Regression - an 80 year study of the Dow Jones industrial average
Linear Regression - an 80 year study of the Dow Jones industrial averageLinear Regression - an 80 year study of the Dow Jones industrial average
Linear Regression - an 80 year study of the Dow Jones industrial average
 
The Relationship between Wage and Inflation
The Relationship between Wage and InflationThe Relationship between Wage and Inflation
The Relationship between Wage and Inflation
 
Munich personal re p ec archiveshould a government fiscally
Munich personal re p ec archiveshould a government fiscally Munich personal re p ec archiveshould a government fiscally
Munich personal re p ec archiveshould a government fiscally
 
oilrpiceeffect
oilrpiceeffectoilrpiceeffect
oilrpiceeffect
 

Similar to MA Research

Applied Economics Letters, 2010, 17, 325–328Are demand ela.docx
Applied Economics Letters, 2010, 17, 325–328Are demand ela.docxApplied Economics Letters, 2010, 17, 325–328Are demand ela.docx
Applied Economics Letters, 2010, 17, 325–328Are demand ela.docx
rossskuddershamus
 
Peter Chien-Tarng Huang MGMT E-5064 Individual Paper
Peter Chien-Tarng Huang MGMT E-5064 Individual PaperPeter Chien-Tarng Huang MGMT E-5064 Individual Paper
Peter Chien-Tarng Huang MGMT E-5064 Individual PaperPeter CT Huang, LEED
 
Outlook for Energy and Minerals Markets - for the 116th Congress
Outlook for Energy and Minerals Markets - for the 116th CongressOutlook for Energy and Minerals Markets - for the 116th Congress
Outlook for Energy and Minerals Markets - for the 116th Congress
Roger Atkins
 
Carragher et al, 2013
Carragher et al, 2013Carragher et al, 2013
Carragher et al, 2013cahir90
 
Uno Assignment Help| Homework Help| Essay Writing Help | Help with Assignment
Uno Assignment Help| Homework Help| Essay Writing Help | Help with AssignmentUno Assignment Help| Homework Help| Essay Writing Help | Help with Assignment
Uno Assignment Help| Homework Help| Essay Writing Help | Help with Assignment
uno Assignment Help
 
Module 4 - SLPRESPONSIBILITY ACCOUNTING FOR COST, PROFIT AND INV.docx
Module 4 - SLPRESPONSIBILITY ACCOUNTING FOR COST, PROFIT AND INV.docxModule 4 - SLPRESPONSIBILITY ACCOUNTING FOR COST, PROFIT AND INV.docx
Module 4 - SLPRESPONSIBILITY ACCOUNTING FOR COST, PROFIT AND INV.docx
roushhsiu
 
Sheet2Production Plant Cash FlowsYearNatural Gas Plant Cash Flows .docx
Sheet2Production Plant Cash FlowsYearNatural Gas Plant Cash Flows .docxSheet2Production Plant Cash FlowsYearNatural Gas Plant Cash Flows .docx
Sheet2Production Plant Cash FlowsYearNatural Gas Plant Cash Flows .docx
lesleyryder69361
 
Wage-Employment Dynamics
Wage-Employment DynamicsWage-Employment Dynamics
Wage-Employment Dynamics
Ruhani Seth
 
The_Oil_and_Gas_Industry_in_Energy_Transitions.pdf
The_Oil_and_Gas_Industry_in_Energy_Transitions.pdfThe_Oil_and_Gas_Industry_in_Energy_Transitions.pdf
The_Oil_and_Gas_Industry_in_Energy_Transitions.pdf
Mamdouh Mohamed
 
2010 Kelly work example Analytical report for Siemens - High oil and gas pr...
2010 Kelly work example   Analytical report for Siemens - High oil and gas pr...2010 Kelly work example   Analytical report for Siemens - High oil and gas pr...
2010 Kelly work example Analytical report for Siemens - High oil and gas pr...JAKIRL
 
Why Policy Matters - Renewable Energy Market Momentum at Risk - June 2015
Why Policy Matters - Renewable Energy Market Momentum at Risk - June 2015Why Policy Matters - Renewable Energy Market Momentum at Risk - June 2015
Why Policy Matters - Renewable Energy Market Momentum at Risk - June 2015Scott Clausen
 
Factors Affecting the Rise of Renewable Energy in the U.S. .docx
Factors Affecting the Rise of Renewable Energy in the U.S. .docxFactors Affecting the Rise of Renewable Energy in the U.S. .docx
Factors Affecting the Rise of Renewable Energy in the U.S. .docx
mydrynan
 
Impact Analysis of Petroluem Product Price Changes on Households’ Welfare in ...
Impact Analysis of Petroluem Product Price Changes on Households’ Welfare in ...Impact Analysis of Petroluem Product Price Changes on Households’ Welfare in ...
Impact Analysis of Petroluem Product Price Changes on Households’ Welfare in ...
inventionjournals
 
Discussion 6.docx
Discussion 6.docxDiscussion 6.docx
Discussion 6.docx
sdfghj21
 
Discussion 6.docx
Discussion 6.docxDiscussion 6.docx
Discussion 6.docx
bkbk37
 
The sleeping giant_-_when_energy_prices_awake_whitepaper
The sleeping giant_-_when_energy_prices_awake_whitepaperThe sleeping giant_-_when_energy_prices_awake_whitepaper
The sleeping giant_-_when_energy_prices_awake_whitepaperShannon Scheiwiller, MBA
 
The sleeping giant_-_when_energy_prices_awake_whitepaper
The sleeping giant_-_when_energy_prices_awake_whitepaperThe sleeping giant_-_when_energy_prices_awake_whitepaper
The sleeping giant_-_when_energy_prices_awake_whitepaper
Shannon Scheiwiller, MBA
 
Cointegration relationship betweeCOINTEGRATION RELATIONSHIP BETWEEN ECONOMIC ...
Cointegration relationship betweeCOINTEGRATION RELATIONSHIP BETWEEN ECONOMIC ...Cointegration relationship betweeCOINTEGRATION RELATIONSHIP BETWEEN ECONOMIC ...
Cointegration relationship betweeCOINTEGRATION RELATIONSHIP BETWEEN ECONOMIC ...
aeijjournal
 
COINTEGRATION RELATIONSHIP BETWEEN ECONOMIC GROWTH, EXPORT AND ELECTRICITY CO...
COINTEGRATION RELATIONSHIP BETWEEN ECONOMIC GROWTH, EXPORT AND ELECTRICITY CO...COINTEGRATION RELATIONSHIP BETWEEN ECONOMIC GROWTH, EXPORT AND ELECTRICITY CO...
COINTEGRATION RELATIONSHIP BETWEEN ECONOMIC GROWTH, EXPORT AND ELECTRICITY CO...
AEIJjournal2
 

Similar to MA Research (20)

Applied Economics Letters, 2010, 17, 325–328Are demand ela.docx
Applied Economics Letters, 2010, 17, 325–328Are demand ela.docxApplied Economics Letters, 2010, 17, 325–328Are demand ela.docx
Applied Economics Letters, 2010, 17, 325–328Are demand ela.docx
 
Peter Chien-Tarng Huang MGMT E-5064 Individual Paper
Peter Chien-Tarng Huang MGMT E-5064 Individual PaperPeter Chien-Tarng Huang MGMT E-5064 Individual Paper
Peter Chien-Tarng Huang MGMT E-5064 Individual Paper
 
Outlook for Energy and Minerals Markets - for the 116th Congress
Outlook for Energy and Minerals Markets - for the 116th CongressOutlook for Energy and Minerals Markets - for the 116th Congress
Outlook for Energy and Minerals Markets - for the 116th Congress
 
Carragher et al, 2013
Carragher et al, 2013Carragher et al, 2013
Carragher et al, 2013
 
Uno Assignment Help| Homework Help| Essay Writing Help | Help with Assignment
Uno Assignment Help| Homework Help| Essay Writing Help | Help with AssignmentUno Assignment Help| Homework Help| Essay Writing Help | Help with Assignment
Uno Assignment Help| Homework Help| Essay Writing Help | Help with Assignment
 
Module 4 - SLPRESPONSIBILITY ACCOUNTING FOR COST, PROFIT AND INV.docx
Module 4 - SLPRESPONSIBILITY ACCOUNTING FOR COST, PROFIT AND INV.docxModule 4 - SLPRESPONSIBILITY ACCOUNTING FOR COST, PROFIT AND INV.docx
Module 4 - SLPRESPONSIBILITY ACCOUNTING FOR COST, PROFIT AND INV.docx
 
Sheet2Production Plant Cash FlowsYearNatural Gas Plant Cash Flows .docx
Sheet2Production Plant Cash FlowsYearNatural Gas Plant Cash Flows .docxSheet2Production Plant Cash FlowsYearNatural Gas Plant Cash Flows .docx
Sheet2Production Plant Cash FlowsYearNatural Gas Plant Cash Flows .docx
 
Wage-Employment Dynamics
Wage-Employment DynamicsWage-Employment Dynamics
Wage-Employment Dynamics
 
The_Oil_and_Gas_Industry_in_Energy_Transitions.pdf
The_Oil_and_Gas_Industry_in_Energy_Transitions.pdfThe_Oil_and_Gas_Industry_in_Energy_Transitions.pdf
The_Oil_and_Gas_Industry_in_Energy_Transitions.pdf
 
2010 Kelly work example Analytical report for Siemens - High oil and gas pr...
2010 Kelly work example   Analytical report for Siemens - High oil and gas pr...2010 Kelly work example   Analytical report for Siemens - High oil and gas pr...
2010 Kelly work example Analytical report for Siemens - High oil and gas pr...
 
Why Policy Matters - Renewable Energy Market Momentum at Risk - June 2015
Why Policy Matters - Renewable Energy Market Momentum at Risk - June 2015Why Policy Matters - Renewable Energy Market Momentum at Risk - June 2015
Why Policy Matters - Renewable Energy Market Momentum at Risk - June 2015
 
Factors Affecting the Rise of Renewable Energy in the U.S. .docx
Factors Affecting the Rise of Renewable Energy in the U.S. .docxFactors Affecting the Rise of Renewable Energy in the U.S. .docx
Factors Affecting the Rise of Renewable Energy in the U.S. .docx
 
Impact Analysis of Petroluem Product Price Changes on Households’ Welfare in ...
Impact Analysis of Petroluem Product Price Changes on Households’ Welfare in ...Impact Analysis of Petroluem Product Price Changes on Households’ Welfare in ...
Impact Analysis of Petroluem Product Price Changes on Households’ Welfare in ...
 
105 eng
105 eng105 eng
105 eng
 
Discussion 6.docx
Discussion 6.docxDiscussion 6.docx
Discussion 6.docx
 
Discussion 6.docx
Discussion 6.docxDiscussion 6.docx
Discussion 6.docx
 
The sleeping giant_-_when_energy_prices_awake_whitepaper
The sleeping giant_-_when_energy_prices_awake_whitepaperThe sleeping giant_-_when_energy_prices_awake_whitepaper
The sleeping giant_-_when_energy_prices_awake_whitepaper
 
The sleeping giant_-_when_energy_prices_awake_whitepaper
The sleeping giant_-_when_energy_prices_awake_whitepaperThe sleeping giant_-_when_energy_prices_awake_whitepaper
The sleeping giant_-_when_energy_prices_awake_whitepaper
 
Cointegration relationship betweeCOINTEGRATION RELATIONSHIP BETWEEN ECONOMIC ...
Cointegration relationship betweeCOINTEGRATION RELATIONSHIP BETWEEN ECONOMIC ...Cointegration relationship betweeCOINTEGRATION RELATIONSHIP BETWEEN ECONOMIC ...
Cointegration relationship betweeCOINTEGRATION RELATIONSHIP BETWEEN ECONOMIC ...
 
COINTEGRATION RELATIONSHIP BETWEEN ECONOMIC GROWTH, EXPORT AND ELECTRICITY CO...
COINTEGRATION RELATIONSHIP BETWEEN ECONOMIC GROWTH, EXPORT AND ELECTRICITY CO...COINTEGRATION RELATIONSHIP BETWEEN ECONOMIC GROWTH, EXPORT AND ELECTRICITY CO...
COINTEGRATION RELATIONSHIP BETWEEN ECONOMIC GROWTH, EXPORT AND ELECTRICITY CO...
 

MA Research

  • 1. The Effect of Energy Shocks on Labour Flows in Canada by Keith Yacucha BA Economics, UBC, 2014 An Extended Essay Submitted in Partial Fulfillment of the Requirements for the Degree of MASTER OF ARTS in the Department of Economics We accept this extended essay as conforming to the required standard Dr. David Giles, Co-Supervisor (Department of Economics) Dr. Graham Voss, Co-Supervisor (Department of Economics)  Keith Yacucha, 2016 University of Victoria All rights reserved. This extended essay may not be reproduced in whole or in part, by photocopy or other means, without the permission of the author.
  • 2. 2 Abstract This essay aims to explore the impacts of energy price shocks on labour flows in Canada, Alberta and Ontario through the utilization of a Vector Smooth Auto-Regressive model. In general, it is found that labour flows react non-linearly and asymmetrically around energy price shocks with these effects being most apparent on the national level, while Alberta and Ontario display less noticeable asymmetric effects.
  • 3. 3 Table of Contents 1.Introduction ...............................................................................................................................................4 2. Literature Review......................................................................................................................................6 3. Data and Methodology ...........................................................................................................................13 3.1 Data...................................................................................................................................................13 3.2 Methodology.....................................................................................................................................16 4. Discussion of Results...............................................................................................................................43 5. Conclusions .........................................................................................................................................73 References ..................................................................................................................................................76 Appendix: IRFs by Region for VAR...........................................................................................................78 Appendix: Non-cumulative IRFs for differenced labour flows from VSTAR models...............................81 Appendix: R Code, Region: Canada.........................................................................................................85
  • 4. 4 1.Introduction The effect of oil price shocks on large oil importing economies such as the United States is a vastly researched topic, however the effects of such shocks on smaller, oil exporting economies, such as Canada is much less documented. This essay aims to add to the literature by exploring these dynamics for the Canadian case. Using a Vector Smooth Transition Auto- Regressive (VSTAR) model and through the corresponding Impulse Response Functions (IRF) we explore how labour flows, specifically, unemployment, job finding and separation rates, adjust to simulated shocks to the price of energy in Canada, Alberta, and Ontario. The focus on the effect of energy prices on the Canadian economy is due to the relative importance of this sector. That is, oil and gas extraction combined with support services amount to just over 5% of Canada’s gross output1, which places this sector as the third largest contributor to output behind the finance (just over 10%) and manufacturing sectors (just over 20%). The important distinction is that the outputs from the oil and gas sector, which are processed into forms of energy, are then utilized by every other industry and consumer for their daily production or consumption needs. Thus while the oil and gas sector is subject to the price of energy for its own profitability, so too then is much of the economy as they utilize the energy for their production and consumption processes. Thus price changes have the potential to disrupt levels of planned production or consumption, which then has reverberating effects through the economy which filters through to impact employment levels. 1 Statistics Canada, Table 381-0031 Provincial gross output, by sector and industry. Regions: Canada, Alberta and Ontario. Industries: all major industry (3 digit) industry classifications, Time Frame: Annual 2008 to 2012. own calculation.
  • 5. 5 The choice to further include Alberta and Ontario in this analysis stems from the classical geo-political and economic divide in Canada between the east and west. That is specifically, oil and gas extraction and support services account for over 20% of Alberta’s output, conversely, Ontario is predominantly involved in manufacturing, with this notably broad sector accounting for close to 25% of Ontario’s output.2 Thus by including Ontario and Alberta in addition to Canada in aggregate, the hope is to have a window into how energy price shocks effect the country on whole, as well as identify potential distinctions in the effect on regional labour flows. It is found that labour flows adjust asymmetrically and non-linearly to shocks in the price of energy. Particularly labour flows react differently to positive and negative oil shocks, and similarly the magnitude of the shock is also important as a scaled up shock does not necessarily translate into an equally scaled up impact. However, this level of asymmetry is very different depending on region, with Canada having the most visible asymmetry, while Alberta and Ontario appear to have less apparent asymmetric effects to energy shocks, The rest of the paper is outlined as follows. Section 2 will discuss and relate the relevant literature to this topic. Section 3 will outline the data used as well as the econometric methodology used in building this model. Section 4 will present, interpret and discuss the results before completing in section 5 with the conclusions. 2 Statistics Canada, Table 381-0031 Provincial gross output, by sector and industry. Regions: Canada, Alberta and Ontario. Industries: all major industry (3 digit) industry classifications, Time Frame: Annual 2008 to 2012. own calculation.
  • 6. 6 2. Literature Review As mentioned the effects of an energy shock on the US macro economy has been an extremely well researched subject. There are of course key differences between the structure of the US and the Canadian economies, it is these distinctions in which we aim to extrapolate from the following literature. Tatom (1987) explores the effect of the then recent fall in oil prices on the macro economy. Using an aggregate demand, aggregate supply (AD-AS) frame work, Tatom explores the theoretical effect of an energy shock on the macroeconomic environment for a handful of countries including Canada. Primarily Tatom finds that energy shocks impact the economy through the aggregate supply side through the adjustment of factor prices and the disruption in productivity due to the price shock altering firms optimal level of capital labour ratios. Tatom, further finds that both positive and negative shocks have an estimated symmetric effect on the economy.3 Davis and Haltiwanger (2001) investigate the transmission mechanism of oil price shocks through to labour markets. They argue that large oil price shocks cause disruptions in the production process, causing an upset in production. 4 Davis and Haltiwanger continue to identify two processes by which this may occur; (i) Aggregate channels referring to potential output, and (ii) Allocative channels referring to the impact of changing oil prices on the desired ratio of capital and labour. 5 In identifying between these processes empirically, Davis and Haltiwanger state that with aggregate channels one would expect that under unfavourable oil 3 Tatom 1987, 44. 4 Davis and Haltiwanger, 2001, 467. 5 Davis and Haltiwanger, 2001, 467.
  • 7. 7 price shocks job creation will be reduced and job destruction would be increased, while under allocative channels one would expect to see both job destruction and creation to increase. 6 Additionally, one would expect employment to respond symmetrically to oil price shocks under aggregate channels, and asymmetrically in the case of allocative channels, with only the magnitude of the oil price shock being of relevance. 7 The rationale for this asymmetric impact under allocative channels is due to this price change causing a disruption in the capital to labour ratio coupled with the potential inability for capital and labour to relocate to sectors or regions in order to be fully utilized. That is, under either a favourable or unfavourable oil price shock, the match of capital to labour is disrupted resulting in increased frictional unemployment until capital and labour are able to relocate to suitable industries or regions. Although Shimer (2012) never explores the relationship of labour flows with oil price shocks, Shimer provides tremendous insight into the role labour flows play in the determination of unemployment rates, stating that in the US since 1987, ninety percent of the fluctuations in unemployment rates were due to changes in the job finding rate. 8 Further, it is Shimer in this work who provides us with the methodology used to later construct the job finding and job separation rates for Canada. Ordonez, Sala and Silva (2011) explore the effects of real oil price shocks on labour flows in the United States. Using a Vector Smooth Transition Autoregressive (VSTAR) model Ordonez 6 Davis and Haltiwanger, 2001, 468. 7 Davis and Haltiwanger, 2001, 468. 8 Shimer, 2012, 127.
  • 8. 8 et al. find that unemployment rates are sensitive to oil price shocks, and further that there are larger responses in the job finding rate supporting that the job finding rate is the driving force for unemployment rather than the separation rate. 9 It is primarily Ordonez, Sala and Silva’s methodology which is followed in this paper in order to evaluate the effect of energy price shocks on Canadian labour flows. Uri (1996) takes an aggregate channel approach in identifying the effects of oil price shocks on the US unemployment rate. Uri argues that rising energy prices increase the cost of production, thereby reducing aggregate supply due to the reduction of goods and services produced. Thus this decline in aggregate output results in a falling demand for labour supply and a rise in unemployment rates. 10 Uri finds that it takes about three years for the effects of a percentage change in real oil price to be fully absorbed by the unemployment rate in a simulated environment.11 Dissou (2010) provides a level of Canadian context to the research, although Dissou’s focus is on the effects of increasing oil prices on sectoral employment. Dissou discusses the possibility that increasing oil prices could result in Dutch disease for the Canadian economy. Specifically, that rising oil prices would hit energy intensive producers with a supply shock, and then a further hit with an unfavorable real exchange rate resulting in their goods no longer being priced competitively in the global market. 12 9 Ordonez, Sala and Silva, 2010, 92. 10 Uri, 1998, 29. 11 Uri, 1998, 35. 12 Dissou, 2010, 562.
  • 9. 9 Hamilton (2003) discusses the negative relationship in the US between oil prices and real output, primarily however he discusses a mechanism by which the effect of oil price shocks on real output through aggregate demand, may be asymmetric. Hamilton proposes that the price of energy must be important in the decision to purchase durables, that is, if energy prices are expected to be high, one may shift their consumption towards energy efficient products, or hold off on their purchase all together. From an investment view point, if a firm is considering building a new factory, the expected price of energy plays into what industrial techniques and equipment are used. Ultimately then, if consumers and firms are uncertain about energy prices then they may post-pone purchases of big ticket items until they feel prices have stabilized. 13 Thus while an unfavourable shock may depress the economy, a favourable shock may have little benefit due to the disruptions caused by uncertainty around energy prices.14 In Hamilton (2011) the effects of oil price shocks are examined further, this time primarily through the supply side. While the case for oil price shocks having asymmetric impacts on the economy is stressed, Hamilton outlines key potential causes for this impact through allocative channels. These causes include increased unemployment due to rising frictional unemployment due to specialized labour and capital, as well as resulting from idle labour and capital as these factors of production attempt to wait out the disruptions caused by the price change.15 13 Hamilton,2003,366. 14 Hamilton,2003,366. 15 Hamilton,2011,3.
  • 10. 10 Kilian (2014) echoes the comments already made regarding the effects of an oil price shock on the economy. Stating that they result in allocative disturbances between capital and labour causing sectoral shifts throughout the economy. However, depending on how specific the given capital or labour is, it may not be able to be easily relocated, resulting in unemployment.16 Of specific note is Kilian’s statement that previous studies identifying asymmetries arising from oil price shocks have been miss-specified due to their inclusion of oil price increases as a variable in the structural VAR model, which Kilian argues leads to inconsistent impulse response estimates and thus cannot be used to quantify asymmetry.17 Kilian further shows, that when he reworks these studies he finds no evidence of an asymmetric effect in the US for anything less than extreme shocks of two standard deviations or more.18 By utilizing a VSTAR model we are able to avoid the misspecification noted by Kilian, as we primarily do not include a variable for oil or energy price increases, and further, a VSTAR allows for an infinite number of states between regimes, and collapses to a linear model under specific circumstances, as a result an explicit component of the modeling process is testing this linear specification against a VSTAR alternative. Lian, Jin, and Ren (2014) further confirm Kilian’s results with a similar conclusion, where they find that in the US, impulse response functions tend to show little if any asymmetry in the US economy for ± 1 standard deviation oil price shocks. However, Lian et al. find that with higher level shocks of ± 2 or 3 standard deviations the asymmetries become very apparent. 19 16 Kilian,2014,143-144. 17 Kilian, 2014, 147. 18 Kilian, 2014, 147. 19 Lian, Xiaoze and Xiaomei, 2014, 224.
  • 11. 11 Finally, Cox, and Harvie (2010) provide an excellent overview of the assumed impact of a positive resource price shock for a resource exporter, like Canada. Cox and Harvie argue that a positive price shock would impact the economy through five primary channels. First through an income effect, by which the resource adds directly to the nations real income. Second through a revenue effect from higher revenue capacity of the government through royalties on the resource. Third is the spending effect where private and public sector spending increases due to increased current and expected future income, wealth, and in the case of public sector, tax revenue. Fourth is the effect on the current account, as the value of resource exports increase the current account is enhanced. Lastly the exchange rate effect, where higher valued resource exports result in a stronger domestic currency. 20 Additionally, Cox and Harvie find that a resource price increase will tend to reduce non-resource industry supply and demand, deteriorate the non-resource trade balance due to lack of competitiveness, potentially cause unstable financial markets and lastly, loss of non-resource output leads to lower employment and capital investment in non-resource sectors which may have long term growth effects. 21 Although the vast majority of the above literature is focused on the US economy, the primary take-away is the set of potential mechanisms by which an energy price shock impacts aggregate supply and aggregate demand. From the aggregate supply side, we would expect very similar effects as outlined above following a price shock. That is following the outline of Davis and Haltiwanger (2001) where if an unfavourable oil shock reduces job creation and increases job separation, then this shock is 20 Cox and Harvie, 2010, 471. 21 Cox and Harvie, 2010, 487.
  • 12. 12 influencing the economy through aggregate channels. That is, the standard text book story of how the economy would adjust following a negative aggregate supply shock. Alternatively, if following this unfavourable shock, both job creation and separation rates increase, then the resultant shock has had an allocative effect on the economy, disrupting the optimal ratios of labour and capital, and thus we would expect if the effect was due to this allocative disturbance that the impacts of energy shocks would by asymmetric, as any shock of a large enough magnitude would cause such disruptions and a drop in productivity, and increase in unemployment. From the aggregate demand side, we would expect a very different story from the consensus provided above. That is, an increase in energy prices would generally follow the mechanisms proposed by Cox and Harvie (2010). That is, an increase in energy prices would increase over all income and wealth, while a decrease would have the opposite effect. This result is of course in direct contradiction to the proposed effect in the US, which of course is a net importer of oil for its energy needs. Despite the expectation that the prevalent pressures on the Canadian economy would be opposite that of the US economy, the issue brought up by Hamilton (2003) still stands. That being that any large disruption in the price of energy is going to cause a disruption in consumption and investment decisions, and thus even favourable shocks, may have little positive effect on the economy. Although we are not explicitly modeling the effects that an energy shock will have on aggregate demand and aggregate supply, it is still important to recognize the dynamics by which an energy shock would flow through these two processes as this ultimately has an effect
  • 13. 13 on labour flows depending on if a given shock pushes us into an inflationary or recessionary output gap. 3. Data and Methodology 3.1 Data All of the data used is sourced from Statistics Canada, where our variables of interest are the Real energy commodity index22 and unemployment rate23 while our other variables for labour flows, job separation and job finding rates are derived as no such data exists in Canada. These rates are derived based off the methodology proposed by Shimer (2012) and utilized by the Bank of Canada. 24 Following Shimer’s methodology, we can easily construct the job finding and separation rates using readily available data. First we construct the probability of finding a job which is the probability that any currently unemployed worker becomes employed within a given month, this probability is constructed using the following sequence, first we have the following equation to estimate next periods unemployment rate: 𝑢 𝑡+1 = (1 − 𝐹𝑡)𝑢 𝑡 + 𝑢 𝑡+1 𝑠 (1) where ‘Ft’ is the probability of an unemployed worker becoming employed within the month, while ‘u’ is the number of unemployed25 in the month subscripted t and t+1. Finally, ‘us’ is the 22 Statistics Canada, Table 176-0075 Fisher commodity price index, United States dollar terms, Bank of Canada, monthly (index, 1972=100). Region: Canada. Commodity: Index. Time Frame: Monthly, Jan. 1972 – Jan. 2016. 23 Statistics Canada, Table 282-0087 Labour force survey estimates (LFS), by sex and age group, seasonally adjusted and unadjusted. Region: Canada, Alberta Ontario. Labour force characteristic: unemployment rate (percent). sex: both sexes. Age group: 15 years and over. Statistic: Estimate. Data type: Unadjusted. Time Frame: Monthly, Jan. 1976 – Jan 2016 24 Zmitrowicz, 2014. 25 Statistics Canada, Table 282-0087 Labour force survey estimates (LFS), by sex and age group, seasonally adjusted and unadjusted. Region: Canada, Alberta Ontario. Labour force characteristic: unemployment. sex: both sexes. Age group: 15 years and over. Statistic: Estimate. Data type: Unadjusted. Time Frame: Monthly, Jan. 1976 – Jan 2016
  • 14. 14 number of short term unemployed, 26 those whose length of unemployment has lasted less than a month. That is, from (1), the number of unemployed in the next period is equal to the number of workers in the present period who have not found a job (1-Ft)ut plus the short term unemployed who held a job in the present period but have become unemployed in the next. Re-arranging (1) we can obtain an expression of the probability of finding a job in any given period as a function of the number of unemployed,27 note that this probability can only be calculated ex-post. 𝐹𝑡 = 1 − 𝑢 𝑡+1 − 𝑢 𝑡+1 𝑠 𝑢 𝑡 (2) while ‘Ft’ is the probability of finding a job, Shimer assumes that in period t, all unemployed workers find a job according to a poisson process thus, ‘ft’, is the rate at which workers find employment, derived as28: 𝑓𝑡 = −ln(1 − 𝐹𝑡) (3) Continuing with Shimer’s methodology, we can also calculate the probability of being separated from employment within a period as the difference between next periods unemployed and the present periods unemployed who have been unable to find work, as a ratio over the total number of employed29: 𝑆𝑡 = 𝑢 𝑡+1 − (1 − 𝐹𝑡)𝑢 𝑡 𝑒𝑡 (4) 26 Statistics Canada. Table 282-0047 - Labour force survey estimates (LFS) – Short Term Unemployment. Region: Canada, Alberta, Ontario. Duration of unemployment: 1 to 4 weeks. Sex: both sexes. Age Group: 15 and over. Time Frame: Monthly, Jan. 1972 – Jan 2016. 27 Shimer, 2012, 130. 28 Shimer, 2012, 130. 29 Shimer, 2012, 131.
  • 15. 15 where ‘ut’ and ‘Ft’ are as previously defined, ‘et’ is the number of employed30 in period t, resulting in ‘St’, the probability of being separated from a job in period t. As with Ft and ft, we can get from the probability of being separated to the rates of separation through the same assumptions and methods, giving us the job separation rate as: 𝑠𝑡 = −ln(1 − 𝑆𝑡) (5) With the variables for labour flows defined, which are assumed to be similar to the job creation and destruction rates as defined by Davis and Haltiwanger (2001), we move to define our variable for energy prices. The series of interest to explore the role of energy shocks is the Bank of Canada Commodity Index for Energy. 31 This index is weighted through the price and production volumes of crude oil32, natural gas, and coal. The Bank of Canada Commodity Index for energy (simply the energy index going forward) is then converted into real terms using the Consumer Price Index for each region33, after this conversion, January 1972 is reset as the base period with a value of 100. Where previous studies focus strictly on the price of oil, typically WTI34, we have chosen to utilize the energy index as a measure of energy prices in order to better capture changes in the cost of energy as faced by firms and consumers. Specifically, oil is not the only energy input 30 Statistics Canada, Table 282-0087 Labour force survey estimates (LFS), by sex and age group, seasonally adjusted and unadjusted. Region: Canada, Alberta Ontario. Labour force characteristic: Employment. sex: both sexes. Age group: 15 years and over. Statistic: Estimate. Data type: Unadjusted. Time Frame: Monthly, Jan. 1976 – Jan 2016 31 Statistics Canada, Table 176-0075 Fisher commodity price index, United States dollar terms, Bank of Canada, monthly (index, 1972=100). Region: Canada. Commodity: Index. Time Frame: Monthly, Jan. 1972 – Jan. 2016. 32 Western Texas Intermediate, Brent and Western Canada Crude. 33 Statistics Canada. CANSIM 326-0020 - Consumer Price Index, by province, monthly (2002=100). Regions: Canada, Alberta, Ontario, Products and product groups: All-items, Time Frame: Monthly, Sept. 1978 – Nov 2015. 34 Kilian & Vigfusson, 2010, 7.
  • 16. 16 being faced by firms, thus by incorporating a weighted index of energy inputs, this is able to better capture the true energy costs being faced by producers and consumers, as well as how these filter through to the macro-economy on whole. Ultimately, the use of this index in practice should not make a large difference, as over the time period evaluated, the real energy index has a correlation with the WTI spot price of 0.964. All data have been collected and manipulated using monthly data, going forward to allow for greater ease in dealing with seasonal unit roots, all series are transformed into quarterly data. This transformation is achieved by taking the average of the observations within each quarter. As a result, the corresponding data has a time range of 1978 Q4 to 2015 Q4, for a total of 149 observations in each of the 4 series. These series have the following naming convention for all graphs and tables: Rnrg for the real energy index, unemp.rate for the unemployment rate, f.rate for the Finding rate and s.rate for the Separation rate. The graphs for these series against time, as well as their summary statistics are displayed in figures 1-3 and tables 1-3 below. 3.2 Methodology The modeling sequence of a VSTAR as proposed by Teräsvirta and Yang (2014) involves first specifying a VAR model35, thus the order of this section will be as follows. First the methodology used to construct a linear VAR model, second a discussion of VSTAR models outlining their functional form and what they allow in modeling, finally, the constructed VAR model will be subjected to tests of linearity, and expanded into a VSTAR model following the aforementioned modeling sequence. 35 Teräsvirta and Yang, 2014, 7.
  • 17. 17 First, each series is tested for the presence of a seasonal unit root using the test of Hylleberg, Engle, Granger, and Yoo (HEGY) (1990). Before testing for seasonal unit roots the energy index series is first transformed by taking the natural logarithm, where the unemployment rate as well as the job finding and separation rates enter as they were presented. Given that all series show a significant trend through time and further more as the data is not seasonally adjusted, the following HEGY test is conducted with seasonal dummies as well as a constant and time trend. The results of these tests are presented in table 4 for each region, while selected critical values for the HEGY test are displayed in table 5 for reference.36 Thus from the above HEGY tests we can conclude that at the 5% significance level, all variables except for selected regions’ unemployment rate should be first or quarterly differenced in order to be made stationary, while the unemployment rates for Canada and Ontario are stationary over this given time period and do not need to be differenced. Thus, after transforming our series to ensure that all variables are stationary, our new series now contains 148 observations from 1979 Q1 to 2015 Q4. The corresponding updated graphs of each variable against time, as well as the summary statistics for each are presented in figures 4- 6 and tables 6-8, where if the series was differenced the series name is pre-fixed with “D_”. With our series being transformed to be stationary we can begin building our VAR model. In essence a VAR is a system of equations, that is, in our case, each of our 4 series is the dependent variable, while the lag of all other series enter in as explanatory variables as well as 36 Hylleberg, Engle, Granger, and Yoo ,1990, 227.
  • 18. 18 Figure 1 Table 1 Series over time: Min Mean Max Standard Deviation Rnrg 39.300 99.518 238.407 43.718 unemp.rate 0.055 0.084 0.135 0.017 f.rate 0.206 0.322 0.448 0.053 s.rate 0.023 0.029 0.036 0.003 Summary Statistics: Canada 1978:Q4 - 2015:Q4
  • 19. 19 Figure 2 Table 2 Series over time: Min Mean Max Standard Deviation Rnrg 40.095 98.633 222.969 41.010 unemp.rate 0.031 0.064 0.122 0.023 f.rate 0.236 0.417 0.669 0.103 s.rate 0.018 0.026 0.039 0.005 Summary Statistics: Alberta 1978:Q4 - 2015:Q4
  • 20. 20 Figure 3 Table 3 Series over time: Min Mean Max Standard Deviation Rnrg 38.393 97.462 233.184 43.089 unemp.rate 0.046 0.076 0.125 0.016 f.rate 0.193 0.329 0.437 0.058 s.rate 0.017 0.026 0.035 0.003 Summary Statistics: Ontario 1978:Q4 - 2015:Q4
  • 21. 21 Table 4 Table 5 HEGY Test, Levels α=5% HEGY Coef T-Stats: Conclusion: Canada l.Rnrg -1.961 -8.690 *** 41.123 *** Quarterly Difference unemp.rate -4.198 *** -4.745 *** 20.852 *** Stationary F.rate -2.871 -4.354 *** 21.263 *** Quarterly Difference S.rate -3.366 * -5.816 *** 52.750 *** Quarterly Difference Alberta l.Rnrg -2.016 -8.898 *** 41.704 *** Quarterly Difference unemp.rate -3.157 -7.983 *** 66.595 *** Quarterly Difference F.rate -2.482 -4.638 *** 68.770 *** Quarterly Difference S.rate -3.263 * -7.348 *** 43.650 *** Quarterly Difference Ontario l.Rnrg -1.946 -8.976 *** 40.970 *** Quarterly Difference unemp.rate -3.855 ** -5.455 *** 17.820 *** Stationary F.rate -2.716 -4.184 *** 19.788 *** Quarterly Difference S.rate -2.760 -5.683 *** 38.785 *** Quarterly Difference Notes: Significance Levels: * 10%, **5%, ***1% Tstat: π1 Tstat: π2 Fstat: π3,π4 H0: πi =0 (Unit Root) HA: πi ≠ 0 (No Unit Root) N = 144, Intercept, Trend, Seasonal Dummies HEGY Test, Differenced α=5% HEGY Coef T-Stats: Conclusion: Canada D_l.Rnrg -6.795 *** -8.449 *** 40.061 *** Stationary unemp.rate D_F.rate -6.024 *** -4.506 *** 22.700 *** Stationary D_S.rate -6.127 *** -4.245 *** 21.349 *** Stationary Alberta D_l.Rnrg -6.794 *** -8.357 *** 39.990 *** Stationary D_unemp.rate -3.990 *** -5.343 *** 25.082 *** Stationary D_F.rate -5.114 *** -4.651 *** 34.210 *** Stationary D_S.rate -6.465 *** -5.778 *** 31.890 *** Stationary Ontario D_l.Rnrg -6.789 *** -8.438 *** 39.946 *** Stationary unemp.rate D_F.rate -5.987 *** -4.313 *** 20.757 *** Stationary D_S.rate -6.578 *** -4.358 *** 17.510 *** Stationary Notes: N = 144, Intercept, No Trend, Seasonal Dummies Significance Levels: * 10%, **5%, ***1% - - Tstat: π1 Tstat: π2 Fstat: π3,π4 H0: πi =0 (Unit Root) HA: πi ≠ 0 (No Unit Root) CV 1% CV 5% CV 10% CV 1% CV 5% CV 10% π1 -4.15 -3.52 -3.21 -3.56 -2.94 -2.62 π2 -3.57 -2.93 -2.61 -3.49 -2.9 -2.59 π3,π4 8.77 6.62 5.55 8.92 6.63 5.56 Seasonal, Intercept, Trend, T=136 Seasonal, Intercept, No Trend, T=136 HEGY Selected Citical Values
  • 22. 22 deterministic variables such as the constant, trend and seasonal dummies. In functional form our VAR takes the following form: 𝑌𝑡 = 𝑋𝑡 𝛽0 + ∑ 𝑌𝑡−𝑖 𝛽1,𝑖 𝑃 𝑖=1 + 𝜀 (6) Where Yt-i from 0 ... P is a (1 X 4) vector lagged P periods. Xt is a (1 X 5) vector of deterministic regressors including a constant, trend and seasonal dummies, 𝜀 is a (1 X 4) vector of residuals, lastly β0, (5 X 4) and β1 (4 X 4) are matrices of coefficients. The next step is to build a VAR model, each of our four series will be included in the VAR in their stationary form, and thus it becomes a process of choosing an appropriate maximum lag length ‘P’ through a process of choosing the model with the smallest information criterion, while jointly ensuring no serial correlation amongst the residuals. In selecting a model, we test for a range of possible maximum lags from one to twelve. From these tests we begin with the lag length as chosen by the Schwarz criterion (SC), From this starting point the lag length is increased until either (A) the inverse roots of the characteristic polynomial for the model’s lag structure are no longer within the unit circle, that meaning the model is dynamically unstable; or preferably (B) until we are no longer able to reject the null of serial correlation by the Breusch-Godfrey test. In this way we are able to select the model with the lowest SC with no serial-correlation in the residuals. In our case, across all models, the SC has been minimized with no serial-correlation in the residuals at a lag length in which all inverse roots are still well within the unit circle which has resulted in a lag length of 3 for Canada and Ontario, and a lag length of 2 for Alberta.
  • 23. 23 Figure 4 Table 6 Differenced Series over Min Mean Max Standard Deviation D_Rnrg -0.496 -0.003 0.324 0.127 unemp.rate 0.055 0.084 0.135 0.017 D_f.rate -0.078 0.000 0.075 0.031 D_s.rate -0.006 0.000 0.006 0.002 Summary Statistics: Canada 1979:Q1 - 2015:Q4
  • 24. 24 Figure 5 Table 7 Differenced Series over time: Min Mean Max Standard Deviation D_Rnrg -0.501 -0.003 0.321 0.126 D_unemp.rate -0.017 0.000 0.024 0.007 D_f.rate -0.139 -0.001 0.189 0.055 D_s.rate -0.007 0.000 0.006 0.003 Summary Statistics: Alberta 1979:Q1 - 2015:Q4
  • 25. 25 Figure 6 Table 8 Differenced Series over time: Min Mean Max Standard Deviation D_Rnrg -0.497 -0.003 0.325 0.127 unemp.rate 0.046 0.076 0.125 0.016 D_f.rate -0.094 0.000 0.082 0.033 D_s.rate -0.008 0.000 0.007 0.003 Summary Statistics: Ontario 1979:Q1 - 2015:Q4
  • 26. 26 With the VAR model identified, we can test under the VAR frame work for the existence of co-integration between our series, where in order for a group of series to be seasonally co- integrated they must have a unit root at the same frequency. Thus, depending on the region, there may be co-integration between all variables, or alternatively, all but the unemployment rate. Using the Johansen method to test for co-integration in the VAR framework, we find no co-integration between any of these series, the results of this test for each region can be found in tables 9-11. With the VAR model now fully specified we can now continue by discussing the role of a VSTAR model before moving on to test for linearity against a STAR alternative. For reference the impulse response functions from the above specified linear VAR models are available in the appendix to refer to the ones to be later constructed with the VSTAR model. The VSTAR model allows for a modeling processes which spans from a linear VAR to a discrete Threshold VAR (TVAR) where all parameters are dependent upon the regime in which the model finds itself in given a threshold or switching parameter. In a TVAR the model has the same amount of states as regimes, that is if a given observation is above a certain threshold then the threshold component of the model is activated (multiplied by 1) alternatively if a given observation is below a certain threshold then the threshold component of the model is not activated (multiplied by 0). A VSTAR model responds extremely similarly in the fact that there are a fixed number of regimes in which the model switches between, but a VSTAR is different in that there are an infinite number of states in which the model could be in between regimes. Thus the key for the VSTAR model is the transition function which controls the rate at which the
  • 27. 27 Table 9 Table 10 Test Stat CV 10% r ≤ 0 25.75 29.12 r ≤ 1 10.90 23.11 r ≤ 2 7.09 16.85 r ≤ 3 6.50 10.49 Test Stat CV 10% r ≤ 0 50.24 59.14 r ≤ 1 24.49 39.06 r ≤ 2 13.59 22.76 r ≤ 3 6.50 10.49 Notes: Lag Length = 4, Including Intercept, Trend and Seasonal Dummies Fail to reject null, no cointegrating vectors Conclusion: HA: r > r₀H₀: r ≤ r₀ "r" represents potential number of co-integrating vectors " Fail to reject null, no cointegrating vectors Conclusion: Trace Test Max Eigenvalue H₀: r ≤ r₀ HA: r=r₀+1 Johansen test for co-integration (Canada) " " " " " Test Stat CV 10% r ≤ 0 21.62 29.12 r ≤ 1 17.03 23.11 r ≤ 2 10.05 16.85 r ≤ 3 6.61 10.49 Test Stat CV 10% r ≤ 0 55.32 59.14 r ≤ 1 33.70 39.06 r ≤ 2 16.66 22.76 r ≤ 3 6.61 10.49 Notes: Lag Length = 3, Including Intercept, Trend and Seasonal Dummies Fail to reject null, no cointegrating vectors " " " "r" represents potential number of co-integrating vectors " " " Trace Test H₀: r ≤ r₀ HA: r > r₀ Conclusion: Johansen test for co-integration (Alberta) Max Eigenvalue H₀: r ≤ r₀ HA: r=r₀+1 Conclusion: Fail to reject null, no cointegrating vectors
  • 28. 28 Table 11 model transitions between regimes as opposed to the TVAR model which discretely jumps between regimes. Typically, this transition function takes the form of a logistic function, in which case the model is referred to as an LSTAR model, which allows for a smooth transition between 0 and 1 with an infinite number of states occurring between the two regimes. Alternatively, the transition function can take the form of an exponential function, in which case the response is symmetric around the threshold, and again allows for an infinite number of states between the regimes. The graphical representations of both LSTAR and ESTAR transition functions are presented below in figure 7. Test Stat CV 10% r ≤ 0 22.81 29.12 r ≤ 1 16.11 23.11 r ≤ 2 10.37 16.85 r ≤ 3 4.02 10.49 Test Stat CV 10% r ≤ 0 53.31 59.14 r ≤ 1 30.50 39.06 r ≤ 2 14.39 22.76 r ≤ 3 4.02 10.49 Lag Length = 4, Including Intercept, Trend and Seasonal Dummies Fail to reject null, no cointegrating vectors " " " "r" represents potential number of co-integrating vectors Notes: " " Trace Test H₀: r ≤ r₀ HA: r > r₀ Conclusion: Max Eigenvalue H₀: r ≤ r₀ HA: r=r₀+1 Conclusion: Fail to reject null, no cointegrating vectors " Johansen test for co-integration (Ontario)
  • 29. 29 Functionally the LSTAR and ESTAR models contain the same variables: 𝐿𝑆𝑇𝐴𝑅: 𝐺(𝑆𝑡; 𝛾, 𝑐) = 1 (1 + 𝑒−𝛾(𝑆 𝑡−𝑑−𝐶)) (7) 𝐸𝑆𝑇𝐴𝑅: 𝐸(𝑆𝑡; 𝛾, 𝑐) = 1 − 𝑒−𝛾(𝑆 𝑡−𝑑−𝐶)2 (8) where in both equations (7), LSTAR, and (8), ESTAR, γ is a parameter which controls the speed at which each respective function transitions between regimes. In the case of an LSTAR as γ approaches 0, G(St; γ, c) collapses to a value of 0.5, leaving us with a linear model; and as γ approaches ∞, G(St; γ, c) discretely jumps between regimes, in essence becoming a threshold model with two regimes. Alternatively, in the case of an ESTAR, E(St; γ, c) collapses to a linear model when γ approaches either 0 or ∞. In each case St-d is a switching variable which is the variable that triggers the change between regimes. St-d can be an endogenous variable in which case d, the delay factor is between 1, and the maximum lag length chosen. Alternatively, St-d may be an exogenous factor such a time trend allowing the model to react differently as it moves through time. In the case of an LSTAR, G(St; γ, c) approaches 0 and 1 as St-d approaches -∞ and ∞ respectively. For an ESTAR, E(St;γ,c) approaches 1 as St-d approaches either ± ∞ and approaches 0 as St-d approaches c, the threshold. In our case the switching variable, St-d, is a lagged value of the difference of the log of the real energy index, while the threshold, c, and γ are estimated for each equation.
  • 30. 30 Figure 7 In the case of our VAR, any given equation can be viewed as: 𝑦 𝑘,𝑡 = 𝑋𝑡 𝛽0 + ∑ ∑ 𝑦 𝑘,𝑡−𝑗 𝛽 𝑘,𝑡−𝑖 + 𝜀𝑖 𝑝 𝑖=1 4 𝑘=1 (9) Where ykt is the dependent variable for equation k, for k in 1 to 4, Xt is a (1 x 5) vector of deterministic variables including an intercept, trend and seasonal dummy variables, yk,t-i is the lagged value for each of our 4 series from i to P, finally β is the coefficient for each respective variable. Extending this model to a STAR involves the addition of a given transition function to be multiplied by our right hand side, the result would be an equation as can be seen below.
  • 31. 31 𝑦𝑖,𝑡 = ( 𝑋𝑡 𝛽0 + ∑ ∑ 𝑦𝑖,𝑡−𝑗 𝛽𝑖,𝑡−𝑗 𝑝 𝑗=1 4 𝑖=1 ) + ( 𝑋𝑡 𝜃0 + ∑ ∑ 𝑦𝑖,𝑡−𝑗 𝜃𝑖,𝑡−𝑗 𝑝 𝑗=1 4 𝑖=1 ) ∗ 𝑓(𝑆𝑖,𝑡−𝑑; 𝛾𝑖, 𝑐𝑖) + 𝜀𝑖 (10) Thus in each equation, all terms enter in linearly as well as being multiplied by the transition function which is bounded between 0 and 1 and allows the model to react differently as shocks push the model into various states between the regimes. Particularly, the transition function completely alters the model based on where the transition function falls on the continuum from 0 to 1. Specifically, for each of the infinite possible states there are different coefficient values for the intercept, trend, seasonal effects, as well as the coefficients on each of the variables as each has been multiplied by the respective value of the transition function. Such a model allows for an extremely flexible modeling process which allows these parameters to change based off of where a switching variable ‘St-d’ finds itself in relation to the threshold. With the purpose and functionality of the VSTAR model laid out, we can now begin the modeling process as proposed by Teräsvirta and Yang (2014). This modeling process as previously eluded to is outlined below: 37 1. Estimating a linear stationary VAR model. 2. Testing the linear VAR against an LSTAR alternative. a. This implies selecting the transition variable(s) and delay factors (St-d) 3. If linearity is rejected, estimating the VSTAR model by non-linear least squares 4. Evaluation of the model through misspecification tests for 37 Teräsvirta and Yang, 2014, 7-8.
  • 32. 32 a. Serial correlation b. Dynamic instability. With the Linear VAR identified, the next step is to test the null of linearity against an LSTAR alternative. This can be done equation be equation, in order to allow each equation to have a separate transition function, or alternatively, enter linearly into the VSTAR model.38 Recalling the transition function G(St;γ,c) which collapsed to a linear model as γ approached zero, the test for linearity against a STAR alternative should be as simple as testing H0: γ=0 for each of the k equations. Unfortunately, this testing procedure is complicated by the presence of unidentified nuisance parameters.39 The solution as proposed by Luukkonen, Saikkonen and Teräsvirta (1988) is to replace the transition function G(St;γ,c) with a suitable Taylor series approximation around γ=0.40 Through this approach there is no longer an identification problem, and linearity can be tested by means of a Lagrange Multiplier test whose statistic has a standard χ2 asymptotic distribution under the null.41 Where a 3rd order Taylor series approximation is recommended42, any given equation in (10) can be expressed as: 𝑦 𝑘𝑡 = 𝑧𝑡 𝛽0 + 𝑧𝑡 𝑠𝑡−𝑑 𝛽1 + 𝑧𝑡 𝑠𝑡−𝑑 2 𝛽2 + 𝑧𝑡 𝑠𝑡−𝑑 3 𝛽3 + 𝑒𝑡 (11) where ykt is a given dependent variable for the kth equation, Zt is a (1 x (5+kp)) vector of all regressors including deterministic variables and lagged dependent variables; and finally st-d is 38 Teräsvirta and Yang, 2014, 7-8. 39 Van Dijk, Teräsvirta and Franses, 2002 ,10. 40 Luukkonen, Saikkonen and Teräsvirta, 1988, 494. 41 Van Dijk, Teräsvirta and Franses, 2002,11. 42 Van Dijk, Teräsvirta and Franses, 2002,11.
  • 33. 33 the switching variable for d from 0 to p. As such the null of linearity that γ=0 can be tested as H0 ’’: β1= β2= β3=0, and the test statistic is denoted as LM3 which has a standard χ2 asymptotic distribution under the null. Where this LM3 statistic is calculated for all possible delay factors on St-d where d can be between 1 and the maximum lag length, p, the choice of ‘d’ is the resulting LM3 statistic which is most significant. 43 If linearity is rejected in favour of a STAR alternative, the following auxiliary regressions based off the Taylor series approximation in (11) and series of tests are proposed to differentiate between an ESTAR and LSTAR model. 44 𝐻01: 𝛽3 = 0 𝐻02: 𝛽1 = 𝛽2 = 0 | 𝛽3 = 0 𝐻03: 𝛽1 = 0 | 𝛽2 = 𝛽3 = 0 Where the notation for H02 and likewise H03 can be thought of as a restriction of the Taylor series approximation in (11), that is for H02 we are testing that β1 and β2 are jointly zero given that β3 is restricted to be zero. If H02 is the most significant of the three nulls, then the model is ESTAR over LSTAR45, again this test can be carried out in the same fashion as the test for linearity with a LM test whose statistic again has a standard χ2 asymptotic distribution under the null. Of important note, as has been shown and referenced by Teräsvirta (1994), these above tests can also be carried out as F-tests, where often, the F variant may be preferred. The 43 Teräsvirta, 1994, 211. 44 Teräsvirta, 1994, 211. 45 Teräsvirta, 1994, 212.
  • 34. 34 reason for this preference is that the χ2 version has been found to be over sized in cases of a large maximum lag length, and short time series.46 In our case however, we are dealing with a time series of sufficient length, and as will shortly be discussed, a short maximum lag length. Thus the LM statistic is utilized with extra attention being applied to threshold results. The tests for linearity are conducted equation by equation47 for each of the regions, for an array of lag lengths and delay values. In each equation, the rejection of linearity is dependent on the lag length chosen, typically we are more likely to reject linearity as the lag length increases, as well these results are sensitive to the region, with some regions more readily rejecting linearity than others. However, the final lag length is not determined until a later step, to be parsimonious, the final test results are displayed below in Table 1248 for a lag length of 2 for the provinces and 3 for Canada, which were the final selected maximum lag lengths for the respective regions. As can be seen, in all cases the difference of the log of the real energy index adjusts through an LSTAR process around itself. Alternatively, unemployment generally adjusts linearly around the energy index, while the job finding rate is generally an ESTAR process and separation rates a LSTAR, but dependent on the region. 46 Teräsvirta, 1994, 210. 47 Teräsvirta and Yang, 2014, 7. 48 Given the number of tests involved for each of these results, the tests themselves have been omitted to conserve space, but can be made available upon request.
  • 35. 35 Table 12 With the functional form of each equation now determined, we move on to the process of estimating the parameters for the STAR model in each region. This process is performed as outlined in Teräsvirta and Yang (2014). Using non-linear least squares equation by equation we estimate the starting values for γ and c. However, as non-linear least squares can be sensitive to the starting values provided, and furthermore can be computationally intensive if many parameters are in need of being estimated, the following method is utilized. First a grid of potential values is created for γ and c, for each fixed initial value of γ0 and c0, β0 can then be estimated by a linear regression, where β is all other coefficients. Then, with β0 estimated, these values of β0 are then fixed and γ1 and c1 are then estimated using non-linear least squares, with the starting values for γ1 and c1, being the initial grid values of γ0 and c0, where this process of recursively estimating γi, ci and βi is continued until the values of the parameters converge between estimation, that is the difference between γi, ci and γi-1, c i-1 is below a given tolerance. This whole process is then repeated for each value in the grid with the final Transition Function Delay Factor Transition Function Delay Factor Transition Function Delay Factor D_l.Rnrg LSTAR 1 LSTAR 1 LSTAR 2 unemp.rate LSTAR 1 Linear - Linear - D_f.rate ESTAR 3 Linear - ESTAR 2 D_s.rate LSTAR 3 LSTAR 2 Linear - Resulting Transition Functions and Delay Factors from Linearity Test Dependent Variable The unemployment rate is not consistently first differenced across regions, thus the dependent variable enters as specified following the HEGY test. Notation above is in levels as this is the case for 2/3 regions. This notation carries on going forward Notes: Canada Alberta Ontario
  • 36. 36 estimates of γ and c being chosen by the values which return the lowest sum of squared residuals for the equation. 49 After each equation is estimated individually, each equation is then combined in a system of equations, and using Seemingly Unrelated Regressions model (SUR) we estimate this system of four equations as a whole to obtain our final parameter estimates50, the resulting values of γk, ck as well as the corresponding graphical representation of the transition function by equation and region can be found for each region in figures 8-10 as well as the transition and threshold estimates for each equation and region in table 13. Table 13 Of particular note with the transition functions as displayed is the speed of transition between regimes. For Canada we witness an array of speeds and transition functions, the difference of the log of the real energy index has a slow transition between regimes and given 49 Teräsvirta and Yang, 2014, 10. 50 Given the number of parameters estimated in this model they are not listed in this essay in order to conserve space, however they can be made available upon request. Equation by Dependent Variable: γ c γ c γ c D_L.Rnrg 4.759 -0.053 1399.775 -0.010 22.609 -0.077 SE 0.256 0.006 22507.349 0.007 13.158 0.027 Unemp.rate 51.936 0.043 SE 22.162 0.011 D_F.rate 25.735 -0.203 268.488 0.079 SE 9.188 0.033 61.899 0.007 D_S.rate 4976.455 0.074 68.835 0.029 SE 16405.120 0.002 37.533 0.010 Notes: Linear Linear Linear Estimated coeficients for transition variable, γ, and threshold, c Canada Alberta Ontario Standard Errors in italics Linear
  • 37. 37 the time period we have no data point ever actually hits the high or low regime. Conversely the unemployment rate and job separation rate adjust rapidly between regimes, especially in the case of the separation rate which has a near discrete jump. Finally, the job finding rate adjusts through a near symmetric ESTAR process around a threshold of -0.2 giving the threshold the approximate interpretation of a 20% decrease in the index. This extreme threshold value however allows the ESTAR to approximate an LSTAR in cases when the change in the index is Figure 8
  • 39. 39 Figure 10 greater than approximately -20%, while at the same time, models that extreme changes in the index which are greatly less that -20% respond with states, and ultimately a regime which is similar to large increases in the index. Looking at the resulting VSTAR estimates for γ and c, as well as the transition functions for Alberta and Ontario also give us an insight as to how we may expect these models to react in the case of an energy price shock in each respective region. For example, in Alberta, both non-linear equations, the difference of the log of the real energy index as well as the job separation rate adjust fairly rapidly around their given threshold, meaning any shock which causes a jump around this threshold will have a drastic effect on the model as it could push the model entirely from one regime to the next. Conversely Ontario’s difference of the log of the
  • 40. 40 real energy index adjusts extremely slowly between the two regimes, and thus any shock to the price index will likely not cause the model to switch regimes, but just move along the continuum of states. Finally, is the job finding rate in Ontario which, like Canada, adjusts through an ESTAR process, the difference in the Ontario case the speed at which this function transition between regimes, specifically here it only takes about a 10% change in the index from the threshold value to jump regimes. Although our results, and discussion so far have centred around the situation where we have a STAR(2,3) model, this distinction has not yet been made in the modeling process. With a STAR model estimated we now need to subject each model to specification tests to select the maximum, lag length, ensure dynamic stability and no serial correlation. In each case the lag length is chosen by the SC, and in each case a maximum lag-length of 1 is selected. However, as with the VAR1 model, this results in a model with serial correlation. Thus following the method used with the linear VAR model, lag length is gradually increased until serial correlation is eliminated such that the model remains stable. As for stability, in the case of a VAR model, this is determined through ensuring the inverse roots of the VAR process remain inside the unit circle. Teräsvirta and Yang (2014) point out, this would be a naïve approach for a VSTAR model, and instead stability can be tested through an impulse response function, by ensuring that the system converges to zero.51,52 51 Teräsvirta and Yang, 2014, 13. 52 Van Dijk, Teräsvirta and Franses, 2002, 22.
  • 41. 41 Through these specification tests, we arrive at a lag length of 3 for Canada, and 2 for both provinces, such that this lag length eliminates serial correlation, while providing a stable system. In all cases, any longer of lag length yields explosive results when shocked. The results of the Breusch-Godfrey test for serial correlation, as well as the information criteria and Mean Squared Error (MSE) for the STAR and VAR model are displayed below in table 13 Table 14 With the models estimated, checked for serial correlation, the next step is to ensure stability of the model. That is, to ensure that the model does not explode when a shock is applied to it. The test for stability is conducted using Impulse Response Functions (IRFs) to ensure that our model converges to zero after a shock. These IRFs are calculated through a dual H period dynamic forecast, first we dynamically forecast H periods ahead from the mean value of the variables with the STAR model, this becomes the control case. The second step is to VAR3 STAR3 VAR2 STAR2 VAR3 STAR2 Schwarz Criterion (SC) -3573.48 -3218.02 -3092.66 -2990.45 -3264.42 -3201.83 Akaike Information Criterion (AIC) -3874.05 -3854.01 -3363.17 -3374.40 -3604.19 -3585.77 Mean Square Error (MSE) 0.0131 0.0102 0.0147 0.0133 0.0137 0.0129 Equation by Dependent Variable: VAR3 STAR3 VAR2 STAR2 VAR3 STAR2 D_L.Rnrg 0.21 0.39 0.68 0.68 0.21 0.44 Unemp.rate 0.52 0.45 0.93 0.96 0.43 0.77 D_F.rate 0.70 0.70 0.59 0.55 0.37 0.08 D_S.rate 0.92 0.94 0.88 0.61 0.90 0.67 Notes: Canada Alberta Ontario Information Critera and MSE for VAR and VSTAR Models by Region P-Values Breusch-Godfrey test for Serial correlation of residuals H0: No serial correlation up to p+1, HA: Serial correlation, α=5% Canada Alberta Ontario
  • 42. 42 repeat the above dynamic H period forecast, except this time shocking the forecast with a single period shock of the real energy index, this shock value takes the value of ± 1 and 2 standard deviations of the real energy index variable, translating to approximately a 13% and 26% change in the index in the shocked period. The next step is to then estimate the confidence intervals for these IRFs, this is done following the 5 step bootstrap method as proposed by Benkwitz, Lutkepohl and Wolters (2001). First the model itself is estimated. Second, with no serial correlation of the residuals, we generate bootstrapped residuals by randomly drawing with replacement from the set of estimated and re-centered residuals. Third, we generate values of Y* by predicting values using the original model and bootstrapped residuals. Fourth, we re-estimate the model, obtaining new parameter estimates from the generated data Y*. Finally, we calculate the bootstrapped version of the statistic of interest (IRF) based on the parameter estimates in the fourth step. 53 Through this process we obtain an IRF for the STAR models with a confidence interval around the point estimate. Given the noise associated with a VAR let alone the further loss of efficiency in estimating the effect of the transition function on all variables, the resultant IRF confidence interval for the STAR is very large resulting in insignificant effects from all shocks at a standard 90% or 95% confidence interval. As a result, in order to demonstrate the general path of the point estimate as well as to portray an understanding of the associated variability, these IRFS are presented along with an one standard deviation confidence interval of the estimate at each realization. 53 Benkwitz, Lutkepohl and Wolters 2001, 84.
  • 43. 43 4. Discussion of Results To bring the discussion back to the question at hand after dealing with the methodology, the question of study is how do shocks in the price of energy effect labour flows in Canada, Alberta, and Ontario. Specifically, we looking for the degree of asymmetry, if any, between positive and negative price shocks, as well as evaluating why there has been a change in the unemployment rate through observing the changes to the job finding and separation rates. Following Davis and Haltiwanger (2001), we are specifically looking to see if unemployment rates are effected through aggregate channels, being the typical macro analysis, or allocative channels referring to the impact of energy shocks in disrupting the match between capital and labour.54 The evaluation of the results will be done region by region, starting first with Canada before moving on to Alberta and finishing with Ontario. For each region a positive and negative shock was computed for one and two standard deviations of the history of the difference of the log of the real energy index, this translates into approximately a ±13% and ±26% shock to the energy price index in a given period. For each of the IRFs a positive energy price shock is denoted by a blue line and confidence interval, where a negative energy price shock is denoted by a red line and confidence interval. Additionally, the IRFs for the labour flows which have been differenced to be made stationary, a cumulative effect IRF is shown in order to demonstrate how a given shock would impact the rate. Specifically, that is a cumulative IRF is used for all job finding and separation rates as well as the unemployment rate in Alberta.55 54 Davis and Haltiwanger, 2001, 468. 55 The IRFs for these variables without the cumulative effect can be found in the appendix for reference.
  • 44. 44 For Canada, the resulting IRFs are displayed in figures 11-18, In general we find that unemployment reacts asymmetrically to shocks in the price of energy with negative shocks having a greater effect than positive ones. Furthermore, as can be seen in comparing the difference between a one and two standard deviation shock, the effect is just over doubled as the magnitude of the shock doubles. Specifically, following a -13% shock to the energy index the national unemployment rate increases by just over 0.20% points, this effect peaks approximately a year after the shock hits the system and is sustained for about two years following the shock before gradually diminishing. Mean while, following a -26% shock to the energy index, the national unemployment rate increases rapidly, peaking again one year after the shock at almost a 0.45% point increase in the unemployment rate, where again this effect is sustained for about two years following the shock before gradually diminishing. Conversely following a positive shock of +13% to the energy index, we witness the unemployment temporarily decreasing by about 0.15% points which is maintained for about a year after the shock, before completely being diminished. The impact of a +26% shock to the energy index has a slightly larger effect, decreasing the unemployment rate by a maximum of about 0.2% points for about a year following the shock before increasing the unemployment rate by about the same amount before gradually diminishing. Importantly however, the effect of a positive shock on unemployment rates is not significant at any point given our one standard deviation confidence interval. Given the strong asymmetry in unemployment rates, even at a one standard deviation shock, this seems to hint towards national unemployment rates being
  • 45. 45 impacted due to these changes causing a mismatch in optimal levels of capital and labour, and thus through allocative channels.56 56 Davis and Haltiwanger, 2001, 468. Figure 11
  • 48. 48 Figure 14 Moving on to evaluating the job finding and separation rates, we further find evidence that the national unemployment rate is primarily effected through allocative channels due to energy price shocks, this is especially apparent for positive shocks, while negative shocks seem to have little if any effect on the job separation rate. For a positive shock, it can be clearly seen
  • 49. 49 that both the job finding and separation rates initially spike in the 3rd quarter following a positive energy shock, with by far the greater change happening in the job finding rate which falls in line with the arguments made by Shimer (2012) 57 and the results of Ordonez et al. (2010) in evaluating the same question for the US economy58 . Thus it seems clear that for Canada on the national level, employment is primarily altered following an energy price shock, especially a positive one, due to firms re-optimizing capital to labour ratios. While positive shocks have very limited effects on the national unemployment rate as compared to negative shocks, there is still spikes in finding and separation rates, thus it would appear that such positive shocks result in a lot of movement between industries or sectors, however at this point this is clearly conjecture and an area for further study. Conversely negative energy price shocks appear to have a large impact on both the unemployment rate and job finding rate, but very little if any impact on the job separation rate. This result seems to suggest that the primary cause for the increasing unemployment rates following a negative energy price shock is not due to workers being separated from their employment at higher rates, but rather suggests a greater difficulty for the unemployed to find work. 57 Shimer, 2012, 127. 58 Ordonez, et al, 2010, 92.
  • 53. 53 Figure 18 For Alberta, we find the resulting IRFs in figures 19-26. First, it is worth recalling that Alberta was the only region in which the unemployment rate was differenced in order to make stationary, thus the IRF for the unemployment rate is not showing the time path of the unemployment rate following a shock, but rather the cumulative effect of the quarterly
  • 54. 54 differences giving us an estimate of how the unemployment rate would adjust following a shock. Aside from this distinction, it can be observed that Alberta actually tends to react asymmetrically to energy price shocks, although not as asymmetrically as Canada, with negative shocks having almost two times the effect on the change in unemployment rates compared to positive ones. Thus although there is a level of asymmetry, given its less extreme nature, it is difficult to make a judgement as to the channel by which employment is effected at this point. Specifically, however, the impact of an approximate -13% energy price shock results in an increase in the unemployment rate by 0.35% points within a year of the shock, where this effect carries on eventually stabilizing at an increase in the unemployment rate of 0.5% points, however this effect is no longer significant given our confidence intervals after 7 quarters. In the case of an approximate -26% energy price shock, the impact on the Albertan unemployment rate is an increase by about 0.75% points within a year of the shock, where again this impact carries on and eventually stabilizes at a level which is about a 0.8% point increase in the unemployment rate when compared to before the shock. Looking at the impact of positive energy price shocks we see unemployment rates following a similar time frame, but with smaller effects. In the case of an approximate +13% shock to the energy price index, we witness that there is about a -0.3% point change in the unemployment rate compared to pre-shock within just over a year of the energy price shock before leveling out at a new unemployment rate which is approximately 0.2% points lower than before the shock. Following an approximate +26% shock to the energy index the
  • 62. 62 Figure 26 unemployment rate decreases by almost 0.6% points within five quarters of the shock, before leveling out at a new lower unemployment rate which is about 0.4% points lower than pre- shock. The most obvious impact in the Albertan case regarding energy price shocks on
  • 63. 63 unemployment rates is the difference in the magnitude between positive and negative shocks, with negative shocks having a much greater impact on unemployment rates. Turning the attention then to the job finding and separation rates, we further find that the job finding rate is the biggest mover, similar to what was found for the Canadian case. Opposite of Canada however is the effect of an energy price shock on these rates, recall that in the Canadian case, both rates tended to move together in same direction implying that employment adjusted through allocative channels. Meanwhile in the Albertan case, the job finding and separation rates clearly diverge, moving in opposite directions following a shock which is indicative that changes in employment in Alberta around energy shocks are primarily due to aggregate channels, that being firms changing their demand for factors of production as the economy moves into either an inflationary or a recessionary output gap. Finally, the results for Ontario, where the corresponding IRFs can be found in figures 27- 34. Ontario provides results which we found unexpected and which are almost a hybrid between the results found for Canada and Alberta. Starting with unemployment rates, it can be seen that the unemployment rate follows a fairly symmetric adjustment process, however under the larger two standard deviation shock, a positive shock has a slightly larger effect. Thus from looking at the effect on unemployment rates it would appear as if Ontario is following a similar path as Alberta. Specifically, following an approximate -13% shock to the real energy price index we witness the unemployment rate in Ontario peaking at just over a 0.1% point increase about a year after the shock before gradually returning to zero, with the impact having virtually disappeared within two years of the shock. Under an approximate -26% shock to the
  • 64. 64 real energy price, we witness an almost identical time path, peaking at just under a 0.25% point increase in unemployment rates a year after the shock before diminishing to zero, with no real impact lasting after about two years. In both the Canadian and Albertan case, negative shocks had a larger effect on the unemployment rate, in Ontario we witness the opposite, where positive energy shocks have a slightly greater impact on the unemployment rate. Specifically, an approximate +13% shock to the real energy index translates to about a 0.13% point decrease in the Ontario unemployment rate, peaking about a year after the shock before very gradually diminishing, reaching no effect with our confidence interval within two years of the shock. Following an approximate +26% shock to the real energy index we witness the unemployment rate dropping by over 0.25% points peaking in the fifth quarter following the shock before diminishing over the next five years. While in this latter case the impact of the energy price shock on the unemployment rate does not fully diminish to zero within our confidence interval over the 5 years displayed, as it takes a full 9 years for this effect to no longer be significant given our interval, however the magnitude of the impact after 5 years is negligible. When evaluating the job finding and separation rates however, we see that in fact these rates again generally move together, as was found for Canada. That is, that this strongly seems to suggest that changes in employment in Ontario following an energy price shock adjust through allocative channels, disrupting the optimal capital to labour ratios, however given that unemployment rates react fairly symmetrically to both positive and negative shocks, it would also appear that aggregate channels may play an important role in determining employment in Ontario.
  • 68. 68 Figure 30 The area that we found most surprising with Ontario however is the rough symmetry in unemployment rates, with positive shocks having a slightly larger impact which is the opposite of Canada and Alberta. As Ontario’s industry make-up is heavy in manufacturing, we initially expected a positive energy price shock to have little effect, if not increase unemployment rates
  • 69. 69 due to the flow through provided by Cox and Harvie (2010) following a positive oil price shock. specifically, we would expect following a positive energy price shock that manufacturing firms, which are assumed to be capital intensive, begin to face higher capital utilization costs and unfavourable exchange rates, that this would filter through to see the unemployment rate in Ontario being negatively impacted. Interestingly however, unemployment rates actually decrease in light of higher energy prices. This impact could be due to either (a) Ontario’s manufacturing sector supporting Alberta’s Oil and Gas sector, and thus despite the rise in costs, Ontario’s manufacturing firms also see increased demand. Another possibility linked to (a) is that despite the unfavourable exchange rate, higher energy prices are typically related to a strong US economy and thus due to increased American demand the manufacturing industry in Ontario still remains strong. Alternatively, (b) capital and labour may be close substitutes in many of these firms, thus as capital utilization costs increase, firms are able to shift their production process from capital intensive to labour intensive methods. Although it is unlikely that the manufacturing production process is flexible enough that capital and labour can be so readily substituted in the short run. The final possibility, which may be the most likely, (c) is that the true data generating process for Ontario has a longer lag length than we are able to model. The reason for the suspicion brought up in (c) is that we are only weakly failing to reject no serial correlation for this model, meaning that if stability was not an issue, I would much rather model this process with a longer maximum lag length. Additionally, as our rejection of linearity has been dependent on lag length, it may be that more variables are found to adjust non- linearly with a longer lag length chosen which may drastically change the model.
  • 73. 73 Figure 34 5. Conclusions Although the above results differ as much as the regions they explain, the common aspects echo and add to previous studies in the US. That is, the job finding rate in all regions is impacted by a far greater magnitude than the separation rate following an energy price shock,
  • 74. 74 leading to a conclusion which is similar to that of Shimer and Ordonez et al. that changes in job finding rates appear to account for the majority of changes in the unemployment rate. Further, following Hamilton, as well as Davis and Haltiwanger, there is evidence that labour flows adjust non-linearly, and asymmetrically to energy price shocks, however this result is sensitive to the region evaluated, as the level of asymmetry is clearly greater in some regions over others. As for Canadian specific results, following this analysis, it seems that Canada and Alberta are far more sensitive to negative shocks than positive ones regardless of magnitude, where negative shocks have a far greater adverse effect on unemployment rates. Ontario on the other hand has a slightly greater beneficial effect following a positive energy shock over a negative, although both effects are nearly symmetrical. Thus is seems that generally, with the exception of Ontario, that labour flows are impacted by decreasing energy prices more than they are by increasing ones. Further it seems split depending on region as to through which channel employment is impacted following shocks to the energy price, but that for Canada on whole, it is clear that changes are due to allocative changes between firms capital and labour mix following a shock, while in Alberta, changes in labour flows are distinctly through aggregate channels, while Ontario seems to be impacted by both, with the effect of allocative channels being very clear in the job finding and separation rates, while aggregate channels can be seen in the fairly symmetric unemployment response. As was mentioned through out the essay there are many areas for further research to be done on this topic for the Canadian case. First would be to extend this analysis to the rest of
  • 75. 75 the provinces to provide a distinctive understanding as to how each province is impacted. Second would be to repeat the above with a measure to control for migration between provinces, as presently the results will be affected by this as capital and labour migrate to areas with work from areas without work following energy price shocks. Third, this process may be repeated using different modelling techniques to capture the non-linear relationship which may be able to overcome the issues of serial correlation and stability which may be effecting the Ontario case. Finally, although not an exhaustive list, this process could be modelled in relation to the broader macro-economic environment, that is through including variables for regional price level and real GDP to model not only how labour flows are impacted following an energy price shock but also how the whole economy adjusts following such a shock under the AD-AS frame work.
  • 76. 76 References Benkwitz, Alexander, Helmut Lutkepohl, and Jurgen Wolters. "Comparison of bootstrap confidence intervals for impulse resonses of German monetary systems." Macroeconomic Dynamics 5 (2001): 81-100. Canty, Angelo, and Brian Ripley. "boot: Bootstrap R (S-Plus) Functions." 2016. Cox, Grant M, and Charles Harvie. "Resource price turbulence and macroeconomic adjustment for a resource exporter." Energy Economics 32 (2010): 469-489. Davis, Steven J, and John Haltiwanger. "Sectorial job creation and destruction responses to oil price changes." Journal of Monetary Economics 48 (2001): 465-512. Engle, R F, S Hylleberg, C W J Granger, and B S YOO. "Seasonal Integration and Cointegration." Journal of Econometrics, 1990: 215-238. Fox, John, and Sanford Weisberg. An R Companion to Applied Regression. Second. Thousand Oaks: Sage, 2011. Grosjean, Philippe, and Frederic Ibanez. "pastecs: Package for Analysis of Space-Time Ecological Series." 2014. Hamilton, James D. "Nonlinearities and the Macroeconomic Effects of Oil Prices." Macroeconomic Dynamics 15, no. 3 (2011): 364-378. Hamilton, James D. "What is an oil shock?" Journal of Econometrics 113 (2003): 363-398. Henningsen, Arne, and Jeff Hamann. "systemfit: A Package for Estimating Systems of Simultaneous Equations in R." Journal of Statistical Software 23, no. 4 (2007): 1-40. Hyndman, Rob, J. "forecast: Forecasting functions for time series and linear models." 2015. Kilian, Lutz. "Oil Price Shocks: Causes and Consequences." Annual Review of Resource Economics 6 (2014): 133-154. Kilian, Lutz, and Robert J Vigfusson. "Nonlinearities in the Oil Price-Output relationship." Working Paper, University of Michigan., 2010: 1-50. Lian, An, Jin Xiaoze, and Ren Xiaomei. "Are the macroeconomic effects of oil price shock symmetric?" Energy Economics 45 (2014): 217-228. Luukkonen, Ritva, Pentti Saikkonen, and Terasvirta Timo. "Testing Linearity Against Smooth Transition Autoregressive Models." Biometrika 75, no. 3 (1988): 491-499. Ordonez , Javier, Hector Sala, and Jose l Silva. "Oil Price Shocks and Labor Market Fluctuations." The Energy Journal 32, no. 3 (2011): 89-118.
  • 77. 77 Pfaff, Bernhard. "VAR, SVAR and SVEC Models: Implementation Within R Package vars." Journal of Statistical Software 27, no. 4 (2008). Pfaff, Bernhard. Analysis of Integrated and Cointegrated Time Series with R. New York: Springer, 2008. Rmetrics core team, Diethelm Wuertz, Tobias Setz, and Yohan Chalabi. "timeSeries: Rmetrics - Financial Time Series Objects." 2015. Shimer, Robert. "Reassessing the ins and outs of unemployment." Review of Economic Dynamics 15 (2012): 127-148. Tatom, A John. "The Macroeconomic Effects of the Recent Fall in Oil Prices." Federal Reserve Bank of St.Louis, 1987: 34-45. Terasvirta, Timo. "Specification, Estimation, and Evaluation of Smooth Transition Autoregressive Models." Journal of the American Statistical Association 89, no. 425 (1994): 208-219. Terasvirta, Timo, and Yukai Yang. "Linearity and Missepcification Tests for Vector Smooth Transition Regression Models." CREATES Research paper, 2015: 1-37. Trapletti, Adrian, and Kurt Hornik. "tseries: Time Series Analysis and Computational Finance." 2015. Uri, Noel D. "Crude oil price volatility and unemployment in the Unites States." Energy 21, no. 1 (1996): 29-38. Van Dijk, Dick, Timo Terasvirta, and Philip Hans Franses. "Smooth Transition Autoregressive Models -- A Survey of Recent Developments." Econometric Reviews 21, no. 1 (2002): 1- 47. Wickham, Hadley. ggplot2: Elegant Graphics for Data Analysis. New York: Springer-Verlag, 2009. Wickham, Hadley, and Romain Francois. "dplyr: A Grammar of Data Manipulation." 2015. Wuertz, Diethelm. "fUnitRoots: Trends and Unit Roots." 2013. Zeileiz, Achim, and Gabor Grothendieck. "zoo: S3 Infrastructure for Regular and Irregular Time Series." Journal of Statistical Software 14, no. 6 (2005): 1-27. Zmitrowicz, Konrad, and Mikael Khan. "Beyond the Unemployment Rate: Assessing Canadian and U.S. Labour Markets Since the Great Recession." Bank of Canada Review, 2014: 42- 53.
  • 78. 78 Appendix: IRFs by Region for VAR Canada
  • 81. 81 Appendix: Non-cumulative IRFs for differenced labour flows from VSTAR models
  • 82. 82
  • 83. 83
  • 84. 84
  • 85. 85 Appendix: R Code, Region: Canada In regards to the code below: much of the code has been commented out, as many functions and output take several hours to run the necessary loops, and thus the results were written to drive and later re-read rather than re-running the entire code file. As a result, most commented lines, (beginning with ‘#’) will need to have the # removed before running in full. Additionally, beware of the effect of the text wrap, as some commented lines may have been wrapped when imported. #+eval=FALSE #=== cda CASE rm(list=ls()) setwd("C:/Users/keith/Google Drive/Essay/Oil/Data/subset/cda") # install.packages('plyr') # install.packages("pastecs") # install.packages("forecast") # install.packages("seasonal") # install.packages('tseries') # install.packages('urca') # install.packages('devtools') # install.packages("vars") # install.packages("fUnitRoots") # install_github('sinhrks/ggfortify') # install.packages('ggplot2') # install.packages('dplyr') # install.packages('stringi') # install.packages('tsDyn') # install.packages('AutoSEARCH') # install.packages('pdR') # install.packages('systemfit') # library(AutoSEARCH) # library(tsDyn) # library(dplyr) library(fUnitRoots) citation('fUnitRoots') library(forecast) citation('forecast') library(urca) citation('urca') library(ggplot2) citation('ggplot2') library(vars) citation('vars') library(zoo) citation('zoo') library(systemfit)
  • 86. 86 citation('systemfit') library(car) citation('car') library(boot) citation('boot') library(tseries) citation('tseries') library(timeSeries) citation('timeSeries') library(pastecs) citation('pastecs') library(dplyr) citation('dplyr') lag <- timeSeries::lag #====== import data cda <- read.csv('C:/Users/keith/Google Drive/Essay/Oil/Data/subset/cda/cda_y.csv') #import data series cda <- na.omit(cda) #omit any rows with NA's names(cda)[1] <- 'date' #rename the first column as the date head(cda) #View the first rows of data frame #import GDP Data #gdp<- read.csv('C:/Users/keith/Google Drive/Essay/Oil/Data/GDP/GDP.csv') #gdp[,2]<-as.numeric(gdp[,2]) #cpi <- read.csv('C:/Users/keith/Google Drive/Essay/Oil/Data/CPI/cpi.csv') #cpi <- cpi[,1:2] # turn into quarterly data, taking average of each qtr. ----------------- cda <- ts(cda[,-1],start=c(1978,9),freq=12) #set cda object to be a TS object cda.qtr <- aggregate(cda,nfreq=4)/3 #turn from monthly to quarterly by taking quarter average cda <- as.data.frame(cda.qtr) #set object class #create zoo version cda_z <- zooreg(cda,start=c(1978,4),freq=4) #create zoo version for object consistency index(cda_z) <- as.yearqtr(index(cda_z)) #set index for TS #create zoo version cda_z <- zooreg(cda,start=c(1978,4),freq=4) index(cda_z) <- as.yearqtr(index(cda_z)) cda[,'date'] <- as.numeric(index(cda_z)) head(cda) head(cda_z) tail(cda_z) # obtain plot and summary statistics of each series ----------------------- #Rnrg - deflated with full CPI summary(cda[,'Rnrg']) ggplot(cda,aes(y=Rnrg,x=date))+geom_line()+geom_smooth(method='lm')+ ggtitle('Real Energy Index over time n deflated with CPI n 1978=100')
  • 87. 87 #Unemp.rate summary(cda[,'unemp.rate']) ggplot(cda,aes(y=unemp.rate,x=date))+geom_line()+geom_smooth(method='lm')+ ggtitle('Unemployment rate over time') #f.rate summary(cda[,'f.rate']) ggplot(cda,aes(y=f.rate,x=date))+geom_line()+geom_smooth(method='lm')+ ggtitle('Job finding rate over time') #s.rate summary(cda[,'s.rate']) ggplot(cda,aes(y=s.rate,x=date))+geom_line()+geom_smooth(method='lm')+ ggtitle('Job separation rate over time') # Given likliehood data will need to be differenced to make stationary -------- # Log(data) so that in general the result will be roughly the % change. l.cda <- data.frame(cda[,'date'],log(cda[,'Rnrg']),cda[,2:4]) names(l.cda)[1] <- 'date' names(l.cda)[2] <- 'Rnrg' l.cda_z <- merge.zoo(log(cda_z[,'Rnrg']),cda_z[,-1],all=F) names(l.cda_z)[1] <- 'l.Rnrg' # obtain plot and summary stats for the log of each series ---------------- #Rnrg summary(l.cda[,'Rnrg']) ggplot(l.cda,aes(y=Rnrg,x=date))+geom_line()+geom_smooth(method='lm')+ ggtitle('Log Real Energy Index over time n deflated with CPI') # TEST FOR SEASONAL UNIT ROOTS USING HEGY TEST ---------------------------- #H0 IS THAT THERE IS A UNIT ROOT AT GIVEN FREQUENCY. #HA IS STATIONARITY AT GIVEN FR'EQUENCY. # #CREATE A FUNCTION TO PERFORM HEGY TEST: ------------------------------ hgy <- function(x,I=F,S=F,tr=F,lag_select=T,P=0){ v=x I=I S=S tr=tr P=P lag_select=lag_select xt<-((v-lag(v,-4))) y1<-((v+lag(v,-1)+lag(v,-2)+lag(v,-3))) y2<-((-v+lag(v,-1)-lag(v,-2)+lag(v,-3))) y3<-((-v+lag(v,-2))) # y<-zooreg(hegy.reg(wts = z)) # index(y) <- index(z) hegy <- merge.zoo(xt,lag(y1,-1),lag(y2,-1),lag(y3,-2),lag(y3,-1),all=F) #Create Intercept int <- zooreg(rep(1,(dim(hegy)[1])))
  • 88. 88 tt <- zooreg(seq(1,dim(hegy)[1],1)) index(int) <- index(hegy) index(tt) <- index(hegy) #Create Seasonal Dummies seas <- rep(c(1,0,0,0),dim(hegy)[1]) seas <- cbind(seas,rep(c(0,1,0,0),dim(hegy)[1])) seas <- cbind(seas,rep(c(0,0,1,0),dim(hegy)[1])) seas <- seas[1:dim(hegy)[1],] seas <- zooreg(seas) index(seas) <- index(hegy) #bring it all together if(I==T){ hegy <- merge.zoo(hegy,int,all=F)} if(S==T){ hegy <- merge.zoo(hegy,seas,all=F)} if(tr==T){ hegy <- merge.zoo(hegy,tt,all=F)} IC <- data.frame(p=NA,BIC=NA,logLik=NA) IC[1,1] <- 0 IC[1,2] <- BIC(lm(hegy[,1]~hegy[,-1]-1)) IC[1,3] <- logLik(lm(hegy[,1]~hegy[,-1]-1)) for(p in 1:8){ hegy1 <- merge.zoo(hegy,lag(xt,-(1:p)),all=F) IC[p+1,1]<-p IC[p+1,2]<-BIC(lm(hegy1[,1]~hegy1[,-1]-1)) IC[p+1,3]<-logLik(lm(hegy1[,1]~hegy1[,-1]-1)) } paste('value of lag for augmentation is:', IC[IC[,'BIC']==min(IC[,'BIC']),'p'], 'determined by BIC') if(lag_select==T){ p<-IC[IC[,'BIC']==min(IC[,'BIC']),'p'] if(p==0){ H1 <- lm(hegy[,1]~hegy[,-1]-1) H1R <- lm(hegy[,1]~hegy[,-c(1,4,5)]-1) H1 <- lm(hegy[,1]~hegy[,-1]-1) print( paste('value of lag for augmentation is:', IC[IC[,'BIC']==min(IC[,'BIC']),'p'], 'determined by BIC')) print(summary(H1)) print(paste('F-stat for pi3,pi4 jointly zero,',anova(H1,H1R,test='F')$F[2])) print(paste('n=',nobs(H1))) print(IC[p+1,])} if(p>0){ hegy1 <- merge.zoo(hegy,lag(xt,-(1:p)),all=F) hegy1 <- na.omit(hegy1) H1<-lm(hegy1[,1]~hegy1[,-1]-1)
  • 89. 89 H1R <- lm(hegy1[,1]~hegy1[,-c(1,4,5)]-1) print( paste('value of lag for augmentation is:', IC[IC[,'BIC']==min(IC[,'BIC']),'p'], 'determined by BIC')) print(summary(H1)) print(paste('F-stat for pi3,pi4 jointly zero,',anova(H1,H1R,test='F')$F[2])) print(paste('n=',nobs(H1))) print(IC[p+1,])}} if(lag_select==F){ p<-P if(p==0){ H1 <- lm(hegy[,1]~hegy[,-1]-1) H1R <- lm(hegy[,1]~hegy[,-c(1,4,5)]-1) H1 <- lm(hegy[,1]~hegy[,-1]-1) print( paste('value of lag for augmentation is:', IC[IC[,'BIC']==min(IC[,'BIC']),'p'], 'determined by BIC')) print(summary(H1)) print(paste('F-stat for pi3,pi4 jointly zero,',anova(H1,H1R,test='F')$F[2])) print(paste('n=',nobs(H1))) print(IC[p+1,])} if(p>0){ hegy1 <- merge.zoo(hegy,lag(xt,-(1:p)),all=F) hegy1 <- na.omit(hegy1) H1<-lm(hegy1[,1]~hegy1[,-1]-1) H1R <- lm(hegy1[,1]~hegy1[,-c(1,4,5)]-1) print( paste('value of lag for augmentation is:', IC[IC[,'BIC']==min(IC[,'BIC']),'p'], 'determined by BIC')) print(summary(H1)) print(paste('F-stat for pi3,pi4 jointly zero,',anova(H1,H1R,test='F')$F[2])) print(paste('n=',nobs(H1))) print(IC[p+1,])}} } ## ALPHA IS 5% # HEGY FOR l.RNRG -- h0 IS UR AT GIVEN FREQ. ------------------------------ z <- l.cda_z[,'l.Rnrg'] hgy(x = z,I=T,S=T,tr=T,lag_select = T) #PI1 T= -1.961, CV 5% -3.52 Fail to reject -- UR present #PI2 T= -8.969, CV 5% -2.93 Reject #PI3 T= -3.840, CV 5% -3.44 reject #PI4 T= -7.238, CV 5% -2.78 Reject #pi3,4 f=41, CV 5% 6.63 Reject. #Thus UR at zero freq only -- Quarterly Difference! z <- diff(l.cda_z[,'l.Rnrg']) hgy(x=z,I=T,S=T,tr = F,lag_select=T) #pi1 t=-6.7 CV 5% -2.94 Fail to reject -- UR present
  • 90. 90 #pi2 t=-8.4 CV 5% -2.90 Reject #pi3 t=-8.4 CV 5% -3.44 Reject #pi4 t=-1.8 CV 5% -1.96, 1.92 #pi3,4 f=40 CV 5% 6.63 Reject #REJECT UR AT ALL FREQ -- 1ST QUART DIFF MAKES SERIES STATIONARY # Unemployment Rate ------------------------------------------------------- #HEGY for Unemp.Rate -- H0 is UR at given freq: z<-l.cda_z[,'unemp.rate'] hgy(x=z,I=T,S=T,tr = T,lag_select = T) #PI1 T= -4.198, CV 5% -3.52 Reject #PI2 T= -4.745, CV 5% -2.93 Reject #PI3 T= -1.770, CV 5% -3.44 reject #PI4 T= -6.184, CV 5% -2.78 Reject #jointF, 20.85, CV 5% 6.63 Reject. #No Unit root present. # Job Finding Rate -------------------------------------------------------- #HEGY for f.Rate -- H0 is UR at given freq: z<-l.cda_z[,'f.rate'] hgy(x=z,I=T,S=T,tr = T,lag_select = T) #pi1 t= -2.871, CV 5% -3.52 Fail to Reject --UR May be Present #pi2 t= -4.354, CV 5% -2.93 Reject #pi3 t= -4.740, CV 5% -3.44 reject #pi4 t= -4.477, CV 5% -2.78 Reject #pi3,4 f= 21.263, CV 5% 6.63 Reject. #Thus UR at zero freq only -- QUarterly Difference! z<- diff(l.cda_z[,'f.rate']) hgy(x=z,I=T,S=T,tr = F,lag_select = T) #pi1 t= -6.024 #pi2 t= -4.506 #pi3 t= -6.733 #pi4 t= 0.131 #pi3,4 f= 22.70 #REJECT UR AT ALL FREQ -- 1ST QUART DIFF MAKES SERIES STATIONARY # Job Separation Rate ----------------------------------------------------- #HEGY for s.Rate -- H0 is UR at given freq: z<-l.cda_z[,'s.rate'] hgy(x=z,I=T,S=T,tr = T,lag_select = T) #pi1 t= -3.366, CV 5% -3.52 Reject #pi2 t= -5.816, CV 5% -2.93 Reject #pi3 t= -6.152, CV 5% -3.44 reject #pi4 t= -6.181, CV 5% -2.78 Reject #pi3,4 f= 52.75, CV 5% 6.63 Reject. z<- diff(l.cda_z[,'s.rate']) hgy(x=z,I=T,S=T,tr = F,lag_select = T)
  • 91. 91 #pi1 t= -6.127 #pi2 t= -4.245 #pi3 t= -6.444 #pi4 t= 0.862 #pi3,4 f= 21.349 #REJECT UR AT ALL FREQ -- 1ST QUART DIFF MAKES SERIES STATIONARY # Differencing Data to make Stationary ------------------------------------ # thus all but Unemployment rate needs to be quarterly differenced, Unemployment Rate is S.I(0). names(l.cda_z) dl.cda <- merge.zoo(diff(l.cda_z[,'l.Rnrg']),l.cda_z[,'unemp.rate'],diff(l.cda_z[,'f.rate']),diff(l.cda_z[,'s.rate' ]),all=F) names(dl.cda) names(dl.cda) <- c('l.Rnrg','unemp.rate','f.rate','s.rate') dl.cda_z <- dl.cda head(dl.cda) head(dl.cda_z) date <- as.numeric(index(dl.cda)) # Both Rnrg, F.rate and S.rate are I(1) at zero freq. test for co-integration between these variables -------- #FUNCTION TO SELECT LAG LENGTH FOR adf TEST. #filter out the seasonal unit roots: (1+L)(1+L^2)Xt <- Xt+Xt-1+Xt-2+Xt-3 Rnrg.s1 <- l.cda_z[,'l.Rnrg']+lag(l.cda_z[,'l.Rnrg'],-1)+lag(l.cda_z[,'l.Rnrg'],- 2)+lag(l.cda_z[,'l.Rnrg'],-3) #filter out all but zero freq for l.Rnrg f.rate.s1 <- l.cda_z[,'f.rate']+lag(l.cda_z[,'f.rate'],-1)+lag(l.cda_z[,'f.rate'],- 2)+lag(l.cda_z[,'f.rate'],-3) #filter out all but zero freq for F.rate s.rate.s1 <- l.cda_z[,'s.rate']+lag(l.cda_z[,'s.rate'],-1)+lag(l.cda_z[,'s.rate'],- 2)+lag(l.cda_z[,'s.rate'],-3) #filter out all but zero freq for S.rate l.cda.S <- merge.zoo(f.rate.s1,Rnrg.s1,all=F) ut <- resid(lm(l.cda.S[,1]~l.cda.S[,-1]-1)) #regress f.rate on Rnrg, and extract residuals # Generate Fn to select optimal lags for ADF test ------------------------- adf.L <- function(x,maxlags=12,type=c('none','drift','trend')){ library(AutoSEARCH) lag<-stats::lag type <- match.arg(type) if(is.zoo(x) == F) stop("x is not of class zoo or zooreg") if(any(is.na(x))) stop("NAs in x") maxlags=maxlags+1 tt <- zooreg(1:length(x[,1]),start=start(x),deltat=deltat(x)) index(tt) = index(x) sc1 <- data.frame(lags=NA,SC=NA,AIC=NA,HQ=NA)
  • 92. 92 ########TYPE = NONE if (type=='none'){ for(i in 1:maxlags){ z<-merge.zoo(diff(x),lag(x), diff(lag(x,1:i)),all=F) res1<-lm(z[,1]~z[,2:(i+1)]-1) sc1[(i),1] <- i-1 sc1[(i),2] <- (info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='sc')$value)[1] sc1[(i),3] <- (info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='aic')$value)[1] sc1[(i),4] <- (info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='hq')$value)[1] } } ########TYPE = DRIFT if (type=='drift'){ for(i in 1:maxlags){ z<-merge.zoo(diff(x),lag(x), diff(lag(x,1:i)),all=F) res1<-lm(z[,1]~z[,2:(i+1)]+1) sc1[(i),1] <- i-1 sc1[(i),2] <- (info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='sc')$value)[1] sc1[(i),3] <- (info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='aic')$value)[1] sc1[(i),4] <- (info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='hq')$value)[1] } } ########TYPE = TREND if (type=='trend'){ for(i in 1:maxlags){ z<-merge.zoo(diff(x),tt,lag(x), diff(lag(x,1:i)),all=F) res1<-lm(z[,1]~z[,3:(i+1)]+1) sc1[(i),1] <- i-1 sc1[(i),2] <- (info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='sc')$value)[1] sc1[(i),3] <- (info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='aic')$value)[1] sc1[(i),4] <- (info.criterion(logLik(res1),n=nobs(res1),k=length(coef(res1)),method='hq')$value)[1] }
  • 93. 93 } print(head(sc1)) paste("optimal lag order for ADF determined by SIC is", sc1[sc1[,2]==min(sc1[,2]),1],'with SIC', round(sc1[sc1[,2]==min(sc1[,2]),2],4),". determined by AIC is", sc1[sc1[,3]==min(sc1[,3]),1],'with AIC', round(sc1[sc1[,3]==min(sc1[,3]),3],4), ". determined by HQ is", sc1[sc1[,4]==min(sc1[,4]),1],'with HQ', round(sc1[sc1[,4]==min(sc1[,4]),4],4)) }a df.L(x = ut,maxlags = 12,type = 'none') (ur.df(y = ut,type = 'none',lags = 5)) #Run ADF on residuals and compare the CV of T-stat to mackinnon table (N=2) #T-stat: -2.3066 Vs 10% CV of -3.04 -- Fail to reject null of no unit root -- NOT seasonally co- integrated. l.cda.S <- merge.zoo(s.rate.s1,Rnrg.s1,all=F) ut <- resid(lm(l.cda.S[,1]~l.cda.S[,-1]-1)) #regress f.rate on Rnrg, intercept and seasonal dummies and extract residuals adf.L(x = ut,maxlags = 12,type = 'none') ur.df(y = ut,type = 'none',lags = 5) #Run ADF on residuals and compare the CV of T-stat to mackinnon table (N=2) #T-stat: -2.8071 Vs 10% CV of -3.04 -- Fail to reject null of no unit root -- NOT seasonally co- integrated. l.cda.S <- merge.zoo(s.rate.s1,f.rate.s1,all=F) ut <- resid(lm(l.cda.S[,1]~l.cda.S[,-1]-1)) #regress f.rate on Rnrg, intercept and seasonal dummies and extract residuals adf.L(x = ut,maxlags = 12,type = 'none') ur.df(y = ut,type = 'none',lags = 5) #Run ADF on residuals and compare the CV of T-stat to mackinnon table (N=2) #T-stat: -2.8837 Vs 10% CV of -3.04 -- Fail to reject null of no unit root -- NOT seasonally co- integrated. # obtain plot and summary stats for each series --------------------------- #Rnrg summary(dl.cda[,'l.Rnrg']) stdev(dl.cda[,'l.Rnrg']) ggplot(dl.cda,aes(y=l.Rnrg,x=date))+geom_line()+geom_smooth(method='lm')+ ggtitle('qtr over qtr % change of Real Energy Index over time n deflated with CPI') #Unemp.rate summary(dl.cda[,'unemp.rate']) stdev(dl.cda[,'unemp.rate']) ggplot(dl.cda,aes(y=unemp.rate,x=date))+geom_line()+geom_smooth(method='lm')+ ggtitle('Unemployment rate over time') #f.rate summary(dl.cda[,'f.rate']) stdev(dl.cda[,'f.rate'])
  • 94. 94 ggplot(dl.cda,aes(y=f.rate,x=date))+geom_line()+geom_smooth(method='lm')+ ggtitle('quarterly change in Job finding rate over time') #s.rate summary(dl.cda[,'s.rate']) stdev(dl.cda[,'s.rate']) ggplot(dl.cda,aes(y=s.rate,x=date))+geom_line()+geom_smooth(method='lm')+ ggtitle('quarterly change in Job separation over time') # View series collectively and obtain summary stats ----------------------- # series in levels -------------------------------------------------------- P<-autoplot.zoo(l.cda_z,facets = (Series ~ .)) P<-P+facet_grid(scales='free_y',facets = (Series ~ .)) P<-P+xlab('Time')+scale_x_yearmon() P<-P+ggtitle('Series over time n Canada') P ggsave('series over time.png') Dstats1 <- stat.desc(cda_z,desc=T)[c('nbr.val','min','mean','max','std.dev'),] #obtain descriptive statistics Dstats1 write.csv(Dstats1,'desc stats levels.csv') #save to file # series differenced ------------------------------------------------------ name_diff <- c('D_l.Rnrg','unemp.rate','D_f.rate','D_s.rate') names(dl.cda_z) <- name_diff P<-autoplot.zoo(dl.cda_z,facets = (Series ~ .)) P<-P+facet_grid(scales='free_y',facets = (Series ~ .)) P<-P+xlab('Time')+scale_x_yearmon() P<-P+ggtitle('Differenced series over time n Canada') P ggsave('differenced series over time.png') names(dl.cda_z) <- names(dl.cda) Dstats2 <- stat.desc(dl.cda_z,desc=T)[c('nbr.val','min','mean','max','std.dev'),] #obtain descriptive statistics zapsmall(Dstats2) write.csv(Dstats2,'desc stats diff.csv') #save to file head(dl.cda_z);tail(dl.cda_z) # using the dl.cda data work out the VAR --------------------------------------- VARselect(dl.cda,type='both',season=4,lag.max = 12)[1] #p=1 has serial correlation #p=2 has serial correlation Vr <- VAR(y=dl.cda,type='both',season=4,p=3) roots(Vr,modulus = F) #View Roots plot(roots(Vr,modulus = F),xlim=c(-1.2,1.2),ylim=c(-1.2,1.2));abline(h = c(1,-1),v=c(1,- 1),col='grey') #Graphically View Roots summary(ca.jo(x = l.cda_z,type = 'eigen',ecdet = 'trend',K = (Vr$p+1),season = 4)) #Fail to Reject Null of No-Cointegration.
  • 95. 95 #r <= 3 6.50 Vs 10% 10.49 #r <= 2 7.09 Vs 10% 16.85 #r <= 1 10.90 Vs 10% 23.11 #r <= 0 25.75 Vs 10% 29.12 summary(ca.jo(x = l.cda_z,type = 'trace',ecdet = 'trend',K = (Vr$p+1),season = 4)) #Fail to Reject Null of No-Cointegration. #r <= 3 6.50 Vs 10% 10.49 #r <= 2 13.59 Vs 10% 22.76 #r <= 1 24.49 Vs 10% 39.06 #r <= 0 50.24 Vs 10% 59.14 # BG test for serial correlation --------------------------------- res <- resid(Vr) #obtain residual vector from VAR lm1 <- lm(res[,1]~1) #regress residual on a constant layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE));plot(res[,1],type='l'); acf(res[,1],) ; pacf(res[,1],) #view ACF PACF bgtest(lm1,order=Vr$p+1,type = 'Chisq') #View BG test results of serial correlation up to P+1 lm2 <- lm(res[,2]~1) layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE));plot(res[,2],type='l'); acf(res[,2]) ; pacf(res[,2]) bgtest(lm2,order=Vr$p+1,type = 'Chisq') lm3 <- lm(res[,3]~1) layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE));plot(res[,3],type='l'); acf(res[,3]) ; pacf(res[,3]) bgtest(lm3,order=Vr$p+1,type = 'Chisq') lm4 <- lm(res[,4]~1) layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE));plot(res[,4],type='l'); acf(res[,4]) ; pacf(res[,4]) bgtest(lm4,order=Vr$p+1,type = 'Chisq') summary(Vr) #View summary for VAR(p) layout(matrix(c(1), 1, 1, byrow = TRUE)) #reset ploting device # base VAR package IRF ---------------------------------------------------- H=20 irf0 <- (irf(x = Vr,impulse ='l.Rnrg',n.ahead = H-1,ci = 0.66,runs = 100)) #extract IRF results for shock to l.Rnrg on all other Variables VAR.irf1 <- data.frame(as.data.frame(irf0[[1]])[,1],as.data.frame(irf0[[2]])[,1],as.data.frame(irf0[[3]])[,1]);n ames(VAR.irf1) <- c('IRF','CIl','CIu') #on l.Rnrg VAR.irf2 <- data.frame(as.data.frame(irf0[[1]])[,2],as.data.frame(irf0[[2]])[,2],as.data.frame(irf0[[3]])[,2]);n ames(VAR.irf2) <- c('IRF','CIl','CIu') #on unemp.rate VAR.irf3 <- data.frame(as.data.frame(irf0[[1]])[,3],as.data.frame(irf0[[2]])[,3],as.data.frame(irf0[[3]])[,3]);n ames(VAR.irf3) <- c('IRF','CIl','CIu') #on f.rate