File: sphere_sampling.rst

package info (click to toggle)
openturns 1.26-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 67,708 kB
  • sloc: cpp: 261,605; python: 67,030; ansic: 4,378; javascript: 406; sh: 185; xml: 164; makefile: 101
file content (56 lines) | stat: -rw-r--r-- 1,850 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.. _sphere_sampling:

Sphere sampling method
----------------------

Within the context of the First and Second Order of the Reliability
Method, the Strong Maximum Test helps to
check whether the design point computed is:

-  the true design point, which means a global maximum point,

-  a strong design point, which means that there is no other local
   maximum verifying the event and associated to a value near the global
   maximum.

The Strong Maximum Test samples a sphere in the standard space.
the gaussian random sampling technique used is described hereafter.

#. sampling of points in :math:`\Rset^N` according to a radial
   distribution: we generate :math:`N` independent standard normal
   samples,

#. projection of the points onto :math:`\cS^{*}` : we map the points
   different from the origin using the transformation
   :math:`M\longmapsto m` such as
   :math:`\displaystyle\mathbf{Om}=R\frac{\mathbf{OM}}{\|\mathbf{OM}\|}`
   where :math:`R` is the radius of the sphere of interest. This
   transformation does not depend on the angular coordinates. Thus, the
   generated points follow a uniform distribution on :math:`\cS^{*}`.

.. plot::

    from mpl_toolkits.mplot3d import Axes3D
    import matplotlib.pyplot as plt
    import openturns as ot

    x = ot.Normal(3).getSample(1000)
    for i in range(len(x)):
        x[i] /= x[i].norm()
    xs, ys, zs = map(lambda j: x.getMarginal(j).asPoint(), range(x.getDimension()))

    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    ax.scatter(xs, ys, zs, marker='.')


.. topic:: API:

    - See :class:`~openturns.StrongMaximumTest`
    - See :class:`~openturns.FORM`


.. topic:: References:

    - Luban, Marshall, Staunton, 1988, "An efficient method for generating a uniform distribution of points within a hypersphere," Computer in Physics, 2(6), 55.