Python reference: ExtremeStatistics

The class ExtremeStatistics is the Python interface to the OrcaFlex extreme statistics results analysis functions. This class encapsulates the following functions from the C API:

The documentation for C_OpenExtremeStatistics describes the process of performing an extreme statistics analysis. In the Python interface the typical call sequence would be:

Construction

This class is normally created by calling the OrcaFlexObject function ExtremeStatistics, for example:

extremeStats = model.environment.ExtremeStatistics("Elevation", objectExtra=oeEnvironment(0,0,0))

This call would create an ExtremeStatistics object from a wave elevation time history. This class can also be created directly:

extremeStats = ExtremeStatistics(values, sampleInterval)

Here, the values parameter is an array of values and sampleInterval the time interval (in seconds) between them. The constructor calls the C API function C_OpenExtremeStatistics.

Properties and functions

Fit

Fit(specification)

This function fits the distribution specified in the specification parameter. The specification parameter is an instance of the Python class ExtremeStatisticsSpecification that represents the C API structure TExtremeStatisticsSpecification and has the same fields. A specification can be obtained by calling the OrcFxAPI module helper functions RayleighStatisticsSpecification() and LikelihoodStatisticsSpecification(). This function calls the C API function C_FitExtremeStatistics.

ExcessesOverThresholdCount

ExcessesOverThresholdCount(specification=None)

This function returns the number of excesses over the threshold specified in specification. If ExtremeStatistics.Fit() has just been called then the specification parameter can be omitted. This function calls the C API function C_CalculateExtremeStatisticsExcessesOverThreshold.

ExcessesOverThreshold

ExcessesOverThreshold(specification=None)

This function returns an array of excess values over the threshold specified in specification. If ExtremeStatistics.Fit() has just been called then the specification parameter can be omitted. This function calls the C API function C_CalculateExtremeStatisticsExcessesOverThreshold.

ToleranceIntervals

ToleranceIntervals(simulatedDataSetCount=1000)

This function calls the C API function C_SimulateToleranceIntervals to simulate tolerance intervals for the fitted distribution. The simulatedDataSetCount parameter specifies the number of simulated data sets used to generate the tolerance intervals. If omitted the default value of 1000 is used, which is the value used by OrcaFlex. The function returns an array of tuples of lower and upper interval limits.

Query

Query(query)

This function is called to query the extreme statistics data once the distribution has been fitted. The query parameter is an instance of the class ExtremeStatisticsQuery that represents the C API structure TExtremeStatisticsQuery. An instance of this class is obtained by calling the OrcFxAPI module helper functions RayleighStatisticsQuery() and LikelihoodStatisticsQuery(). The result returned by this function is an instance of the class ExtremeStatisticsOutput which has the same attributes as the C API structure TExtremeStatisticsOutput.