VisualTest_DrawLinearModel

(Source code, png, hires.png, pdf)

../../_images/VisualTest_DrawLinearModel.png
VisualTest_DrawLinearModel(sample1, sample2, linearModelResult)

Draw a linear model plot.

Parameters
sample1, sample22-d sequence of float

Samples to draw.

linearModelResultLinearModelResult

Linear model to plot.

Returns
graphGraph

The graph object

Examples

>>> import openturns as ot
>>> from openturns.viewer import View
>>> ot.RandomGenerator.SetSeed(0)
>>> dimension = 2
>>> R = ot.CorrelationMatrix(dimension)
>>> R[0, 1] = 0.8
>>> distribution = ot.Normal([3.0] * dimension, [2.0]* dimension, R)
>>> size = 100
>>> sample2D = distribution.getSample(size)
>>> firstSample = ot.Sample(size, 1)
>>> secondSample = ot.Sample(size, 1)
>>> for i in range(size):
...     firstSample[i] = ot.Point(1, sample2D[i, 0])
...     secondSample[i] = ot.Point(1, sample2D[i, 1])
>>> lmtest = ot.LinearModelAlgorithm(firstSample, secondSample).getResult()
>>> drawLinearModelVTest = ot.VisualTest.DrawLinearModel(firstSample, secondSample, lmtest)
>>> View(drawLinearModelVTest).show()