Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

library(fpp3) library(dplyr) library(tsibble) # Load the data and create tsibble myseries % select(date, value) %>% mutate(Month = yearmonth(date)) %>% as_tsibble(index = Month) # Split the

library(fpp3) library(dplyr) library(tsibble)

# Load the data and create tsibble myseries <- read_abs_series("A84424387A", release_date="2024-01-01") %>% select(date, value) %>% mutate(Month = yearmonth(date)) %>% as_tsibble(index = Month)

# Split the data into training and test sets training_set <- myseries %>% filter(Month <= yearmonth("2020-02"))

test_set <- myseries %>% filter(Month > yearmonth("2020-02"))

# Fit the Holt-Winters multiplicative model with log transformation hw_model <- training_set %>% model( HW = ETS(log(value) ~ error("M") + trend("A") + season("M")) )

# Forecast for the length of the test set hw_forecast <- hw_model %>% forecast(h = nrow(test_set))

# Plot the training data and the forecast final_plot <- autoplot(myseries, value) + autolayer(hw_forecast, .id = "series") + labs(title = "Holt-Winters' Multiplicative Forecast for Female Students Working and Studying Full-Time", x = "Year and Month", y = "Number of Students (in thousands)")

print(final_plot) is the code above correct for part c ii) in the attached.

The other photo is the output of the above code. I am worried that its wrong as the predicted values seem to explode.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Cambridge IGCSE And O Level Additional Mathematics Coursebook

Authors: Sue Pemberton

2nd Edition

1108411665, 9781108411660

More Books

Students also viewed these Mathematics questions

Question

=+a. market value of the land and the older plant;

Answered: 1 week ago