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

ENH: marginal effect, continuous ATE, derivative of predict for splines, GAM #9185

Open
josef-pkt opened this issue Mar 29, 2024 · 0 comments

Comments

@josef-pkt
Copy link
Member

AFAICS, we don't support computing derivative of predicted mean w.r.t. a spline exog variable.

related topics for margins, margeff, e.g. #6479

The Spline basis function support derivatives, so it's just work to connect those.

We need a which option for it in GLMGam.
Currently the model GLMGam.predict is all inherited. only the GLMGamResults class has it's own predict and get_prediction methods to handle "exog" spline basis function generation.

This might be as simple as adding deriv=0 option to predict and _tranform_predict_exog and transmitting it to the spline transform method.
Maybe not so trivial for non-identity link: deriv for linear predictor still needs to be combined with the derivative of the inverse link function evaluated at the predicted mean. We might have the relevant pieces for margeff in GLM.

We need to make sure that the regression params match the spline derivative basis function to compute linear predictor derivative.

(Thought triggered while looking at articles for splines in quantile regression.)

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

No branches or pull requests

1 participant