Repository navigation
Conversation
…sian. Erratic solver behavior.
|
Hello @josef-pkt! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
| @@ -0,0 +1,236 @@ | |||
| import numpy.testing as npt | |||
| import numpy as np | |||
| from scikits.statsmodels.regression.censored_model import Tobit | |||
There was a problem hiding this comment.
still uses scikit namespace
| predict stdp, stdp | ||
| * calculates Pr(a < xb + u < b), the probability that y|x would be | ||
| * observed in the interval (a,b). Takes inf and neg. inf | ||
| predit pr2535, pr(25,35) |
| return TobitResults(self, mlefit) | ||
|
|
||
| class TobitResults(base.LikelihoodModelResults): | ||
| def __init__(self, model, mlefit): |
There was a problem hiding this comment.
no super call in __init__
| #TODO: fix this to remove params, we need a general solution here | ||
| predict.__doc__ = Tobit.predict.__doc__ | ||
|
|
||
| def webuse(data, baseurl='http://www.stata-press.com/data/r11/'): |
There was a problem hiding this comment.
outdated
I think we have/had a function like this merged, but it should also work with pandas directly
There was a problem hiding this comment.
returns structured dtype, recarray
| dta = StringIO(dta.read()) # make it truly file-like | ||
| return genfromdta(dta) | ||
|
|
||
| if __name__ == "__main__": |
| true_params = np.array([-1.530712955415909, -.1051385059749894, .1282901151942823, -.0277671231250877, -.9434969317125149, -.085975029751076, .3128387422989903, .0142119678926689, 7.836529294458556, 4.498874144181835]) | ||
|
|
||
| # ok | ||
| print 'Newton' |
|
two model classes TobitOlsen and Tobit |
| @transform2(_exponentiate_sigma) | ||
| def score(self, params): | ||
| params, sigma = params[:-1], params[-1] | ||
| return self._score(params, sigma) |
There was a problem hiding this comment.
too many helper functions and methods, makes it difficult to follow code.
params is not uniquely defined, params including scale/sigma, and params without scale/sigma
|
This pull request introduces 9 alerts when merging ab79784 into 47137eb - view on LGTM.com new alerts:
|
|
design: This PR splits observations into 3 arrays (for each, endog, exog) depending on the censoring type of the observation. score_obs could be defined on arrays with rearranged observations. e.g. useful for HC cov_type. Alternative design is to keep loglikeobs, score_obs and similar in original order. This is, for example, what I did in OrderedModel. robust cov_type, brief coogle search for tobit
aside: Giles argues for specification testing instead of robust cov (I don't agree with Giles (and others that argue similarly), second comment by Jonah B. Gelbach sounds good to me) |
rebased #2139 which was a rebase of skipper's original PR
conflict with tools decorator, I skipped the commit as conflict resolution
Patch failed at 0009 ENH: Add transform decorators with testsneeds another interactive rebase:
I guess this largely predates python 3
PR does not include unit tests results files. I had removed them in 2139.