CalibrationStrategy

class CalibrationStrategy(*args)

Calibration strategy.

Available constructors:

CalibrationStrategy(range)

CalibrationStrategy(range=[0.117, 0.468], expansionFactor=1.2, shrinkFactor=0.8, calibrationStep=100)

Parameters
rangeInterval of dimension 1 [m,M]

Acceptance rate values for which no update of the calibration coefficient is performed.

expansionFactorfloat, e > 1

Expansion factor e to use to rescale the calibration coefficient if the latter is too high (greater than the upper bound of range).

shrinkFactorfloat, 0 < s < 1

Shrink factor s to use to rescale the calibration coefficient if the latter is too low (smaller than the lower bound of range). If expansionFactor is specified, shrinkFactor must be mentioned too.

calibrationSteppositive int

Calibration step corresponding for example to q in the description of the method getCalibrationStrategyPerComponent() of the RandomWalkMetropolisHastings class.

Notes

A CalibrationStrategy can be used by a RandomWalkMetropolisHastings for example (see the description of the method getCalibrationStrategyPerComponent() ).

Methods

computeUpdateFactor(self, rho)

Compute the update factor.

getCalibrationStep(self)

Get the calibration step.

getClassName(self)

Accessor to the object’s name.

getExpansionFactor(self)

Get the expansion factor.

getId(self)

Accessor to the object’s id.

getImplementation(self)

Accessor to the underlying implementation.

getName(self)

Accessor to the object’s name.

getRange(self)

Get the range.

getShrinkFactor(self)

Get the shrink factor.

setCalibrationStep(self, calibrationStep)

Set the calibration step.

setExpansionFactor(self, expansionFactor)

Set the expansion factor.

setName(self, name)

Accessor to the object’s name.

setRange(self, range)

Set the range.

setShrinkFactor(self, shrinkFactor)

Set the shrink factor.

__init__(self, \*args)

Initialize self. See help(type(self)) for accurate signature.

computeUpdateFactor(self, rho)

Compute the update factor.

Parameters
rhofloat

Acceptance rate \rho to take into account.

Returns
lambdafloat

Let \lambda be the calibration coefficient to update, it gives a factor \phi(\rho) such that \phi(\rho) \lambda is the updated calibration coefficient according to the strategy. The value is computed as follows:

\phi(\rho) = \left\{
         \begin{array}{l}
             \displaystyle s  \quad if \; \rho < m \\
             \displaystyle e  \quad if \; \rho > M \\
             \displaystyle 1  \quad otherwise
         \end{array}
         \right.

with s \in ]0, 1[, e > 1 and [m,M] the values given, respectively, by the methods getShrinkFactor(), getExpansionFactor() and getRange().

Examples

>>> import openturns as ot
>>> calibration = ot.CalibrationStrategy(ot.Interval(0.1, 0.4), 1.2, 0.8)
>>> print(calibration.computeUpdateFactor(0.09))
0.8
>>> print(calibration.computeUpdateFactor(0.6))
1.2
>>> print(calibration.computeUpdateFactor(0.18))
1.0
getCalibrationStep(self)

Get the calibration step.

Returns
steppositive int

Calibration step corresponding for example to q in the description of the method getCalibrationStrategyPerComponent() of the RandomWalkMetropolisHastings class.

getClassName(self)

Accessor to the object’s name.

Returns
class_namestr

The object class name (object.__class__.__name__).

getExpansionFactor(self)

Get the expansion factor.

Returns
expansionFactorfloat

Expansion factor e. See the description of the method computeUpdateFactor().

getId(self)

Accessor to the object’s id.

Returns
idint

Internal unique identifier.

getImplementation(self)

Accessor to the underlying implementation.

Returns
implImplementation

The implementation class.

getName(self)

Accessor to the object’s name.

Returns
namestr

The name of the object.

getRange(self)

Get the range.

Returns
rangeInterval of dimension 1

Range [m,M] in the description of the method computeUpdateFactor().

getShrinkFactor(self)

Get the shrink factor.

Returns
shrinkFactorfloat

Shrink factor s in the description of the method computeUpdateFactor().

setCalibrationStep(self, calibrationStep)

Set the calibration step.

Parameters
steppositive int

Calibration step corresponding for example to q in the description of the method getCalibrationStrategyPerComponent() of the RandomWalkMetropolisHastings class.

setExpansionFactor(self, expansionFactor)

Set the expansion factor.

Parameters
expansionFactorfloat, e > 1

Expansion factor e. See the description of the method computeUpdateFactor().

setName(self, name)

Accessor to the object’s name.

Parameters
namestr

The name of the object.

setRange(self, range)

Set the range.

Parameters
rangeInterval of dimension 1

Range [m,M] in the description of the method computeUpdateFactor().

setShrinkFactor(self, shrinkFactor)

Set the shrink factor.

Parameters
shrinkFactorfloat, 0 < s < 1

Shrink factor s in the description of the method computeUpdateFactor().