# Sparse Matrix Functional Spec

**URL:** <https://discourse.mc-stan.org/t/sparse-matrix-functional-spec/109>\
**Category:** Developers\
**Created:** [October 19, 2016, 9:00pm UTC](https://discourse.mc-stan.org/t/sparse-matrix-functional-spec/109 "2016-10-19T21:00:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob\_Carpenter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bob_carpenter/32/9230_2.png) [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Post date:** [October 19, 2016, 9:00pm UTC](https://discourse.mc-stan.org/t/sparse-matrix-functional-spec/109/1 "2016-10-19T21:00:13Z")

</div>

I started roughing out the sparse matrix functional spec  
(also vectors and row vectors):

> **[stan-dev/stan](https://github.com/stan-dev/stan/wiki/Functional-Spec:-Sparse-Matrix-Data-Types)**
>
> Stan development repository. The master branch contains the current release. The develop branch contains the latest stable development. See the Developer Process Wiki for details. - stan-dev/stan

The stumbling block is going to be posterior analysis where  
we need every parameter, transformed parameter and generated  
quantity to have the same shape so we have the same variables  
in each iteration. But if we have to declare a sparse matrix  
with the coordinates (row, column pairs) at which it is potentially  
non-zero, it’s going to be very hard to do when you have operations  
on sparse matrices like addition.

- Bob
