Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ECON 102: First Assignment (sample solution)

This is an example of what we expect students to have done for the first assignment.  The codes are included in the solution to show you how the graphs were produced, but it was not required to do so.  Also, do not compare my interpretation with the students’.  I am only adding some comments to the particular dataset I used to create the solution.

Part A: Visualization

1.  Plot the series using a line chart.  Briefly describe what you see:  Is it a positive or negative trend? Is the trend increasing? What kind of short term fluctuations do you observe?


Consumption expenditure from 1960 to 2019

1950         1960         1970         1980         1990        2000        2010        2020

Time


The trend is positive and slightly increasing: the annual variation does seem a little bit smaller at the beginning of the sample compared with the end of the sample.  It is hard to detect the cycle because the series is very volatile around the trend. Also, the high frequency fluctuations seems constant which might suggest that they are caused by the seasonal component.

2.  Answer the previous question using the log-scale. Can you tell if the growth rate is increasing or decreasing on average over the period?


Consumption expenditure from 1960 to 2019 (log−scale)

1950         1960         1970         1980         1990        2000        2010        2020

Time


Now the trend is positive and constant, which suggests a constant growth rate on average over the period.  We also see the series being less and less volatile.  Since it is expressed in logs, it means that deviations from the trend in percentage are decreasing.

3.  To better see how the growth rate evolves through time, plot the annualized growth rate of consumption expenditure. Describe what you see. Is it constant on average?


In the following graph, the horizontal line represents 0. It is included in the chart to better see if the growth rate is positive or negative on average.


Annualized growth rate of consumption expenditure from 1960 to 2019

1950         1960         1970         1980         1990        2000        2010        2020

Time


First, the annualized growth rate is very volatile oscillating between -87.49% and 1379.38%. The series is more often above zero, which implies that the growth rate is positive on average and relatively constant (the average is 34.38%). We also see that the volatility is decreasing over the period.






Part B: Time Series Decomposition

1.  Fit a linear and quadratic trends to your series.  Then, create a line chart with your original series and the two trends. Which trend seems to best fit the series? Explain.


Consumption expenditure from 1960 to 2019

1950         1960         1970         1980         1990        2000        2010        2020

Time


We can see that the linear trend does not fit the data well. The quadratic trend shows that the positive trend is increasing over the period (smaller annual variations at the beginning compared with the end of the period). Since the series is expressed in thousands of dollars, this result does not allow us to conclude that the growth rate is increasing.  We can only analyze the evolution of the growth rate when the series is expressed in logs..

2.  Fit a linear and quadratic trends to the log of your series.  Then, create a line chart with the log of your series and the two trends.  Which trend seems to best fit the series?  Do you see a difference between the best trend in this question and in the previous one? Explain.



Consumption expenditure from 1960 to 2019 (log−scale)

1950         1960         1970         1980         1990        2000        2010        2020

Time


The linear trend fits the data much better when using the log-scale.  In fact, we see very little difference (almost undetectable) between the linear and quadratic trends. This suggests that the growth rate is almost constant on average over the period.

Answer the following questions using the log-scale and the trends computed in question 2.

3.  Plot the detrended series using the trend that best fit the series. Briefly describe what you see: Do you better detect short term fluctuations?


In the following we use the quadratic because it cannot be worse than the linear trend We could have also used the linear trend since they both t the series equally well.


Detrended consumption expenditure

from 1960 to 2019 (log−scale)

1950         1960         1970         1980         1990        2000        2010        2020

Time


We now see better the high frequency fluctuations.   However, the cycle is barely detectable because the high frequency components are too volatile.  We do see a cycle hidden behind the fluctuations (the average is going up and down), but it will be easier to talk about the cycle in the next question.

4.  Using a moving average of order 5, compute the cyclical component of your series.  Then, plot the cycle and briefly describe what you see: interpret the values of some peaks and troughs.


In the following graph, the function polygon is used to highlight some periods.   It was not required for you to do it, but it shows how you could present your results.




Cyclical component of consumption expenditure

from 1960 to 2019 (log−scale)

1950     1960     1970     1980     1990     2000     2010     2020

Time


Negative Cycle

Positive Cycle


We observe that the series is showing a high level of persistence (stays positive or negative for many consecutive years). The shaded areas show periods of more than 3 consecutive years when the cyclical remain positive (blue) or negative (red). In particular the series was above its trend on average for the period 1961-1964, and it was below on average for the period 1997-2000. We can interpret some values of the cycle as follows: the series was 14.23% higer than the trend on average in 1952-Q2 and 17.14% lower on average in 1955-Q1. They are the two largest deviations from the trend over that period.

Note: You may have chosen to put the detrended series and the cycle on the same graph.  It is not wrong, but the point of plotting the cycle is to avoid being clouded by the volatile high frequency components.  It is an acceptable answer, but, as you can see, it makes it harder to interpret the cycle.






Cyclical component of consumption expenditure

from 1960 to 2019 (log−scale)


Detrended

Cycle



1950     1960     1970     1980     1990     2000     2010     2020

Time


5.  Plot the low frequency of your series and briefly describe what you see.

Answer



Low frequency component of consumption expenditure

from 1960 to 2019 (log−scale)



1952

1950         1960         1970         1980         1990        2000        2010        2020

Time


Without the high frequency component, we can see better the trending behaviour of the series and its cyclical component.   In particular, we can see a peak in  1952 and a trough in  1955 (represented on the graphs by the two circles). The green dotted line is the trend and was added to the graph to better see the cycles.




6.  Compute the seasonal component and represent it on a bar chart (only the 4 quarters). Interpret the four seasonal values.

Notice that the the numbers are written on top or below each bar, but it was not required for you to include them.


Seasonal component of consumption expenditure

from 1960 to 2019 (log−scale)


0.0833

0.0715

−0.1213

3

Quarter


The interpretion is:  expenditure is 8.33% above the annual average in quarter 1, it is 3.35% below the annual average in quarter 2, it is 12.13% below the annual average in quarter 3 and it is 7.15% above the annual average in quarter 4 on average.

Part C: Comovement

For this part, select any other series in the file assignment1.zip and answer the following questions:

Create a scatter plot of your series expressed in logs against the selected series also expressed in logs.





Scatterplot of two expenditure series expressed in logs


6.9                  7.0                  7.1                  7.2                  7.3                  7.4

Selected series