DrawEvent

class DrawEvent(event, insideEventPointColor='lightsalmon3', outsideEventPointColor='darkseagreen3', insideEventFillColor='lightsalmon1', outsideEventFillColor='darkseagreen1')

Methods

buildCrossCutFunction(i, j)

Create the cross-cut parametric function for projection (i,j).

draw(bounds[, sampleSize, nX, nY, ...])

Draw the event, superimposing the graphics.

drawInputOutputSample(inputSample, outputSample)

Draw the sample of an event.

drawLimitState(bounds[, nX, nY])

Draw the limit state of an event.

drawLimitStateCrossCut(bounds[, i, j, nX, nY])

Draw the cross-cut of the limit state of an event on a cross-cut.

drawSample(sampleSize)

Draw the sample of an event.

drawSampleCrossCut(sampleSize[, i, j])

Draw the sample of an event on a cross-cut.

fillEvent(bounds[, nX, nY])

Draw the sample of an event.

fillEventCrossCut(bounds[, i, j, nX, nY])

Fill the space inside an event with a color on a cross-cut.

__init__(event, insideEventPointColor='lightsalmon3', outsideEventPointColor='darkseagreen3', insideEventFillColor='lightsalmon1', outsideEventFillColor='darkseagreen1')

Create an event with draw services.

The limit state function must be in dimension > 1 only.

Parameters:
eventan ot.Event

The event we want to draw.

insideEventPointColora string

The color of the points inside the event. Suggested colors: “forestgreen”, “darkolivegreen”.

outsideEventPointColora string

The color of the points outside of the event. Suggested colors: “orange”, “orangered”.

insideEventFillColora string

The color of the filled domains inside the event.

outsideEventFillColora string

The color of the filled domains outside of the event.

buildCrossCutFunction(i, j)

Create the cross-cut parametric function for projection (i,j).

The parametric function is the event function where the only free variables are (X[i], X[j]) and other variables are set to the mean point.

We must have i < j, otherwise the function would be evaluated at the wrong input X.

Parameters:
iint

The index of the first marginal of the cross-cut.

jint

The index of the second marginal of the cross-cut.

Returns:
crosscutFunctionot.Function

The cross-cut function.

draw(bounds, sampleSize=1000, nX=50, nY=50, drawLimitState=True, drawSample=True, fillEvent=False)

Draw the event, superimposing the graphics.

Parameters:
sampleSize: int

The sample size.

bounds: an ot.Interval

The lower and upper bounds of the cross-cut interval.

nXint

The number of points in the X axis.

nYint

The number of points in the Y axis.

drawLimitStatebool

If True, draw the limit state surface.

drawSamplebool

If True, draw the sample.

fillEventbool

If True, fill the event.

Returns:
figMatplotlib.figure

The plot.

drawInputOutputSample(inputSample, outputSample)

Draw the sample of an event. The points inside and outside the event are colored.

Parameters:
inputSample: an ot.Sample

The input 2D sample.

outputSample: an ot.Sample

The output 1D sample.

Returns
——-
None.
drawLimitState(bounds, nX=50, nY=50)

Draw the limit state of an event.

This produces a matrix of cross cuts.

Parameters:
bounds: an ot.Interval

The lower and upper bounds of the interval.

nXan int

The number of points in the X axis.

nYan int

The number of points in the Y axis.

Returns:
figmatplotlib.figure

The plot.

drawLimitStateCrossCut(bounds, i=0, j=1, nX=50, nY=50)

Draw the cross-cut of the limit state of an event on a cross-cut.

Parameters:
bounds: an ot.Interval

The lower and upper bounds of the cross-cut interval.

iint

The index of the first marginal of the cross-cut.

jint

The index of the second marginal of the cross-cut.

nXan int

The number of points in the X axis.

nYan int

The number of points in the Y axis.

Returns:
graphot.Graph

The plot of the (i, j) cross cut.

drawSample(sampleSize)

Draw the sample of an event.

The points inside and outside the event are colored.

Parameters:
sampleSize: int

The sample size.

Returns:
figMatplotlib.figure

The plot.

drawSampleCrossCut(sampleSize, i=0, j=1)

Draw the sample of an event on a cross-cut.

The points inside and outside the event are colored.

The algorithm uses the getMarginal() method of the distribution in order to create the bivariate distribution. Then the sample is generated from this bivariate distribution. A more rigorous method would draw the conditional distribution, but this might reduce the performance in general. https://github.com/mbaudin47/otbenchmark/issues/47

Parameters:
sampleSize: int

The sample size.

iint

The index of the first marginal of the cross-cut.

jint

The index of the second marginal of the cross-cut.

Returns:
graphot.Graph

The plot.

fillEvent(bounds, nX=50, nY=50)

Draw the sample of an event.

The points inside and outside the event are colored.

Parameters:
sampleSize: int

The sample size.

Returns:
figMatplotlib.figure

The plot.

fillEventCrossCut(bounds, i=0, j=1, nX=50, nY=50)

Fill the space inside an event with a color on a cross-cut.

Parameters:
bounds: an ot.Interval

The lower and upper bounds of the cross-cut interval.

iint

The index of the first marginal of the cross-cut.

jint

The index of the second marginal of the cross-cut.

nXint

The number of points in the X axis.

nYint

The number of points in the Y axis.

Returns:
graphot.Graph

The plot.