You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a quick prototype for a Logit plot observed versus predicted, using lowess as smoother (local averaging)
see #6430 (calibration) #6434 plot elements like add_lowess
another possibility CUSUM plot version of the above
However, it's not easy to see smaller misspecification when applied to training sample.
(idea: instead of binning to get local probabilities, we use the empirical "cdf" but it is a cumulative probability where observations have different expected values)
simulated example: distortion in misspecified link function linpred = np.exp(linpred + 0.5) - 2 but model assumes Logit
nobs=200 so we see some deviation from 45 degree line
A calibration plot that I found appealing. Just for inspiration.
The possibility to compute confidence intervals looks also utile.
Source: Steyerberg, E. W. Clinical prediction models : a practical approach to development, validation, and updating. (2019). Chapter 15 (Evaluation Performance)
I'm just trying to figure out similar plots for OrderedModel #7035 and MNLogit, so I can compare predictions of those two.
One option in the multivariate/multinomial case it to plot separately for each choice dummy.
If I iterate lowess in a larger example, e.g. default it=3, then I get a fit to extremes, e.g. many zeros in fitted values. I think robustness or mad kicks in and having only a few local opposite, 0, 1 values are treated as outliers.
I get better results with it=0, e.g. add_lowess(ax, frac=0.3, it=0) which are closer to 45 degree line
example for anes96 data using MNLogit while looking at plots for #7035, using separate plots for each endog dummy.
Activity
josef-pkt commentedon Jan 18, 2020
example plot for current version (nobs=500, simulated data, no random seed)
josef-pkt commentedon Jan 18, 2020
another possibility CUSUM plot version of the above
However, it's not easy to see smaller misspecification when applied to training sample.
(idea: instead of binning to get local probabilities, we use the empirical "cdf" but it is a cumulative probability where observations have different expected values)
simulated example: distortion in misspecified link function
linpred = np.exp(linpred + 0.5) - 2but model assumes Logitnobs=200 so we see some deviation from 45 degree line
normanius commentedon Jun 19, 2020
A calibration plot that I found appealing. Just for inspiration.
The possibility to compute confidence intervals looks also utile.
Source: Steyerberg, E. W. Clinical prediction models : a practical approach to development, validation, and updating. (2019). Chapter 15 (Evaluation Performance)
josef-pkt commentedon Sep 27, 2020
I'm just trying to figure out similar plots for OrderedModel #7035 and MNLogit, so I can compare predictions of those two.
One option in the multivariate/multinomial case it to plot separately for each choice dummy.
josef-pkt commentedon Sep 29, 2020
If I iterate lowess in a larger example, e.g. default
it=3, then I get a fit to extremes, e.g. many zeros in fitted values. I think robustness or mad kicks in and having only a few local opposite, 0, 1 values are treated as outliers.I get better results with
it=0, e.g.add_lowess(ax, frac=0.3, it=0)which are closer to 45 degree lineexample for anes96 data using MNLogit while looking at plots for #7035, using separate plots for each endog dummy.
josef-pkt commentedon Sep 29, 2020
another issue training sample versus test sample:
Most of our regression plots are in-sample, they take a results instance and get the relevant data from those.
my prototype for the binary reset test uses fitted and observed which can be used also with a test sample.
edit
this functions are from my dev notebook
try_mnlogit_ordered_margin.ipynbjosef-pkt commentedon Jan 20, 2023
related: overlap diagnostic for propensity score
nonoverlapping observations are close to 0 or 1 boundaries.
What would be useful is to add the histogram/kde for axes similar to or using seaborn
bump for 0.15 we can add it to a Binary Diagnostic class similar to the plots for CountDiagnostic