Douglas Kinney presentation Between-Lives Regression 07.08.14
Time series and regression presentation for oct 5th rice presentation r group
-
Upload
william-yarberry -
Category
Technology
-
view
451 -
download
1
description
Transcript of Time series and regression presentation for oct 5th rice presentation r group
Example Time Series & Multivariate Regression in R -
Predicting Steel Demand
Example Time Series & Multivariate Regression in R -
Predicting Steel Demand
Time Series Time Series
• The math is pretty substantial (at least for me!)
• Key concepts are seasonality, auto-regression, trend and level
• We used Holt-Winters and ARIMA (auto regression integrated moving average); plenty of other functions exist
Client management wants to predict demand (in tons) of steel
Client management wants to predict demand (in tons) of steel
Some HW CodeSome HW Code
Prediction Prediction
ARIMAARIMA
• “Seasonal ARIMA modelsare powerful tools in the analysis of time series as they are capable of modeling a very wide range of series”
• Best to learn thoroughly and from deep study. But if you have a day job …. Just pluck code to optimize the parameters and use it
Here’s the code for selecting the best ARIMA parameters
Here’s the code for selecting the best ARIMA parameters
Multivariate RegressionMultivariate Regression
• Identified about 150 economic indicators; from economy.com and other sources.
1 response; 150 predictors – tedious to find best COR
1 response; 150 predictors – tedious to find best COR
Now we know top ten predictors for agriculture – let’s build a model
Now we know top ten predictors for agriculture – let’s build a model
Whack a mole on predictorsWhack a mole on predictors
Get a nice modelGet a nice model
Remembering why we walked into the swamp … oh yea, to predict future tons for agriculture products
Remembering why we walked into the swamp … oh yea, to predict future tons for agriculture products
Another approachAnother approach
• You can “lag” your predictors so that – for example - when you build your model, you associate July 2011 actual (response) with April of 2011 predictor value. If you have a good model, lagging allows you to predict future values without depending on “experts” to opine on future economic indicators.
Simple code to “lag” Simple code to “lag”
R has a
Built in
Lag function
If you want a copy of slides or code, just email me.
If you want a copy of slides or code, just email me.
Bill Yarberry
Thanks.