# Rolling Sum

**URL:** <https://discourse.julialang.org/t/rolling-sum/30793>\
**Category:** Statistics\
**Tags:** question\
**Created:** [November 6, 2019, 2:01pm UTC](https://discourse.julialang.org/t/rolling-sum/30793 "2019-11-06T14:01:50Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![sairus7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sairus7/32/10816_2.png) [@sairus7](https://discourse.julialang.org/u/sairus7)\
**Post date:** [November 6, 2019, 6:37pm UTC](https://discourse.julialang.org/t/rolling-sum/30793/17 "2019-11-06T18:37:58Z")

</div>

See the following conversation, there are also some code examples in comments. In particular, this comment:

> [@ANN: MaxMinFilters.jl - fast streaming maximum / minimum within moving window](https://discourse.julialang.org/t/ann-maxminfilters-jl-fast-streaming-maximum-minimum-within-moving-window/30151/7):
>
> Here is a minimal example of running mean, the same applies to higher order stats: using Statistics function runmean1(x::Vector{T}, n::Int64=10)::Vector{T} where {T\<:Real} len = size(x,1) @assert n\<len && n\>1 "Argument n is out of bounds." out = zeros(len - n + 1) @inbounds for i = n:len out[i-n+1] = mean(view(x, i-n+1:i)) end return out end function runmean2(x::Vector{T}, n::Int64=10)::Vector{T} where {T\<:Real} len = size(x,1) @assert n\<len && n\>1 "Arg…

---

_[View the full topic](https://discourse.julialang.org/t/rolling-sum/30793)._
