Benedikt Herwerth

Results 12 comments of Benedikt Herwerth

I ran into this problem as well these days. On the original approach with `apply`, I investigated in a debugger. I think the two cases take different paths after this...

What you describe seems like a useful extension of `transform` to me. > I don't follow why this would need to be done - can you expand on this? The...

I've been trying to understand what would be needed to implement this feature. What is not yet clear to me: 1. What is the exact output of `pm.sample` that should...

Has this been solved in the meantime? The following works for me and the shape change propagates from `x` to `y` when setting the data. I can also sample the...

I've just found out that the example fails when I explicitly set the shape of `y` like this: ```python y = pm.Normal("y", y_est, observed=y_obs, shape=(10,)) ``` In this case, I...

Yes, using `shape=x.shape` works as well and the shape change get's propagated to `y`. But then the current behavior is already reasonable, isn't it?

> The problem is that users don't usually think about specifying shape for likelihoods because PyMC is so handy and infers it from the observed data. In this particular example,...

Looks like `shape` is not checked against `dims` when the random variable is created. However, when sampling, this results in an error in `xarray` when the inference data is created:...

I had a closer look at the code and I see that there already is a logic in place for resizing RVs based on `dims` (and `observed`): https://github.com/pymc-devs/pymc/blob/c8db06b125b1bde286cc00298239980a807d26fa/pymc/distributions/distribution.py#L263-L269 However, it...

This indeed looks like a more involved task. The current resize logic extends dimensions to the left, and I don't see a quick way to adapt it to cover broadcasting...