Open TURNS

advertisement
Open TURNS User’s Day #5
12 juin 2012
Open TURNS User’s Day #5
Contents
9h – 9h30 

Reception at EDF R&D Clamart

Open TURNS :
9h30 – 10h30


10h30 – 12h

12h – 12h30 
14h – 16h
16h15 – 17h


Identity card

Consortium and Industrial Club

Web site

Open TURNS trainings
New features from the 0.14.0 release

Scientific and technologic new features

New modules : FFTW, SVM, Matplotlib, MixMod (modifications)
Open TURNS and the Stochastic Processes

« Processus gaussiens et leur simulation » (1h) : F. Poirion (ONERA)

« The Stochastic Processes in Open TURNS v1.0 » (30’) : A. Dutfoy (EDF R&D MRI)
Studies using Open TURNS

Study 1 :« Modélisation de variables dépendantes pour l'étude de la dispersion de la signature
infrarouge» (30’) : S. Lefebvre (ONERA)

Study 2 : « Assistance à l’élaboration de gammes d’assemblage innovantes de structures
composites » (30’) : L. Andalfatto (EADS-IW / ENS Cachan)

Study 3 : « Interfaces Open TURNS - Java, Matlab, Octave » (30’) : P. Rekapalli (EADS-IW)

Study 4 : « Open TURNS en mécanique » (30’) : A-L. Popelin (EDF)

Study 5 : « Analyse de sensibilité multi-échelle – Open TURNS / YACS » : Y. Caniou
Next works of the Consortium and Discussion
Open TURNS : identity card
Open TURNS aims at propagating uncertainties through a model until a given variable of interest. It
proposes some functionalities in order to quantify uncertainties in order to rank their influence on the
variable of interest. Open TURNS also enables to build meta models.

Partners 2005 – 2011 : EDF – R&D / EADS – Innovation Works / PhiMECA :

transparency : to make the methodology and the associated software be accepted by certification or control entities

genericity : to benefit from different fields where the same approach is developped (mechanics, hydraulics, ...)

computing performance : to enable the treatment of complex industrial cases (parallélisation, distribution, ...)
 Open TURNS : an open source platform dedicated to uncertainty treatment by probabilistic methods

Open source Treatment of Uncertainty, Risk ‘N Statistics

sous LGPL licence
www.openturns.org
Uncertainty Methodology
Open TURNS is the software associated to the Global Methodology of Treatment of Uncertainties developped
first at EDF R&D in 1990 and then improved by contributions from other companies :

Step A : Study Specification : uncertain input variables, model, variable of interest, analysis criteria (range
study, central dispersion, probability to exceed an extrem threshold)

Step B : Uncertainty Quantification : modelisation of the joint distribution of the input uncertain parameters

Step C : Uncertainty Propagation : quantification of the analysis criteria

Step C’ : Uncertainty Ranking
Uncertainty Methodology - Open TURNS

Numerous functionalities for each step of the Methodology in particular ....
 Code linked to Open TURNS :
 Generic Wrapper générique which enables to wrap OT to any code using input and output text files, with authomatic multithreading
functionalities (parallélism multiprocessors / multicores)
 Interface with python functions, which enables the realisation of complex wrappers without compilation
 Standard Interface for the development of wrappers of any complexity (distributed wrapper, binary data) which require the development
of an external wrapper
 Salome compatibility : OpenTURNS composant of Salome, linked to YACS
 Step B : Uncertainty Quantification
 Estimation from data :

Distribution fittings (parametric or not),

Validation Tests (quantitative or graphical),

Estimation of the dependence : copula, correlation coefficient

Regression
 Modelisation of Joint Distributions of dimension n :
•
Combination Marginals + Copula,
•
Parametric Distributions of dimension n (normal, student...)
•
Non Parametric Distribution of dimension n : kernel fitting (n), Sklar Copula
•
Linear combination of pdf
•
Linear combination of random variables,
•
Random sum of independent discrete variables according to a Poisson process
•
…
Uncertainty Methodology - Open TURNS

Open TURNS = repository of innovant or recent algorithms



the most recent and efficient algorithms of non uniform distribution generation
•
Ziggurat method (2005) for the normal distribution
•
sequential reject algorithm (1993) for the binomial distribution,
•
Tsang & Marsaglia method (2000) for the gamma distribution,
•
Lebrun algorithm (2012) for the MultiNomial distribution,
the most recent algorithms of evaluation of the CDF
•
Marsaglia algorithm for the exact statistics of Kolmogorov (2003),
•
Benton et Krishnamoorthy algorithm for the distributions non centered Student and non centered Chi2 (2003).
PhD results
•
Sparse chaos expansion polynomials : G. Blatman (EDF/R&D/MMC) (2010)
•
Accelerated simulation algorithm for the evaluation of low probabilities : M. Munoz (EDF/R&D/MRI) : (in projet)
 Innovation : the internal data model is based on the multidimensional cumulative density
function which enables :
 the sampling approach : estimation of statistical characteristics of the output variable from a large numerical
sample
 and the analytical approach : exact partial or total résolution of some problems using the probabilistic
modelisation and the implementation in Open TURNS of the function R n --> R p algebra until order 2:
•
exact determination of the distribution of the sum of random variables thanks to the characteristic
functions implemented for each distribution,
•
exact representation of the distribution of a random variable such that its pdf is a linear
comibnation of pdf,
•
exact determination of the distribution of a random variable defined as the random sum according
to a Poisson process of iid discrete random variables (for ex, cumulated failure times when
failures follow a Poisson process)
•
particular manipulations on distributions : extraction of marginals, extraction of dependence
structure, ...
Open TURNS in images
Open TURNS in images
Open TURNS in images
Open TURNS in images
Open TURNS : software, doc and Users
Open TURNS is ….
 a C++ library giving functionalities for the treatment of uncertainties
 a pyhton module offering high level operators
With a detailed documentation :
 scientific documentation : Reference Guide,
 Users documentation : Use Cases Guide, User Manual, Examples Guide
 technical documentation : Architecture Guide, Wrapper Guide, Contribution Guide, Windows port doc.
… and a sympathetic community :
 Openturns.org : official web site
 a particular page share to communicate about the sofware
 the annual Users day
Open TURNS ans its Consortium


The Open TURNS Consortium is organised around two main committees in close collaboration :

Steering Committee : driving the evolution of the scientific content and the architecture,
responsible for the releases, organisation of the User’s Day

Technical Committee : responsible for the scientific and technological content, audit of the
different contributions, pro active to propose evolutions and partnerships
How to contribute to / interact with Open TURNS ?

Level 1 : the contributor wants to share around the tool by proposing new
functionalities (developed under C++ or python with the module mechanism), a
script (pre / post processing of data, coupling with other tools, ….)
 GO TO share.openturns.org

Level 2 : the contributor wants to contribute to the official version of Open TURNS
Contribution to the C++ library, to the python TUI python
 Open TURNS quality criteria to be respected (at the end) : code source +
documentation, detailed in the Coding Rules Guide + Contribution Guide

don’t hesitate to contact the Open TURNS Consoritum as soon as possible!
Open TURNS ans its User Club

Current situation :



The Open TURNS user's community is increasing :
•
industrial : SNCF, Dassault-Aviation, MBDA, Astrium, Airbus, Michelin, Lafarge,
Orange, EDF-SEPTEN, EDF-CIDEN,
•
Research centers and universities : LNE, EDF-R&D, EADS-IW, ENS Cachan, IFMA,
CEA
•
Services : InModelia, IMACS, Phimeca
•
projets ANR, européens, ...
Open TURNS is closer to the industrial computational chains :
•
EDF : Salome et SalomeMeca, ...
•
ERDF : plateform of computation for the safety of electric networks
•
Other applications
Open TURNS is interfaced to:
•
Matlab,
•
SciLab,
•
PhimecaSoft, ...
==> increasing needs in the community :

To train the users,

To enrich the tool with specific needs coming from various areas,

To adapt the tool to specific constraints,

To ensure the long-term maintenance and ensure the adequate quality of service, ...
Open TURNS ans its User Club

Since 2012 : creation of the Open TURNS Users Club

Industrial people & Academics

To share best practices around the use of Open TURNS in uncertainty studies :

•
discussions
•
Scientific presentations around the uncertainty management methodology
•
Use-case with the tool
To mutualize the developments to enrich the platform:
•
Common requirements shared by several industrial to prototype scientfic developments ( module
C++, production of python scripts, ...),
•

The actions of developments and maintenance done by partners labelled by the Open TURNS
consortium Open TURNS,
To organize training and communication actions
… you are welcome !
(contacts : anne.dutfoy@edf.fr, fabien.mangeant@eads.net, yalamas@phimeca.com)
Open TURNS – www.openturns.org

Quick access to main parts of the website by left and upper menu
Open TURNS – www.openturns.org

Easy acces to the download page

Documentation

Version 1.0 => 168 downloads between the 22th of april and the 1st of june

France : 68 %
Open TURNS – Trainings

EDF

« Uncertainty Management : Open TURNS »
•
3 days to learn the use of Open TURNS : python TUI, wrapping aspects, application of the
methodologie from step A to step C & C’
•
next session in october 2013, ITECH ref : 4888
 contact : Corine Tripet : 01 47 65 58 41

MAI : 26 to 28 novembre 2012, Uncertainty Management in Computational Mechanics
General Methodology, Probabilistic Fatigue Design, etc… & illustrations with OpenTURNS


contact : Marc Berveiller, EDF : 01 60 73 73 66
PHIMECA

Several 2 days sessions on the different steps from the methodology:

Probability & Statistics

Response Surfaces Models

Uncertainty propagation methods for sensitivity & dispersion analysis

Uncertainty propagation methods for reliability evaluation

Introduction to the use of OpenTURNS : 2 days

Introduction to the use of PhimecaSoft : 2 days
New features from the 0.14.0

Python types capabilities
 Numpy array / matrix ↔ Open TURNS Matrix conversion
 Available for all Matrix types : Matrix, SymmetricMatrix, ComplexMatrix, Tensor, …
 Both ways numpy.array ↔ ot.Matrix:
a0 = np.array( ((1.+3j,0.),(3.+7j,4.-9j)) )
m0 = ot.ComplexMatrix( a0 )
a1 = np.array( m0 )
 Implicit conversion for Indices, Description, CorrelationMatrix, CovarianceMatrix types
 No need to specify these types anymore:
v0.15 : marginal = distribution.getMarginal( Indices( [ 1, 2, 4 ] ) )
v1.0 : marginal = distribution.getMarginal( [ 1, 2, 4 ] )
 Python philosophy : hidden basic types, shorter scripts
 More operators for NumericalPoint, NumericalSample, Matrix
 NumericalPoint : __div__ → x / 3.0
 NumericalPoint : __rmul__ → 3.0 * x
 NumericalSample : __eq__ → if xs == y:
 Matrix : __rmul__ → 3.0 * m
New features from the 0.14.0

Last Releases : 0.15.0 in April 2011; 1.0 in April 2012.

Scientific aspects



Chaos polynomial expansion, sparse chaos :
•
Othonormalised polynomials for the discrete distributions : CharlierFactory, MeixnerFactory,
KrawtchoukFactory
•
Model selection: Kfold
•
Projection algorithm: PenalizedLeastSquaresAlgorithmFactory
Additional distributions and factories :
•
1 D continuous distributions : LogUniform, LogUniformFactory
•
1 D discrete distributions : NegativeBinomial
•
N D continuous distribution: MinCopula
Numerical models :
•
Vectorial functions : AggregatedNumericalMathEvaluationImplementation,
AnalyticalNumericalMathEvaluationImplementation,
DatabaseNumericalMathEvaluationImplementation
•
Process rransformations :DynamicalFunction, TemporalFunction, SpatialFunction,,
BoxCoxFactory, BoxCoxTransform, InverseBoxCoxTransform, InverseTrendTransform,,
TrendFactory, TrendTransform
•
Differentiation: BlendedStep
New features from the 0.14.0

Scientific aspects


Processes (1.0)
•
Families of processes: CompositeProcess, Process, RandomWalk, ARMA, WhiteNoise,
SpectralNormalProcess, TemporalNormalProcess
•
Second order models : CovarianceModel, CauchyModel, ExponentialCauchy,
ExponentialModel, StationaryCovarianceModel, SecondOrderModel, SpectralModel,
SpectralModelFactory, UserDefinedSpectralModel
•
Statistiocal estimation : WelchFactory, WhittleFactory
•
Filtrage: FilteringWindows, Hamming, Hanning
•
Event : Domain, EventDomainImplementation, EventProcess
•
Data contenairs : ProcessSample, RegularGrid, TimeSeries
Diverse
•
Numerical analysis :
•
Linear algebra : ComplexMatrix, HermitianMatrix, TriangularComplexMatrix,
SquareComplexMatrix
•
Fourier transform : FFT, KissFFT
•
Design of Experiments : GaussProductExperiment, RandomizedLHS,
RandomizedQuasiMonteCarlo, HaselgroveSequence, ReverseHaltonSequence
•
Graphical analysis : SimulationSensitivityAnalysis
Some new modules :
MixMod & FFTW

See presentation .pdf
Some new modules :
Matplotlib based module

New graphing module

Allows to visualize Open TURNS graphs through python matplotlib plotting library

Replaces graphing with R command line, Rpy2, ...

Outputs nicer, more customizable plots

Available as an independent python module until next release
view = View( graph )
view.save( 'curve.png' )
view.show()
pyplot.text( 0.15, 0.6, 'Zou!')
New matplotlib based module

Curve
New matplotlib based module

Contour
New matplotlib based module

Histogram
New matplotlib based module

Qqplot
New matplotlib based module

Cloud
New matplotlib based module

CobWeb
New matplotlib based module

Staircase
New matplotlib based module

Convergence graph
Open TURNS : its logo
 The Galton Board (1822 - 1911) : british explorer, geograph, inventor, meteorologist, proto-geneticist,
psychometrician, statistician
Open TURNS and the Stochastic Processes

« Processus gaussiens et leur simulation » : F. Poirion (ONERA)

« Les processus stochastiques dans Open TURNS v1.0 » : A. Dutfoy (EDF R&D MRI)
Open TURNS and the Stochastic Processes
getTimeGrid
getRealization
where
TimeSeries
NumericalPoint
computeTemporalMean
drawMarginal(i)
(X(,t)), tR
Process
RegularGrid
getSample
getMarginalProcess
WhiteNoise
RandomWalk
ARMA
Graph
ProcessSample : collection of n TimeSeries
computeTemporalMean
NumericalSample
TimeSeries
computeMean
computeQuantilePerComponent
TimeSeries
Process
: de dimension m <d
SpectralNormalProcess
TemporalNormalProcess
CompositeProcess
Open TURNS and the White Noise & Random Walk
White noise
Random walk
RandomWalk
WhiteNoise
RandomWalk(myOrigin, myDistribution, myTimeGrid)
WhiteNoise(myDistribution, myTimeGrid)
NumericalPoint
Distribution
Distribution
RegularGrid
P(-1) = 0.9; P(10) = 0.1
N(0,1)
N(0,1)
RegularGrid
Open TURNS and the ARMA processes
ARMA models stationnary processes :
ARMA(myARCoef, myMACoef,myWNdist) (a)
ARMA(myARCoef, myMACoef,myWNdist, myCurrentState) (b)
ARMA
ARCoefficient
WhiteNoise
ARMAState
MACoefficient
• getRealization()
TimeSeries
 does not depend on the current state
==> thermalization step
• getPossibleFuture(Nit)
TimeSeries
 must take into account the influence of the current
state on the first instants
==> NO thermalization step
add Nther instants to the time grid
generate the process on the new time grid
! creation (b) is mandatory
! Care : Beyond Nther instants, the future has no link with
the present
erase the first Nther instants
by default, Nther = f(roots of the AR polynomials)
! authomatically performed with (a) creation
• getSample(n)
ProcessSample
• getPossibleFuture(Nit,n)
ProcessSample
Open TURNS and the ARMA estimation (1d)
 Principles :
 White noise : Gaussian(0,2)
 Whittle likelihood function which is a ratio between an estimate of the spectral density function of the data
and the analytical spectral density function of an ARMA(p,q) process
 Welch method to estimate the spectral density function of the data using a tappering window (Hamming,
Hanning)
 Estimation :
 for a given (p,q)
 for a range on p and a range on q : (pIndices, qIndices)
 decision criteria : corrected AIC
 other information : BIC and AIC criteria
WhittleFactory
The AIC and AIC c criteria select the best
structure - AICc penalizes the high (p,q)
The BIC criteria selects the best prediction model
For n-> , the three selections (p,q) converge
WhittleFactory(p,q) (a)
WhittleFactory(pIndices,qIndices) (b)
Indice
• build (TS or PS) :
• build (TS or PS, criterion) :
TimeSeries
ARMA
NumericalPoint
ProcessSample
 criterion : in order to get the evaluation of the
3 criteria : AICc, AIC, BIC
criterion = NumericalPoint()
• getHistory()
WhittleFactoryStateCollection
 stores all theARMA(p,q) models of the range
 ranks the models with respect to the AICc
criteria
 stores the evaluation of the 3 criteria for each
ARMA(p,q)
Open TURNS and the Normal processes
Normal processes
• defined by its
covariance function
• if stationnary,
defined by its stationnary
covariance function
==> ExponentialModel
• if stationnary,
defined by its spectral density function
CauchyModel
==>
UserDefinedModel
• may be estimated from data (non
parametric Welch estimator)
SecondOrderModel
==>
WechFactory
ExponentialCauchyModel
TemporalNormalProcess
SpectralNormalProcess
 in order to insure the
coherence between the
covariance function and the
spectral density function
Open TURNS and the trend computation
Principles : In general, the time series (Yt)t writes :
The objective here is to identify the trend function f and to remove it from the
observed time series in order to analyse the stationary time series (Xt)t .
(Xt)t stationnary
==> We decompose f over the functional basis B :
 Coefficients identification : algorithms which combine cross validation techniques and advanced
regression strategies, in order to provide the estimation of the coefficients associated to the best model
among the basis functions (sparse model).
==> Construction of the ‘Trend Factory’ :
TrendFactory
TrendFactory(myBasisSequenceFact, myFittingAlgo)
BasisSequenceFactory
ex :
LAR
==> generates a sub basis of B
FittingAlgo
ex :
CorrectedLeaveOneOut
KFold
==> estimates the empirical error
Open TURNS and the trend computation
This ‘Trend Factory’ is used to create a trend transform :
• with a particular functional basis B
• and a particluar time serie
TrendFactory
• build(myTimeSeries, myFunctionBasis)
TimeSeries
TrendTransform
NumericalMathFunctionCollection
• add the trend to (Xt)t :
• evaluate the trend at t :
>> myYTimeSeries = myTrendTranform(Xt )
>> trend_t = myTrendTranform.getFunction ()(t)
• remove the trend from (Yt)t :
>> myXTimeSeries = myTrendTranform . getInverse( )(Yt )
Open TURNS and the Box Cox transform
 Principles : the Box Cox transform h : (Yt)t -> (h(Yt))t with a stabilized variance (if it exists) : such that Var[h(Y t)_]
is constant with respect to the time for each i.
For each scalar marginal process :
==> For ex, if
then :
==> For ex : if
then :
 In general, the Box Cox transformation writes (where  is scalar) :
==> More generally : if
then :
•  may be estimated from the data or given by the User
BoxCoxFactory
• BoxCoxFactory()
• BoxCoxFactory(alpha)
if (Yt)t has negative values, translate it of alpha :
(alpha + Yt)t is a positive time series
Open TURNS and the Box Cox transform
This ‘Box Cox Factory’ is used to create a Box Cox transform with a particular time series where the 
factor is estimated from the data
BoxCoxFactory
• build(myTimeSeries)
BoxCoxTransform
TimeSeries
• transform (Yt)t into (h(Yt))t :
• transform (h(Yt))t into (Yt)t
or :
or :
>> myYt = myBoxCoxTranform.getInverse()(myStabilizedTS )
>> myStabilizedTS = myBoxCoxTranform(myYt )
Open TURNS and the Box Cox and Trend transforms
 We illustrate the full process of analysis
ARMA(0,1)
Box Cox transform :
stabilization of the variance
 = 0.046
Trend suppression :
LAR & cross validation
basis : polynomials of
degree  4
linear trend
Open TURNS and the propagation of processes
 Dynamical function :
TemporalFunction
TemporalFunction(myFunctiong)
SpatialFunction
SpatialFunction(myFunctiong)
NumericalMathFunction
NumericalMathFunction
DynamicalFunction
DynamicalFunction(myTemporalFunction)
DynamicalFunction(mySpatialFunction)
 Composite Process :
 Event :
 Monte Carlo estimation :
myYt = CompositeProcess(f,myXt)
Studies with Open TURNS

Study 1 : « Modélisation de variables dépendantes pour l'étude de la dispersion de la signature
infrarouge » - S. Lefebvre - ONERA

Study 2 : « Assistance à l’élaboration de gammes d’assemblage innovantes de structures composites » :
L. Champaney » – L. Andalfatto EADS-IW / ENS-CACHAN

Study 3 : « Interfaces Open TURNS - Java, Matlab, Octave » - P. Rekapalli – EADS-IW

Study 4 : « Open TURNS in Mecanics » – AL Popelin - EDF R&D

Study 5 : « Analyse de sensibilité multi-échelle – Open TURNS / YACS » – Y. Caniou - PhiMECA
Perspectives


Processus stochastiques : new developments to come

Dickey-Fuller stationarity test

Multidimensional ARMA estimation

Estimation of the covariance function stationnary : FFT algorithm, non stationnary : crude
sample autocovariance function
Bayesian modelisation

Bayesian updating of « a priori » distribution in conjunction with physical models


Use Case discussion meeting : 19 juin 2012
OpenTURNS in its environment…

Python friendly

Automatic conversion (e.g. array/matrix)

Use of MatPlotLib library for the visualisation

Other ideas ?

Use of the module mecanism in order to extend the OpenTURNS capabilities
Discussion

Some ideas ...

points on which you would like some improvements ?

additional functionnalities ?

how to improve the Open TURNS diffusion ?
It’s up to you !
The end ....
Thanks for your participation
... and see you next year !
Download