Quadratic_1GaussModel¶
- class threadcount.models.Quadratic_1GaussModel(independent_vars=['x'], prefix='', nan_policy='raise', **kwargs)[source]¶
Bases:
CompositeModelQuadratic + 1 Gaussian Model.
Essentially created by:
lmfit.models.QuadraticModel() + GaussianModelH(prefix="g1_")\[f(x) = a x^2 + b x + c + A e^{[{-{(x-\mu)^2}/{{2\sigma}^2}}]}\]where the parameter g1_height corresponds to \(A\), g1_center to \(\mu\), and g1_sigma to \(\sigma\).
The param names are [‘g1_height’, ‘g1_center’, ‘g1_sigma’, ‘a’, ‘b’, ‘c’]
- Parameters:
independent_vars (
listofstr, optional) – Arguments to the model function that are independent variables default is [‘x’]).prefix (str, optional) – String to prepend to parameter names, needed to add two Models that have parameter names in common.
nan_policy ({'raise', 'propagate', 'omit'}, optional) – How to handle NaN and missing values in data. See Notes below.
**kwargs (optional) – Keyword arguments to pass to
Model.
Notes
1. nan_policy sets what to do when a NaN or missing value is seen in the data. Should be one of:
‘raise’ : raise a ValueError (default)
‘propagate’ : do nothing
‘omit’ : drop missing data
Methods Summary
guess(data, x, **kwargs)Estimate initial model parameter values from data.
Methods Documentation
- guess(data, x, **kwargs)¶
Estimate initial model parameter values from data.
The data for gaussian g1 will be guessed by 1 gaussian plus constant.
a and b model parameters are initialized by any model parameter hint and not affected by the guess function.
- Parameters:
data (array_like) – Array of data (i.e., y-values) to use to guess parameter values.
x (array_like) – Array of values for the independent variable (i.e., x-values).
**kws (optional) – Additional keyword arguments, passed to model function.
- Returns:
params – Initial, guessed values for the parameters of a Model.
- Return type: