Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to fit list of 3D data to a 2D normal distribution function (preferably in Python)
    primarykey
    data
    text
    <p>I am looking for any script (preferably Python) to calculate the two dimensional normal distribution function of series of three dimensional data. If one does not exist, I would appreciate any code, or pseudocode, someone could provide.</p> <p>The input will be a list of triples like so</p> <pre><code>[[x1, y1, z1], [x2, y2, z2], [x3, y3, z3],..., [xn, yn, zn]] </code></pre> <p>What I need is the mean and standard deviation/variance of the two dimensional normal distribution that most closely represents the data, so as to be able to manipulate it, and, later, recreate it. </p> <p><strong>example</strong></p> <p>For the sake of simplicity I will defer to using a one dimensional normal function. If I have the following two dimensional data points</p> <pre><code>[ [-4, 0.0001], [-3, 0.0044], [-2, 0.054 ], [-1, 0.242 ], [0 , 0.3989], [1 , 0.242 ], [2 , 0.054 ], [3 , 0.0044], [4 , 0.0001] ] </code></pre> <p>I expect the script to output </p> <pre><code>mean = 0.0 standard deviation = 1.0 variance = 1.0 </code></pre> <p>That way, if I want to, for example, change the standard deviation from <code>sd = 1.0</code> to <code>sd = 2.0</code>, I can modify the curve, recreate it, sample the points <code>-4...4</code>, and rewrite the values to the data like so.</p> <pre><code>[ [-4, 0.027 ], [-3, 0.0648], [-2, 0.121 ], [-1, 0.176 ], [0 , 0.1995], [1 , 0.176 ], [2 , 0.121 ], [3 , 0.0648], [4 , 0.027 ] ] </code></pre> <p>Now my question is: how do I do that with a list of three dimensional points which closely represent a two dimensional normal distribution?</p> <hr> <p>I would prefer to do this in Python, or to call a shell script. However, I would not be against using a program like MatLab or Maple.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload