コード例 #1
0
cloud1.setColor("orange")
cloud1.setLineWidth(2)
graph.add(cloud1)

size = 150 - size

# Data
x2 = ot.Uniform(1.0, 9.0).getSample(size)
y2 = ot.Uniform(0.0, 120.0).getSample(size)
# Merge with previous data
x = ot.Sample(x1)
y = ot.Sample(y1)
x.add(x2)
y.add(y2)
# Quadratic model
algo = ot.QuadraticLeastSquares(x, y)
algo.run()
quadratic = algo.getMetaModel()

graph = ot.Graph("Null Spearman coefficient", "u", "v", True, "")
graph.add(cloud1)
cloud2 = ot.Cloud(x2, y2)
cloud2.setPointStyle("square")
cloud2.setColor("blue")
cloud2.setLineWidth(2)
graph.add(cloud2)
curve2 = ot.Curve(x, quadratic(x))
curve2.setColor("black")
curve2.setLineWidth(2)
graph.add(curve2)
コード例 #2
0
point[0] = 1
point[1] = 1
data[4] = point
point[0] = -0.5
point[1] = -0.5
data[5] = point
point[0] = -0.5
point[1] = 0.5
data[6] = point
point[0] = 0.5
point[1] = -0.5
data[7] = point
point[0] = 0.5
point[1] = 0.5
data[8] = point
myLeastSquares = ot.QuadraticLeastSquares(data, myFunc)
myLeastSquares.run()
responseSurface = myLeastSquares.getResponseSurface()
print("myLeastSquares=", repr(myLeastSquares))
print("responseSurface=", repr(responseSurface))
inPoint = ot.NumericalPoint(myFunc.getInputDimension(), 0.2)
print("myFunc(", repr(inPoint), ")=", repr(myFunc(inPoint)))
print("responseSurface(", repr(inPoint), ")=", repr(responseSurface(inPoint)))
dataOut = myFunc(data)
myLeastSquares = ot.QuadraticLeastSquares(data, dataOut)
myLeastSquares.run()
responseSurface = myLeastSquares.getResponseSurface()
print("myLeastSquares=", repr(myLeastSquares))
print("responseSurface=", repr(responseSurface))
inPoint = ot.NumericalPoint(myFunc.getInputDimension(), 0.2)
print("myFunc(", repr(inPoint), ")=", repr(myFunc(inPoint)))