Open debrouwere opened 8 years ago
Further ideas and requirements for the regression modeling:
RandomVariable
, which is how we integrate models with the rest of Posteriorimodel(data).my_var(other_var=33)
. We could even allow model(data).my_var()
which would be identical to just fitting the marginal distribution from the data, as you're not conditioning on anything.
The idea of posteriori is basically advanced napkin math, so you don't want to get bogged down with false precision. That said,
PyMC
or a frequentist model instatsmodels
or a machine learning algorithm fromscikit-learn
If you have data, then of course we'll be able to better estimate the parameters of the gamma distribution than by just using user-provided guesses for extreme quantiles. Alternatively (or additionally), we can construct our Monte Carlo sample by sampling from the original data with replacement.
If you have a model, you can skip some of the napkin math because the
Y = XB
specification is already there. In essence, instead of using Posteriori to describe an arbitrary model, you let the fitting algorithm figure out how important each variable is and how it contributes to the outcome.If you don't have a model but you do have data that could be modeled, we could have Posteriori do it for you: LASSO regression (linear or logistic as needed) is perfect for this, because it's fast and we can use all variables in the data yet only keep the most meaningful ones. (It is of course up to the user to make sure that the data is representative, includes the most significant confounders and doesn't include any variables that would introduce selection bias. Still, Posteriori is not supposed to be better than careful statistical modeling, it's supposed to be better than not using any sort of probabilistic reasoning at all.)
This could even be extended to multinomial logistic regression: the outcome would be not a single random variable but a random variable for each outcome, representing the prediction interval for each outcome.
So really all this would entail is a little bit of glue code. The bigger question is what a nice interface would look like.