-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Right now Gumbi only allows (pymc) marginalized posterior predictions, i.e. only mean and variance rather than individual samples. We should also implement an interface for drawing individual posterior samples via .conditional.
Gumbi exposes the Pymc API, so for now the user can access the underlying pymc objects to do this:
gp = gmb.GP(...)
gp.fit(...)
gp.prepare_grid()
# add the GP conditional to the model, given the new X values
with model:
f_pred = gp.conditional("f_pred", gp.grid_points)
# To use the MAP values, you can just replace the trace with a length-1 list with `mp`
with model:
pred_samples = pm.sample_posterior_predictive([gp.MAP], vars=[f_pred], samples=2000)But this approach obviously introduces complexity that Gumbi was intended to remove. In particular:
- The two-step process of declaring
f_predand then drawing samples should be reduced to a single command, maybegp.draw(samples=2000, point='MAP') f_predshould be declared as apm.Dataobject so that its value can be updated repeatedly, similar to the suggestion here. This should probably be done pre-emptively during intial model building.- The output
pred_samplesshould be reshaped and stored as aParraysimilar to howpredictbehaves. This will be slightly complicated by the fact thatpred_sampleswill have an additional dimension compared togp.grid_pointscorresponding to different samples.ParrayPlottershould potentially be updated to accomodate this, otherwise the user might need to create a newParrayPlotterinstance for each sample.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels