From d51700ab53b58bed6a741ffaf36335a9b66f2816 Mon Sep 17 00:00:00 2001 From: Lazloo Date: Thu, 9 Jun 2016 16:41:17 +0200 Subject: [PATCH] 20160609 1. Interpolation results for "nD-Interpolation" are now accessible 2. "plotScreeningAnalysis" can now be used for displaying optimal regions 3. Debug "plotParetoFront" 4. Debug MCMC with Slice algorithm: Respects now upper/lower bounds of input variable Signed-off-by: Lazloo --- dependencies/@AnalyzeKriging/plotParetoFront.m | 13 ++++++++++++- .../@AnalyzeKriging/plotScreeningAnalysis.m | 2 ++ .../MCMCDistributionFctSlice.m | 4 ++++ .../@BayesianOptimization/calcNewSamplesViaMCMC.m | 4 ++-- .../mcmcstat/{boxplot.m => boxplotMCMCStat.m} | 0 5 files changed, 20 insertions(+), 3 deletions(-) rename dependencies/auxiliaryFunctions/externalTools/mcmcstat/{boxplot.m => boxplotMCMCStat.m} (100%) diff --git a/dependencies/@AnalyzeKriging/plotParetoFront.m b/dependencies/@AnalyzeKriging/plotParetoFront.m index 5ecd1ab..19d390d 100644 --- a/dependencies/@AnalyzeKriging/plotParetoFront.m +++ b/dependencies/@AnalyzeKriging/plotParetoFront.m @@ -18,7 +18,8 @@ % You can set: % - ShowBounds: Decide if Confidence bounce should be shown % - ShowData: Decide if the data used for the kriging model shall be -% plotted +% plotted. For more information see documentation of +% "plotParetoFrontData" % - WidthConfidenceInterval: Decide how broad the condicence tube should % be. This is related to normal % distribution(mean value +- @@ -77,6 +78,11 @@ objectOpt = findobj(gca,'DisplayName','Optimal Sample Points'); objectNonOptExtra = findobj(gca,'DisplayName','Non-optimal Extra Points'); objectOptExtra = findobj(gca,'DisplayName','OptimalExtra Points'); + else + objectOpt = []; + objectNonOpt = []; + objectOptExtra = []; + objectNonOptExtra = []; end case 3 % Check if "gridFit" is available @@ -125,6 +131,11 @@ objectOpt = findobj(gca,'DisplayName','Optimal Sample Points'); objectNonOptExtra = findobj(gca,'DisplayName','Non-optimal Extra Points'); objectOptExtra = findobj(gca,'DisplayName','OptimalExtra Points'); + else + objectOpt = []; + objectNonOpt = []; + objectOptExtra = []; + objectNonOptExtra = []; end otherwise error('plotParetoFront is not implemented for more than 3 objectives') diff --git a/dependencies/@AnalyzeKriging/plotScreeningAnalysis.m b/dependencies/@AnalyzeKriging/plotScreeningAnalysis.m index cf13245..bed8e9b 100644 --- a/dependencies/@AnalyzeKriging/plotScreeningAnalysis.m +++ b/dependencies/@AnalyzeKriging/plotScreeningAnalysis.m @@ -12,6 +12,8 @@ % - Objective ... decide if the Kriging estimation ('KrigingInterpolation'), the expected % improvement ('ExpectedImprovement') or optimal regions % ('Optimum') shall be plotted +% - testValue ... if Objective = 'Optimum', testValue can be used as +% described in plotOptimum23D() % % % Output: - diff --git a/dependencies/@BayesianOptimization/MCMCDistributionFctSlice.m b/dependencies/@BayesianOptimization/MCMCDistributionFctSlice.m index 55af582..0ef9a26 100644 --- a/dependencies/@BayesianOptimization/MCMCDistributionFctSlice.m +++ b/dependencies/@BayesianOptimization/MCMCDistributionFctSlice.m @@ -30,6 +30,8 @@ boolIsValid = boolIsValid&~bsxfun(@gt,estimationPoints,obj.UBInputVarInterpolation{obj.ObjectiveIndicesUsedByCalcNewSamplesViaMCMC(1)}); else boolIsValid = true(nParameterSets,1); + boolIsValid = boolIsValid&~any(bsxfun(@lt,estimationPoints,obj.LBInputVarInterpolation{obj.ObjectiveIndicesUsedByCalcNewSamplesViaMCMC(1)})); + boolIsValid = boolIsValid&~any(bsxfun(@gt,estimationPoints,obj.UBInputVarInterpolation{obj.ObjectiveIndicesUsedByCalcNewSamplesViaMCMC(1)})); end probabilityDensity = log(0)*ones(nParameterSets,1); @@ -43,6 +45,8 @@ obj.ObjectiveIndicesUsedByCalcNewSamplesViaMCMC,... estimationPoints(boolIsValid,:))); end +% else +% keyboard end end diff --git a/dependencies/@BayesianOptimization/calcNewSamplesViaMCMC.m b/dependencies/@BayesianOptimization/calcNewSamplesViaMCMC.m index ea8b456..83a4c2c 100644 --- a/dependencies/@BayesianOptimization/calcNewSamplesViaMCMC.m +++ b/dependencies/@BayesianOptimization/calcNewSamplesViaMCMC.m @@ -103,7 +103,7 @@ case 'Slice' % Initialize Input Variables - randIniSample = rand(nInputVar,1).*(obj.UBInputVarInterpolation{firstKrigingIndex} - ... + randIniSample = rand(1,nInputVar).*(obj.UBInputVarInterpolation{firstKrigingIndex} - ... obj.LBInputVarInterpolation{firstKrigingIndex}) + ... obj.LBInputVarInterpolation{firstKrigingIndex}; @@ -114,7 +114,7 @@ sampleMatrix = slicesample(randIniSample,... obj.getnMCMCLinks,... 'logpdf',distributionFct,... - 'width',((obj.UBInputVarInterpolation{firstKrigingIndex}-obj.LBInputVarInterpolation{firstKrigingIndex})/5)'); + 'width',((obj.UBInputVarInterpolation{firstKrigingIndex}-obj.LBInputVarInterpolation{firstKrigingIndex})/5)); % Cutting out sampleMatrixCutted = sampleMatrix(obj.nCutLinks+1:end,:); diff --git a/dependencies/auxiliaryFunctions/externalTools/mcmcstat/boxplot.m b/dependencies/auxiliaryFunctions/externalTools/mcmcstat/boxplotMCMCStat.m similarity index 100% rename from dependencies/auxiliaryFunctions/externalTools/mcmcstat/boxplot.m rename to dependencies/auxiliaryFunctions/externalTools/mcmcstat/boxplotMCMCStat.m