s="page-wrapper" tabindex="-1" role="main">
          <div class="page-inner">

            <section class="normal" id="section-">

<div>
This is an old version, <a href="https://mc-stan.org/docs/functions-reference/higher-order_functions.html#functions-reduce">view current version</a>.
</div>
<div id="functions-reduce" class="section level2">
<h2><span class="header-section-number">9.4</span> Reduce-Sum Function</h2>
<p>Stan provides a higher-order reduce function for summation. A function which returns a 