# Why does the MAP estimate of the parameter vector of the dirichlet sum to 1?

**URL:** https://discourse.pymc.io/t/why-does-the-map-estimate-of-the-parameter-vector-of-the-dirichlet-sum-to-1/858
**Category:** Questions
**Created:** [February 13, 2018, 9:13pm UTC](https://discourse.pymc.io/t/why-does-the-map-estimate-of-the-parameter-vector-of-the-dirichlet-sum-to-1/858 "2018-02-13T21:13:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![abhicherath](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/abhicherath/32/1975_2.png) [@abhicherath](https://discourse.pymc.io/u/abhicherath)
#### Post date: [February 13, 2018, 9:13pm UTC](https://discourse.pymc.io/t/why-does-the-map-estimate-of-the-parameter-vector-of-the-dirichlet-sum-to-1/858/1 "2018-02-13T21:13:51Z")

</div>

```
    #Example for Pymc3 forums
import pymc3 as pm
import theano.tensor as tt
import pandas as pd
import numpy as np

pred_arr = [[2,3,4],[5,1,9]]
data = [2,3]
with pm.Model() as model:
    a_vec = np.array([100 for i in range(3)])

    prior = pm.Dirichlet('a',a = a_vec,shape=(3))
            
    likelihood = pm.Normal('y',mu = tt.dot(np.array(pred_arr),prior),sd = 0.1,observed = np.array(data).T)
    
    abra = pm.find_MAP()
    trace = pm.fit(1000,start = abra)

```

In the above example of dirichlet regression (note the numbers are just nonsense), I don’t understand why the posterior values of the concentration parameters of the dirichlet sum to 1. Why is this?

EDIT: I am very sorry, my brain had a massive derp. obviously the MAP values are not the MAPs of the concentration parameters, rather the actual values for which the posterior is maxed. Please close this.

---

<div class="post-metadata">

### Author: ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)
#### Post date: [February 14, 2018, 6:22am UTC](https://discourse.pymc.io/t/why-does-the-map-estimate-of-the-parameter-vector-of-the-dirichlet-sum-to-1/858/2 "2018-02-14T06:22:13Z")

</div>

No problem 😉 Thumbs up for finding out the solution/reason yourself.

---

<div class="post-metadata">

### Author: ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)
#### Post date: [February 14, 2018, 6:22am UTC](https://discourse.pymc.io/t/why-does-the-map-estimate-of-the-parameter-vector-of-the-dirichlet-sum-to-1/858/3 "2018-02-14T06:22:16Z")

</div>


