0% found this document useful (0 votes)
30 views

Advanced Analytics, Assignment 1

The document summarizes the components of a Holt-Winters plot generated from time series electricity production data. It shows the original data, fitted values that follow a trend between 34-35, and forecasted values represented by a blue line beyond the end of the data. The plot indicates seasonality with peaks, averages, and drops. It also includes confidence intervals around the forecasted values and forecasts future data for the next two years. R code is included to load the data, perform Holt-Winters exponential smoothing, and plot the forecast.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Advanced Analytics, Assignment 1

The document summarizes the components of a Holt-Winters plot generated from time series electricity production data. It shows the original data, fitted values that follow a trend between 34-35, and forecasted values represented by a blue line beyond the end of the data. The plot indicates seasonality with peaks, averages, and drops. It also includes confidence intervals around the forecasted values and forecasts future data for the next two years. R code is included to load the data, perform Holt-Winters exponential smoothing, and plot the forecast.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Chavi Agarwal ADVANCED ANALYTICS PG21200

ASSIGNMENT 1

INTERPRETATION
Components of the Holt-Winters Plot

The Original Data: Data consist of 397 rows and two columns. It is time series data and it has a trend.

Fitted Values: The fitted values are between 34-35, blue lines represent the forecast.

Forecasted Values: The blue line beyond the end of the original data represents future forecasting.

Trend: Here trend is continuing in forecasting

Seasonal Patterns: Data between 0-20 is continually increasing in trend. There is a pattern of peak,
average and drop in the plot.

Forecast Horizon:

Blue line after data ends indicates the future data forecasting for next two year (appx.)

Confidence Intervals:

The forecast plot often includes shaded areas around the forecasted values. These shaded areas represent
confidence intervals. Shaded areas with blue lines is visible here.
Chavi Agarwal ADVANCED ANALYTICS PG21200

R-CODE

#Search for a time series dataset and perform Holt winters

#Load data

setwd("D:/Semester 4/Advanced Analytics")

Electric_Production = read.csv("C:\\Users\\lonovo\\Desktop\\Advance analytics\\


Electric_Production.csv")

data <- read.csv("../Advanced Analytics/Electric_Production.csv")

head(data)

#Install the forecast package

install.packages("forecast")

# Load the forecast packagehttp://127.0.0.1:35859/graphics/dc8c40cf-1989-46a1-93de-1f11dc336bb8.png

library(forecast)

# Create a time series object by using the command given below

ts_electric_prod <- ts(Electric_Production$IPG2211A2N, frequency = 12)

ts_electric_prod.

# Apply exponential smoothing using the Holt-Winters

fit_electric_prod <- HoltWinters(ts_electric_prod)http://127.0.0.1:35859/graphics/72dc89eb-0c67-4975-


b5b5-8bed7d29690d.png

fit_electric_prod

# Print the forecast for the next 12 months

forecast(fit_electric_prod, h = 12)

# Finally, we print the forecast for the next 12 months using the forecast() function and specifying h = 12
as the number of periods to forecast.

forecast_electric_prod = forecast(fit_electric_prod, h = 12)

#Plot the forecast using the plot command.

plot(forecast_electric_prod)

# Set smaller margins


Chavi Agarwal ADVANCED ANALYTICS PG21200

par(mar = c(2, 2, 2, 2))

pdf("output_plot.pdf", width = 10, height = 6)

plot(x, y, main = "My Plot")

dev.off()

Screenshot:

You might also like