Skip to content
Snippets Groups Projects
Commit 01a73c69 authored by Farid Mohammadi's avatar Farid Mohammadi
Browse files

[PA-A] save post_plot only in pdf format.

parent eab97be2
No related branches found
No related tags found
No related merge requests found
......@@ -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 =====================
#=====================================================
......
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment