set.seed(1234)
# 1. Simulate 50 observations from N(0, 2)
<- 0
mu <- 2
sigma_squared <- 50
n
# Generate white noise data
<- rnorm(n, mean = mu, sd = sqrt(sigma_squared))
data
# 2. Create a Time Series Object with Weekly Seasonality (frequency = 7)
# Assuming the data is daily, a frequency of 7 captures weekly patterns
<- ts(data, frequency = 7)
ts_data
# 3. Convert the ts Object to a tsibble
# The 'as_tsibble()' function automatically handles the frequency
<- as_tsibble(ts_data)
tsibble_data
# Plot the Gaussian White Noise
ggplot(tsibble_data, aes(x = index, y = value)) +
geom_line(color = "blue") +
geom_point(color = "darkgreen") +
labs(
title = "Simulated Gaussian White Noise Without Gaps",
x = "Month",
y = "Value"
+
) theme_minimal()
Time Series Homework: Chapter 4 Lesson 1 Key
Please_put_your_name_here
Questions
Question 1 - Gaussian White Noise (30 points)
a) Simulate a realization of Gaussian White Noise and plot it. Use 50 points and \(\sigma^2=2\)
b) Estimate the mean and variance. Why don’t they match exactly with the parameters values you used to create it?
c) Demonstrate this process second order stationary. Apply a statistical test to assess if the mean is zero. Use correlograms to show the covariance and correlation functions for lags up to 10. Explain your findings.
d) Use the classical decomposition on your simulated series, plot the results.
d) Please evaluate practical signifficance of the estimates of the trend and seasonal component.
Extra Credit
Question 3 - Random Walks (55 points)
a) Simulate a realization of a white noise process using the Exponential distribution. If \(s_t\) is the realization from an exponentially distributed random variable, use the white noise \(w_t=s_t-\lambda\) for your simulation. The length of the series is 500 points and \(\lambda=1\). Please plot your simulation.
b) Superimpose a histogram of the Gaussian White noise simulation from Question 2 versus the Exponential White Noise. Please compare and contrast the two distributions. Your chart should look close to Figure 1 below. Hint: research exponential random variables and their right-tail properties.

c) Create a random walk series using the Exponential DWN simulations. Please plot the series.
d) Use the Holt-Winters decomposition method to estimate the trend, seasonal, and random components of the series.
e) Please evaluate practical significance of the estimates for the parameters of the model using the default algorithm settings (minimize the SS1PE).
Rubric
Mastery (5) | Incomplete (0) | ||
Question 1a: Gaussian White Noise | They effectively plot the simulated realization of Gaussian White Noise in R using plotting functions like plot() or ggplot2, ensuring proper labeling of the axes, a title, and any other necessary elements for clear visualization. Code is well-commented. | Students struggle to simulate Gaussian White Noise in R or effectively plot the simulation, potentially due to errors in coding or misunderstandings of the process. Their R code may lack sufficient comments, making it challenging for others to understand or reproduce the results. The plot may lack clarity or proper presentation, hindering interpretation, and may omit necessary elements such as axis labels or a title. | |
Mastery (10) | Incomplete (0) | ||
Question 1b: Sample second order properties | Students demonstrate an understanding of statistical concepts such as variance, covariance, and autocorrelation, and use appropriate methods or functions to estimate these properties in their chosen statistical software. Proficient explanations may highlight factors such as sample size, random variability, or measurement error, which can introduce discrepancies between estimated properties and the parameters set during data creation. | Students fail to estimate the second-order properties of the sample data or provide a coherent explanation for discrepancies with the parameters set during data creation. They may demonstrate a limited understanding of statistical concepts or use inappropriate methods for estimation. Additionally, they may overlook key factors contributing to discrepancies, providing vague or incomplete explanations. Overall, their analysis may lack depth or clarity, hindering comprehension of the reasons behind the observed differences. | |
Mastery (5) | Incomplete (0) | ||
Question 1c: Decomposition | Student applies the classical decomposition to the simulated series, accurately separating and plotting the components (trend, seasonal, and random) with clear labels and appropriate formatting. | Fails to apply classical decomposition or does not plot the decomposed components clearly. Missing labels or poor formatting make the plot difficult to interpret. | ||
Mastery (10) | Incomplete (0) | ||
Question 1d: Interpretation and Analysis | Clearly evaluates the trend and seasonal component estimates. Provides a well-reasoned evaluation of whether decomposition is appropriate for the series. | Fails to accurately interpret the trend and seasonal components, providing minimal or incorrect insights into the data patterns. Lacks a clear or well-supported evaluation of the appropriateness of decomposition, with reasoning that is vague, unsupported, or does not address the model assumptions. | |
Mastery (10) | Incomplete (0) | ||
Question 2a: Simulation and Plot | Correctly simulates a realization of white noise by generating 500 points from an Exponential distribution, and presents the results in a clear plot with appropriate axis labels and units. | Fails to correctly simulate the white noise process, does not use the specified parameters, or presents a plot that lacks clarity, labels, or units. | |
Mastery (10) | Incomplete (0) | ||
Question 2b: Histograms | Responses superimpose a histogram of the Gaussian White Noise simulation from Question 2 alongside the Exponential White Noise. They compare and contrast the two distributions, demonstrating an understanding of statistical concepts such as mean and variance. Proficient analyses may include research findings on the mean and variance of an exponential random variable, providing context for the comparison. The resulting chart closely resembles Figure 1, showing clear distinctions between the distributions and offering insightful commentary on their similarities and differences. |
Responses may struggle to accurately superimpose the histograms of Gaussian White Noise and Exponential White Noise or provide a coherent comparison between the two distributions. They may lack understanding of statistical concepts such as mean and variance or fail to research the properties of an exponential random variable. The resulting chart may lack clarity or proper presentation, hindering interpretation of the distributions. Additionally, they may overlook key differences between the distributions or provide vague or superficial comparisons, indicating a limited understanding of the underlying concepts. | |
Mastery (10) | Incomplete (0) | ||
Question 2c: Simulate a Random Walk | Correctly generates a random walk series using Exponential DWN simulations and accurately plots the series with clear axis labels and units | Fails to correctly generate the random walk series, does not use Exponential DWN as specified, or presents a plot that lacks clarity, labels, or appropriate units. | |
Mastery (5) | Incomplete (0) | ||
Question 2d: Holt Winters Decomposition | Applies the Holt-Winters decomposition method to estimate the trend, seasonal, and random components, presenting results that clearly reflect each component’s behavior within the series. | Fails to apply the Holt-Winters decomposition, produces inaccurate component estimates, or presents results that are unclear or incorrectly labeled. | |
Mastery (20) | Incomplete (0) | ||
Question 2e: Holt Winters Decomposition Evaluation | Provides a thoughtful evaluation of whether decomposition is appropriate for a random walk, considering the characteristics of the series. | Fails to interpret the parameter estimates or provides an incomplete or incorrect explanation of their significance. Does not evaluate decomposition validity for a random walk or provides unsupported reasoning. | |
Total Points | 85 |