Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

These questions use R. Any help is greatly appreciated and please provide the re

ID: 3315035 • Letter: T

Question

These questions use R. Any help is greatly appreciated and please provide the relevant code as well.

This assignment is best done in R. All of the functions and the data you need are in the R package "tpp which can be installed using the usual methods 1. Data set baoks contains the daily sales of paperback and hardcover books at the same store. The task is to forecast the next four days' sales for paperback and hardcover books (data set books). a. Plot the series and discuss the main features of the data b. Use simple exponential smoothing with the ssafunction (setting initial "simple") and explore different values of for the paperback series. Record the within-sample SSE for the one-step forecasts. Plot SSE against and find which value of works best. What is the effect of on the forecasts? c. Now let sa select the optimal value of a. Use this value to generate forecasts for the next four days. Compare your results with 2 d. Repeat but with initialoptinal". How much difference does an optimal initial level make? 2. Apply Holt's lincar method to the paperback and hardback series and compute four-day forecasts in cach case. Compare the SSE measures of Holt's method for the two series to those of simple exponential smoothing in the previous question. Discuss the merits of the two forecasting methods for these data sets. a. b. Compare the forecasts for the two series using both methods. Which do you think is best? 3. For this exercise, use the monthly Australian short-term overseas visitors data, May 1985- April 2005. (Data set: visitors.) a. Make a time plot of your data and describe the main features of the scries b. Forecast the next two years using H c. Why is multiplicative scasonality necessary here? d. Experiment with making the trend exponential and/or damped. e. Compare the RMSE of the one-step forecasts from the various methods. Which do olt- Winters' multiplicative method. you prefer?

Explanation / Answer

# Multiple Linear Regression
library(fpp)

library(TTR)

# Importing the dataset
#TS
dataset = books
summary(dataset)

plot(dataset[,1],
main = 'Books Data',
col = 'Blue',
ylab = "Paperback",
xlab = "Days",
type = "line")


plot(dataset[,2],
main = 'Books Data',
col = 'Blue',
ylab = "Hardcover",
xlab = "Days",
type = "line")
dataNew <- ts(dataset,frequency = 7)
summary(dataNew)
datDecmp <- decompose(dataNew)
plot(datDecmp$trend,main = "Trend",
xlab = "Period")

# Calculating the simple moving average
# for AirPassengers data on the yearly basis by setting n to 12
adjust_dat <- dataNew - datDecmp$seasonal
trendpattern <- SMA(adjust_dat[,1],n =7) #for Paperback
trendpattern2 <- SMA(adjust_dat[,2], n=7) #for Hardcover

#HOLT Forecast for paperback n Hardcover
fcast <- holt(dataNew[,1]) #For Paperback
fcast2 <- holt(dataNew[,2]) #For Hardcover
plot(fcast)
plot(fcast2)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote