Nom

overview — An overview of the NISP toolbox.

Purpose

The goal of this toolbox is to provide Non Intrusive Spectral Projection method. It is related to the polynomial chaos tool in the OPUS platform, which received funding from the French National Research Agency (Agence Nationale de la Recherche). This toolbox is released under the LGPL licence.

Design

The internal design of the system is based on the following components :

  • “nisp” provides function to configure the global behaviour of the toolbox. This allows to startup and shutdown the library, configure and quiery the verbose level or initialize the seed of the random number generator.

  • “randvar” is the class which allows to manage a random variable. Various types of random variables are available, including uniform, normal, exponential, etc...

  • “setrandvar”, is the class which allows to manage a set of random variables. Several methods are available to build a sampling from a set of random variables. We can use, for example, a Monte-Carlo sampling or a Sobol low discrepancy sequence. This feature allows to use the class as Design of Experiment tool (DOE).

  • “polychaos” is the class which allows to manage a polynomial chaos expansion. The coefficients of the expansion are computed based on given numerical experiments which creates the association between the inputs and the outputs. Once computed, the expansion can be used as a regular function. The mean, standard deviation or quantile can also be directly retrieved.

The current toolbox provides an object-oriented approach of the C++ NISP library. This object oriented approach allows to manage objects, even if the Scilab language itself is not currently object-oriented (August 2009). This way, the Scilab toolbox accurately reflects the C++ library, without the need to manage memory (this is performed by the toolbox). To achieve this goal, the interface uses a hash map, which stores the map between integer tokens and the address of the associated C++ objects.

The current toolbox is a stand-alone component which uses only standard Scilab features.

Features

The following list presents the features provided by the NISP toolbox :

  • Manage various types of random variables :

    • uniform,

    • normal,

    • exponential,

    • log-normal,

  • Generate random numbers from a given random variable,

  • Transform an outcome from a given random variable into another,

  • Manage various sampling methods for sets of random variables,

    • Monte-Carlo,

    • Sobol,

    • Latin Hypercube Sampling,

    • various samplings based on Smolyak.

  • Manage polynomial chaos expansion and get specific outputs, including

    • mean,

    • variance,

    • quantile,

    • correlation, etc...

  • Generate the C source code which computes the output of the polynomial chaos expansion.

TODO

  • manage other low-discrepancy sequences, such as Halton, Faure, etc...

Example : (TODO)

In the following example, we compute the polynomial chaos expansion of a very simple function, taking two input variables and returning one output variable. The output result is computed by the Exemple function as the product of the two inputs. The first variable is associated with a Normal law, while the second is associated with a Uniform law.

      //
      // "Spécifications scientifiques et informatiques : Chaos Polynomial"
      // D-WP1/08/01/A
      // MARTINEZ JM. - CEA
      //
      function y = Exemple (x)
        y(1) = x(1) * x(2);
      endfunction
      // 4.1 Représentation des paramètres incertains
      vu1 = randvar_new("Normale",1.0,0.5);
      vu2 = randvar_new("Uniforme",1.0,2.5);
      srvu = setrandvar_new();
      setrandvar_addrandvar ( srvu,vu1);
      setrandvar_addrandvar ( srvu,vu2);
      // Représentation des variables stochastiques
      vx1 = randvar_new("Normale");
      vx2 = randvar_new("Uniforme");
      srvx = setrandvar_new();
      setrandvar_addrandvar ( srvx,vx1);
      setrandvar_addrandvar ( srvx,vx2);
      ny = 1;
      pc = polychaos_new ( srvx , ny );
      // 4.3 Plan d'expériences numériques
      degre = 2;
      setrandvar_buildsample(srvx,"Quadrature",degre);
      setrandvar_buildsample( srvu , srvx );
      // 4.4 Réalisation du plan d'expériences numériques
      np = setrandvar_getsize(srvx);
      polychaos_setsizetarget(pc,np);
      nx = polychaos_getdiminput(pc);
      ny = polychaos_getdimoutput(pc);
      for k=1:np
      inputdata = setrandvar_getsample(srvu,k);
      outputdata = Exemple(inputdata);
      polychaos_settarget(pc,k,outputdata);
      end
      // 4.5 Calcul des coefficients
      polychaos_setdegree(pc,degre);
      polychaos_computeexp(pc,srvx,"Integration");
      // 4.6 Edition de l'analyse de sensibilité
      average = polychaos_getmean(pc);
      var = polychaos_getvariance(pc);
      mprintf("Mean    = %f\n",average);
      mprintf("Variance    = %f\n",var);
      mprintf("Indice de sensibilité du 1er ordre\n");
      mprintf("    Variable X1 = %f\n",polychaos_getindexfirst(pc,1));
      mprintf("    Variable X2 = %f\n",polychaos_getindexfirst(pc,2));
      mprintf("Indice de sensibilite Totale\n");
      mprintf("    Variable X1 = %f\n",polychaos_getindextotal(pc,1));
      mprintf("    Variable X2 = %f\n",polychaos_getindextotal(pc,2));
      // Clean-up
      polychaos_destroy(pc);
      randvar_destroy(vu1)
      randvar_destroy(vu2)
      randvar_destroy(vx1)
      randvar_destroy(vx2)
      setrandvar_destroy(srvu);
      setrandvar_destroy(srvx);
    

Authors

Jean-Marc Martinez, 2008-2009 (NISP library)

Michael Baudin, 2008-2009 (interface to the NISP library)

Acknowledgments

Allan Cornet

Bibliography

GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html

"Librairie NISP - Modélisation probabiliste d?incertitudes par développement en chaos polynomial", JM. Martinez, CEA, RAPPORT DM2S, SFME/LGLS/RT/09-007/A

See Also

nisp, randvar, setrandvar, polychaos