I’m trying to make a bayesian isotonic regression.
I have an unknown function that I’m trying to fit this model too. The x values runs from 0-100 (these are integers) and the y value is an event (0, 1). I want to fit a probability, p(y|x), to this data
As my x value increases the p(y) can only increase or stay the same, which is why I have chosen to use an isotonic regression. The relationship does not follow a known function so fitting a sigmoid or another function won’t work.
I’m planning to start very simply.
with pm.Model() as model:
prior = CUSTOMER_PRIOR('prior', )
observed = pm.Bernoulli('observed', p=prior[observed_x], observed=observed_y)
trace = pm.sample(1000)
pm.traceplot(trace)
This is roughly how I expect the code to look. The CUSTOM_PRIOR would sample isotonic functions, which are actually a list of length 101. Each element represents the probability of y for the value Xi where i is 0-100.
First of all does my model my sense or is there a better way to structure it? Secondly, my question is how do I make this custom prior?