biocore / BIRDMAn

Bayesian Inferential Regression for Differential Microbiome Analysis
BSD 3-Clause "New" or "Revised" License
22 stars 5 forks source link

Use consistent dimensionality for posterior_predictive & log_likelihood between serial & parallel #15

Closed gibsramen closed 3 years ago

gibsramen commented 3 years ago

Currently, the dimensions in these two Datasets differ depending on if they were fit serially or in parallel. This is an impediment for calculating loo consistently for the two different model types.

Serial:

<xarray.Dataset>
Dimensions:          (chain: 4, draw: 100, y_predict_dim_0: 672)
Coordinates:
  * chain            (chain) int64 0 1 2 3
  * draw             (draw) int64 0 1 2 3 4 5 6 7 8 ... 92 93 94 95 96 97 98 99
  * y_predict_dim_0  (y_predict_dim_0) int64 0 1 2 3 4 5 ... 667 668 669 670 671
Data variables:
    y_predict        (chain, draw, y_predict_dim_0) float64 3.765e+03 ... 0.0

Parallel:

<xarray.Dataset>
Dimensions:          (chain: 4, draw: 100, feature: 28, y_predict_dim_0: 24)
Coordinates:
  * chain            (chain) int64 0 1 2 3
  * draw             (draw) int64 0 1 2 3 4 5 6 7 8 ... 92 93 94 95 96 97 98 99
  * y_predict_dim_0  (y_predict_dim_0) int64 0 1 2 3 4 5 6 ... 18 19 20 21 22 23
  * feature          (feature) object 'OTU9' 'OTU15' ... 'OTU688' 'OTU729'
Data variables:
    y_predict        (feature, chain, draw, y_predict_dim_0) float64 537.0 .....
gibsramen commented 3 years ago

Probably made much easier via https://github.com/arviz-devs/arviz/pull/1579