Predictive analytics is a great technology that can help in identifying the origin of a problem before it actually happens. It involves the collective experience of an organization that helps in taking better decisions in the future. It has many strategic advantages as it allows a company in becoming the leader when the changes actually happen. Predictive Analytics is considered a boon for the organizations to grow in the highly competitive market.
Topics covered:
1. Beyond OLS: What real life data-sets look like!
2. Decoding Forecasting
3. Handling real life datasets & Building Models in R
4. Forecasting techniques and Plots
Webinar: The Whys and Hows of Predictive Modelling
1. www.edureka.co/advanced-predictive-modelling-in-r
View Advanced Predictive Modelling with R course details at www.edureka.co/advanced-predictive-modelling-in-r
Advanced Predictive Modelling with R
For Queries:
Post on Twitter @edurekaIN: #askEdureka
Post on Facebook /edurekaIN
For more details please contact us:
US : 1800 275 9730 (toll free)
INDIA : +91 88808 62004
Email Us : sales@edureka.co
2. Slide 2 www.edureka.co/advanced-predictive-modelling-in-r
At the end of this module, you will be able to understand:
Introduction to Predictive Modeling
Beyond OLS: How real life data-set looks like!
Decoding Forecasting
How to handle real life dataset: Two examples
How to Build Models in R: Example
Forecasting techniques and Plots
Objectives
3. Slide 3 www.edureka.co/advanced-predictive-modelling-in-r
a <- ts(1:20, frequency = 12, start = c(2011, 3))
print(a)
## Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
## 2011 1 2 3 4 5 6 7 8 9 10
## 2012 11 12 13 14 15 16 17 18 19 20
str(a)
## Time-Series [1:20] from 2011 to 2013: 1 2 3 4 5 6 7 8 9 10 ...
attributes(a)
## $tsp
## [1] 2011.167 2012.750 12.000
##
## $class
## [1] "ts"
Creating a Simple TimeSeries
15. Slide 15 www.edureka.co/advanced-predictive-modelling-in-r
Difference of Difference
tsdisplay(diff(diff(euretail,4)))
The significant spike at lag 1 in the ACF
suggests a non-seasonal MA(1) component,
and the significant spike at lag 4 in the ACF
suggests a seasonal MA(1) component
Consequently, we begin with an
ARIMA(0,1,1)(0,1,1)4 model,
indicating a first and seasonal difference,
and non-seasonal and seasonal MA(1)
components
16. Slide 16 www.edureka.co/advanced-predictive-modelling-in-r
Fitting a Model
fit <- Arima(euretail, order=c(0,1,1), seasonal=c(0,1,1))
fit
## Series: euretail
## ARIMA(0,1,1)(0,1,1)[4]
##
## Coefficients:
## ma1 sma1
## 0.2901 -0.6909
## s.e. 0.1118 0.1197
##
## sigma^2 estimated as 0.1812: log likelihood=-34.68
## AIC=75.36 AICc=75.79 BIC=81.59
24. Slide 24 www.edureka.co/advanced-predictive-modelling-in-r
DIY: Corticosteroid Drug Sales in Australia
We will try to forecast monthly corticosteroid drug sales in Australia
These are known as H02 drugs under the Anatomical Therapeutical Chemical classification scheme
fit <- auto.arima(h02, lambda=0, d=0, D=1, max.order=9,stepwise=FALSE, approximation=FALSE)
tsdisplay(residuals(fit))
Box.test(residuals(fit), lag=36, fitdf=8, type="Ljung")
fit <- Arima(h02, order=c(3,0,1), seasonal=c(0,1,2), lambda=0)
plot(forecast(fit), ylab="H02 sales (million scripts)", xlab="Year")