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

NegativeBinomial missing fit_regularized method #1454

Closed
josef-pkt opened this issue Mar 9, 2014 · 0 comments

Comments

Projects
None yet
1 participant
@josef-pkt
Copy link
Member

commented Mar 9, 2014

see #1453 for an error this causes

the main problem is that the inherited start_params doesn't take the extra negbin parameters into account.

aside: finding the range of alpha to use for regularization is not obvious. needs to be relatively large in the larger (nobs=20,000) dataset alpha=10

I think by default we should not penalize the negbin parameter, e.g.
if alpha >0 and isscalar(alpha) then

amask = np.ones(len(res.params))
amask[-1] = 0
alpha = alpha * amask

also: there are no documentation examples for fit_regularized

josef-pkt added a commit to josef-pkt/statsmodels that referenced this issue Apr 22, 2014

@josef-pkt josef-pkt closed this in 544400d Jul 22, 2014

PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014

yarikoptic added a commit to yarikoptic/statsmodels that referenced this issue Oct 23, 2014

Merge commit 'v0.5.0-1189-g48f7a21' into releases
* commit 'v0.5.0-1189-g48f7a21': (970 commits)
  REF _fit_newton use np.asarray(hess)
  REF: _fit_newton, add ridge_factor option, default 1e-10
  REF: _fit_newton add Ridge correction to Hessian, see also statsmodels#953
  Bug comment: commented out code, weigths don't sum to 1 see statsmodels#1845
  CLN: TST cleanup comment, unused code.
  REF: "is" None (not ==)
  BUG: fix if alpha is scalar, TST: try standardized
  REF: NegativeBinomial fit_regularized, try regularized Poisson for start_params
  DOC: add comment in notes about not penalizing NegBin shape parameter [skip ci]
  TST: TestNegativeBinomialL1Compatability use desired as start_params
  TST: adjust test, precision and start_params (failure on TravisCI)
  BUG: NegativeBinomial fix aic, bic for 'geometric', adjust tests
  REF add k_extra to NegativeBinomial, don't count it in df_model, df_resid
  TST explicitely define k_extra in test class
  CLN: a few cosmetic changes
  TST fix negbin geometric test for fit_regularized
  CLN L1NegativeBinomialResults rename closes statsmodels#1615,     remove redundant `__init__`
  BUG NegativeBinomial add fit_regularized closes statsmodels#1453 closes  statsmodels#1454     adjust test to handle extra parameter
  REF: has_constant remove special code in linear_model, is moved to data
  Fix const_idx with multiple const, more tests
  ...

yarikoptic added a commit to yarikoptic/statsmodels that referenced this issue Oct 23, 2014

Merge branch 'releases' into debian-experimental
* releases: (970 commits)
  REF _fit_newton use np.asarray(hess)
  REF: _fit_newton, add ridge_factor option, default 1e-10
  REF: _fit_newton add Ridge correction to Hessian, see also statsmodels#953
  Bug comment: commented out code, weigths don't sum to 1 see statsmodels#1845
  CLN: TST cleanup comment, unused code.
  REF: "is" None (not ==)
  BUG: fix if alpha is scalar, TST: try standardized
  REF: NegativeBinomial fit_regularized, try regularized Poisson for start_params
  DOC: add comment in notes about not penalizing NegBin shape parameter [skip ci]
  TST: TestNegativeBinomialL1Compatability use desired as start_params
  TST: adjust test, precision and start_params (failure on TravisCI)
  BUG: NegativeBinomial fix aic, bic for 'geometric', adjust tests
  REF add k_extra to NegativeBinomial, don't count it in df_model, df_resid
  TST explicitely define k_extra in test class
  CLN: a few cosmetic changes
  TST fix negbin geometric test for fit_regularized
  CLN L1NegativeBinomialResults rename closes statsmodels#1615,     remove redundant `__init__`
  BUG NegativeBinomial add fit_regularized closes statsmodels#1453 closes  statsmodels#1454     adjust test to handle extra parameter
  REF: has_constant remove special code in linear_model, is moved to data
  Fix const_idx with multiple const, more tests
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.