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

Create convenience quantile functions for various probability distributions #19

Closed
pierucci opened this issue Dec 26, 2015 · 4 comments
Closed
Milestone

Comments

@pierucci
Copy link
Owner

Should include:

  • Binomial and multinomial variables.
  • Beta and gamme density.
  • Bounded density (e.g. non negative).
  • Empirical density.
  • RR, OR, HR...
@pierucci
Copy link
Owner Author

@KZARCA if you have any other suggestion regarding probability distribution that will be needed?

@pierucci pierucci changed the title Create convenience quantile functions for various parameters Create convenience quantile functions for various probability distributions Dec 26, 2015
@KZARCA
Copy link
Collaborator

KZARCA commented Dec 28, 2015

We should add lognormal and logit normal distributions, even if the latter
one is rarely used.

@KZARCA https://github.com/KZARCA if you have any other suggestion
regarding probability distribution that will be needed?


Reply to this email directly or view it on GitHub
#19 (comment).

@pierucci
Copy link
Owner Author

Support for Dirichlet distribution will be non trivial. Suggested implementation:

  • Specify resampling from a multinomial distribution with r_multinomial();
  • Specify which parameters belong to the same multinomial distribution with a define_multinomial() statement.

Example for {a, b, c} ~ Dirichlet(20, 30, 50) and {d, e} ~ Dirichlet(5, 10):

define_resample(
  a = r_multinomial(n = 20),
  b = r_multinomial(n = 30),
  c = r_multinomial(n = 50),

  d = r_multinomial(n = 5),
  e = r_multinomial(n = 10),

  define_multinomial(a, b, c),
  define_multinomial(d, e)
)

This implementation should check:

  • That no parameter belong to more than one distribution;
  • That all parameters belong to one distribution;
  • That no parameter is correlated to anything else, not sure how to handle that correctly, or if it's even a good idea to handle that in the first place...

Programming:

  • Ugly ugly string manipulation + parse();
  • We will probably regret it eventually...

The define_multinomial() function will rescale multinomial parameters to sum to 1 by appending something like this to the dot-list:

a = a / (a+b+c),
b = b / (a+b+c),
c = c / (a+b+c),

d = d / (d+e),
e = e / (d+e)

@pierucci
Copy link
Owner Author

Actually solving everything UI-wise with a formula interface:

define_resample(
  a + b + c ~ multinom(20, 30, 50),
  d + e ~ multinom(5, 10),

# also works for standard distributions

  f ~ norm(0, 1)
)

Only the interface changed, the rest is the same behind the hood (and it's a mess, see #30).

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

2 participants