deerlab.dipolarpenalty#

dipolarpenalty(Pmodel, r, type, selection=None)[source]#

Construct penalties based on the distance distribution.

This function constructs penalties for a given distance distribution that can be used to impose certain desired properties on the distribution. The type of penalty and the function to optimize it are determined by the type parameter. The selection parameter allows the user to choose a method for optimizing the penalty weight.

Parameters:
PmodelModel object

The model of the distance distribution. If Pmodel is None, a non-parametric distance distribution is assumed.

rarray_like

Distance axis vector, in nanometers. This vector specifies the distances at which the distance distribution is defined.

typestring

Type of property to be imposed by the penalty. This parameter determines the type of penalty that will be constructed, as well as the function that will be optimized to determine the penalty weight. The following values are supported for this parameter:

  • 'smoothness' : Imposes a smoothness constraint on the distance distribution. This penalty is optimized by minimizing the L2 norm of the second derivative of the distribution.

  • 'compactness' : Imposes a compactness constraint on the distance distribution. This penalty is optimized by minimizing the square root of the product of the distance distribution and the square of the difference between the distances and their mean.

selectionstring, optional

Selection functional for the outer optimization of the penalty weight. Possible values:

  • 'aic' - Akaike information criterion

  • 'bic' - Bayesian information criterion

  • 'aicc' - COrrected Akaike information criterion

  • 'icc' - Informational complexity criterion

If no value is provided, 'icc' is used for 'compactness' and 'aic' for 'smoothness'.

Returns:
penaltyPenalty object

Penalty object to be passed to the fit function.