Nom

polychaos — A class to manage a Polynomial Chaos expansion.

SYNOPSIS

 tokenmatrix = polychaos_tokens () 
 nb = polychaos_size () 
 pc = polychaos_new ( file )
 pc = polychaos_new ( srv , ny )
 pc = polychaos_new ( pc , nopt , varopt )
 polychaos_destroy (pc) 
 polychaos_settarget ( pc , k , j , output )
 polychaos_settarget ( pc , k , output ) 
 polychaos_settarget ( pc , output ) 
 polychaos_setsizetarget ( pc , np )
 polychaos_setinput ( pc , ivar , invalue )
 polychaos_setinput ( pc , invalue )
 polychaos_setgroupempty ( pc )
 polychaos_setgroupaddvar ( pc , ivar )
 polychaos_setdimoutput ( pc , ny )
 polychaos_setdegree ( pc , no )
 polychaos_setanova ( pc )
 polychaos_save ( pc , file )
 polychaos_realisation ( pc )
 polychaos_readtarget ( pc , file )
 polychaos_propagateinput ( pc )
 polychaos_propagateinput ( pc , inputvector )
 polychaos_getvariance ( pc , ovar )
 polychaos_getvariance ( pc )
 output = polychaos_gettarget ( pc , k , j )
 output = polychaos_gettarget ( pc , k )
 output = polychaos_gettarget ( pc )
 np = polychaos_getsizetarget ( pc )
 polychaos_getsample ( pc , k , ovar )
 polychaos_getquantile ( pc , k )
 polychaos_getsample ( pc )
 polychaos_getquantwilks ( pc , walpha , wbeta , ovar )
 polychaos_getquantwilks ( pc , walpha , wbeta )
 polychaos_getquantile ( pc , alpha , ovar )
 polychaos_getquantile ( pc , alpha )
 polychaos_getoutput ( pc , ovar )
 polychaos_getoutput ( pc )
 polychaos_getmultind ( pc )
 polychaos_getmean ( pc , ovar )
 polychaos_getmean ( pc )
 polychaos_getlog ( pc )
 polychaos_getinvquantile ( pc , threshold , ovar )
 polychaos_getinvquantile ( pc , threshold )
 polychaos_getindextotal ( pc , ivar , ovar )
 polychaos_getindextotal ( pc , ivar )
 polychaos_getindextotal ( pc )
 polychaos_getindexfirst ( pc , ivar , ovar )
 polychaos_getindexfirst ( pc , ivar )
 polychaos_getindexfirst ( pc )
 polychaos_getgroupinter ( pc , ovar )
 polychaos_getgroupinter ( pc )
 polychaos_getgroupind ( pc , ovar )
 polychaos_getgroupind ( pc )
 ny = polychaos_getdimoutput ( pc )
 nx = polychaos_getdiminput ( pc )
 p = polychaos_getdimexp ( pc )
 no = polychaos_getdegree ( pc )
 polychaos_getcovariance ( pc , ovar1 , ovar2 )
 polychaos_getcovariance ( pc )
 polychaos_getcorrelation ( pc , ovar1 , ovar2 )
 polychaos_getcorrelation ( pc )
 polychaos_getanovaordco ( pc , threshold , r )
 polychaos_getanovaordco ( pc , threshold )
 polychaos_getanovaord ( pc )
 polychaos_getanova ( pc )
 polychaos_getanova ( pc , r )
 polychaos_generatecode ( pc , filename , funname )
 polychaos_freememtarget ( pc )
 polychaos_freememory ( pc )
 polychaos_computeoutput ( pc , input )
 polychaos_computeoutput ( pc )
 polychaos_computeexp ( pc , srv , method )
 polychaos_computeexp ( pc , pc2 , invalue , varopt )
 polychaos_buildsample ( pc , type , np , order )

Description

The polychaos_new function allows to create a new polynomial. The polychaos_destroy function allows to destroy an existing polynomial.

The polychaos_new function returns a token which is a unique identifier for the new polynomial. Indeed, when a new polynomial is created, a counter is updated which corresponds to the returned token. This way, each token is unique and can correspond only to one single polynomial.

The functions polychaos_tokens and polychaos_size allow to manage the polynomials which have already been created. The function polychaos_size returns the number of polynomials, while the polychaos_tokens function returns the list of current polynomials.

Groups of variables

TODO

Compute the polynomial output for a given input.

TODO

Functions

The following functions are available.

tokenmatrix = polychaos_tokens ()

Returns a 1x(n) matrix containing the tokens of current polynomials, where n is the number of polynomials.

n = polychaos_size ()

Returns a 1x(n) matrix containing the tokens of current polynomials, where n is the number of polynomials.

pc = polychaos_new ( srv , ny )

Creates a new PolynomialChaos based on given SetRandomVariable srv and number of output ny.

pc = polychaos_new ( pc , nopt , varopt )

Create a new polychaos from another polychaos and an array of integers varopt with size nopt.

pc = polychaos_new ( file )

Creates a new polychaos from a data file.

polychaos_destroy (pc)

Destroys the current polynomial.

polychaos_settarget ( pc , k , j , output )

Set the output value for experiment #k and output #j, where 1 ≤ k ≤ np and 1 ≤ j ≤ ny

polychaos_settarget ( pc , k , output )

Set the output for experiment #k to the matrix output, where 1 ≤ k ≤ np, where np is the number of experiments and output is a matrix with size 1 x (ny), where ny is the number of output random variables.

polychaos_settarget ( pc , output )

Set the output matrix where output is a matrix with size (np) x (ny), where np is the number of experiments and ny is the number of ouput random variables.

polychaos_setsizetarget ( pc , np )

Set the number of experiments to np.

polychaos_setinput ( pc , ivar , value )

Set the input of input variable #ivar to value, where 1 ≤ ivar ≤ nx, where nx is the number of input random variables.

polychaos_setinput ( pc , invalue )

Set the input as a 1 x (nx) matrix, where nx is the number of input random variables.

polychaos_setgroupempty ( pc )

Setup an empty group of input random variables.

polychaos_setgroupaddvar ( pc , ivar )

Adds an input variable ivar to the group, with 1 ≤ ivar ≤ nx, where nx is the number of input random variables.

polychaos_setdimoutput ( pc , ny )

Set the number of output random variables to ny.

polychaos_setdegree ( pc , no )

Set the degree of the polynomial.

polychaos_setanova ( pc )

Computes the anova.

polychaos_save ( pc , file )

Saves the polynomial chaos into file.

polychaos_realisation ( pc )

TODO

polychaos_readtarget ( pc , file )

Read the output of the experiments from the file.

polychaos_propagateinput ( pc )

Propagate an input which has been set with the setinput method.

polychaos_propagateinput ( pc , inputvector )

Propagate the given input data, where value is a 1 x (nx) matrix, with nx the number of input random variables.

polychaos_getvariance ( pc , ovar )

Returns the variance of the output variable which index is ovar, where 1 ≤ ovar ≤ ny.

polychaos_getvariance ( pc )

Returns the variance of the all output variables, as a 1 x (ny) matrix, where ny is the number of output random variables.

output = polychaos_gettarget ( pc , k , j )

Returns the output value for experiment #k and input random variable #j, where 1 ≤ k ≤ np and 1 ≤ j ≤ nx

output = polychaos_gettarget ( pc , k )

returns the output value for experiment #k and input #j, where 1 ≤ k ≤ np where output is a 1 x (nx) matrix with nx the number of input random variables.

output = polychaos_gettarget ( pc )

Returns the output matrix as a (np) x (nx) matrix, where np is the number of experiments and nx is the number of input random variables.

np = polychaos_getsizetarget ( pc )

Returns the number of experiments.

polychaos_getsample ( pc , k , ovar )

Returns the sample of experiment #k, where 1 ≤ k ≤ np, for output variable #ovar, where 1 ≤ ovar ≤ ny

polychaos_getsample ( pc , k )

Returns the sample of experiment #k, where 1 ≤ k ≤ np, as a (1) x ny matrix, where ny is the number of output random variables.

polychaos_getsample ( pc )

Returns the sampling as a (np) x (ny) matrix, where np is the number of experiments and ny is the number of output random variables.

polychaos_getquantwilks ( pc , walpha , wbeta , ovar )

Returns the Wilks quantile of order alpha for output variable #ovar, where 1 ≤ ovar ≤ ny

polychaos_getquantwilks ( pc , walpha , wbeta )

Returns the Wilks quantiles of order alpha for all output variables, as a (1) x ny matrix, where ny is the number of output random variables.

polychaos_getquantile ( pc , alpha , ovar )

Returns the quantile of order alpha for output random variable #ovar, where 1 ≤ ovar ≤ ny, where ny is the number of output random variables.

polychaos_getquantile ( pc , alpha )

Returns the quantiles of order alpha for all output variables, as a (1) x ny matrix, where ny is the number of output random variables.

polychaos_getoutput ( pc , ovar )

Returns the output for output variable #ovar, where 1 ≤ ovar ≤ ny, where ny is the number of output random variables.

polychaos_getoutput ( pc )

Returns the outputs for all output variables, as a (1) x ny matrix, where ny is the number of output random variables.

polychaos_getmultind ( pc )

Prints the multiple indices.

polychaos_getmean ( pc , ovar )

Returns the mean of the output variable which index is ovar, where 1 ≤ ovar ≤ ny, where ny is the number of output random variables.

polychaos_getmean ( pc )

Returns the mean of the all output variables, as a 1 x (ny) matrix, where ny is the number of output random variables.

polychaos_getlog ( pc )

Prints out a log of current polynomial.

polychaos_getinvquantile ( pc , threshold , ovar )

Returns the probability of having an output variable ovar over a given threshold, where 1 ≤ ovar ≤ ny with ny the number of output random variables.

polychaos_getinvquantile ( pc , threshold )

returns the probability of having an output variable over a given threshold, as a 1 x (ny) matrix with ny the number of output random variables.

polychaos_getindextotal ( pc , ivar , ovar )

Returns the total index for the input variable #ivar and the output variable #ovar, where 1≤ ivar ≤ nx with nx the number of input random variables and 1 ≤ ovar ≤ ny with ny the number of output random variables.

polychaos_getindextotal ( pc , ivar )

Returns the total index of the input variable #ivar and the output variable #ovar=1, where 1 ≤ ivar ≤ nx with nx the number of input random variables.

polychaos_getindextotal ( pc )

Returns all total indices, as a (nx) x (ny) matrix with nx the number of input random variables and ny the number of output random variables.

polychaos_getindexfirst ( pc , ivar , ovar )

Returns the first index order of the input variable #ivar and the output variable #ovar, where 1 ≤ ivar ≤ nx and 1 ≤ ovar ≤ ny, with nx the number of input random variables and ny the number of output random variables.

polychaos_getindexfirst ( pc , ivar )

Returns the first index order of the input variable #ivar and the output variable #ovar=1, where 1 ≤ ivar ≤ nx, with nx the number of input random variables.

polychaos_getindexfirst ( pc )

returns all first index order indices, as a (nx) x (ny) matrix, with nx the number of input random variables and ny the number of output random variables.

polychaos_getgroupinter ( pc , ovar )

Returns the interaction indice of an output variable ovar, where 1 ≤ ovar ≤ ny, where ny is the number of output random variables.

polychaos_getgroupinter ( pc )

Returns all interaction indices, as a 1 x (ny) matrix, where ny is the number of output random variables.

polychaos_getgroupind ( pc , ovar )

Returns the sensitivity indice of an output variable ovar, where 1 ≤ ovar ≤ ny, where ny is the number of output random variables.

polychaos_getgroupind ( pc )

Returns all sensitivity indices, as a 1 x (ny) matrix, where ny is the number of output random variables.

ny = polychaos_getdimoutput ( pc )

Returns the number of output random variables.

nx = polychaos_getdiminput ( pc )

Returns the number of input random variables.

p = polychaos_getdimexp ( pc )

Returns the dimension of the expansion.

no = polychaos_getdegree ( pc )

Returns the degree of the polynomial.

polychaos_getcovariance ( pc , ovar1 , ovar2 )

returns the covariance of the output random variables #ovar1 and #ovar2, where 1 ≤ ovar1, ovar2 ≤ ny, where ny is the number of output random variables.

polychaos_getcovariance ( pc )

Returns the covariance of the all output variables, as a (ny) x (ny) matrix, where ny is the number of output random variables.

polychaos_getcorrelation ( pc , ovar1 , ovar2 )

returns the correlation of the output random variables #ovar1 and #ovar2, where 1 ≤ ovar1, ovar2 ≤ ny, where ny is the number of output random variables.

polychaos_getcorrelation ( pc )

Returns the correlation of the all output variables, as a (ny) x (ny) matrix, where ny is the number of output random variables.

polychaos_getanovaordco ( pc , threshold , r )

Prints out the anova ordered coefficients (TODO : what is treshold ? What is r ?).

polychaos_getanovaordco ( pc , threshold )

Prints out the anova ordered coefficients (TODO : what is treshold ?).

polychaos_getanovaord ( pc )

Prints out the anova ordered coefficients.

polychaos_getanova ( pc )

Prints out the anova.

polychaos_getanova ( pc , r )

Prints out the anova (TODO : what is r ?).

polychaos_generatecode ( pc , filename , funname )

Generates the source code to compute the polynomial chaos into the file filename. The generated function name is funname.

polychaos_freememtarget ( pc )

Free the memory associated with the output of the experiments.

polychaos_freememory ( pc )

Free the memory of the polynomial (TODO : what is the difference between freememory and freememtarget ?).

polychaos_computeoutput ( pc , input )

Propagate the input matrix with size 1 x (nx) where nx is the number of input random variables and compute the output y.

polychaos_computeoutput ( pc )

Computes the output y with size ny, where ny is the number of output random variables.

polychaos_computeexp ( pc , srv , method )

Computes the coefficients of the polynomial chaos expansion where srv is a setrandvar token and method is a string representing the computation algorithm.

The list of possible values for the string method is :

  • "Integration"
  • "Regression"

polychaos_computeexp ( pc , pc2 , invalue , varopt )

Compute the coefficient based on another polynomial chaos (TODO : what is varopt ? What is invalue ?).

polychaos_buildsample ( pc , type , np , order )

Build an internal sampling of given type, with np experiments with order. (TODO : what is order ?)

The list of possible values for the input argument "type" is the following.

  • "MonteCarlo"
  • "Lhs"
  • "QmcSobol"
  • "Quadrature"
  • "Petras"
  • "SmolyakGauss"
  • "SmolyakTrapeze"
  • "SmolyakFejer"
  • "SmolyakClenshawCurtis"

Example

TODO

Bibliography

TODO

Authors

Jean-Marc Martinez, 2009, CEA

Michael Baudin, 2009, Digiteo