User Manual 3.3 Dispersions : Différence entre versions

De Wiki
Aller à : navigation, rechercher
m (1 révision importée)
 
(2 révisions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
 
+
== Introduction ==
 
+
=== Scope ===
#set($a=0)
+
#set($b=0)
+
#set($c=0)
+
#set($d=0)
+
 
+
== {{t/}} Introduction ==
+
=== {{tt/}} Scope ===
+
 
This section describes how dispersions are defined and used in the PATRIUS library.
 
This section describes how dispersions are defined and used in the PATRIUS library.
 
Dispersions are not to be mixed up with random generation (not detailed in this page). Dispersions always rely on a random generator.
 
Dispersions are not to be mixed up with random generation (not detailed in this page). Dispersions always rely on a random generator.
  
=== {{tt/}} Javadoc ===
+
=== Javadoc ===
 
The dispersions objects are available in the package <code>org.apache.commons.math3.random</code> in the Commons Math Library (and Commons Math add-ons). This package also handles random generation.
 
The dispersions objects are available in the package <code>org.apache.commons.math3.random</code> in the Commons Math Library (and Commons Math add-ons). This package also handles random generation.
|=Library|=Javadoc
 
|Commons-Math |[{{JavaDoc3.3}}/org/apache/commons/math3/random/package-summary.html Package org.apache.commons.math3.random]
 
|Commons-Math addons |[{{JavaDoc3.3}}/org/apache/commons/math3/random/package-summary.html Package org.apache.commons.math3.random]
 
  
=== {{tt/}} Links ===
+
{| class="wikitable"
 +
|-
 +
! scope="col"| Library
 +
! scope="col"| Javadoc
 +
|-
 +
|Commons-Math
 +
|[{{JavaDoc3.3}}/org/apache/commons/math3/random/package-summary.html Package org.apache.commons.math3.random]
 +
|-
 +
|Commons-Math addons
 +
|[{{JavaDoc3.3}}/org/apache/commons/math3/random/package-summary.html Package org.apache.commons.math3.random]
 +
|}
 +
 
 +
===  Links ===
 
None as of now.
 
None as of now.
  
=== {{tt/}} Useful Documents ===
+
=== Useful Documents ===
 
None as of now.
 
None as of now.
  
=== {{tt/}} Package Overview ===
+
=== Package Overview ===
  
  
== {{t/}} Features Description ==
+
== Features Description ==
=== {{tt/}} Random number generation ===
+
=== Random number generation ===
 
Distributed random number generation is based on using implementations of interface <code>org.apache.commons.math3.random.NormalizedRandomGenerator</code>.
 
Distributed random number generation is based on using implementations of interface <code>org.apache.commons.math3.random.NormalizedRandomGenerator</code>.
 
Each implementation of this interface provides a specific dispersion scheme. For instance, the following code will generate random numbers with Gaussian distribution of mean 0 and unit standard deviation:
 
Each implementation of this interface provides a specific dispersion scheme. For instance, the following code will generate random numbers with Gaussian distribution of mean 0 and unit standard deviation:
Ligne 38 : Ligne 40 :
 
As shown in the above example, building a dispersion object requires a random generator implementing <code>org.apache.commons.math3.random.RandomGenerator</code> interface.
 
As shown in the above example, building a dispersion object requires a random generator implementing <code>org.apache.commons.math3.random.RandomGenerator</code> interface.
  
=== {{tt/}} Random vector generation ===
+
=== Random vector generation ===
 
Correlated random vector generation is based on using implementations of interface <code>org.apache.commons.math3.random.RandomVectorGenerator</code>.
 
Correlated random vector generation is based on using implementations of interface <code>org.apache.commons.math3.random.RandomVectorGenerator</code>.
 
Each implementation of this interface provides a specific dispersion scheme. For instance, the following code will generate uniformly correlated random vectors according to provided covariance matrix:
 
Each implementation of this interface provides a specific dispersion scheme. For instance, the following code will generate uniformly correlated random vectors according to provided covariance matrix:
Ligne 49 : Ligne 51 :
 
As shown in the above example, building a dispersion object requires a random generator implementing <code>org.apache.commons.math3.random.RandomGenerator</code> interface.
 
As shown in the above example, building a dispersion object requires a random generator implementing <code>org.apache.commons.math3.random.RandomGenerator</code> interface.
  
== {{t/}} Getting Started ==
+
== Getting Started ==
 
{{specialInclusion prefix=$theme section="GettingStarted"/}}
 
{{specialInclusion prefix=$theme section="GettingStarted"/}}
  
== {{t/}} Contents ==
+
== Contents ==
=== {{tt/}} Interfaces ===
+
=== Interfaces ===
 
The library defines the following interfaces related to dispersions:
 
The library defines the following interfaces related to dispersions:
  
|=Interface|=Summary|=Javadoc
+
{| class="wikitable"
|'''NormalizedRandomGenerator'''|Interface for normalized random generators|[{{JavaDoc3.3}}/org/apache/commons/math3/random/NormalizedRandomGenerator.html ...]
+
|-
|'''RandomVectorGenerator'''|Interface for random vector generators|[{{JavaDoc3.3}}/org/apache/commons/math3/random/RandomVectorGenerator.html ...]
+
! scope="col"| Interface
 +
! scope="col"| Summary
 +
! scope="col"| Javadoc
 +
|-
 +
|'''NormalizedRandomGenerator'''
 +
|Interface for normalized random generators
 +
|[{{JavaDoc3.3}}/org/orekit/math/random/NormalizedRandomGenerator.html ...]
 +
|-
 +
|'''RandomVectorGenerator'''
 +
|Interface for random vector generators
 +
|[{{JavaDoc3.3}}/org/orekit/math/random/RandomVectorGenerator.html ...]
 +
|}
 +
 
  
 
Note: interface for random number generators is <code>org.apache.commons.math3.random.RandomGenerator</code>.
 
Note: interface for random number generators is <code>org.apache.commons.math3.random.RandomGenerator</code>.
  
=== {{tt/}} Classes ===
+
=== Classes ===
 
The library defines the following classes related to dispersions:
 
The library defines the following classes related to dispersions:
 +
{| class="wikitable"
 +
|-
 +
! scope="col"| Class
 +
! scope="col"| Summary
 +
! scope="col"| Javadoc
 +
|-
 +
|'''GaussianRandomGenerator'''
 +
|Generator following Gaussian distribution
 +
|[{{JavaDoc3.3}}/org/orekit/math/random/GaussianRandomGenerator.html ...]
 +
|-
 +
|'''UniformRandomGenerator'''
 +
|Generator following uniform distribution
 +
|[{{JavaDoc3.3}}/org/orekit/math/random/UniformRandomGenerator.html ...]
 +
|-
 +
|'''UncorrelatedRandomVectorGenerator'''
 +
|Generator for Gaussian uncorrelated vectors
 +
|[{{JavaDoc3.3}}/org/orekit/math/random/UncorrelatedRandomVectorGenerator.html ...]
 +
|-
 +
|'''CorrelatedRandomVectorGenerator'''
 +
|Generator for Gaussian correlated vectors
 +
|[{{JavaDoc3.3}}/org/orekit/math/random/CorrelatedRandomVectorGenerator.html ...]
 +
|-
 +
|'''UniformlyCorrelatedRandomVectorGenerator'''
 +
|Generator for uniformly correlated vectors
 +
|[{{JavaDoc3.3}}/org/orekit/math/random/UniformlyCorrelatedRandomVectorGenerator.html ...]
 +
|-
 +
|'''UnitSphereRandomVectorGenerator'''
 +
|Generator for vectors isotropically located on a sphere
 +
|[{{JavaDoc3.3}}/org/orekit/math/random/UnitSphereRandomVectorGenerator.html ...]
 +
|}
  
|=Classe|=Summary|=Javadoc
+
=== Correlated random vector generator ===
|'''GaussianRandomGenerator'''|Generator following Gaussian distribution|[{{JavaDoc3.3}}/org/apache/commons/math3/random/GaussianRandomGenerator.html ...]
+
The user provides a covariance matrix and a random generator.<br>
|'''UniformRandomGenerator'''|Generator following uniform distribution|[{{JavaDoc3.3}}/org/apache/commons/math3/random/UniformRandomGenerator.html ...]
+
|'''UncorrelatedRandomVectorGenerator'''|Generator for Gaussian uncorrelated vectors|[{{JavaDoc3.3}}/org/apache/commons/math3/random/UncorrelatedRandomVectorGenerator.html ...]
+
|'''CorrelatedRandomVectorGenerator'''|Generator for Gaussian correlated vectors|[{{JavaDoc3.3}}/org/apache/commons/math3/random/CorrelatedRandomVectorGenerator.html ...]
+
|'''UniformlyCorrelatedRandomVectorGenerator'''|Generator for uniformly correlated vectors|[{{JavaDoc3.3}}/org/apache/commons/math3/random/UniformlyCorrelatedRandomVectorGenerator.html ...]
+
|'''UnitSphereRandomVectorGenerator'''|Generator for vectors isotropically located on a sphere|[{{JavaDoc3.3}}/org/apache/commons/math3/random/UnitSphereRandomVectorGenerator.html ...]
+
 
+
=== {{tt/}} Correlated random vector generator ===
+
The user provides a covariance matrix and a random generator.
+
 
'''When using Gaussian correlated random vector generator''':
 
'''When using Gaussian correlated random vector generator''':
 
* The covariance matrix root is extracted using a Cholesky decomposition. The number of columns of the root matrix corresponds to the rank of the provided covariance matrix.
 
* The covariance matrix root is extracted using a Cholesky decomposition. The number of columns of the root matrix corresponds to the rank of the provided covariance matrix.
Ligne 90 : Ligne 126 :
 
* The final correlated vector is obtained by linearly multiplying z by the standard deviation vector.
 
* The final correlated vector is obtained by linearly multiplying z by the standard deviation vector.
  
== {{t/}} Tutorials ==
+
== Tutorials ==
=== {{tt/}} Tutorial 1 ===
+
=== Tutorial 1 ===
 
{{specialInclusion prefix=$theme section="Tuto1"/}}
 
{{specialInclusion prefix=$theme section="Tuto1"/}}
  
=== {{tt/}} Tutorial 2 ===
+
=== Tutorial 2 ===
 
{{specialInclusion prefix=$theme section="Tuto2"/}}
 
{{specialInclusion prefix=$theme section="Tuto2"/}}
  
== {{t/}} [[File:lightBulb.png]] Tips & Tricks ==
+
== [[File:lightBulb.png]] Tips & Tricks ==
 
None as of now.
 
None as of now.
 +
 +
[[Category:User_Manual_3.3_Mathematics]]

Version actuelle en date du 27 février 2018 à 09:50

Introduction

Scope

This section describes how dispersions are defined and used in the PATRIUS library. Dispersions are not to be mixed up with random generation (not detailed in this page). Dispersions always rely on a random generator.

Javadoc

The dispersions objects are available in the package org.apache.commons.math3.random in the Commons Math Library (and Commons Math add-ons). This package also handles random generation.

Library Javadoc
Commons-Math Package org.apache.commons.math3.random
Commons-Math addons Package org.apache.commons.math3.random

Links

None as of now.

Useful Documents

None as of now.

Package Overview

Features Description

Random number generation

Distributed random number generation is based on using implementations of interface org.apache.commons.math3.random.NormalizedRandomGenerator. Each implementation of this interface provides a specific dispersion scheme. For instance, the following code will generate random numbers with Gaussian distribution of mean 0 and unit standard deviation:

final RandomGenerator g = new JDKRandomGenerator();
final NormalizedRandomGenerator generator = new GaussianRandomGenerator(g);
final double value = generator.nextNormalizedDouble();

As shown in the above example, building a dispersion object requires a random generator implementing org.apache.commons.math3.random.RandomGenerator interface.

Random vector generation

Correlated random vector generation is based on using implementations of interface org.apache.commons.math3.random.RandomVectorGenerator. Each implementation of this interface provides a specific dispersion scheme. For instance, the following code will generate uniformly correlated random vectors according to provided covariance matrix:

final RandomGenerator g = new JDKRandomGenerator();
final RandomVectorGenerator generator = new UniformlyCorrelatedRandomVectorGenerator(mean, covariance, 0, g);
final double[] value = generator.nextVector();

As shown in the above example, building a dispersion object requires a random generator implementing org.apache.commons.math3.random.RandomGenerator interface.

Getting Started

Modèle:SpecialInclusion prefix=$theme section="GettingStarted"/

Contents

Interfaces

The library defines the following interfaces related to dispersions:

Interface Summary Javadoc
NormalizedRandomGenerator Interface for normalized random generators ...
RandomVectorGenerator Interface for random vector generators ...


Note: interface for random number generators is org.apache.commons.math3.random.RandomGenerator.

Classes

The library defines the following classes related to dispersions:

Class Summary Javadoc
GaussianRandomGenerator Generator following Gaussian distribution ...
UniformRandomGenerator Generator following uniform distribution ...
UncorrelatedRandomVectorGenerator Generator for Gaussian uncorrelated vectors ...
CorrelatedRandomVectorGenerator Generator for Gaussian correlated vectors ...
UniformlyCorrelatedRandomVectorGenerator Generator for uniformly correlated vectors ...
UnitSphereRandomVectorGenerator Generator for vectors isotropically located on a sphere ...

Correlated random vector generator

The user provides a covariance matrix and a random generator.
When using Gaussian correlated random vector generator:

  • The covariance matrix root is extracted using a Cholesky decomposition. The number of columns of the root matrix corresponds to the rank of the provided covariance matrix.
  • An uncorrelated vector of size the rank of the covariance matrix is generated using the provided random generator
  • The final correlated vector is obtained by multiplying the covariance root matrix by this generated vector.

When using uniformly correlated random vector generator, the process is more complex:

  • The covariance matrix is converted into a correlation matrix. Standard deviation vector is extracted from the process. Obtained correlation matrix must be positive semi-definite (all eigenvalues must be non negative).
  • Spearman correction is applied to the correlation matrix. If corrected correlation matrix is not positive semi-definite, correction is not applied.
SpearmanCorrection.png
  • The correlation matrix root is extracted using a Cholesky decomposition. The number of columns of the root matrix corresponds to the rank of the correlation matrix.
  • A uncorrelated vector of size the rank of the covariance matrix is generated using the provided random generator
  • The product of correlation matrix root L and uncorrelated vector T is then transformed to get a uniform law:
UniformCorrection.png
  • The final correlated vector is obtained by linearly multiplying z by the standard deviation vector.

Tutorials

Tutorial 1

Modèle:SpecialInclusion prefix=$theme section="Tuto1"/

Tutorial 2

Modèle:SpecialInclusion prefix=$theme section="Tuto2"/

LightBulb.png Tips & Tricks

None as of now.