hyperspy._components.skew_normal module
- class hyperspy._components.skew_normal.SkewNormal(x0=0.0, A=1.0, scale=1.0, shape=0.0, module=['numpy', 'scipy'], **kwargs)
Bases:
hyperspy._components.expression.Expression
Skew normal distribution component.
Asymmetric peak shape based on a normal distribution.For definition see https://en.wikipedia.org/wiki/Skew_normal_distributionSee also http://azzalini.stat.unipd.it/SN/Variable
Parameter
x0
A
scale
shape
- Parameters
x0 (float) – Location of the peak position (not maximum, which is given by the mode property).
A (float) – Height parameter of the peak.
scale (float) – Width (sigma) parameter.
shape (float) – Skewness (asymmetry) parameter. For shape=0, the normal distribution (Gaussian) is obtained. The distribution is right skewed (longer tail to the right) if shape>0 and is left skewed if shape<0.
**kwargs – Extra keyword arguments are passed to the
Expression
component.
Notes
The properties mean (position), variance, skewness and mode (position of maximum) are defined for convenience.
- estimate_parameters(signal, x1, x2, only_current=False)
Estimate the skew normal distribution by calculating the momenta.
- Parameters
- Return type
Notes
Adapted from Lin, Lee and Yen, Statistica Sinica 17, 909-927 (2007) https://www.jstor.org/stable/24307705
Examples
>>> g = hs.model.components1D.SkewNormal() >>> x = np.arange(-10, 10, 0.01) >>> data = np.zeros((32, 32, 2000)) >>> data[:] = g.function(x).reshape((1, 1, 2000)) >>> s = hs.signals.Signal1D(data) >>> s.axes_manager._axes[-1].offset = -10 >>> s.axes_manager._axes[-1].scale = 0.01 >>> g.estimate_parameters(s, -10, 10, False)
- property mean
Mean (position) of the component.
- property mode
Mode (position of maximum) of the component.
- property skewness
Skewness of the component.
- property variance
Variance of the component.