Calculation of joint density from pymc model

If you use pm.Data for the observed data you can change it between evaluations or you can define the model without making the observed variable observed.

model.compile_logp() gives you the compiled logp function. The inputs have the format of model.initial_point().

If you remove the observed kwarg, the data is part of that initial_point dictionary.

Otherwise, if you use pm.Data, data will be a shared variable that can be modified with data.set_value(new_value) between calls.

1 Like