Changeset 993

Show
Ignore:
Timestamp:
10/30/08 17:27:06 (2 months ago)
Author:
dutka
Message:

MERGE: trunk> svn merge -r 972:992 https://.../dutfoy/devel

Added a new documentation: the Example guide, which presents full length studies examples.
Updated the Use Cases guide with the description of the new wrapper loading mechanism, the better Python integration, the ability to define a NumericalMathFunction based on a Python function, a new use-case showing how to compute moments from a sample of the output variable.
Fixed a typo in the User Manual. It closed ticket #151.
Changed the description of the NonCentralStudent distribution in the UseCases guide and the UserManual. This fixed the ticket #152.
Added a new guide that provides full-length studies, the Examples guide.
Moved ExampleGuide to ExamplesGuide.
Moved ExampleGuide.tex to ExamplesGuide.tex.
Added automatic inclusion of the Python script and its result into the Examples Guide.
Fixed bugs in computeConditionalQuantile() and computeCinditionalCDF() methods of ComposedCopula class.
Minor enhancement of DistFunc class.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/doc/configure.ac

    r992 r993  
    113113           src/ReferenceGuide/Makefile 
    114114           src/ContributionGuide/Makefile 
     115           src/ExamplesGuide/Makefile 
    115116]) 
    116117#           src/CodingRulesGuide/Makefile 
  • trunk/doc/src/DocumentationGuide/OpenTURNS_DocumentationGuide.tex

    r862 r993  
    7575\begin{itemize} 
    7676   \item[$\bullet$] {\itshape Open TURNS - Reference Guide}, 
    77   \item[$\bullet$] {\itshape Open TURNS - Example Guide} (to appear soon)
     77  \item[$\bullet$] {\itshape Open TURNS - Examples Guide}
    7878\end{itemize} 
    7979 
     
    8989  \item[$\bullet$] {\bf Link with the Open TURNS Methodology} : this field recalls the position of the algorithm in the Global Methodology. It precises to which step of the Global Methodology it participates. 
    9090  \item[$\bullet$] {\bf References and theoretical basics} : this field gives some usefull references to the User who wants to know more about the method. It recalls, too, some limits in the use of the method. 
    91   \item[$\bullet$] {\bf Examples} : this field applies the method on a simple example. Most of the forms of this documentation present the analytical example of a cantilever beam, of Young's modulus E, length L, section modulus I, which undergoes a concentrated bending force at one end. We study then the vertical displacement of the extreme end. 
    92 \end{itemize} 
    93  
    94 To have an example of the use of a particular algorithm or of a particular method, the User is invited to refer either to the documentation {\itshape Reference Guide - Open TURNS}  in its section {Example} or to the documentation {\itshape Example Guide - Open TURNS} which applies the Global Methodology on a particular example.\\ 
     91  \item[$\bullet$] {\bf Examples} : this field applies the method on some examples. Most of the forms of this documentation present the analytical example of a cantilever beam, of Young's modulus E, length L, section modulus I, which undergoes a concentrated bending force at one end. We study then the vertical displacement of the extreme end. 
     92\end{itemize} 
     93 
     94To have an example of the use of a particular algorithm or of a particular method, the User is invited to refer either to the documentation {\itshape Reference Guide - Open TURNS}  in its section {Example} or to the documentation {\itshape Examples Guide - Open TURNS} which applies the Global Methodology on a particular example.\\ 
    9595 
    9696Some hyperlinks are present to facilitate the navigation between the documentation {\itshape Uncertainty Reference Guide - Open TURNS} and the others ones. 
    9797 
    9898 
    99         \subsection{ Example Guide} 
    100  
    101 This Guide applies the whole Global Methodology on the following analytical example :  the evaluation of the height of an embankment to protect from flows.\\ 
    102  
    103 The User may find in this documentation a complete probabilistic uncertainty treatment study. In particular, all the results are discussed and the documentation aims at explicitating the interest of such a study. \\ 
    104 Let's note that the documentation {\itshape Open TURNS - Use Cases Guide for the Textual User Interface} gives also the example of an uncertainty study, performed on the analytical example of a cantilever beam wich undergoes a concentrated bending force at one end.\\ 
     99        \subsection{Examples Guide} 
     100 
     101This Guide applies the whole Global Methodology on some analytical examples. For now, there is only one example: the case of a cantilever beam wich undergoes a concentrated bending force at one end.\\ 
     102 
     103The User may find in this documentation a complete probabilistic uncertainty treatment study.\\ 
    105104 
    106105The User is invited to refer to that documentation in particular to apprehend properly the signification of the results of the methods preconised in the Globel Methodology.\\ 
    107106 
    108 Some links are present to facilitate the navigation between the documentation {\itshape Example Guide - Open TURNS} and the {\itshape Reference Guide - Open TURNS} one. 
     107Some links are present to facilitate the navigation between the documentation {\itshape Examples Guide - Open TURNS} and the {\itshape Reference Guide - Open TURNS} one. 
    109108 
    110109 
     
    141140The presentation follows the steps preconised in the Global Methodology.\\ 
    142141 
    143 The User is invited to consult this documentation before implementating a study through the TUI : he will probably find there an example of what he wants to perform. The documentation is made to enable the User to make some cut/copy from the documentation into his study.\\ 
    144  
    145 An example of complete uncertainty study is given at the end of the documentation : the analytical example of a cantilever beam wich undergoes a concentrated bending force at one end. 
     142The User is invited to consult this documentation before implementating a study through the TUI : he will probably find there an example of what he wants to perform. The documentation is made to enable the User to make some cut/copy from the documentation into his study. 
    146143 
    147144\section{Software Source.} 
     
    201198\item {\itshape Reference Guide} : \\ 
    202199source file $OpenTURNS\_ReferenceGuide.tex$, 
    203 \item {\itshape Example Guide} : \\ 
    204 source file $OpenTURNS\_ExampleGuide.tex$. 
     200\item {\itshape Examples Guide} : \\ 
     201source file $OpenTURNS\_ExamplesGuide.tex$. 
    205202\end{itemize} 
    206203  \item[$\bullet$] {\bf TextualUserInterface} :  
  • trunk/doc/src/Makefile.am

    r862 r993  
    2525include $(top_srcdir)/config/common.am 
    2626 
    27 SUBDIRS      =  ArchitectureGuide DocumentationGuide ReferenceGuide UseCasesGuide UserManual WrapperGuide GNU_free_documentation_licence ContributionGuide #CodingRulesGuide 
    28 DIST_SUBDIRS =  ArchitectureGuide DocumentationGuide ReferenceGuide UseCasesGuide UserManual WrapperGuide GNU_free_documentation_licence ContributionGuide #CodingRulesGuide 
     27SUBDIRS      =  ArchitectureGuide DocumentationGuide ReferenceGuide UseCasesGuide UserManual ExamplesGuide WrapperGuide GNU_free_documentation_licence ContributionGuide ExamplesGuide #CodingRulesGuide 
     28DIST_SUBDIRS =  ArchitectureGuide DocumentationGuide ReferenceGuide UseCasesGuide UserManual ExamplesGuide WrapperGuide GNU_free_documentation_licence ContributionGuide ExamplesGuide #CodingRulesGuide 
    2929 
    3030EXTRA_DIST   = logoOpenTURNS.jpg 
  • trunk/doc/src/ReferenceGuide/OpenTURNS_ReferenceGuide.tex

    r862 r993  
    1 %Copyright (c)  2007  EDF-EADS-PHIMECA. 
     1%Copyright (c)  2005  EDF-EADS-PHIMECA. 
    22%  Permission is granted to copy, distribute and/or modify this document 
    33%  under the terms of the GNU Free Documentation License, Version 1.2 
  • trunk/doc/src/ReferenceGuide/global_methodology_content.tex

    r862 r993  
    1 %Copyright (c)  2007  EDF-EADS-PHIMECA. 
     1%Copyright (c)  2005  EDF-EADS-PHIMECA. 
    22%  Permission is granted to copy, distribute and/or modify this document 
    33%  under the terms of the GNU Free Documentation License, Version 1.2 
  • trunk/doc/src/ReferenceGuide/reference_guide_content.tex

    r862 r993  
    1 %Copyright (c)  2007  EDF-EADS-PHIMECA. 
     1%Copyright (c)  2005  EDF-EADS-PHIMECA. 
    22%  Permission is granted to copy, distribute and/or modify this document 
    33%  under the terms of the GNU Free Documentation License, Version 1.2 
  • trunk/doc/src/ReferenceGuide/reference_guide_title.tex

    r862 r993  
    1 %Copyright (c)  2007  EDF-EADS-PHIMECA. 
     1%Copyright (c)  2005  EDF-EADS-PHIMECA. 
    22%  Permission is granted to copy, distribute and/or modify this document 
    33%  under the terms of the GNU Free Documentation License, Version 1.2 
  • trunk/doc/src/UseCasesGuide/OpenTURNS_UseCasesGuide.tex

    r972 r993  
    107107It is important to note that the python test files given in open source with the code source of Open TURNS  are very useful : they provide to the User an example of the utilisation of each object of Open TURNS. The User is invited to refer to them : they will surely help him to write his study through the TUI with the right syntax.\\ 
    108108 
     109 
     110 
     111 
     112\subsection*{Loading the openturns python library} 
     113\addcontentsline{toc}{subsection}{Loading the openturns python library} 
     114 
    109115In order to write a python file using fonctionalities proposed by the \emph{openturns} python module, it is necessary to load the module in the python shell. If there is no danger to overload functionalities coming from other python modules, the loading command is :  
    110116 
     
    138144\end{center} 
    139145gives a general overview of the whole objects proposed by the \emph{openturns} python library.\\ 
     146 
     147 
     148 
     149\subsection*{Verbosity level of the Open TURNS platform} 
     150\addcontentsline{toc}{subsection}{Verbosity level of the Open TURNS platform} 
     151 
     152It is possible to specify the verbosity level of the Open TURNS platform, through the object {\itshape Log} which contains the internal following variables :  
     153\begin{itemize} 
     154 \item {\itshape Log.DBG} to catch the messages related the level debug, 
     155 \item {\itshape Log.WRAPPER} to catch the messages related to the wrapper, 
     156 \item {\itshape Log.INFO} to catch the messages related to the platform information, 
     157 \item {\itshape Log.USER} to catch the messages defined by the User, 
     158 \item {\itshape Log.WARN} to catch the messages related to warnings, 
     159 \item {\itshape Log.ERROR} to catch the messages related to errors. 
     160\end{itemize} 
     161By default, the Open TURNS platform shows all the messages related to the levels DBG, WARN and ERROR.\\ 
     162It is possible to change it by the command {\itshape Log.Show()}. For example to catch the messages related to the level debug, the warnings and information, the command is :   
     163\begin{center} 
     164\begin{lstlisting} 
     165Log.Show(Log.DBG + Log.WARN + Log.INFO) 
     166\end{lstlisting} 
     167\end{center} 
     168In order to catch all the possible messages (highest verbosity level), the command is :  
     169\begin{center} 
     170\begin{lstlisting} 
     171Log.Show(Log.ALL) 
     172\end{lstlisting} 
     173\end{center} 
     174In order to catch no message (lowest verbosity level), the command is :  
     175\begin{center} 
     176\begin{lstlisting} 
     177Log.Show(Log.NONE) 
     178\end{lstlisting} 
     179\end{center} 
     180 
     181 
     182 
     183 
     184\subsection*{Some usefull general commands} 
     185\addcontentsline{toc}{subsection}{Some usefull general commands} 
     186 
    140187 
    141188The command {\itshape help} gives detailed information on each  object of the {\itshape openturns} python library. For example, to get information on the object {\itshape NumericalPoint}, the command is :  
     
    188235where $[TAB]$ is the Tabulation touch. 
    189236 
     237 
     238 
     239 
     240 
     241\subsection*{Link with other python standards} 
     242\addcontentsline{toc}{subsection}{Link with other python standards} 
     243 
     244It is possible to define a NumericalPoint from a list python, as follows :  
     245\begin{center} 
     246\begin{lstlisting} 
     247point = NumericalPoint( [1.1, 2.2, 3.3, 4.4] ) 
     248\end{lstlisting} 
     249\end{center} 
     250 
     251 
     252It is possible to define a NumericalPoint from a tuple python, as follows :  
     253\begin{center} 
     254\begin{lstlisting} 
     255point2 = NumericalPoint( (1.1, 2.2, 3.3, 4.4) ) 
     256\end{lstlisting} 
     257\end{center} 
    190258 
    191259 
     
    347415We explicitate here the probability density function of the Non Central Student :  
    348416$$ 
    349 p_T(x) = \frac{\exp(-\delta^2 / 2)}{\sqrt{\nu\pi} \Gamma(\nu / 2)}\left(\frac{\nu}{\nu + (x+\gamma)^2}\right) ^ {(\nu + 1) / 2} \sum_{j=0}^{\infty} \frac{\Gamma\left(\frac{\nu + j + 1}{2}\right)}{\Gamma(j + 1)}\left((x+\gamma)\delta\sqrt{\frac{2}{\nu + x^2}}\right) ^ j 
     417p_T(x) = \frac{\exp(-\delta^2 / 2)}{\sqrt{\nu\pi} \Gamma(\nu / 2)}\left(\frac{\nu}{\nu + (x-\gamma)^2}\right) ^ {(\nu + 1) / 2} \sum_{j=0}^{\infty} \frac{\Gamma\left(\frac{\nu + j + 1}{2}\right)}{\Gamma(j + 1)}\left(\delta(x-\gamma)\sqrt{\frac{2}{\nu + (x-\gamma)^2}}\right) ^ j 
    350418$$ 
    351419 
     
    34123480 
    34133481\index{Sample Statistics!Min - Max} 
     3482\index{Sample Statistics!Moments evaluation} 
    34143483\index{Sample Statistics!Covariance} 
    34153484\index{Sample Statistics!Skewness} 
     
    36503719\vspace*{0.5cm} 
    36513720 
    3652 It is necessary to refer to the documentation {\itshape Open TURNS - Wrappers Guide} to have explanations on what constitues an Open TURNS wrapper.\\ 
     3721It is necessary to refer to the documentation {\itshape Open TURNS - Wrappers Guide} to have explanations on what constitues an Open TURNS wrapper. \\ 
     3722It is possible to separate the loading of the wrapper file and the creation of the NumericalMathFunction, as indicated in CASE 2 of the script given belows. 
    36533723 
    36543724\requirements{ 
     
    36773747 
    36783748\begin{lstlisting} 
     3749# CASE 1 : we load the wrapper file and create the NumericalMathFunction at the same time 
    36793750# Create the limit state function 'poutre' from the wrapper 'poutre' 
    36803751    poutre = NumericalMathFunction("poutre") 
     3752 
     3753# CASE 2 : we load separately the wrapper file and create the NumericalMathFunction 
     3754# Load the wrapper file 
     3755    wrap = WrapperFile.FindWrapperByName("poutre") 
     3756# Create the limit state function 'poutre' from the wrapper wrap 
     3757    poutre = NumericalMathFunction(wrap) 
    36813758\end{lstlisting} 
    36823759 
     
    36963773 \item[$\bullet$] the hessian evaluation method is the  centered finite difference method, with the differential increment $h=1e-4$ for each direction. 
    36973774\end{itemize} 
    3698 it is possible to change the evaluation method for the gradietn or the hessian. The following Use Case shows how to proceed.\\ 
     3775It is possible to change the evaluation method for the gradient or the hessian. The following Use Case shows how to proceed.\\ 
    36993776 
    37003777The example here is the AnalyticalFunction {\itshape myAnalyticalFunction} defined by the formula :  
     
    37613838\end{lstlisting} 
    37623839 
     3840 
     3841 
     3842     \subsubsection{UC : From a fonction defined in the script python} 
     3843 
     3844\index{Limit State Function!Function declarde in the script python} 
     3845 
     3846 
     3847The objective of this UC is to create the limit state function, from a function defined in the script python. Open TURNS automatically gives to the analytical formula an implementation for the gradient and the hessian : by default,  
     3848\begin{itemize} 
     3849 \item[$\bullet$]the gradient evaluation method is the  centered finite difference method, with the differential increment $h=1e-5$ for each direction, 
     3850 \item[$\bullet$] the hessian evaluation method is the  centered finite difference method, with the differential increment $h=1e-4$ for each direction. 
     3851\end{itemize} 
     3852It is possible to change the evaluation method for the gradient or the hessian. The following Use Case shows how to proceed.\\ 
     3853 
     3854In order to be able to use the function with the {\itshape openturns} library, it is necessary to define a class which derives from {\itshape OpenTURNSPythonFunction} as indicated belows. The example here is the functions {\itshape modelePYTHON} and {\itshape modelePYTHON2}:  
     3855\begin{equation} 
     3856\begin{array}{l|lcl} 
     3857modelePYTHON : & \mathbb{R}^4 & \rightarrow & \mathbb{R} \\ 
     3858         & (E,F,L,I)    & \mapsto     & \displaystyle \frac{FL^3}{3EI} 
     3859\end{array} 
     3860\end{equation} 
     3861 
     3862\begin{equation} 
     3863\begin{array}{l|lcl} 
     3864modelePYTHON2 : & \mathbb{R}^4 & \rightarrow & \mathbb{R}^2 \\ 
     3865         & (a,b,c)    & \mapsto     & \displaystyle (a^2, abc) 
     3866\end{array} 
     3867\end{equation} 
     3868 
     3869 
     3870\requirements{ 
     3871  none 
     3872} 
     3873{ 
     3874  \begin{description} 
     3875    \item[$\bullet$] the limit state function : {\itshape modeleOpenTURNS} 
     3876    \item[type] : NumericalMathFunction 
     3877  \end{description} 
     3878} 
     3879 
     3880\espace 
     3881Python script for this UseCase : 
     3882    
     3883\begin{lstlisting} 
     3884# CASE 1 : function : R^4 --> R 
     3885 
     3886# Create here the python lines to define the implementation of the function 
     3887 
     3888# In order to be able to use that function with the openturns library,  
     3889# it is necessary to define a class which derives from OpenTURNSPythonFunction 
     3890 
     3891class modelePYTHON(OpenTURNSPythonFunction) :  
     3892  # that following method defines the input size (4) and the output size (1) 
     3893  def __init__(self) :  
     3894     OpenTURNSPythonFunction.__init__(self,4,1) 
     3895 
     3896  # that following method gives the implementation of modelePYTHON 
     3897  def f(self,x) :  
     3898     E=x[0] 
     3899     F=x[1] 
     3900     L=x[2] 
     3901     I=x[3] 
     3902     return [-(F*L*L*L)/(3.*E*I)] 
     3903 
     3904# Use that function defined in the script python  
     3905# with the openturns library 
     3906# Create a NumericalMathFunction from modelePYTHON 
     3907modeleOpenTURNS = NumericalMathFunction(modelePYTHON()) 
     3908 
     3909 
     3910# CASE 2 : function : R^3 --> R^2 
     3911 
     3912# Create here the python lines to define the implementation of the function 
     3913 
     3914# In order to be able to use that function with the openturns library,  
     3915# it is necessary to define a class which derives from OpenTURNSPythonFunction 
     3916 
     3917class modelePYTHON2(OpenTURNSPythonFunction) :  
     3918  # that following method defines the input size (3) and the output size (2) 
     3919  def __init__(self) :  
     3920     OpenTURNSPythonFunction.__init__(self,3,2) 
     3921 
     3922  # that following method gives the implementation of modelePYTHON 
     3923  def f(self,x) :  
     3924     a=x[0] 
     3925     b=x[1] 
     3926     c=x[2] 
     3927     return [-a*a,a*b*c] 
     3928 
     3929# Use that function defined in the script python  
     3930# with the openturns library 
     3931# Create a NumericalMathFunction from modelePYTHON2 
     3932modeleOpenTURNS2 = NumericalMathFunction(modelePYTHON2()) 
     3933\end{lstlisting} 
    37633934 
    37643935 
     
    40004171# Give directly to the 'poutreReduced' function a gradient evaluation method  
    40014172# thanks to the finite difference technique 
    4002     # For example, radient technique : non centered finite difference method 
     4173    # For example, gradient technique : non centered finite difference method 
    40034174    myGradient = NonCenteredFiniteDifferenceGradient(NumericalPoint(2, 1.0e-7), poutreReduced.getEvaluationImplementation()) 
    40044175    print "myGradient = ", myGradient 
     
    47114882In order to evaluate the central tendance of the output variable of interest described by a numerical sample, it is possible to use all the functionalities described in the  Use Case \ref{statistical}.\\ 
    47124883 
    4713 The Use Case  \ref{correlationAnalysis} describes the correlation analysis we can perform between the random input vector, described by a numerical sample, and the output variable of interest described by a numerical sample too. 
    4714  
    4715 \subsubsection{UC : Correlation analysis on samples : Pearson and Spearman coefficients, PCC, PRCC, SRC, SRRC coefficients}\label{correlationAnalysis} 
    4716  
    4717 \index{Correlation!Pearson correlation coefficient} 
    4718 \index{Correlation!Partial Pearson correlation coefficient (PCC)} 
    4719 \index{Correlation!Spearman correlation coefficient} 
    4720 \index{Correlation!Partial rank correlation coefficient (PRCC)} 
    4721 \index{Correlation!Standard regression coefficient (SRC)} 
    4722 \index{Correlation!Standard rank regression coefficient (SRRC)} 
    4723  
    4724  
    4725 \requirements{ 
    4726   \begin{description} 
    4727     \item[$\bullet$] a first numerical sample : {\itshape inputSample}, may be of dimension >1 
    4728     \item[type] : NumericalSample 
    4729     \item[$\bullet$] a second numerical sample : {\itshape outputSample}, must be of dimension =1 
    4730     \item[type] : NumericalSample 
    4731   \end{description} 
    4732 
    4733 
    4734   \begin{description} 
    4735     \item[$\bullet$] the different correlation coefficients : {\itshape PCCcoefficient, PRCCcoefficient, SRCcoefficient, SRRCcoefficient, pearsonCorrelation, spearmanCorrelation} 
    4736     \item[type] : NumericalPoint 
    4737   \end{description} 
    4738 
    4739  
    4740 \espace 
    4741 Python script for this UseCase : 
    4742  
    4743 \begin{lstlisting} 
    4744 # PCC coefficients evaluated between the outputSample and each coordinate of inputSample  
    4745    PCCcoefficient = CorrelationAnalysis.PCC(inputSample, outputSample) 
    4746  
    4747 # PRCC evaluated between the outputSample and each coordinate of inputSample (based on the rank values)  
    4748    PRCCcoefficient = CorrelationAnalysis.PRCC(inputSample, outputSample) 
    4749  
    4750 # SRC evaluated between the outputSample and each coordinate of inputSample  
    4751    SRCcoefficient = CorrelationAnalysis.SRC(inputSample, outputSample) 
    4752  
    4753 # SRRC evaluated between the outputSample and each coordinate of inputSample (based on the rank values)  
    4754    SRRCcoefficient = CorrelationAnalysis.SRRC(inputSample, outputSample) 
    4755  
    4756 # Pearson Correlation Coefficient 
    4757 # CARE :  inputSample must be of dimension 1 
    4758    pearsonCorrelation = CorrelationAnalysis.PearsonCorrelation(inputSample, outputSample) 
    4759  
    4760 # Spearman Correlation Coefficient 
    4761 # CARE :  inputSample must be of dimension 1 
    4762     spearmanCorrelation = CorrelationAnalysis.SpearmanCorrelation(inputSample, outputSample) 
    4763 \end{lstlisting} 
    4764  
    4765  
    4766  
    4767  
    4768 \subsubsection{UC : Moments evaluation from the Taylor variance decomposition method and evaluation of the importance factors associated} 
    4769  
    4770 \index{Quadratic Cumul} 
    4771 \index{Graph!Quadratic Cumul importance factors} 
     4884The Use Case  \ref{correlationAnalysis} describes the correlation analysis we can perform between the input random  vector, described by a numerical sample, and the output variable of interest described by a numerical sample too. 
     4885 
     4886 
     4887 
     4888\subsubsection{UC : Moments evaluation from the Taylor variance decomposition method (or Quadratic Cumul method) and evaluation of the importance factors associated} 
     4889 
     4890\index{Taylor variance decomposition (Quadratic Cumul)} 
     4891\index{Quadratic Cumul (Taylor variance decomposition)} 
     4892\index{Graph!Taylor variance decomposition (Quadratic Cumul) importance factors} 
    47724893\index{Graph Manipulation!ViewImage} 
    47734894\index{Graph Manipulation!Show} 
     
    47774898\requirements{ 
    47784899  \begin{description} 
    4779     \item[$\bullet$] the random input vector : {\itshape input} 
    4780     \item[type] : RandomVector which implementation is a UsualRandomVector 
    4781     \item[$\bullet$] the output variable of interest : {\itshape output} 
     4900    \item[$\bullet$] the output variable of interest : {\itshape output}, which may be of dimension $\geq 1$ 
    47824901    \item[type] : RandomVector which implementation is a CompositeRandomVector 
    47834902  \end{description} 
     
    47854904{ 
    47864905  \begin{description} 
    4787     \item[$\bullet$] Moments (order 1, 2, 3) of the variable of interest and its components 
     4906    \item[$\bullet$] Mean and covariance of the variable of interest 
    47884907    \item[type] : NumericalPoint, Matrix 
    47894908    \item[$\bullet$] Importance factors from quadratical cumul method only for {\itshape output} of dimension 1 
     
    48574976 
    48584977 
     4978 
     4979 
     4980\subsubsection{UC : Moments evaluation a random sample of the output variable of interest} 
     4981 
     4982\index{Sample Statistics!Moments evaluation} 
     4983\index{Graph!Taylor variance decomposition (Quadratic Cumul) importance factors} 
     4984\index{Graph Manipulation!ViewImage} 
     4985\index{Graph Manipulation!Show} 
     4986 
     4987The objective of this UC  is to evaluate the mean and standard deviation of the output variable of interest by generating a random sample of the output variable of interest and evaluate the empirical indicators from that sample.\\ 
     4988 
     4989\requirements{ 
     4990  \begin{description} 
     4991    \item[$\bullet$] the output variable of interest : {\itshape output}, which may be of dimension $\geq 1$ 
     4992    \item[type] : RandomVector which implementation is a CompositeRandomVector 
     4993  \end{description} 
     4994} 
     4995{ 
     4996  \begin{description} 
     4997    \item[$\bullet$] Mean and covariance of the variable of interest 
     4998    \item[type] : NumericalPoint, CovarianceMatrix 
     4999  \end{description} 
     5000} 
     5001 
     5002\espace 
     5003Python script for this UseCase : 
     5004 
     5005\begin{lstlisting} 
     5006# Create a random sample of the output variabe of interest of size 1000 
     5007    size = 1000 
     5008    outputSample = output.getNumericalSample(size) 
     5009 
     5010# Get the empirical mean  
     5011    empiricalMean = outputSample.computeMean() 
     5012    print "Empirical Mean = ", empiricalMean 
     5013 
     5014# Get the empirical covariance matrix 
     5015    empiricalCovarianceMatrix = outputSample.computeCovariance() 
     5016    print "Empirical Covariance Matrix = ", empiricalCovarianceMatrix 
     5017 
     5018# Get the standard deviation of the i-th component of the output variabe of interest 
     5019    # Import the sqrt functionality from the math python library 
     5020    from math import sqrt 
     5021    for i in range(output.getDimension()) :  
     5022       print "Standard deviation of component", i+1,  " = ", sqrt(empiricalCovarianceMatrix[i,i]) 
     5023\end{lstlisting} 
     5024\espace 
     5025 
     5026 
     5027 
     5028 
     5029 
     5030\subsubsection{UC : Correlation analysis on samples : Pearson and Spearman coefficients, PCC, PRCC, SRC, SRRC coefficients}\label{correlationAnalysis} 
     5031 
     5032\index{Correlation!Pearson correlation coefficient} 
     5033\index{Correlation!Partial Pearson correlation coefficient (PCC)} 
     5034\index{Correlation!Spearman correlation coefficient} 
     5035\index{Correlation!Partial rank correlation coefficient (PRCC)} 
     5036\index{Correlation!Standard regression coefficient (SRC)} 
     5037\index{Correlation!Standard rank regression coefficient (SRRC)} 
     5038 
     5039 
     5040This Use Case  describes the correlation analysis we can perform between the input random  vector, described by a numerical sample, and the output variable of interest described by a numerical sample too.\\ 
     5041 
     5042\requirements{ 
     5043  \begin{description} 
     5044    \item[$\bullet$] a first numerical sample : {\itshape inputSample}, may be of dimension >1 
     5045    \item[type] : NumericalSample 
     5046    \item[$\bullet$] a second numerical sample : {\itshape outputSample}, must be of dimension =1 
     5047    \item[type] : NumericalSample 
     5048  \end{description} 
     5049} 
     5050{ 
     5051  \begin{description} 
     5052    \item[$\bullet$] the different correlation coefficients : {\itshape PCCcoefficient, PRCCcoefficient, SRCcoefficient, SRRCcoefficient, pearsonCorrelation, spearmanCorrelation} 
     5053    \item[type] : NumericalPoint 
     5054  \end{description} 
     5055} 
     5056 
     5057\espace 
     5058Python script for this UseCase : 
     5059 
     5060\begin{lstlisting} 
     5061# PCC coefficients evaluated between the outputSample and each coordinate of inputSample  
     5062   PCCcoefficient = CorrelationAnalysis.PCC(inputSample, outputSample) 
     5063 
     5064# PRCC evaluated between the outputSample and each coordinate of inputSample (based on the rank values)  
     5065   PRCCcoefficient = CorrelationAnalysis.PRCC(inputSample, outputSample) 
     5066 
     5067# SRC evaluated between the outputSample and each coordinate of inputSample  
     5068   SRCcoefficient = CorrelationAnalysis.SRC(inputSample, outputSample) 
     5069 
     5070# SRRC evaluated between the outputSample and each coordinate of inputSample (based on the rank values)  
     5071   SRRCcoefficient = CorrelationAnalysis.SRRC(inputSample, outputSample) 
     5072 
     5073# Pearson Correlation Coefficient 
     5074# CARE :  inputSample must be of dimension 1 
     5075   pearsonCorrelation = CorrelationAnalysis.PearsonCorrelation(inputSample, outputSample) 
     5076 
     5077# Spearman Correlation Coefficient 
     5078# CARE :  inputSample must be of dimension 1 
     5079    spearmanCorrelation = CorrelationAnalysis.SpearmanCorrelation(inputSample, outputSample) 
     5080\end{lstlisting} 
     5081 
     5082 
     5083 
     5084 
     5085 
     5086 
     5087 
    48595088\subsubsection{UC : Quantile estimations : Wilks and empirical estimators} 
    48605089 
    48615090 
    4862 \index{Quantile!Empirical estimation
     5091\index{Quantile!Empirical estimation
    48635092\index{Quantile!Wilks estimation} 
    48645093\index{Wilks} 
     
    50035232This section gives elements to create events in the physical space {\itshape Event} and in the standard space {\itshape StandardEvent}.\\ 
    50045233 
    5005 The example here is the output variable {\itshape output} defined from the limit state function {\itshape poutre} defined in  Eq.(\ref{equatPoutre}) and the random input vector $(E,F,L,I)$. The event considered is :  
     5234The example here is the output variable {\itshape output} defined from the limit state function {\itshape poutre} defined in  Eq.(\ref{equatPoutre}) and the input random vector $(E,F,L,I)$. The event considered is :  
    50065235$$ 
    50075236myEvent = \{ (E,F,L,I) \in \mathbb{R}^4 / poutre(E,F,L,I) \leq -1.5\}. 
     
    50485277This section gives elements to manipulate an {\itshape StandardEvent} in Open TURNS .\\ 
    50495278  
    5050 The example here is an output variable {\itshape output} defined from the limit state function {\itshape f} and the random input vector {\itshape input}. The event considered is :  
     5279The example here is an output variable {\itshape output} defined from the limit state function {\itshape f} and the input random vector {\itshape input}. The event considered is :  
    50515280$$ 
    50525281myEvent = \{ output=f(input) \leq -1.5 \}. 
     
    51125341\requirements{ 
    51135342  \begin{description} 
    5114     \item[$\bullet$] the random input vector : {\itshape input} 
     5343    \item[$\bullet$] the input random vector : {\itshape input} 
    51155344    \item[type] : RandomVector which implementation is a UsualRandomVector 
    51165345    \item[$\bullet$] the output variable of interest : {\itshape output} of dimension 1 
     
    53735602\requirements{ 
    53745603  \begin{description} 
    5375     \item[$\bullet$] the random input vector : {\itshape input} 
     5604    \item[$\bullet$] the input random vector : {\itshape input} 
    53765605    \item[type] : RandomVector which implementation is a UsualRandomVector 
    53775606    \item[$\bullet$] the output variable of interest of dimension 1 : {\itshape output}  
     
    57085937# Draw the convergence graph and the confidence intervalle of level alpha 
    57095938    # By default, alpha = 0.95 
    5710     alpha = 0.95 
    5711     convergenceGraph = myAlgo.drawProbabilityConvergence(0.90
     5939    alpha = 0.90 
     5940    convergenceGraph = myAlgo.drawProbabilityConvergence(alpha
    57125941 
    57135942    # Impose a bounding box : x-range and y-range 
     
    59246153# Draw the convergence graph and the confidence intervalle of level alpha 
    59256154   # By default, alpha = 0.95 
    5926    alpha = 0.95 
    5927    convergenceGraph = myAlgo.drawProbabilityConvergence(0.90
     6155   alpha = 0.90 
     6156   convergenceGraph = myAlgo.drawProbabilityConvergence(alpha
    59286157 
    59296158  # Impose a bounding box : x-range and y-range 
     
    60106239# Draw the convergence graph and the confidence intervalle of level alpha 
    60116240   # By default, alpha = 0.95 
    6012    alpha = 0.95 
    6013    convergenceGraph2 = myAlgo2.drawProbabilityConvergence(0.90
     6241   alpha = 0.90 
     6242   convergenceGraph2 = myAlgo2.drawProbabilityConvergence(alpha
    60146243 
    60156244   # Impose a bounding box : x-range and y-range 
     
    61536382# Draw the convergence graph and the confidence intervalle of level alpha 
    61546383   # By default, alpha = 0.95 
    6155    alpha = 0.95 
    6156    convergenceGraph = myAlgo1.drawProbabilityConvergence(0.90
     6384   alpha = 0.90 
     6385   convergenceGraph = myAlgo1.drawProbabilityConvergence(alpha
    61576386 
    61586387   # Impose a bounding box : x-range and y-range 
     
    62286457# Draw the convergence graph and the confidence intervalle of level alpha 
    62296458   # By default, alpha = 0.95 
    6230    alpha = 0.95 
    6231    convergenceGraph = myAlgo2.drawProbabilityConvergence(0.90
     6459   alpha = 0.90 
     6460   convergenceGraph = myAlgo2.drawProbabilityConvergence(alpha
    62326461 
    62336462   # Impose a bounding box : x-range and y-range 
     
    62706499\subsection{UC : Linear and Quadratic Taylor approximations} 
    62716500 
    6272 \index{ResponseSurface!Linear Taylor approximation} 
    6273 \index{ResponseSurface!Quadratic Taylor approximation} 
    6274 \index{ResponseSurface!Linear least squares approximation} 
     6501\index{Response Surface!Linear Taylor approximation} 
     6502\index{Response Surface!Quadratic Taylor approximation} 
     6503\index{Response Surface!Linear least squares approximation} 
    62756504 
    62766505This section details the first method to construct a response surface : from the linear or quadratic Taylor approximations of the function at a particular point.\\ 
     
    63406569 
    63416570 
    6342 \index{ResponseSurface!Linear least squares approximation} 
     6571\index{Response Surface!Linear least squares approximation} 
    63436572\index{Random Generator} 
    63446573 
     
    64016630 
    64026631 
    6403 \index{ResponseSurface!Linear least squares approximation} 
     6632\index{Response Surface!Linear least squares approximation} 
    64046633\index{Random Generator} 
    64056634 
     
    66256854 
    66266855 
    6627  
    6628  
    6629  
    6630 \newpage 
    6631 \section{Annexe 1 :  One example of a complete study} 
    6632  
    6633 \subsection{Presentation of the study case} 
    6634  
    6635 This Annexe presents several Use Cases described previoulsy in order to show one example of a complete study. \\ 
    6636 This example has been presented in the ESREL 2007 conference in the paper : {\itshape Open TURNS, an Open source initiative to Treat Uncertainties, Risks'N Statistics in a structured industrial approach}, from A. Dutfoy(EDF R\&D), I. Dutka-Malen(EDF R\&D), R. Lebrun (EADS innovation Works) \& all.\\ 
    6637  
    6638 Let's consider the following analytical example of a cantilever beam, of Young's modulus $E$, length $L$, section modulus $I$. One end is built in a wall and we apply a concentrated bending load at the other end of the beam. The deviation (vertical displacement) y of the free end is equal to :  
    6639 $$ 
    6640 y(E, F, L, I) = \frac{FL^3}{3EI} 
    6641 $$ 
    6642  
    6643 \begin{figure}[Hhbtp] 
    6644 \begin{center} 
    6645   \psfrag{F}{F} 
    6646   \psfrag{E}{E} 
    6647   \psfrag{L}{L} 
    6648   \psfrag{I}{I} 
    6649   \psfrag{a}{a} 
    6650   \psfrag{e}{e} 
    6651   \includegraphics[width=10cm]{poutre.pdf} 
    6652 \end{center} 
    6653 \caption{cantilever beam under a ponctual bending load.} 
    6654 \end{figure} 
    6655  
    6656  
    6657 The objective of this UC is to evaluate the influence of uncertainties on the input data $(E, F, L, I)$ on the deviation $y$.\\ 
    6658 We consider a steel beam with a hollow square section of length $a = 2. e-2 m$ and of thickness $t=1.e-3 m$. Thus, the flexion section inertie of the beam is equal to $I = 2.47e-9 m^4$. The beam length is $L = 1 m$. The Young's modulus $E$ is $E = 2.1e11 kg.m^{-1}.s^{-2}$. The charge applied is $F = 10 kg.m.s^{-2}$.\\ 
    6659 The random modelisation of the input data is the following one : we consider for each input data a gaussian distribution, which mean $\mu$ is the deterministic value given above and which standard deviation is a percentile of the mean :  
    6660 \begin{itemize} 
    6661   \item[$\bullet$] E  = Gaussian($\mu_E$, 5\% * $\mu_E$)  
    6662   \item[$\bullet$] F  = Gaussian($\mu_F$, 10\% * $\mu_F$) 
    6663   \item[$\bullet$] L  = Gaussian($\mu_L$, 1\% * $\mu_L$) 
    6664   \item[$\bullet$] I  = Gaussian($\mu_I$, 1\% * $\mu_I$) 
    6665 \end{itemize} 
    6666 \vspace*{0.5cm} 
    6667 This example treats the following points of the methodology :  
    6668 \begin{itemize} 
    6669   \item[$\bullet$] Deterministic Study : Min/Max study 
    6670 \begin{itemize} 
    6671   \item with a deterministic experiment plane, 
    6672   \item with a random experiment plane, 
    6673 \end{itemize} 
    6674   \item[$\bullet$] Random Study : central tendance of the output variable of interest 
    6675 \begin{itemize} 
    6676   \item Taylor variance decomposition, 
    6677   \item Random sampling, 
    6678 \end{itemize} 
    6679   \item[$\bullet$] Random Study : threshold exceedance: deviation <-1cm 
    6680 \begin{itemize} 
    6681   \item FORM, 
    6682   \item SORM,, 
    6683   \item Monte Carlo simulation method, 
    6684   \item Directional Sampling method, 
    6685   \item Latin HyperCube Sampling method, 
    6686   \item Importance Sampling method 
    6687   \item Kernel Smoothing Fitting. 
    6688 \end{itemize} 
    6689 \end{itemize} 
    6690  
    6691  
    6692  
    6693 \subsection{The TUI File} 
    6694  
    6695  
    6696 \begin{lstlisting} 
    6697 #! /usr/bin/env python 
    6698  
    6699 from openturns import * 
    6700  
    6701 from math import * 
    6702  
    6703 from openturns_viewer import ViewImage 
    6704  
    6705 # This function enables a pretty print of a NumericalPoint 
    6706 def printNumericalPoint(point, digits) : 
    6707   oss = "[" 
    6708   eps = pow(0.1, digits) 
    6709   for i in range(point.getDimension()) : 
    6710     if i == 0 : 
    6711       sep = "" 
    6712     else : 
    6713       sep = "," 
    6714     if fabs(point[i]) < eps : 
    6715       oss += sep + str(fabs(point[i])) 
    6716     else : 
    6717       oss += sep + str(point[i]) 
    6718     sep = "," 
    6719   oss += "]"  
    6720   return oss 
    6721  
    6722  
    6723 ########################################### 
    6724 ### Fonction 'poutre' 
    6725 ########################################### 
    6726  
    6727 # We create a numerical math function  
    6728 myFunction = NumericalMathFunction("poutre") 
    6729  
    6730  
    6731 ########################################### 
    6732 ### Random input vector 
    6733 ########################################### 
    6734  
    6735  
    6736  
    6737 dim = myFunction.getInputNumericalPointDimension() 
    6738  
    6739 # We create a normal distribution point of dimension 4 
    6740 mean = NumericalPoint(dim, 0.0) 
    6741 # E : steel : 210000 MPa 
    6742 mean[0] = 2.1e11 
    6743 # F : 1kg : 10N 
    6744 mean[1] =  10.0 
    6745 # L : 1 m 
    6746 mean[2] = 1.0 
    6747 # I : square hollow section of width 2 cm and thickness 1mm : 2.47325 e-9 
    6748 mean[3] =  2.47325e-9 
    6749 sigma = NumericalPoint(dim, 1.0) 
    6750 # E : 5% * mean 
    6751 sigma[0] = 0.05 *  mean[0] 
    6752 # F : 10% * mean 
    6753 sigma[1] = 0.1 * mean[1] 
    6754 # L : 1% * mean 
    6755 sigma[2] = 0.01 * mean[2] 
    6756 # I : 1% * mean 
    6757 sigma[3] = 0.01 * mean[3] 
    6758  
    6759 R = IdentityMatrix(dim) 
    6760 myDistribution = Normal(mean, sigma, R) 
    6761  
    6762  
    6763 input = RandomVector(myDistribution) 
    6764  
    6765 output =  RandomVector(myFunction, input) 
    6766  
    6767  
    6768 ########################################### 
    6769 ### Deterministic Study 
    6770 ########################################### 
    6771  
    6772  
    6773 print "####################" 
    6774 print " Deterministic Study" 
    6775 print "####################" 
    6776  
    6777 print "deterministic evaluation at the mean point : " 
    6778 print "deviation(mean point) = ", myFunction(mean) 
    6779  
    6780  
    6781 #################################################### 
    6782 # Min/Max study with deterministic experiment plane 
    6783 #################################################### 
    6784  
    6785 print "###################################################" 
    6786 print " Min/Max study with deterministic experiment plane" 
    6787 print "###################################################" 
    6788  
    6789  
    6790 # Creation of the structure of the experiment plane : type Axial  
    6791  
    6792 # On each direction separately, several levels are evaluated 
    6793 # here,  3 levels : +/-1, +/-3, +/-5 from the center 
    6794 levelsNumber = 3 
    6795 levels = NumericalPoint(levelsNumber, 0.0, "Levels") 
    6796 levels[0] = 1 
    6797 levels[1] = 3 
    6798 levels[2] = 5 
    6799 # Creation of the axial plane 
    6800 myPlane = Axial(dim, levels) 
    6801 print "myPlane = " , myPlane 
    6802  
    6803 # Generation of points according to the structure of the experiment plane  
    6804 # (in a reduced centered space)  
    6805 inputSample = myPlane.generate() 
    6806  
    6807 # Scaling of the structure of the experiment plane 
    6808 # scaling vector for each dimension of the levels of the structure  
    6809 # to take into account the dimension of each component 
    6810 # for example : the standard deviation of each component of 'input'  
    6811 # in case of a RandomVector 
    6812 scaling = NumericalPoint(dim) 
    6813 scaling[0] = sqrt(input.getCovariance()[0,0]) 
    6814 scaling[1] = sqrt(input.getCovariance()[1,1]) 
    6815 scaling[2] = sqrt(input.getCovariance()[2,2]) 
    6816 scaling[3] = sqrt(input.getCovariance()[3,3]) 
    6817 print "sigma = ", scaling 
    6818 inputSample.scale(scaling) 
    6819 print "centered Sample = ", inputSample 
    6820  
    6821 # Translation of the nonReducedSample onto the center of the experiment plane 
    6822 # center = mean point of the input distribution 
    6823 center = input.getMean() 
    6824 inputSample.translate(center) 
    6825 print "inputSample = ", inputSample 
    6826 pointNumber = inputSample.getSize() 
    6827 print "points number = ", pointNumber 
    6828  
    6829 outputSample = myFunction(inputSample) 
    6830  
    6831 minValue = outputSample.getMin() 
    6832 maxValue = outputSample.getMax() 
    6833  
    6834 print " From an axial  experiment plane of size = ", pointNumber 
    6835 print "levels = ", levels 
    6836 print "min Value = ", minValue[0] 
    6837 print "max Value = ", maxValue[0] 
    6838 print "" 
    6839  
    6840 ###########