Repository navigation
REF/ENH delta method and nonlinear wald test rebased - #7758
Conversation
|
name inconsistency this doesn't seem to have method for vectorized t_test, only joint wald test however summary has the full e.g. in the unit test case (pdb at end of comparing delta_cov with Poisson margins last line in lpm is for constant that margeff does not include |
|
needs clearer description about difference between joint and vectorized. test cases look good, i.e. it looks like it does what we need. |
7bac6b2 to
4241fdf
Compare
|
It looks like I don't have any example scripts from 2015 except for those that look like the basis for the unit test examples. |
|
I think I looked at this before, confint for predicted probs in discrete models in Stata Xu, Jun, and J. Scott Long. "Confidence intervals for predicted outcomes in regression models for categorical outcomes." The Stata Journal 5, no. 4 (2005): 537-559. |
|
last commit left a |
| lmstat = np.dot(np.dot(diff.T, np.linalg.inv(v)), diff) | ||
| return lmstat, stats.chi2.sf(lmstat, df_constraints) | ||
|
|
||
| def se_vectorized(self): |
There was a problem hiding this comment.
not sure we need _vectorized postfix.
sounds a bit strange
|
another usecase: in multilink models we could have params = (linpred, linpred2) but we still need cross-cov_params, i.e. off-diagonal blocks. When we have analytical derivatives, then we won't gain anything, deriv already uses linear prediction part. |
wald_tests uses cov same pattern as Results t_test and wald_test in models. |
4241fdf to
b9b0501
Compare
|
style check doesn't like the later: we should also support transformation classes, i.e. |
|
name It's not an analogue to I think we want the instance return, but it should have a method name that indicates that. We could wald_test_nl and t_test_nl methods that directly return the hypothesis test results. difference to standard get_prediction: Stata has test_nl and predict_nl separately. possible one internal usecase is to support get_prediction, e.g. Prob(y=0) aggregated over obs We might need a safeguard in the function that has both vectorized and joint inference if the number of rows is large. |
|
another usecase of joint: comparing predicted means and margins 2 rows with predictions (e.g. given by link) at two points of exog x1, x2, with f(x1), f(x2) The diff f(x2; p) - f(x1; p) is not monotonic wr.t. x, so we cannot use endpoint transformation in confint. We should have a separate function of univariate in linpred functions, e.g. to support get_prediction in Poisson, Logit, GLM and other models (e.g. symmetric distributions, ...) where mean is separable from dispersion/variance/extra_params (block-diagonal information matrix)
|
|
If we do GMM, then statistics like probability/expected counts - freq is just an extra moment condition. A hypothesis test would be either an overidentifying test or a test on the diff = observed - expected. |
|
all green, in it goes |
rebased version of #2296
trivial merge conflict
needed fixes to run and pass unit tests