diff --git a/BayesValidRox/tests/PA-A/ffpm_validation_stokespnm.py b/BayesValidRox/tests/PA-A/ffpm_validation_stokespnm.py index c33684ce45611faafab6f8114bdae834e595129a..559da9846c0a66e3f9bc03e77c5ec32c3887a4a4 100755 --- a/BayesValidRox/tests/PA-A/ffpm_validation_stokespnm.py +++ b/BayesValidRox/tests/PA-A/ffpm_validation_stokespnm.py @@ -156,8 +156,8 @@ def run(params, averaging=True,errorPerc=0.05, PCEEDMethod='normal'): # The degree with the lowest Leave-One-Out cross-validation (LOO) # error (or the highest score=1-LOO)estimator is chosen as the final # metamodel. - MetaModelOpts.MinPceDegree = 10 # default = 1 10 - MetaModelOpts.MaxPceDegree = 10 #10 + MetaModelOpts.MinPceDegree = 7 # default = 1 10 + MetaModelOpts.MaxPceDegree = 7 #10 # q-quasi-norm 0<q<1 (default=1) MetaModelOpts.q = 0.75 #np.linspace(0.3,0.6,3) @@ -306,14 +306,15 @@ def run(params, averaging=True,errorPerc=0.05, PCEEDMethod='normal'): # Select the inference method BayesOptsCalib.SamplingMethod = 'MCMC' - # import emcee - # BayesOptsCalib.MCMCmoves = emcee.moves.StretchMove() + import emcee + BayesOptsCalib.MCMCmoves =[(emcee.moves.DEMove(), 0.8), + (emcee.moves.DESnookerMove(), 0.2),] BayesOptsCalib.MCMCnwalkers = 500 #300 # BayesOptsCalib.MCMCnSteps = 1500 #5000 # Maximum a Posteriori based on primary analysis - theta_MAP = np.array([1e-3,5.26480244078e-06,1.7642875191945115e-05, - 35237.668793254459160]) - BayesOptsCalib.MCMCinitSamples = theta_MAP + # theta_MAP = np.array([1e-3,5.26480244078e-06,1.7642875191945115e-05, + # 35237.668793254459160]) + # BayesOptsCalib.MCMCinitSamples = theta_MAP BayesOptsCalib.MAP ='mean' BayesOptsCalib.PlotPostDist = True @@ -366,7 +367,7 @@ def run(params, averaging=True,errorPerc=0.05, PCEEDMethod='normal'): #===================================================== # Plot posterior predictive postPredictiveplot(PCEModel.ModelObj.Name, errorPerc, averaging, case='Calib') - + return BayesCalib #===================================================== #================== VALIDATION ===================== #===================================================== diff --git a/BayesValidRox/tests/PA-A/post_plot.py b/BayesValidRox/tests/PA-A/post_plot.py index 8ecda790b5295885ddbeb876113221f7e4ced273..f49c1694af8fc5423b8ff7c5169039eaee80d230 100755 --- a/BayesValidRox/tests/PA-A/post_plot.py +++ b/BayesValidRox/tests/PA-A/post_plot.py @@ -138,7 +138,7 @@ def postPredictiveplot(modelName, errorPrec, averaging=True, case='Calib', bins= plt.title(title,fontdict=font) fig.subplots_adjust(top=0.95) plotname = OutputName if OutputName == 'p' else 'velocity' - fig.savefig('./'+OutputDir+'/PointID_'+str(idx+1)+'_'+plotname+'.svg', bbox_inches='tight') + # fig.savefig('./'+OutputDir+'/PointID_'+str(idx+1)+'_'+plotname+'.svg', bbox_inches='tight') fig.savefig('./'+OutputDir+'/PointID_'+str(idx+1)+'_'+plotname+'.pdf', bbox_inches='tight') plt.close()