---
title: "Time Series Homework: Chapter 1 Lesson 2"
subtitle: "Please_put_your_name_here"
format: 
  html:
    embed-resources: true
    toc: true
editor: source
---

```{r}
#| message: false
#| echo: false

# Loading R packages
if (!require("pacman")) install.packages("pacman")
pacman::p_load(tidyverse, 
               tsibble, fable,
               feasts, tsibbledata,
               fable.prophet,
               patchwork,
               lubridate, 
               rio 
)
```

## Data

```{r}
# Macroeconomic Data: unemployment rate
unemp_rate <- rio::import("https://byuistats.github.io/timeseries/data/unemp_rate.csv")

```

## Questions

### Question 1 - Context and Measurement (10 points)

The first part of any time series analysis is context. You cannot properly analyze data without knowing what the data is measuring. Without context, the most simple features of data can be obscure and inscrutable. This homework assignment will center around the US unemployment series.

Please research the time series. The subheadings below has a link to a source to help you get started. In the spaces below, give the data collection process, unit of analysis, and meaning of each observation for the US unemployment time series.

#### a) US unemployment

<https://www.bls.gov/cps/cps_htgm.htm>

::: {.callout-note title="Answer" icon="false"}
<!-- Delete this and put your answer here. The three colons mark the end of your answer. -->
:::

### Question 2 - Estimating the Trend: Annual Aggregation (10 points)

Please plot the US Unemployment time series and superimpose the annual mean of the series in the same graph. Use the appropriate axis labels, units, and captions.

::: {.callout-note title="Answer" icon="false"}
```{r}
# Please provide your code here

```

<!-- Delete this and put your written answer here. The three colons mark the end of your answer. -->
:::

### Question 3 - Trend Analysis (30 points)

##### a) Describe the US Unemployment time series and its trend. Comment on the series' sampling interval, time series trend characteristics, seasonal variation, and cycle.

::: {.callout-note title="Answer" icon="false"}
<!-- Delete this and put your written answer here. The three colons mark the end of your answer. -->
:::

##### b) What does the trend represent? What do you suspect is causing the patterns in the trend? *Hint: Research the Natural Unemployment Rate*

::: {.callout-note title="Answer" icon="false"}
<!-- Delete this and put your written answer here. The three colons mark the end of your answer. -->
:::

##### c) Please justify whether the trend is deterministic or stochastic.

::: {.callout-note title="Answer" icon="false"}
<!-- Delete this and put your written answer here. The three colons mark the end of your answer. -->
:::

<!-- Try not to touch the table markdown below -->

## Rubric

|                                                  |                                                                                                                                                                                                                                                                                   |                                                                                                                                                                                                         |
|--------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Criteria**                                     | **Mastery (10)**                                                                                                                                                                                                                                                                  | **Incomplete (0)**                                                                                                                                                                                      |
| **Question 1: Context and Measurement**          | The student demonstrates a clear understanding of the context for each data series (US unemployment, term premium, and Google Trends for "chocolate"). The explanation includes details about the data collection process, unit of analysis, and the meaning of each observation. | The student fails to provide a clear understanding of the context for one or more data series.                                                                                                          |
|                                                  | **Mastery (10)**                                                                                                                                                                                                                                                                  | **Incomplete (0)**                                                                                                                                                                                      |
| **Question 2: Data Visualization**               | The student creates clear and informative plots to visualize the time series and trend. The plot is professional and at a minimum includes the appropriate axis labels, units, and captions                                                                                       | The student does not include visualizations or the visualizations provided are unclear and do not effectively represent the data. The plot doesn't include one or more of the required components.      |
|                                                  | **Mastery (10)**                                                                                                                                                                                                                                                                  | **Incomplete (0)**                                                                                                                                                                                      |
| **Question 3a: Data description**                | The student uses appropriate technical language to describe the main features of time series data including sampling interval, time series trend, seasonal variation and cycle.                                                                                                   | The student does not use technical language to describe the main features of time series data or does not define one or more specified terms.                                                           |
|                                                  | **Mastery (10)**                                                                                                                                                                                                                                                                  | **Incomplete (0)**                                                                                                                                                                                      |
| **Question 3b: Causes of US Unemployment trend** | Demonstrates understanding of potential factors influencing the patterns in the trend. Their understanding of potential factors shows understanding of the underlying data, it's source, and required independent research.                                                       | Fails to demonstrate any understanding of potential factors influencing the patterns in the trend. Shows a lack of awareness of the underlying data, its source, and the need for independent research. |
|                                                  | **Mastery (10)**                                                                                                                                                                                                                                                                  | **Incomplete (0)**                                                                                                                                                                                      |
| **Question 3c: Trend Classification**            | Shows understanding of the relevant concepts. Accurately justifies the trend's classification. Shows a good understanding of the definitions deterministic and stochastic trends.                                                                                                 | Fails to demonstrate any understanding of the relevant concepts or provides no accurate justification for the trend's classification.                                                                   |
|                                                  | **Mastery (10)**                                                                                                                                                                                                                                                                  | **Incomplete (0)**                                                                                                                                                                                      |
| **General: R Programming Usage**                 | The student effectively utilizes R to complete the assignment. Code snippets or outputs are appropriately included to support the analysis. Code is annotated and commented enough for a third party to understand and evaluate easily.                                           | One or more code snippets or outputs are missing. Code is minimally annotated and commented, making it challenging for a third party to understand and evaluate. The code doesn't work or render.       |
| **Total Points**                                 | **60**                                                                                                                                                                                                                                                                            |                                                                                                                                                                                                         |
