-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
predict does not attempt to invert transformations to left hand side #1449
Comments
good question, Do we get anything that can help out of patsy? In general we might need to have predefined function something like link functions that also specify the inverse link function. |
Stata handles this well by taking the approach I did in Margins for predict. You can use certain pre-defined transforms or pass your own IIRC. |
It's similar to what we do with "linear=True" in discrete models. but there we don't use any inference properties for the linear prediction, and the non-linear model is what is modeled and estimated. Since it's related https://groups.google.com/d/msg/pystatsmodels/51f6ZLErP8A/wySASdAk3iQJ |
Stata's predictnl? http://www.stata.com/manuals13/rpredictnl.pdf That looks like a general approach. |
Yeah that sounds maybe right. I don't recall well though. My idea was always just thought do take a general transformation.
Or using pre-defined like stata (somewhere I might be misremembering)
Which is like margins for a linear model. |
What is Margins?
|
Just another thought: I prefer to keep it in a separate method like Stata, predict_nonlin (?) because we might want to have different ways of approximating the nonlinear prediction, and it's distribution. linear transformation don't change the distribution assuming the underlying parameters are normal or t distributed. (aside: I'm bumping into bias and bias correction for non-linear transformation in M-estimators for robust) a semi random reference http://oregonstate.edu/instruct/fw431/sampson/LectureNotes/04-DeltaMethod.pdf side note: |
related question (I never looked at this) |
I'm 100% sure I've written this code, but I have no idea where it is. I thought I included it at some point. I'll look around. |
for poisson prediction of the actual y values http://stackoverflow.com/questions/17922637/prediction-intervals-for-poisson-regression-on-r and to get confidence intervals on predicted probabilities logit, probit, poisson, ...
|
Let's say I have a model like this:
Presumably I am trying to predict
y
froms
. I am taking the log of the left hand side so that I believe that I now have a linear model. Ultimately though, I want the forecast value of y for a given value of s.If I use
fit.predict(s)
, what I am given are predictions forlog(y)
as opposed toy
itself. Is there any way (for some subset of transformations for which the inverse is known) to tell thepredict
that I would like to predicty
? Something like:fit.predict(s, 'y')
The text was updated successfully, but these errors were encountered: