<- rio::import("https://byuistats.github.io/timeseries/data/gdp_fred.csv") |>
gdp_ts mutate(year_over_year = gdp_millions / lag(gdp_millions, 4)-1) |>
mutate(quarter = yearquarter(mdy(quarter))) |>
filter(quarter >= yearquarter(my("Jan 1990")) & quarter < yearquarter(my("Jan 2025"))) |>
na.omit() |>
mutate(t = 1:n()) |>
mutate(std_t = (t - mean(t)) / sd(t)) |>
as_tsibble(index = quarter)
Time Series Homework: Chapter 6 Lesson 2
Please_put_your_name_here
Data
Questions
Question 1 - Stationary Model Comparison (20 points)
We have worked with AR(p), MA(q), ARMA(p,q) stochastic processes. The theoretical ACF and PACF functions of each model can help us identify which of the three models would be a good fit for a particular time series. From the Time Series Notebook:
In the pprevious assignment, you worked with a simulation of a AR(3) process and a MA(3) process. In this assignment you will be comparing your findings from that assignment to an ARMA(3,3) process.
ARMA(3,3) Simulation
<- 10000 # Number of observations
n <- c(0.5, 0.3, 0.1) # AR coefficients
ar_coeffs <- c(-0.7, -0.5, 0.2) # MA coefficients
ma_coeffs
# Simulate the ARMA(3, 3) process
set.seed(123) # For reproducibility
<- arima.sim(n = n, model = list(ar = ar_coeffs, ma = ma_coeffs), sd = 1)
arma33_process
# Convert the simulated ARMA(3, 3) process to a tsibble
<- as_tsibble(tibble(Time = 1:n, value = arma33_process), index = Time) arma_33
a) Plot the ACFs for the ARMA(3) simulation.
b) Plot the PACFs for the ARMA(3) simulation.
Question 2 - ARMA(p,q): GDP Business Cycles (50 points)
Business cycles are the fluctuations in economic activity that an economy experiences over time, marked by phases of expansion, peak, contraction (or recession), and trough. During expansion, economic indicators such as GDP rise, reaching a peak where the economy operates at maximum capacity. Following the peak, the economy contracts, leading to a recession characterized by falling GDP, until it hits a trough, the lowest point, signaling the end of contraction and the start of recovery. The yearly percentage change in real GDP effectively captures the fluctuations of business cycles by quantifying the rate at which an economy’s total output of goods and services grows or shrinks from one year to the next. The yearly percentage change in real US GDP in decimals is the year_over_year
variable in the gdp_ts
tsibble.
a) Plot the yearly percentage change in US Real GDP
b) Plot the ACF and PACF of the series
c) Based on the ACF and PACF, please speculate which stationary model will best fit the data.
d) Please fit an AR(p) model to the yearly percentage change in US Real GDP.
e) Please fit an MA(q) model to the yearly percentage change in US Real GDP.
f) Please fit an ARMA(p,q) model to the yearly percentage change in US Real GDP.
g) In a table, please compare the fit of each model. Which do you think is the best model for the series?
Rubric
Criteria | ||
Mastery (5) | Incomplete (0) | |
Question 1a: ACF Plots | Students produce clear and well-labeled plots of the autocorrelation functions (ACFs) for the AR(2), MA(2), and ARMA(2,2) simulations. | Submissions have low-quality visualizations or unclear labeling. |
Mastery (5) | Incomplete (0) | |
Question 1b: PACF | Students produce clear and well-labeled plots of the partial autocorrelation functions (PACFs) for the AR(2), MA(2), and ARMA(2,2) simulations. | Submissions have low-quality visualizations or unclear labeling. |
Mastery (10) | Incomplete (0) | |
Question 1c: Evaluation of Theoretical functions | Students contrast the theoretical description provided in the question prompt and compare it with the plots they created from multiple simulations with different seeds. They accurately identify and explain any discrepancies or agreements between the theoretical description and the observed patterns in the plots. Their analysis demonstrates a clear understanding of sampling distributions and their representations on ACF and PACF plots. | Students contrast doesn’t provide sufficient evidence of understanding of simulation procedures or the theoretical understanding of ACF and PACF. There is not enough content to evaluation whether students understand the sampling process and estimation of ACF and PACF. |
Mastery (5) | Incomplete (0) | |
Question 2a: Plot | Students plot the yearly percentage change in US Real GDP, ensuring that the plot is clear, properly labeled, and accurately represents the data. They provide appropriate axis labels, a title, and a legend if necessary to enhance interpretability. | Submissions have low-quality visualizations or unclear labeling. |
Mastery (5) | Incomplete (0) | |
Question 2b: ACF and PACF | Students produce clear and well-labeled plots of the ACF and PACF | Submissions have low-quality visualizations or unclear labeling. |
Mastery (15) | Incomplete (0) | |
Question 2c: Best fit speculation | Students analyze the ACF and PACF plots to speculate on the best stationary model for the data. They provide clear reasoning supported by observations from the plots, identifying any significant autocorrelation or partial autocorrelation patterns that suggest a particular model. Their speculation demonstrates a solid understanding of time series analysis concepts and the relationship between ACF, PACF, and model selection. | Students attempt to speculate on the best stationary model based on the ACF and PACF plots but may struggle to provide clear reasoning or insights. Their analysis lacks coherence or depth, with limited discussion of relevant autocorrelation or partial autocorrelation patterns. They may overlook significant features in the plots or misinterpret their implications for model selection. |
Mastery (5) | Incomplete (0) | |
Question 2d: AR(p) fitted | Students proficiently fit an AR(p) model to the yearly percentage change in US Real GDP. They correctly select an appropriate lag order p based on the ACF and PACF analysis or other model selection criteria, estimate the model parameters using appropriate methods, and interpret the results effectively. | They may have difficulty selecting an appropriate lag order p, estimating the model parameters accurately, or interpreting the results effectively. Their interpretation may lack depth or clarity, indicating a limited understanding of the modeling process |
Mastery (5) | Incomplete (0) | |
Question 2e: MA(q) fitted | Students proficiently fit an MA(q) model to the yearly percentage change in US Real GDP. They correctly select an appropriate lag order p based on the ACF and PACF analysis or other model selection criteria, estimate the model parameters using appropriate methods, and interpret the results effectively. | They may have difficulty selecting an appropriate lag order p, estimating the model parameters accurately, or interpreting the results effectively. Their interpretation may lack depth or clarity, indicating a limited understanding of the modeling process |
Mastery (5) | Incomplete (0) | |
Question 2f: ARMA(p,q) fitted | Students proficiently fit an ARMA(p,q) model to the yearly percentage change in US Real GDP. They appropriately select the orders p and q based on the ACF and PACF analysis or other model selection criteria, estimate the model parameters using appropriate methods, and interpret the results effectively. Their interpretation demonstrates a clear understanding of the the underlying dynamics of the data. | They may have difficulty selecting an appropriate lag order p and q estimating the model parameters accurately, or interpreting the results effectively. Their interpretation may lack depth or clarity, indicating a limited understanding of the modeling process |
Mastery (10) | Incomplete (0) | |
Question 2g: Model selection | Students effectively use AIC, AICc, and BIC to compare and evaluate models, presenting results in a clear table format similar to the one found in the Model Comparison section of the Time Series Notebook Ch5 Lesson 3. Their discussions on the nuance model selection evidences they understand the importance of considering the context and data generating process that is part of model specification. | Students struggle to effectively use AIC, AICc, and BIC to compare and evaluate models, resulting in unclear or incomplete presentation of results or failure to address the dangers of relying solely on algorithms for model selection. |
Total Points | 70 |