Getting NaN values or Inf when evaluating the PCE model

Hi, everyone

I am using the PCE model to model the input-output relationship. Specifically, my input is defined using kernel estimator and Gaussian copula:

iOpts.Marginals = uq_KernelMarginals(solar_power’);
C = corr(solar_power’,‘Type’, ‘Spearman’);
iOpts.Copula.Type = ‘Gaussian’;
iOpts.Copula.RankCorr = C;
Input=uq_createInput(iOpts);

where solar_power is my data matrix, with 30 dimension and 17520 observations.

Then I force the PCE model to use the Hermite basis by commanding (I think this procedure will automatically uses the Nataf transformation):

MetaOpts.PolyTypes=p;

where p is a 1*30 cell containing ‘Hermite’.

After building the PCE model. I try to evaluate the outputs using my original 17520 observations:

YPC = uq_evalModel(solar_power’);

I found that for most observations, it returns normal values. However, for some observations, e.g., for the 1306th observation, the values of the multiple outputs contain NaN, Inf, -Inf, or normal values.

I am very confused about this. If I have built a PCE model, how can I get NaN or Inf value for a given observation?

Best regards,
Yx W

Hi @YuanXi_Wu,

Thank you for posting here. In general, PCE models should not produce NaN or inf values. Could you please check whether your data contain NaN or inf? If the data is fine, I would suggest that you provide here a minimum working example that can reproduce the issue, so that we could look more into the details of the problem.

Best regards,
Xujia

Dear @xujia ,

Sorry for the late reply. After debugging, I think the problem lies in that the input samples contain NaN or Inf. This is caused by a small bug in the kernel inference in uqlab and has already been fixed in this post by @styfen.schaer.

Thanks for your attention.

Best regards,
Yuanxi Wu