<- rio::import("https://byuistats.github.io/timeseries/data/USENERGYPRICE.csv") avgkwhr
Time Series Homework: Chapter 3 Lesson 4
Please_put_your_name_here
Data
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 series below.
Please research the time series. In the spaces below, give the data collection process, unit of analysis, and meaning of each observation for the series.
Average Price of Electricity per Kilowatt-Hour in U.S.: City Average
Question 2 - US Average Price of Electricity: Additive Holt-Winters Forecasting (25 points)
a) Please use the Holt-Winters smoothing method to the series.
We will discuss this more in class but for those who are curious in this dataset originally there was no value for September 1985. In this case with only one seemingly random value missing from our data the implications of how we fill the value are less impactful, regardless the method chosen here was to average the values from \(t_{-1}\) & \(t_{+1}\) then use the resulting value to fill the missing data. This can be accomplished quickly using the following base R code:
# Average the values from the periods before(82) and after(84) the missing period(83).
<- (avgkwhr_tsbl$usenergyprice[82]+avgkwhr_tsbl$usenergyprice[84])/2
value # this evaluates to 0.835
# Fill missing value with average of surrounding values
$usenergyprice[83] <- value avgkwhr_tsbl
For your convience the data provided for this Homework assignment has already been filled.
<- avgkwhr_tsbl |>
avgkwhr_hw model(Additive = ETS(usenergyprice ~
trend("A", alpha = 0.01, beta = 0.0001) +
error("A") +
season("A", gamma = 0.02),
opt_crit = "amse", nmse = 1))
report(avgkwhr_hw)
Series: usenergyprice
Model: ETS(A,A,A)
Smoothing parameters:
alpha = 0.01
beta = 1e-04
gamma = 0.02
Initial states:
l[0] b[0] s[0] s[-1] s[-2] s[-3]
0.06314664 0.0001318904 -0.0002283627 0.00315456 0.004239397 0.003979987
s[-4] s[-5] s[-6] s[-7] s[-8] s[-9]
0.003794928 -0.001439147 -0.00257199 -0.001345245 -0.003035241 -0.002245286
s[-10] s[-11]
-0.001832954 -0.002470646
sigma^2: 1e-04
AIC AICc BIC
-1708.733 -1707.856 -1649.897
autoplot(components(avgkwhr_hw))
Warning: Removed 12 rows containing missing values or values outside the scale range
(`geom_line()`).
augment(avgkwhr_hw) |>
ggplot(aes(x = yearmonth, y = usenergyprice)) +
#coord_cartesian(xlim = yearmonth(c("1978 Nov","1984 Dec"))) +
#coord_cartesian(xlim = yearmonth(c("2010 Nov","2016 Dec"))) +
geom_line() +
geom_line(aes(y = .fitted, color = "Fitted")) +
labs(color = "")
b) What parameters values did you choose for \(\alpha\), \(\beta\), and \(\gamma\). Justify your choice.
c) Please plot the Holt-Winters forecast of the series for the next 36 months superimposed against the original series. Please see Figure 7 in Chapter 3: Lesson 4
d) Is the trend in the US Average Price of Electricity series deterministic or stochastic? What is the basis of your evaluation?
Question 3 - Real US Average Price of Electricity: Additive Holt-Winters Forecasting (25 points)
The upward trend of the series is mostly due to inflation, the generalized increase in prices throughout the economy. One way to quantify inflation is to use a price index, like the Personal Consumption Expenditures Deflator (PCE).The series HERE shows that prices in the US have climbed steadily over the last 60 years.Because energy is an important part of the economy, it’s likely that energy prices have followed a similar pattern. Adjusting a series with nominal prices, like the price of electricity, to real prices that account for inflation is simple, divide the original series by the price index. The data set imported below is the real price of electricity, which is the US Average Price of Electricity divided by the PCE index excluding food and energy prices (PCEPILFE). Repeat steps a) to d) for the updated series.
a) Please use the Holt-Winters smoothing method to the series.
b) What parameters values did you choose for \(\alpha\), \(\beta\), and \(\gamma\). Justify your choice.
c) Please plot the Holt-Winters forecast of the series for the next 12 months superimposed against the original series. Please see Figure 7 in Chapter 3: Lesson 3
d) Is the trend in the US Average Real Price of Electricity series deterministic or stochastic? What is the basis of your evaluation?
Rubric
Criteria | Mastery (10) | Incomplete (0) |
Question 1: Context and Measurement | The student thoroughly researches the data collection process, unit of analysis, and meaning of each observation for both the requested time series. Clear and comprehensive explanations are provided. | The student does not adequately research or provide information on the data collection process, unit of analysis, and meaning of each observation for the specified series. |
Mastery (5) | Incomplete (0) | |
Question 3a: HW Smoothing | Demonstrate the implementation of the Holt-Winters smoothing method in R, providing well-commented code that clearly explains each step of the algorithm. They correctly specify the necessary parameters, including trend and seasonality components. | Students encounter difficulties in accurately implementing the Holt-Winters smoothing method in R. Their code may lack sufficient comments or clarity, making it challenging to understand the implementation process. Additionally, they may overlook important parameters or make errors in the application of the method, leading to inaccuracies in the results. |
Mastery (10) | Incomplete (0) | |
Question 3b: Parameter Choice | Responses not only specify the chosen parameter values for $\alpha$, $\beta$, and $\gamma$ in the context of the Holt-Winters smoothing method but also correctly identify the purpose of each parameter in their explanation. They provide a thorough justification for each parameter choice, considering factors such as the data characteristics, seasonality patterns, and the desired level of smoothing | Student struggles to clearly specify the chosen parameter values for $\alpha$, $\beta$, and $\gamma$. It’s no clear that they understand the purpose of each parameter in their explanation. They may provide limited or vague justification for each parameter choice, lacking consideration of important factors such as data characteristics or seasonality patterns. |
Mastery (5) | Incomplete (0) | |
Question 3c: Forecast Plot | Responses effectively create a plot of the Holt-Winters forecast for the next 24 months superimposed against the original series in R. The forecasted values align with the original series and display relevant trends and seasonality patterns. Additionally, they appropriately label the axes, title the plot, and provide a clear legend to distinguish between the original series and the forecast. The plot closely resembles Figure 7 in the Time Series Notebook | Student encounter challenges in creating a plot of the Holt-Winters forecast. They may struggle with accurately implementing the plotting code, resulting in inaccuracies or inconsistencies in the plotted forecast. Additionally, their plot may lack proper labeling of the axes, a title, or a legend, making it difficult to interpret the information presented. Furthermore, their plot may deviate significantly from Figure 7 in the Time Series Notebook. |
Mastery (5) | Incomplete (0) | |
Question 3d: Trend Evaluation | The submission demonstrate a clear understanding of the distinction between deterministic and stochastic trends and provide a reasoned argument for their assessment based on the observed data properties. They provide anevaluation of the data characteristics, considering factors such as the presence of consistent patterns or irregular fluctuations over time. Analyses involve visual inspections to identify any discernible patterns or randomness in the trend. | Student offers limited insights into the data characteristics, lacking consideration of relevant factors such as patterns or fluctuations over time. Additionally, their evaluation may lack depth or coherence. No plots drawn to evaluate the trend. |
Mastery (5) | Incomplete (0) | |
Question 3a: HW Smoothing | Demonstrate the implementation of the Holt-Winters smoothing method in R, providing well-commented code that clearly explains each step of the algorithm. They correctly specify the necessary parameters, including trend and seasonality components. | Students encounter difficulties in accurately implementing the Holt-Winters smoothing method in R. Their code may lack sufficient comments or clarity, making it challenging to understand the implementation process. Additionally, they may overlook important parameters or make errors in the application of the method, leading to inaccuracies in the results. |
Mastery (10) | Incomplete (0) | |
Question 3b: Parameter Choice | Responses not only specify the chosen parameter values for $\alpha$, $\beta$, and $\gamma$ in the context of the Holt-Winters smoothing method but also correctly identify the purpose of each parameter in their explanation. They provide a thorough justification for each parameter choice, considering factors such as the data characteristics, seasonality patterns, and the desired level of smoothing | Student struggles to clearly specify the chosen parameter values for $\alpha$, $\beta$, and $\gamma$. It’s no clear that they understand the purpose of each parameter in their explanation. They may provide limited or vague justification for each parameter choice, lacking consideration of important factors such as data characteristics or seasonality patterns. |
Mastery (5) | Incomplete (0) | |
Question 3c: Forecast Plot | Responses effectively create a plot of the Holt-Winters forecast for the next 24 months superimposed against the original series in R. The forecasted values align with the original series and display relevant trends and seasonality patterns. Additionally, they appropriately label the axes, title the plot, and provide a clear legend to distinguish between the original series and the forecast. The plot closely resembles Figure 7 in the Time Series Notebook | Student encounter challenges in creating a plot of the Holt-Winters forecast. They may struggle with accurately implementing the plotting code, resulting in inaccuracies or inconsistencies in the plotted forecast. Additionally, their plot may lack proper labeling of the axes, a title, or a legend, making it difficult to interpret the information presented. Furthermore, their plot may deviate significantly from Figure 7 in the Time Series Notebook. |
Mastery (5) | Incomplete (0) | |
Question 3d: Trend Evaluation | The submission demonstrate a clear understanding of the distinction between deterministic and stochastic trends and provide a reasoned argument for their assessment based on the observed data properties. They provide anevaluation of the data characteristics, considering factors such as the presence of consistent patterns or irregular fluctuations over time. Analyses involve visual inspections to identify any discernible patterns or randomness in the trend. | Student offers limited insights into the data characteristics, lacking consideration of relevant factors such as patterns or fluctuations over time. Additionally, their evaluation may lack depth or coherence. No plots drawn to evaluate the trend. |
Total Points | 60 |