User Manual 4.0 Dispersions : Différence entre versions

De Wiki
Aller à : navigation, rechercher
 
(7 révisions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
 
+
__NOTOC__
 
+
 
== Introduction ==
 
== Introduction ==
 
=== Scope ===
 
=== Scope ===
Ligne 8 : Ligne 7 :
 
=== Javadoc ===
 
=== Javadoc ===
 
The dispersions objects are available in the package <code>fr.cnes.sirius.patrius.math.random</code>. This package also handles random generation.
 
The dispersions objects are available in the package <code>fr.cnes.sirius.patrius.math.random</code>. This package also handles random generation.
|=Library|=Javadoc
+
 
|Patrius |[{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/math/random/package-summary.html Package fr.cnes.sirius.patrius.math.random]
+
{| class="wikitable"
|Patrius |[{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/math/random/package-summary.html Package fr.cnes.sirius.patrius.math.random]
+
|-
 +
! scope="col"| Library
 +
! scope="col"| Javadoc
 +
|-
 +
|Patrius  
 +
|[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/random/package-summary.html Package fr.cnes.sirius.patrius.math.random]
 +
|-
 +
|Patrius  
 +
|[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/random/package-summary.html Package fr.cnes.sirius.patrius.math.random]
 +
|}
  
 
=== Links ===
 
=== Links ===
Ligne 23 : Ligne 31 :
 
== Features Description ==
 
== Features Description ==
 
=== Random number generation ===
 
=== Random number generation ===
Distributed random number generation is based on using implementations of interface <syntaxhighlight lang="java">fr.cnes.sirius.patrius.math.random.NormalizedRandomGenerator</syntaxhighlight>.
+
Distributed random number generation is based on using implementations of interface <code>fr.cnes.sirius.patrius.math.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:
 
<syntaxhighlight lang="java">
 
<syntaxhighlight lang="java">
Ligne 31 : Ligne 39 :
 
</syntaxhighlight>
 
</syntaxhighlight>
  
As shown in the above example, building a dispersion object requires a random generator implementing <syntaxhighlight lang="java">fr.cnes.sirius.patrius.math.random.RandomGenerator</syntaxhighlight> interface.
+
As shown in the above example, building a dispersion object requires a random generator implementing <code>fr.cnes.sirius.patrius.math.random.RandomGenerator</code> interface.
  
 
=== Random vector generation ===
 
=== Random vector generation ===
Correlated random vector generation is based on using implementations of interface <syntaxhighlight lang="java">fr.cnes.sirius.patrius.math.random.RandomVectorGenerator</syntaxhighlight>.
+
Correlated random vector generation is based on using implementations of interface <code>fr.cnes.sirius.patrius.math.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:
 
<syntaxhighlight lang="java">
 
<syntaxhighlight lang="java">
Ligne 42 : Ligne 50 :
 
</syntaxhighlight>
 
</syntaxhighlight>
  
As shown in the above example, building a dispersion object requires a random generator implementing <syntaxhighlight lang="java">fr.cnes.sirius.patrius.math.random.RandomGenerator</syntaxhighlight> interface.
+
As shown in the above example, building a dispersion object requires a random generator implementing <code>fr.cnes.sirius.patrius.math.random.RandomGenerator</code> interface.
  
 
=== Correlated random vector generator ===
 
=== Correlated random vector generator ===
The user provides a covariance matrix and a random generator.
+
The user provides a covariance matrix and a random generator.<br>
 
'''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 68 : Ligne 76 :
 
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|[{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/math/random/NormalizedRandomGenerator.html ...]
+
|-
|'''RandomVectorGenerator'''|Interface for random vector generators|[{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/math/random/RandomVectorGenerator.html ...]
+
! scope="col"| Interface
 +
! scope="col"| Summary
 +
! scope="col"| Javadoc
 +
|-
 +
|'''NormalizedRandomGenerator'''
 +
|Interface for normalized random generators
 +
|[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/random/NormalizedRandomGenerator.html ...]
 +
|-
 +
|'''RandomVectorGenerator'''
 +
|Interface for random vector generators
 +
|[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/random/RandomVectorGenerator.html ...]
 +
|}
  
 
Note: interface for random number generators is <code>fr.cnes.sirius.patrius.math.random.RandomGenerator</code>.
 
Note: interface for random number generators is <code>fr.cnes.sirius.patrius.math.random.RandomGenerator</code>.
Ligne 77 : Ligne 96 :
 
The library defines the following classes related to dispersions:
 
The library defines the following classes related to dispersions:
  
|=Classe|=Summary|=Javadoc
+
{| class="wikitable"
|'''GaussianRandomGenerator'''|Generator following Gaussian distribution|[{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/math/random/GaussianRandomGenerator.html ...]
+
|-
|'''UniformRandomGenerator'''|Generator following uniform distribution|[{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/math/random/UniformRandomGenerator.html ...]
+
! scope="col"| Class
|'''UncorrelatedRandomVectorGenerator'''|Generator for Gaussian uncorrelated vectors|[{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/math/random/UncorrelatedRandomVectorGenerator.html ...]
+
! scope="col"| Summary
|'''CorrelatedRandomVectorGenerator'''|Generator for Gaussian correlated vectors|[{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/math/random/CorrelatedRandomVectorGenerator.html ...]
+
! scope="col"| Javadoc
|'''UniformlyCorrelatedRandomVectorGenerator'''|Generator for uniformly correlated vectors|[{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/math/random/UniformlyCorrelatedRandomVectorGenerator.html ...]
+
|-
|'''UnitSphereRandomVectorGenerator'''|Generator for vectors isotropically located on a sphere|[{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/math/random/UnitSphereRandomVectorGenerator.html ...]
+
|'''GaussianRandomGenerator'''
 +
|Generator following Gaussian distribution
 +
|[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/random/GaussianRandomGenerator.html ...]
 +
|-
 +
|'''UniformRandomGenerator'''
 +
|Generator following uniform distribution
 +
|[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/random/UniformRandomGenerator.html ...]
 +
|-
 +
|'''UncorrelatedRandomVectorGenerator'''
 +
|Generator for Gaussian uncorrelated vectors
 +
|[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/random/UncorrelatedRandomVectorGenerator.html ...]
 +
|-
 +
|'''CorrelatedRandomVectorGenerator'''
 +
|Generator for Gaussian correlated vectors
 +
|[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/random/CorrelatedRandomVectorGenerator.html ...]
 +
|-
 +
|'''UniformlyCorrelatedRandomVectorGenerator'''
 +
|Generator for uniformly correlated vectors
 +
|[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/random/UniformlyCorrelatedRandomVectorGenerator.html ...]
 +
|-
 +
|'''UnitSphereRandomVectorGenerator'''
 +
|Generator for vectors isotropically located on a sphere
 +
|[{{JavaDoc4.0}}/fr/cnes/sirius/patrius/math/random/UnitSphereRandomVectorGenerator.html ...]
 +
|}
  
 
[[Category:User_Manual_4.0_Mathematics]]
 
[[Category:User_Manual_4.0_Mathematics]]

Version actuelle en date du 21 février 2018 à 14:01

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 fr.cnes.sirius.patrius.math.random. This package also handles random generation.

Library Javadoc
Patrius Package fr.cnes.sirius.patrius.math.random
Patrius Package fr.cnes.sirius.patrius.math.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 fr.cnes.sirius.patrius.math.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 fr.cnes.sirius.patrius.math.random.RandomGenerator interface.

Random vector generation

Correlated random vector generation is based on using implementations of interface fr.cnes.sirius.patrius.math.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 fr.cnes.sirius.patrius.math.random.RandomGenerator interface.

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.

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 fr.cnes.sirius.patrius.math.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 ...