# Reliability analysis by AkMCS.PCK

**URL:** <https://uqworld.org/t/reliability-analysis-by-akmcs-pck/732>\
**Category:** Community Q&A and How To\
**Tags:** reliability\
**Created:** [July 7, 2020, 5:19pm UTC](https://uqworld.org/t/reliability-analysis-by-akmcs-pck/732 "2020-07-07T17:19:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdollahi](https://uqworld.org/user_avatar/uqworld.org/abdollahi/32/440_2.png) [@Abdollahi](https://uqworld.org/u/Abdollahi)\
**Post date:** [July 7, 2020, 5:19pm UTC](https://uqworld.org/t/reliability-analysis-by-akmcs-pck/732/1 "2020-07-07T17:19:00Z")

</div>

Hello everyone,

I try to solve the reliability problem with more random variables (\>10) with ‘AKMCS’ based on ‘PCK’. The options are used follows as:

APCKMCSOpts.Type = ‘Reliability’;  
APCKMCSOpts.Method = ‘AKMCS’;  
APCKMCSOpts.AKMCS.MetaModel = ‘PCK’;  
APCKMCSOpts.AKMCS.IExpDesign.Sampling = ‘LHS’;  
APCKMCSOpts.AKMCS.MaxAddedED = 20;  
APCKMCSOpts.AKMCS.IExpDesign.N = 20;  
APCKMCSOpts.AKMCS.PCK.Kriging.Corr.Family = ‘Gaussian’;  
% APCKMCSOpts.LARS.LarsEarlyStop=50;  
APCKMCSOpts.AKMCS.Convergence=‘stopPf’;  
APCKMCSOpts.Simulation.MaxSampleSize = 1e6;  
myAPCKMCSAnalysis = uq\_createAnalysis(APCKMCSOpts);

I get this warning:

Warning: Warning: numerical instability!! Gamma for LAR  
iteration 17 was set to 0 to prevent crashes.

> In uq\_lar (line 269)  
> In uq\_PCE\_lars (line 60)  
> In uq\_PCE\_calculate\_coefficients\_regression (line 197)  
> In uq\_PCE\_calculate\_coefficients (line 47)  
> In uq\_calculateMetamodel (line 18)  
> In uq\_initialize\_uq\_metamodel (line 358)  
> In uq\_core\_module/run\_initialization\_script  
> In uq\_core\_model/add\_module  
> In uq\_createModel  
> In uq\_PCK\_calculate\_coefficients (line 88)  
> In uq\_calculateMetamodel (line 24)  
> In uq\_initialize\_uq\_metamodel (line 358)  
> In uq\_core\_module/run\_initialization\_script  
> In uq\_core\_model/add\_module  
> In uq\_createModel  
> In uq\_akmcs (line 110)  
> In uq\_reliability (line 62)  
> In uq\_analysis/run  
> In uq\_runAnalysis  
> In uq\_initialize\_uq\_reliability (line 633)  
> In uq\_core\_module/run\_initialization\_script  
> In uq\_core\_analysis/add\_module  
> In uq\_createAnalysis  
> In DARMM\_ver1\_Temporal\_1 (line 303)

I did a change in uq\_lar.m based on @nluethen comments:

After line 224 of uq\_lar, I added the line:  
Pinv(Psi(:,a\_coeff)’\*Psi(:,a\_coeff));

But my problem is not solved.  
Also, I used this option “LarsEarlyStop” and it was not worked for reliability analysis.  
Could anyone help me to understand my mistake?

Best Regards,

---

<div class="post-metadata">

**Author:** ![nluethen](https://uqworld.org/user_avatar/uqworld.org/nluethen/32/218_2.png) [@nluethen](https://uqworld.org/u/nluethen)\
**Post date:** [July 14, 2020, 8:32am UTC](https://uqworld.org/t/reliability-analysis-by-akmcs-pck/732/2 "2020-07-14T08:32:57Z")

</div>

Hi @Abdollahi,

The warning can sometimes appear, typically when your data does not contain enough information for LARS to select the regressors properly. Can you find out when the warning appears, is it already in the first iteration of AKMCS? It seems you are specifying 20 initial points and 20 additional points for AKMCS in more than 10 dimensions, so only 40 points in total, that might be too little to get a reasonable answer!

The [change in uq\_lar.m](https://uqworld.org/t/after-update-receiving-error-in-uq-blockwise-inverse/238) that you mention also had to do with data/design matrix problems, but doesn’t have to do with this warning, so it won’t change anything in your case.

Regarding your second question,

> [@Abdollahi](#):
>
> I used this option “LarsEarlyStop” and it was not worked for reliability analysis.

I am not sure what you mean with that (how did you notice it was not used?) But can it be that `LARS` should be a field of `APCKMCSOPTS.AKMCS.PCK` instead of being a field of `APCKMCSOpts`?

~~By the way, the line `APCKMCSOpts.Simulation.MaxSampleSize = 1e6;` is only valid for MC-based reliability and will probably be ignored.~~ Sorry, I was wrong about that, see [Reliability Analysis manual](https://uqftp.ethz.ch/uqlab_doc_pdf/1.3.0/UserManual_Reliability.pdf), p. 40.

Let us know whether this helped solve your problems. Good luck! 🙂
