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

Implement logprob derivation for order statistics #6350

Closed
ricardoV94 opened this issue Nov 29, 2022 · 1 comment
Closed

Implement logprob derivation for order statistics #6350

ricardoV94 opened this issue Nov 29, 2022 · 1 comment

Comments

@ricardoV94
Copy link
Member

Description

The idea would be to derive the logprob for the following type of graphs

import aesara.tensor as at
import pymc as pm

y_rv = at.max(at.random.uniform(0, 1, size=3))   # or min
y_rv = at.sort(at.random.uniform(0, 1, size=3))
y_rv = at.sort(at.random.uniform(0, 1, size=3))[idx]  # max / min correspond to idx==-1 or idx==0

y_vv = y_rv.clone()
pm.logprob.factorized_joint_logprob({y_rv: y_vv})

https://en.wikipedia.org/wiki/Order_statistic#Probabilistic_analysis

This might be a bit far-fetched / difficult to find a good general solution that goes beyond a few simple cases (e.g, order statistics with non-i.i.d RVs):

y_rv = at.max(at.random.uniform([0, 1], [2, 3]))
y_rv = at.max(at.stack([at.random.uniform(0, 1), at.random.normal(0, 1)]))

Probability for order statistics of IID variables are pretty straightforward to obtain, requiring expressions that depend on the CDFs. For non IID, things grow quickly in complexity: https://en.wikipedia.org/wiki/Bapat%E2%80%93Beg_theorem

@ricardoV94
Copy link
Member Author

Superseded by #7121

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