UQWorld

Setting the value of certain parameters (PCE)

Suppose that a PCE metamodel has been trained using an input of N parameters with uniform distribution, e.g. [0,1]. Is it possible to quickly update this model by setting a constant value for M (M<N) of its parameters?

Ultimately, what I want is to avoid having to train a different PCE model each time I set a constant value to certain parameters. This will aid greatly in studying the change of Sobol’ indices with respect to time. So far, I have to train a different PCE model for each point in time, but it would be much faster if i could just set the value of time on the PCE model (implying that the PCE metamodel has been trained with a distribution of time as one of its inputs) and then calculate the Sobol’ indices based on that.

I hope that my idea made sense and am looking forward to your suggestions

1 Like

Hi @ChrisP,

welcome to UQWorld! :slight_smile:

The easiest solution I see is to write a wrapper function around your PCE model, which takes an N-1-dimensional vector as input, and sets one of the parameters to the desired constant value. You can use this as your new model and compute MC-based Sobol indices. This is cheap since evaluating the PCE is very fast. (Make sure to implement a vectorized wrapper, and set newmodelopts.IsVectorized = True.)

Or, if you really need this lower-dimensional PCE object, you can use the property that a polynomial with one dimension set to constant is still a polynomial. So you could evaluate your N-dim PCE many times (it’s cheap anyways) and use this as data to fit another PCE corresponding to another input object myInputConst which is the same as myInput, but with one dimension set to a constant value. It could look like this:

ioptsConst = ioptsOrig; % copy the original input options object
ioptsConst.Marginals(1).Type = 'constant';
ioptsConst.Marginals(1).Parameters = 0.155;
ioptsConst.Marginals(1).Moments = [];
myInputConst = uq_createInput(ioptsConst);

Xconst = uq_getSample(myInputConst, 1000); % draw samples from the new input object
Yconst = uq_evalModel(myPCE, Xconst); % evaluate your N-dim PCE

% re-use MetaOpts from creation of myPCE: same settings
MetaOpts.Input = myInputConst; % make sure the PCE uses the new input object

MetaOpts.ExpDesign.X = Xconst;
MetaOpts.ExpDesign.Y = Yconst;

myPCEconst = uq_createModel(MetaOpts); % should have an LOO of ~1e-30 (exact fit)

Regarding using time as an input parameter: is time in your application really a random variable? With what distribution? Is time continuous or discrete? There are most likely better approaches than using time as an input RV. If you could describe your problem in more detail, we might be able to suggest something. Also have a look at these two questions about surrogating of time-dependent models:

I hope this helps, let us know how you proceed! :slight_smile:

1 Like