# Using dot-product in hierarchical or unpooled model

**URL:** <https://discourse.pymc.io/t/using-dot-product-in-hierarchical-or-unpooled-model/1321>\
**Category:** Questions\
**Created:** [June 2, 2018, 2:56pm UTC](https://discourse.pymc.io/t/using-dot-product-in-hierarchical-or-unpooled-model/1321 "2018-06-02T14:56:29Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![erlendd](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/erlendd/32/842_2.png) [@erlendd](https://discourse.pymc.io/u/erlendd)\
**Post date:** [June 3, 2018, 2:38pm UTC](https://discourse.pymc.io/t/using-dot-product-in-hierarchical-or-unpooled-model/1321/5 "2018-06-03T14:38:38Z")

</div>

Ok thanks for your help, yes this helped. I also found a good solution on the forums here: [Theano error with element wise multiplication](https://discourse.pymc.io/t/theano-error-with-element-wise-multiplication/157)

```
crime_p = (a[city] + b[city] * X).sum(axis=1)

```

In terms of getting out predictions, I take it most people would use alpha and beta (rather than a and b)? E.g. if I had some random new city that I had no data about.

---

_[View the full topic](https://discourse.pymc.io/t/using-dot-product-in-hierarchical-or-unpooled-model/1321)._
