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
{{ message }}
Repository navigation
ENH: add get_prediction to MNLogit, NonlinearDeltaCov for multinomial #7888
In #7870 I leave MNLogit get_prediction as NotImplementedError
OrderModel also does not have get_prediction and not much for predict
The problem in MNLogit is that params is 2-d. We need to ravel to patch params to cov_params.
Similar case is already implemented in discrete MultinomialModel._derivative_exog for margins.
see next comment for using NonlinearDeltaCov for average prediction (probabilities of each choice)
related usecase: I started with some diagnostics common to models with categorical/multinomial response, e.g. base on average probabilities (e.g. stochastically-larger residuals) and Hosmer-Lemeshow type binning.
NonlinearDeltaCov seems to work using ravelling (using a model from a unit test
The inherited wald results method res1._get_wald_nonlinear(func_pred) raises an exception with shape error
2-d return of func does not work yet in NonlinearDeltaCov.
The problem here will be how to vectorize over obs, if exog is not just one row (without aggregation) and we predict several observations.
i.e. expected, se/sd will be 2-dim, confint will be 3 dim similar to fittedvalues, bse, pvalues, ..., conv_int in results class
summary/summary_frame would need multi-index, i.e. flattened results
other option to support:
getting cov for one multivariate prediction, as they are not independent (as for separate observations)
related implementation issue: multi-output which in get_prediction, e.g. which="prob" in count models, which is also not vectorized yet (AFAIR, or did I fix that already?)
Activity
josef-pkt commentedon Nov 18, 2021
NonlinearDeltaCov seems to work using ravelling (using a model from a unit test
The inherited wald results method
res1._get_wald_nonlinear(func_pred)raises an exception with shape error2-d return of func does not work yet in NonlinearDeltaCov.
std err and other columns are not verified yet.
josef-pkt commentedon Jun 23, 2023
The problem here will be how to vectorize over obs, if exog is not just one row (without aggregation) and we predict several observations.
i.e. expected, se/sd will be 2-dim, confint will be 3 dim similar to fittedvalues, bse, pvalues, ..., conv_int in results class
summary/summary_frame would need multi-index, i.e. flattened results
other option to support:
getting cov for one multivariate prediction, as they are not independent (as for separate observations)
related implementation issue: multi-output
whichin get_prediction, e.g. which="prob" in count models, which is also not vectorized yet (AFAIR, or did I fix that already?)