-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
allow OrderedProbit
and OrderedLogit
to take vector inputs
#5216
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
Comments
Hi @drbenvincent and @ricardoV94, happy to work on this task. I will aim for the Approach 1 that allows vector inputs for |
Great stuff @danhphan, assigned to you. |
@danhphan Let us know if you need help with this one |
Hi @ricardoV94, sorry it is still WIP. I have tested this code:
And it work for For example, if sigma's shape is (88,) => need to convert it to shape (88,1). However, I am not sure this is a good solution? as I am still learning on aesara TensorVariable.
|
@danhphan the reshape change you are referring to can easly be done with |
Hi @ricardoV94, that's good to know, so it is similar to numpy arrays. 😄 I will update the code in Cheers 👯 |
This is all looking great. FYI I'm planning on writing up an example for the |
Hi, thank you @drbenvincent, glad that it helps 😄 |
Closed via #5418 |
At the moment, as far as I can tell,
OrderedProbit
andOrderedLogit
break if you try to provide vector inputs foreta
andsigma
parameters.For example, if you have data like this

where your data is encoded as a vector of
y
values alongside a vector ofgrp_idx
, then it looks like you cannot do this...Approach 1 - better but doesn't work
We have a common set of cutpoints
theta
, but each of the groups has differenteta
andsigma
. We try to pass in a vector ofeta
andsigma
values using advanced indexing. But this does not work 🙁Approach 2 - split into separate likelihood terms
If we cannot pass in vectors to
eta
orsigma
, then the solution that works is to encode the data differently so that you now have observations from one group asy1
and observations from another group asy2
This approach does work, but makes model specification cumbersome, and doesn't scale well with more groups.
Not crucial for this issue, but the
constrainedUniform
is a proposed new distribution, outlined in pymc-devs/pymc-extras#32.The text was updated successfully, but these errors were encountered: