# Is there a function for batch mean and std

**URL:** <https://discourse.julialang.org/t/is-there-a-function-for-batch-mean-and-std/77849>\
**Category:** Statistics\
**Tags:** question, statistics\
**Created:** [March 14, 2022, 6:39am UTC](https://discourse.julialang.org/t/is-there-a-function-for-batch-mean-and-std/77849 "2022-03-14T06:39:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Post date:** [March 14, 2022, 6:39am UTC](https://discourse.julialang.org/t/is-there-a-function-for-batch-mean-and-std/77849/1 "2022-03-14T06:39:31Z")

</div>

Hi,

Is there a package that has a function doing something similar to [Batch updates for simple statistics](https://notmatthancock.github.io/2017/03/23/simple-batch-stat-updates.html)

In other words, I want to calculate `std(vcat(a,b))` and know mean(a), mean(b), std(a), std(b), length(a), length(b), but don’t know `a` and `b`.

---

<div class="post-metadata">

**Author:** ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)\
**Post date:** [March 14, 2022, 7:02am UTC](https://discourse.julialang.org/t/is-there-a-function-for-batch-mean-and-std/77849/2 "2022-03-14T07:02:20Z")

</div>

Maybe that’s not really what you’re asking for, but have you checked [OnlineStats](https://github.com/joshday/OnlineStats.jl/)?

---

<div class="post-metadata">

**Author:** ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Post date:** [March 14, 2022, 10:10am UTC](https://discourse.julialang.org/t/is-there-a-function-for-batch-mean-and-std/77849/3 "2022-03-14T10:10:08Z")

</div>

Thank you, `OnlineStats.jl` does actually have what I need, it is the `merge` function. I do actually have the original data (`a` and `b`), I just don’t want to save it.
