Repository navigation
Conversation
|
not many comments about specification and implementation choices in PRs and issues Main restriction here. This cannot be used for proportions or counts. The endog has to be a single choice. |
|
problem without constant we cannot estimate a Null model this works but produces nan standard errors (coeff on const is zero), but loglike is computed setting We could add an |
|
This pull request introduces 3 alerts when merging cc353cc into 3d6a493 - view on LGTM.com new alerts:
|
|
strange: appveyor fails only on 3.8 with missing module, should fail everywhere |
| for x, y in zip(endog.values.categories[:-1], | ||
| endog.values.categories[1:])] | ||
| names['yname'] = endog_name | ||
| names['xname'] = names['xname'] + threshold_name |
There was a problem hiding this comment.
exog does not need a model specific treatment. This should be handled by the generic framework.
threshold_names should use labels in __init__ independent of input format
| thresh = np.concatenate(([-np.inf], thresh, [np.inf])) | ||
| xb = self.exog.dot(params[:-(self.k_levels - 1)])[:, None] | ||
| low = thresh[:-1] - xb | ||
| upp = thresh[1:] - xb |
There was a problem hiding this comment.
separate out this part, DRY
it is also used in every loglike related function
There was a problem hiding this comment.
maybe not here
predict computes all integration bounds, loglike only two per observation
in predict low up could be selected after computing thresh - xb instead of computing it twice
| thresh = np.concatenate((th_params[:1], | ||
| np.exp(th_params[1:]))).cumsum() | ||
| thresh = np.concatenate(([-np.inf], thresh, [np.inf])) | ||
| xb = self.exog.dot(params[:-(self.k_levels - 1)])[:, None] |
There was a problem hiding this comment.
BUG: this should use exog argument if not None, not self.exog
| def prob(self, low, upp): | ||
| """interval probability | ||
| """ | ||
| return np.maximum(self.cdf(upp) - self.cdf(low), 0) |
There was a problem hiding this comment.
need something analogous for pdf for score and hessian
|
Probably because that run tests from an install, not from the source tree. Porbbaly missing and |
Good that we have some CI that does this, otherwise we might not check for missing files in install distribution. |
|
I opened issue #7023 to see whether we can easily convert link classes to distribution classes (difference in method names) |
| thresh = np.concatenate(([-np.inf], thresh, [np.inf])) | ||
| thresh_i_low = thresh[self.endog] | ||
| thresh_i_upp = thresh[self.endog + 1] | ||
| xb = self.exog.dot(params[:-(self.k_levels - 1)]) |
There was a problem hiding this comment.
outsource linpred,
then we need to add offset only at a single method.
|
problem with derivatives, score with respect to threshold parameters Because I use the exp increment parameterization for the constant in the integration bounds, the derivatives are different from Greene. a change in one threshold parameter affect all higher integration bounds and so derivative for those is not zero. so for score I still have to compute all probabilities, also those that belong to a different interval than the observation. One possibility would be to use the exp increment parameterization only during the optimization with numerical derivatives, and get score and hessian for the simple threshold constant for post-estimation. Or use analytical score for exog parameters (which I have now) and numerical derivatives for threshold parameters. I did this somewhere. maybe (?) in count models edit I think for score_test and similar we only need the score_factor with repect to the exog parameters. It is unlikely in this case that we want to test restrictions on the threshold constants. |
|
Stata ologit allows for offset and constraints I added offset now, and it can be used to estimate the null model (currently only params of null results are tested)
with inherited score_obs, we inherit generic robust cov Stata allows cov type "robust" (i.e. HC1 IIRC) and "cluster" With |
|
df_resid looks wrong, full model: df_resid is 400 - 3 and doesn't count the 2 threshold parameters, df_model subtracts 1 for constant ! (by default) |
|
current parameter names are misleading because those are not the internal names e.g. summary shows "gpa", internal is "x3"
|
25f20d8 to
c05cead
Compare
|
Hello @josef-pkt! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2020-09-15 14:59:47 UTC |
|
I have an uncommitted change in One problem is to access the original endog before patsy transformed it, currently that's difficult. I guess the cleanest solution would be to add the option for not using patsy for endog to also, I can add a user facing edit |
|
I tried subclassing edit checking with |
|
tricky: |
c05cead to
6fc1e65
Compare
|
I made some changes in how |
|
looks pretty bad unit test fail all over the place (but pytest output in this case is much too verbose to get an overview) one case in missing handling in another case, MixedLM uses an allowed list I need to continue another day, I need to recompile statsmodels, but that's not possible because I have too many open python interpreters/notebooks to shut them down now. |
|
This pull request introduces 1 alert when merging 6fc1e65 into 7d727fd - view on LGTM.com new alerts:
|
|
fixing the allowed kwargs is easy, but it looks like there is a more tricky problem with missing value handling, several test failures for that. next problem: pickling (all other unit tests in failing test are all in formula handling in pickling Might be better to add some eg. in MixedLM, with my addition of
those are added in I think that should work, if we have a Also, then from_formula can just provide the info to |
|
locally, unit tests for base, regression and miscmodels now pass This is still a version with an explicit |
|
This pull request introduces 3 alerts when merging f63c243 into 4328705 - view on LGTM.com new alerts:
|
|
There are cases where
|
f63c243 to
7e64c98
Compare
|
I continue with ordinal model in #7035 |
formula_tools as model argument, was: Ordinal model rebased
|
This pull request introduces 2 alerts when merging 7e64c98 into 4328705 - view on LGTM.com new alerts:
|
formula_tools as model argument, was: Ordinal model rebasedformula_info as model argument, was: Ordinal model rebased
rebased version of #6982 , based on PR #2600 and issue #807