What you are going to end up with is fairly lengthy document

Assignment Help Computer Engineering
Reference no: EM131981378

Retail Forecast Assignment

This assignment utilizes retail data from the "retaildata.csv" file (or .xlsx file, or expandedretail files). You are to pick one series from the data (i.e., one column) and follow most or all of the following steps. This is an unrealistic exercise in the sense that one would typically skip over irrelevant methods. Be sure to discuss the quality and validity of each method as you go along, at least in general terms.

What you're going to end up with is a fairly lengthy document, and in the end you should identify the one or two best forecasting models that you have utilized. Plot the best forecast(s), and describe why you think they are the best choices among the methods available to you.

Step 1: Load the data, and for simplicity separate out whatever variables (columns) or observations (rows) that you're interested in examining. Make sure the resulting variables are time series, and convert to time series as appropriate.

• To select specific columns, use newvar <- (data$newvar), or newvar <- (data[,#]), where # is the column of "newvar".
• Check whether your data is a time series (if applicable) using is.ts(newvar).
• If it isn't a time series, use ts(newvar, start = ##, end=##, frequency=m) to convert it to one

Step 2: Plot the data, and answer the following questions.

1. Are there outliers or influential observations?
2. Is there seasonality? If so, is the seasonality consistent throughout the series, or changing?
3. Is there a trend? If so, is it roughly linear or non-linear?
4. Aside from seasonality, does the data have fairly consistent variation, or is a transformation potentially warranted?

• You're going to want to use autoplot() initially.
• Then, if there's seasonality, use ggseasonplot()
• You can decompose the data using stl(), changing argument s.window=## to see if the seasonality is changing over time. There's also the stlplus package.

Step 3: Simple is sometimes best. First, using a training set, see if a simple average or naïve method fits the series.

• If you're dealing with a time series, creating a training set using something along the following lines: newvar_training <- window(newvar, start=##, end=##)

• Once you've got your training set, experiment with rwf(), meanf(), and rwf(newvar_training, drift=TRUE). You'll want to set your forecast horizon, h, such that the last forecast based on your training set coincides with the last observation of your test set (i.e, newvar, in this case). If you cut four quarters off of your data to be your test set, for example, then set h=4.

• If data is seasonal, you should also try snaive()
• You're going to want to plot all of these.

Step 4: If simpler methods are sub-optimal, the next step is to apply the time series linear model, using a training set.

• Here you'll want to use tsfit <- tslm(newvar_training ~ trend + seasonal)
• Then tsfcast <- forecast(tsfit, h=##, level=c(80,95))
• Then autoplot(tsfcast). Also use autolayer() to superimpose your reserved (test set) data on your forecast.

Step 5: We looked at the seasonal naïve forecast earlier; that involved a naïve forecast for each seasonal period. The tslm with seasonal dummies is similar. Next up would be seasonally adjusting the data (usually using stl), and then performing naïve or simple forecasts on the adjusted data.

stlf <- stlf(newvar_training, h=##, s.window="periodic", robust=FALSE, method=c("rwdrift"), level=c(80,95))

Step 6a: Next in order of complexity/sophistication is simple exponential smoothing. If there is a clear trend, or clear seasonality, one would probably skip SES and head straight to Holt's linear trend method, or Holt-Winter's.

• Something along the lines of the following code is a good place to start.

fit1<-ses(training_set,alpha=.33, initial="optimal", h=12) fit2<-ses(training_set,alpha=.67, initial="optimal", h=12) fit3<-ses(training_set, h=24)

• Try to determine the best alpha. The "optimal" one from SES isn't necessarily the one that gives the best forecasts.

Step 6b: Holt's method

• Next one might try a few Holt's method approaches. If there's seasonality, one can use Holt's on seasonally adjusted data. Or you can skip to H-W. There are four possibilities here for the trends: {additive, not damped}, {additive, damped}, {exponential, not damped}, and

{exponential, damped}

fit4 <- holt(training_set, h=12)
fit5 <- holt(training_set, h=12, damped=TRUE)
fit6 <- holt(training_set, h=12, exponential=TRUE)
fit7 <- holt(training_set, h=12, exponential=TRUE, damped=TRUE)

Step 6c: Holt-Winter's

• Then, if there's seasonality, try Holt-Winter's. There are a few options here, as well. In particular, seasonality can be additive or multiplicative. If the seasonal pattern is changing over time, you want multiplicative.

fit8<-hw(full_data,seasonal="additive")
fit9<-hw(full_data,seasonal="multiplicative")

Step 6d: ETS

• To test our assertions of trend and seasonality, as well as generate confidence intervals, we will use the ETS (Error, Trend, Seasonal) model to define and create the forecast that minimizes AICc. These can be constrained to be only additive, only damped, etc., or you can just let the computer select everything.

• One approach: estimate using ETS, without restriction. See what kind of model gets chosen, e.g., ETS(MNM). Compare to a similar Holt-Winter's or Holt specification, e.g. HW with multiplicative seasonality. Perhaps try a partially restricted ETS, or an ETS on Box-Cox transformed data. Then tabulate the accuracy measures and pick the best model.

To be continued... We haven't done any residual testing. If the data are non-stationary, then there's more work to be done. Specifically, fitting an ARIMA model.

There is a follow-up to this assignment, where you will fit an ARIMA model to the same data series, then compare the resulting forecasts to your best forecast(s) from this assignment.

Reference no: EM131981378

Questions Cloud

Provide a staffing plan in order to ensure future product : You are a Human Resources Manager of an expanding technology company consisting of 170 employees that develops and distributes small electronic devices.
Description of a program to compute : Develop a Pseudo code description of a program to compute both roots given the values of a,b,and c. Be sure to identify the real and imaginary parts.
What peeked your interest the most : Your discussion subject of this week is what did you find most complex or perplexing about vulnerability assessment? What peeked your interest the most?
How ransomware is spread : How ransomware is spread. What suggestions would you make for preventing the spread of ransomware and protecting your organizations data from falling victim.
What you are going to end up with is fairly lengthy document : What you're going to end up with is a fairly lengthy document, and in the end you should identify the one or two best forecasting models that you have utilized.
Prepare research paper on security engineering : You need to prepare research paper on Security Engineering. You need to make format changes in attached file
What type of disaster plan should organization have in place : Identify a health care facility in your area (Dallas TX). What type of disaster plan should this organization have in place?
What are some of the strategies that firms engage : What is the difference between adding value in the value chain and creating returns for shareholders?
Methods of encrypting and decrypting text : For this project you will be writing methods of encrypting and decrypting text.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Explain would you object to the given approach

She claims that you could also eliminate your SAN and connect the client computers directly to the disk array. Would you object to this approach? Explain.

  Write a recursive program to compute height of a binary tree

Write a recursive program to compute the height of a binary tree: the longest distance from the root to an external node.

  Write an ada program to calculate exam statistics

Write an Ada program to calculate exam statistics. The file Exam_Data.txt contains an unknown number of exam scores.

  Make a public static method named comparescores

Write down a public static method named compareScores that takes two doubles as its arguments and returns the integer value of -1 if the first argument is less than the second, 0 if the first argument is the same as the second, and +1 if the first..

  Give an example of a software change

For some existing or hypothetical application, give an example of a software change that might be due to a change in the social environment.

  Describe in brief the type of test program you would need

Describe in brief the type of test program you would need to run on the system. and the type of measurements you would need to make.

  Distinguish between a ring and a commutative ring

Define a group and distinguish between a group and a commutative group. Define a ring and distinguish between a ring and a commutative ring.

  Describe the specific methods and tools that will be used

Describe the specific methods and tools that will be used to provide visualization of the structured and unstructured data for the organization.

  Discuss contract or derivative requirement for cybersecurity

Discuss the contract requirements and derivative requirements for cybersecurity at Sifers-Grayson in 3 to 5 paragraphs under "Section 6 General Comments."

  Determine the address map of the given system

Consider the hardware schematic shown in Figure.

  Create an application that gets customer account data

Create an application that gets customer account data, including an account number, customer name, and balance due.

  Explain the following statements as logic expressions

Please state the following statements as logic expressions.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd