Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong intercept extraction index #3

Open
Henrydw opened this issue Mar 8, 2020 · 0 comments
Open

Wrong intercept extraction index #3

Henrydw opened this issue Mar 8, 2020 · 0 comments

Comments

@Henrydw
Copy link

Henrydw commented Mar 8, 2020

Intercept extraction index in wrong

On line 156 in tobit.py.
The intercept is improperly extracted from the result of the optimisation, it is saved as:
result.x[1]
which the first of the coefficients, not the intercept.
It seems it should be:
result.x[0]

The index should be 0, not 1.

if self.fit_intercept:
            self.intercept_ = result.x[1]  <- THIS LINE HERE
            self.coef_ = result.x[1:-1]
        else:
            self.coef_ = result.x[:-1]
            self.intercept_ = 0

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant