Fitting an ARMAX model
In this exercise you will fit an ARMAX model to a time series which represents the wait times at an accident and emergency room for urgent medical care.
The variable you would like to model is the wait times to be seen by a medical professional wait_times_hrs
. This may be related to an exogenous variable that you measured nurse_count
which is the number of nurses on shift at any given time. These can be seen below.
This is a particularly interesting case of time series modeling as, if the number of nurses has an effect, you could change this to affect the wait times.
The time series data is available in your environment as hospital
and has the two columns mentioned above. The ARMA
class is also available for you.
This is a part of the course
“ARIMA Models in Python”
Exercise instructions
- Instantiate an ARMAX(2,1) model to train on the
'wait_times_hrs'
column ofhospital
using the'nurse_count'
column as an exogenous variable. - Fit the model.
- Print the summary of the model fit.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Instantiate the model
model = ____
# Fit the model
results = ____
# Print model fit summary
____