pyamr.metrics.weights
Classes
- class pyamr.metrics.weights.SigmoidA(r=200, g=0.5, offset=0.0, scale=1.0, percentiles=None, thresholds=None)[source]
Methods:
approximated_sigmoid
(x[, x_curves])This function computes the approximated sigmoid.
threshold
(r, x[, thresholds])This function thresholds the r given the values of x.
weights
(x)This cuntion computes the weights.
weights_percentile
(x, percentiles)This function returns the weights.
This function returns the weights.
- approximated_sigmoid(x, x_curves=None)[source]
This function computes the approximated sigmoid.
Note: The approximated sigmoid is defined within the interval [0,1].
- Parameters:
x (numpy.array) – The values to be converted to weights.
x_curves (tuple) – The values indicating where the low/upper curves should start.
- Returns:
r – The weights.
- Return type:
numpy.array
- threshold(r, x, thresholds=(None, None))[source]
This function thresholds the r given the values of x.
- Parameters:
x (numpy.array) – The values to be converted to weights.
r (numpy.array) – The weights to be thresholded.
threshold_low (number;) – The values in x lower will have minimum weight.
treshold_high (number;) – The values in x higher will have maximum weight.
- weights(x)[source]
This cuntion computes the weights.
- Parameters:
x
x_percentiles
x_threshold_low
x_threshold_high
Examples using pyamr.metrics.weights.SigmoidA
Step 04 - TSA to estimate trends
Using weighted least squares (WLS)