Skip to content

GLM/LEF for non-linear mean function #2179

Open

Description

@josef-pkt

We need to extend the LEF/GLM models to not be GLinearM.

I thought there are open issues, but I didn't see any.

design idea (some notes for it)

Instead of moving to general nonlinear mean function E(y | x) = m(x, params), we can move to a combination link-mean function E(y | x) = inverse_link(m(x, params)).

One main point: reuse current link properties, and current score_factor to extend it by just replacing the inner part which is currently the linear prediction linpred = exog dot params + offset
The advantage is in applying chain rule for derivatives.
If link is identity, then this reduces to the econometrics general mean function.

Activity

  1. added this to the 0.8 milestone on Jan 12, 2015
  2. modified the milestones: 0.8, 0.10 on Feb 3, 2018
  3. josef-pkt commented on Feb 3, 2018

    @josef-pkt
    MemberAuthor

    A quick experiment to see how much we have to override in GLMNonlinear inheriting from GLM.
    https://gist.github.com/josef-pkt/5e717a6da313b7a41f23f7d1adbd9c19

    There are problems with the accuracy of the hessian, with possible problems of observed versus expected information matrix. #3278 has a reference and mentions hessian approximation in the comments.
    I didn't check any references now, this was just a brief coding exercise to check inheritance.

  4. josef-pkt commented on Jan 22, 2021

    @josef-pkt
    MemberAuthor

    a possible application for this: density estimation from histogram of sample or noisy pdf.

    y_i = n * d * pdf(x_i, theta) where pdf is midpoint of bin, and y_i is count in bin, (using local linear or some approx to prob of bin)
    or
    y_i = cdf(x_i, theta) where y_i is ecdf, cumulative counts (maybe not, loose independence of observations)

    or use proper discretized prob_i = cdf_ub_i - cdf_lb_i (similar to MLE using grouped data)

  5. josef-pkt commented on Jan 22, 2021

    @josef-pkt
    MemberAuthor

    gist looks good.

    I think the problem mentioned in the gist with gaussian derivatives is that scale is not fixed during the score, hessian computation.
    This has been cleared up in master a while ago and we fix now scale during the optimization in fit, and have adjusted unit tests that use fixed scale for derivatives (when comparing to numerical derivatives)..

    bump

  6. modified the milestones: 0.10, 0.13 on Jan 22, 2021
  7. josef-pkt commented on Oct 16, 2022

    @josef-pkt
    MemberAuthor

    bump

    one application would be Logit or Probit (or CDFLink) with heteroscedasticity of latent variable
    see several articles and Stats programs for heteroscedastic logit or ologit.

    heteroscedasticity of latent variable in binary models introduces nonlinearity in mean function
    It's relevant for interval censored latent variables, binary with CDFLink, ordinal, CensoredCount.

    This is different from heteroscedasticity in dispersion as in models with extra dispersion parameters like negbin, beta-binomial or families for continuous endog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions