bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / stats / _morestats / yeojohnson_normmax
function
scipy.stats._morestats:yeojohnson_normmax
source: build-install/usr/lib/python3.14/site-packages/scipy/stats/_morestats.py:1920
Signature
def yeojohnson_normmax(x, brack = None, *, nan_policy = propagate)Summary
Compute optimal Yeo-Johnson transform parameter.
Extended Summary
Compute optimal Yeo-Johnson transform parameter for input data, using maximum likelihood estimation.
Parameters
x: array_likeInput array.
brack: 2-tuple, optionalThe starting interval for a downhill bracket search with
optimize.brent. Note that this is in most cases not critical; the final result is allowed to be outside this bracket. If None,optimize.fminboundis used with bounds that avoid overflow.nan_policy: {'propagate', 'omit', 'raise'}Defines how to handle input NaNs.
propagate: if a NaN is present in the input, the output will be NaN.omit: NaNs will be omitted when performing the calculation.raise: if a NaN is present, aValueErrorwill be raised.
Returns
maxlog: floatThe optimal transform parameter found.
Notes
Examples
import numpy as np from scipy import stats import matplotlib.pyplot as plt✓
rng = np.random.default_rng() x = stats.loggamma.rvs(5, size=30, random_state=rng) + 5 lmax = stats.yeojohnson_normmax(x)✓
fig = plt.figure() ax = fig.add_subplot(111) prob = stats.yeojohnson_normplot(x, -10, 10, plot=ax)✓
ax.axvline(lmax, color='r')
✗<matplotlib.lines.Line2D object at 0x7f3f60eca7b0>
plt.show()
✓
See also
Aliases
scipy.stats.yeojohnson_normmax