-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
From @cvanoli:
Found a better way actually, since the
fitfunction in the Regression Model in urbansim_templates uses the model_fit from urbansim.models, which at the same time, uses thestatsmodels.regression.linear_model.OLSResultswe can get the residuals from the fit object like the urbansim.models does here : https://github.com/UDST/urbansim/blob/master/urbansim/models/regression.py#L344.
So, I would suggest the following two lines to solve this:
- Add here https://github.com/UDST/urbansim_templates/blob/master/urbansim_templates/models/regression.py#L104 a
self.residuals = None- In the fit function after the fitted parameters: https://github.com/UDST/urbansim_templates/blob/master/urbansim_templates/models/regression.py#L192
addself.residuals = results.resid
So in estimation, after you fit the model you can call the residuals as m.residuals
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels