# %% # The algorithm added a point to the right bound of the domain. # %% for krigingStep in range(5): xNew = getNewPoint(xMin, xMax, krigResult) yNew = g(xNew) X.add(xNew) Y.add(yNew) krigResult = createMyBasicKriging(X, Y) graph = plotMyBasicKriging(krigResult, xMin, xMax, X, Y) graph.setTitle("Kriging #%d " % (krigingStep + 1) + graph.getTitle()) View(graph) # %% # We observe that the second added point is the left bound of the domain. The remaining points were added strictly inside the domain where the accuracy was drastically improved. # # With only 10 points, the metamodel accuracy is already very good with a Q2 which is equal to 99.9%. # %% # Conclusion # ---------- # # The current example presents the naive implementation on the creation of a sequential design of experiments based on kriging. More pratical algorithms are presented in the following references. # # * Mona Abtini. Plans prédictifs à taille fixe et séquentiels pour le krigeage (2008). Thèse de doctorat de l'Université de Lyon. # * Céline Scheidt. Analyse statistique d’expériences simulées : Modélisation adaptative de réponses non régulières par krigeage et plans d’expériences (2007). Thèse présentée pour obtenir le grade de Docteur de l’Université Louis Pasteur. # * David Ginsbourger. Sequential Design of Computer Experiments. Wiley StatsRef: Statistics Reference Online, Wiley (2018 ) View.ShowAll()
graph = ot.HistogramFactory().build(sample, 10).drawPDF() # graph.draw('curve3.png') view = View(graph) # view.save('curve3.png') view.show() # QQPlot tests size = 100 normal = ot.Normal(1) sample = normal.getSample(size) sample2 = ot.Gamma(3.0, 4.0, 0.0).getSample(size) graph = ot.VisualTest.DrawQQplot(sample, sample2, 100) # graph.draw('curve4.png') view = View(graph) # view.save('curve4.png') view.ShowAll(block=True) # Clouds tests dimension = 2 R = ot.CorrelationMatrix(dimension) R[0, 1] = 0.8 distribution = ot.Normal(ot.Point(dimension, 3.0), ot.Point(dimension, 2.0), R) size = 100 sample1 = ot.Normal([3.0] * dimension, [2.0] * dimension, R).getSample(size) sample2 = ot.Normal([2.0] * dimension, [3.0] * dimension, R).getSample(size // 2) cloud1 = ot.Cloud(sample1, "blue", "fsquare", "Sample1 Cloud") cloud2 = ot.Cloud(sample2, "red", "fsquare", "Sample2 Cloud") graph = ot.Graph("two samples clouds", "x1", "x2", True, "topright")