Gauss 3d.py

From Werner KRAUTH

(Difference between revisions)
Jump to: navigation, search
Revision as of 21:19, 22 September 2015
Werner (Talk | contribs)

← Previous diff
Current revision
Werner (Talk | contribs)

Line 1: Line 1:
 +This page presents the program gauss_3d.py, a direct-sampling algorithm for three independent Gaussians.
 +
 +__FORCETOC__
 +=Description=
 +
 +=Program=
import random, math import random, math
Line 7: Line 13:
random.gauss(0.0, 1.0)) random.gauss(0.0, 1.0))
print x, y, z print x, y, z
 +=Version=
 +See history for version information.
 +
 +[[Category:Python]]
 +[[Category:Honnef_2015]]
 +[[Category:MOOC_SMAC]]

Current revision

This page presents the program gauss_3d.py, a direct-sampling algorithm for three independent Gaussians.


Contents

Description

Program

import random, math

nsamples = 100
for sample in xrange(nsamples):
    x, y, z = (random.gauss(0.0, 1.0),
               random.gauss(0.0, 1.0),
               random.gauss(0.0, 1.0))
    print x, y, z

Version

See history for version information.

Personal tools