# Using multiple data fields as input to FindDistribution\[ \]

**URL:** <https://community.wolfram.com/t/using-multiple-data-fields-as-input-to-finddistribution/21765>\
**Category:** Questions\
**Tags:** data-science, statistics-and-probability\
**Created:** [March 16, 2023, 8:06pm UTC](https://community.wolfram.com/t/using-multiple-data-fields-as-input-to-finddistribution/21765 "2023-03-16T20:06:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![masandlin](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@masandlin](https://community.wolfram.com/u/masandlin)\
**Post date:** [March 16, 2023, 8:06pm UTC](https://community.wolfram.com/t/using-multiple-data-fields-as-input-to-finddistribution/21765/1 "2023-03-16T20:06:15Z")

</div>

Hi;  
In my attached notebook, I accessed four fields (SepalLength, SepalWidth, PetalLength, PetalWidth) from the Fisher’s Irises data repository with the intention of using the FindDistribution[] function to obtain a Multinormal distribution. However, it appears that the FindDistribution[] function is having difficulty with the multiple fields.

Since I am new to probability in Mathematica, it is most likely something that I am doing incorrectly. I would certainly appreciate any help.

Thanks,  
Mitch Sandlin

[FindDistributionQuestion.nb](https://community.wolfram.com/uploads/short-url/tzhhJcM0t9tJoXcRrtIBjBNRyE6.nb) (158 KB)

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [March 17, 2023, 2:55am UTC](https://community.wolfram.com/t/using-multiple-data-fields-as-input-to-finddistribution/21765/2 "2023-03-17T02:55:24Z")

</div>

From the “Details and Options” section of the documentation for `FindDistribution`:

> The data must be a list of possible outcomes from a univariate  
> distribution.

So there are a couple of problems

1. Your code is passing a list of associations for data rather than a list of numbers
2. `FindDistribution` can only handle univariate data

---

<div class="post-metadata">

**Author:** ![jbaldwinpsw](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@jbaldwinpsw](https://community.wolfram.com/u/jbaldwinpsw)\
**Post date:** [March 17, 2023, 3:58am UTC](https://community.wolfram.com/t/using-multiple-data-fields-as-input-to-finddistribution/21765/3 "2023-03-17T03:58:36Z")

</div>

If you just want to estimate the parameters of a multivariate normal with the Iris data, then the following will work:

```
m = {m1, m2, m3, m4};
cov = {{v11, v12, v13, v14},
          {v12, v22, v23, v24},
          {v13, v23, v33, v34},
          {v14, v24, v34, v44}};
FindDistributionParameters[Values[data], MultinormalDistribution[m, cov]]
(* {m1 -> 5.84333, m2 -> 3.05733, m3 -> 3.758, m4 -> 1.19933, 
 v12 -> -0.0421511, v13 -> 1.26582, v14 -> 0.512829, v23 -> -0.327459,
  v24 -> -0.120828, v34 -> 1.28697, v11 -> 0.681122, v22 -> 0.188713, 
 v33 -> 3.0955, v44 -> 0.577133} *)

```
