# \`\_scvi\_local\_l\_mean\` and \`\_scvi\_local\_l\_var\` only depend on batch?

**URL:** <https://discourse.scverse.org/t/scvi-local-l-mean-and-scvi-local-l-var-only-depend-on-batch/35>\
**Category:** scvi-tools\
**Created:** [January 15, 2021, 6:21pm UTC](https://discourse.scverse.org/t/scvi-local-l-mean-and-scvi-local-l-var-only-depend-on-batch/35 "2021-01-15T18:21:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![munfred](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/munfred/32/9_2.png) [@munfred](https://discourse.scverse.org/u/munfred)\
**Post date:** [January 15, 2021, 6:21pm UTC](https://discourse.scverse.org/t/scvi-local-l-mean-and-scvi-local-l-var-only-depend-on-batch/35/1 "2021-01-15T18:21:49Z")

</div>

Hello! I have noticed that the variables `_scvi_local_l_mean` and `_scvi_local_l_var` that get added to `adata.obs` on versions \>0.7 seem to only depend on batch (see the screenshot belows which shows adata.obs with cells from two batches).

My understanding is that these are priors for the library size in each cell, so they should differ for each cell, not for each batch. What have I understood wrong?

 ![Screen Shot 2021-01-15 at 15.07.46](https://canada1.discourse-cdn.com/flex035/uploads/forum11/original/1X/ccb8fa7025cd5d74d0c02d7abf5bfcce05cc330f.png)

---

<div class="post-metadata">

**Author:** ![adamgayoso](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/adamgayoso/32/100_2.png) [@adamgayoso](https://discourse.scverse.org/u/adamgayoso)\
**Post date:** [January 15, 2021, 8:00pm UTC](https://discourse.scverse.org/t/scvi-local-l-mean-and-scvi-local-l-var-only-depend-on-batch/35/2 "2021-01-15T20:00:33Z")

</div>

This is the expected behavior. Consider a dataset with one batch. We assume that

\ell\_n \sim \mathrm{LogNormal}(\mu, \sigma^2)

where \mu is equal to the average of the log library size in that batch, and likewise \sigma^2 the variance of the log library size in that batch (both over all cells).

The reason you see each cell having the same value in a batch is related to how we load the data into the model.
