GLS: missing standard errors/confidence interval for fittedvalues/predict

Bug #428911 reported by joep
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
statsmodels
New
Undecided
Unassigned

Bug Description

I didn't find any results for getting the prediction error for fittedvalues or for predictions made with GLS.predict. It would be nice to have standard errors that can be used to plot confidence intervals together with the fitted values.

This should be relatively easy for iid case in OLS, but maybe not so easy for heteroscedastic case (GLS, WLS) or other non-i.i.d. cases
(GLSAR doesn't have conditional or one-step ahead prediction yet.)

Revision history for this message
Skipper Seabold (jsseabold) wrote :

Is the prediction error just the root mean squared error or the standard error of the regression, assuming homoskedasticity?

I never added this result explicitly though I thought about it.

If this is correct then the confidence interval of a fitted value is just

fitted_vale +/- critical_value * SER

For us SER is given by (mse_resid)**.5 or equivalently (scale)**.5

With heteroskedasticity then we just have to weight the observations?

Revision history for this message
joep (josef-pktd) wrote :

The prediction error is the sum of the error variance plus the variance that comes from the uncertainty in the parameter (beta) estimates

A version that works with independently distributed case, OLS and WLS, but not for general GLS

http://bazaar.launchpad.net/~josef-pktd/statsmodels/statsmodels-josef-experimental/annotate/head%3A/scikits/statsmodels/sandbox/regression/predstd.py

I'm not sure whether we should attach it to results or rewrite so it can be attached to the model (WLS)

I'm waiting for a GLS case, random effects model, not sure about GLSAR, to see whether predict should be in model or result class. I suspect that once we have other classes than OLS, GLS then we need model specific prediction code.

For GLSAR, I would introduce new method in model called "forecast", distinction between forecast and predict as in Greene, with or without knowledge of time.

GLS for arbitrary correlation is still unclear, eg. spatial econometrics and Gaussian Processes with kernel covariance structure.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.