# Fitting data with multiple attributes

**URL:** https://discourse.pymc.io/t/fitting-data-with-multiple-attributes/745
**Category:** Questions
**Created:** [January 16, 2018, 8:32pm UTC](https://discourse.pymc.io/t/fitting-data-with-multiple-attributes/745 "2018-01-16T20:32:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![cmsayers](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@cmsayers](https://discourse.pymc.io/u/cmsayers)
#### Post date: [January 16, 2018, 8:32pm UTC](https://discourse.pymc.io/t/fitting-data-with-multiple-attributes/745/1 "2018-01-16T20:32:09Z")

</div>

I recently started to use PyMC3, and have a question.

Is it possible to use PyMC3 to fit data in which each sample (this could be a discrete time sample, for example) has measurements of several different quantities associated with it, all of which are predicted by a different function of the parameters of an underlying model). That is, each sample is described by a vector, rather than a scalar.

If this is possible, how would I need to modify a statement such as

Y\_obs = Normal(‘Y\_obs’, mu=mu, sd=sigma, observed=Y)

for example?

---

<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: [January 16, 2018, 10:51pm UTC](https://discourse.pymc.io/t/fitting-data-with-multiple-attributes/745/2 "2018-01-16T22:51:37Z")

</div>

You can either define it as a MvNormal, or a Normal with `mu` and/or `sigma` being the same size vector as Y. If would be equivalent as having `Y_obs1`, `Y_obs2`… etc.

---

<div class="post-metadata">

### Author: ![cmsayers](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@cmsayers](https://discourse.pymc.io/u/cmsayers)
#### Post date: [January 17, 2018, 12:46am UTC](https://discourse.pymc.io/t/fitting-data-with-multiple-attributes/745/3 "2018-01-17T00:46:10Z")

</div>

Do you have an example you would be willing to share?

---

<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: [January 17, 2018, 6:02am UTC](https://discourse.pymc.io/t/fitting-data-with-multiple-attributes/745/4 "2018-01-17T06:02:11Z")

</div>

You can have a look at [https://osf.io/rsfdv/](https://osf.io/rsfdv/). You can find the background information about it in the code and the accompany preprint.
