# Vector and matrix variables with dimension of size 0

**URL:** https://discourse.mc-stan.org/t/vector-and-matrix-variables-with-dimension-of-size-0/290
**Category:** Developers
**Created:** [March 8, 2017, 7:21pm UTC](https://discourse.mc-stan.org/t/vector-and-matrix-variables-with-dimension-of-size-0/290 "2017-03-08T19:21:45Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![jonah](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jonah/32/200_2.png) [@jonah](https://discourse.mc-stan.org/u/jonah)
#### Post date: [March 9, 2017, 11:16pm UTC](https://discourse.mc-stan.org/t/vector-and-matrix-variables-with-dimension-of-size-0/290/4 "2017-03-09T23:16:09Z")

</div>

Yeah we do what Daniel mentioned a lot in the Stan programs for rstanarm. For example, it allows us to do something like

```
data {
  ...
  int<lower=0,upper=1> has_intercept;
}
parameters {
  ...
  real alpha[has_intercept];
}

```

so `alpha` will only have positive length if the user has specified a model with an intercept.

I guess I used an array and not a vector in that example, but it’s the same idea.

---

_[View the full topic](https://discourse.mc-stan.org/t/vector-and-matrix-variables-with-dimension-of-size-0/290)._
