I feel I might be missing something obvious here, but is there an easy way to output a model's prediction with PIs for some new input without using wls_prediction_std? I am using a very simple OLS model, code to help my explanation is here:
model = sm.OLS.from_formula('mpg ~ horsepower', df)
model = model.fit()
x_pred = pd.DataFrame(data=[98],columns=['horsepower'])
print(model.predict(x_pred))
This yields a single predicted value, however I am interested in knowing the values at the 95% prediction interval. As mentioned I know there is a way to do this with wls_prediction_std as follows:
bias = pd.Series(np.ones(shape=(len(x_pred))))
x_pred = pd.concat([bias,x_pred],axis=1)
print(x_pred)
print(wls_prediction_std(model, exog=x_pred.values))
However this clearly doesn't work very seamlessly with the OLS functionality (e.g. compared to the methods of RegressionResults). Is there a method in RegressionResults that I've missed?