Parametric fit features¶
light_curve.BazinFit
¶
Bases: _FeatureEvaluator
Bazin function fit
Five fit parameters and goodness of fit (reduced \(\chi^2\)) of the Bazin function developed for core-collapsed supernovae:
Note, that the Bazin function is developed to be used with fluxes, not magnitudes. Also note a typo in the Eq. (1) of the original paper, the minus sign is missed in the "rise" exponent.
- Depends on: time, magnitude, magnitude error
- Minimum number of observations: 6
- Number of features: 6
Bazin et al. 2009 DOI:10.1051/0004-6361/200911847 Names and description of the output features: - bazin_fit_amplitude: half amplitude of the Bazin function (A) - bazin_fit_baseline: baseline of the Bazin function (B) - bazin_fit_reference_time: reference time of the Bazin fit (t0) - bazin_fit_rise_time: rise time of the Bazin function (tau_rise) - bazin_fit_fall_time: fall time of the Bazin function (tau_fall) - bazin_fit_reduced_chi2: Bazin fit quality (reduced chi2)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
algorithm
|
str
|
Non-linear least-square algorithm, supported values are: mcmc, ceres, mcmc-ceres, lmsder, mcmc-lmsder, nuts, nuts-ceres, nuts-lmsder. |
required |
mcmc_niter
|
int
|
Number of MCMC iterations |
128
|
ceres_niter
|
int
|
Number of Ceres iterations |
10
|
ceres_loss_reg
|
float or None
|
Ceres loss regularization. If set to a number, the loss function is
regularized to discriminate outlier residuals larger than this value.
|
None
|
lmsder_niter
|
int
|
Number of LMSDER iterations |
10
|
init
|
list or None
|
Initial conditions, must be |
None
|
bounds
|
list of tuples or None
|
Boundary conditions, must be |
None
|
ln_prior
|
str or list of ln_prior.LnPrior1D or None
|
Prior for MCMC, |
None
|
transform
|
bool or None
|
If
See |
None
|
bands
|
list of str or None
|
Passband names for multiband mode. If provided, the feature is evaluated independently per passband and the outputs are concatenated in passband order. If None (default), single-band mode is used. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
names |
list of str
|
Feature names |
descriptions |
list of str
|
Feature descriptions |
bands |
numpy.ndarray of str or None
|
Passband names for multiband mode, or None for single-band mode |
supported_algorithms |
list of str
|
Available argument values for the constructor |
Methods:
| Name | Description |
|---|---|
__call__ |
Extract features and return them as a numpy array |
many |
Extract features from multiple light curves in parallel |
model |
Underlying parametric model function Parameters¶
Returns¶
|
Examples:
>>> import numpy as np
>>> from light_curve import BazinFit
>>>
>>> fit = BazinFit('mcmc')
>>> t = np.linspace(0, 10, 101)
>>> flux = 1 + (t - 3) ** 2
>>> fluxerr = np.sqrt(flux)
>>> result = fit(t, flux, fluxerr, sorted=True)
>>> # Result is built from a model parameters and reduced chi^2
>>> # So we can use as a `params` array of the static `.model()` method
>>> model = BazinFit.model(t, result)
light_curve.LinexpFit
¶
Bases: _FeatureEvaluator
Linexp function fit
Four fit parameters and goodness of fit (reduced \(\chi^2\)) of the Linexp function developed for core-collapsed supernovae:
Note, that the Linexp function is developed to be used with fluxes, not magnitudes.
- Depends on: time, flux, flux error
- Minimum number of observations: 5
- Number of features: 5
Names and description of the output features: - linexp_fit_amplitude: Amplitude of the Linexp function (A) - linexp_fit_reference_time: reference time of the Linexp fit (t0) - linexp_fit_fall_time: fall time of the Linexp function (tau) - linexp_fit_baseline: baseline of the Linexp function (B) - linexp_fit_reduced_chi2: Linexp fit quality (reduced chi2)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
algorithm
|
str
|
Non-linear least-square algorithm, supported values are: mcmc, ceres, mcmc-ceres, lmsder, mcmc-lmsder, nuts, nuts-ceres, nuts-lmsder. |
required |
mcmc_niter
|
int
|
Number of MCMC iterations |
128
|
ceres_niter
|
int
|
Number of Ceres iterations |
10
|
ceres_loss_reg
|
float or None
|
Ceres loss regularization. If set to a number, the loss function is
regularized to discriminate outlier residuals larger than this value.
|
None
|
lmsder_niter
|
int
|
Number of LMSDER iterations |
10
|
init
|
list or None
|
Initial conditions, must be |
None
|
bounds
|
list of tuples or None
|
Boundary conditions, must be |
None
|
ln_prior
|
str or list of ln_prior.LnPrior1D or None
|
Prior for MCMC, |
None
|
transform
|
bool or None
|
If
See |
None
|
bands
|
list of str or None
|
Passband names for multiband mode. If provided, the feature is evaluated independently per passband and the outputs are concatenated in passband order. If None (default), single-band mode is used. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
names |
list of str
|
Feature names |
descriptions |
list of str
|
Feature descriptions |
bands |
numpy.ndarray of str or None
|
Passband names for multiband mode, or None for single-band mode |
supported_algorithms |
list of str
|
Available argument values for the constructor |
Methods:
| Name | Description |
|---|---|
__call__ |
Extract features and return them as a numpy array |
many |
Extract features from multiple light curves in parallel |
model |
Underlying parametric model function Parameters¶
Returns¶
|
Examples:
>>> import numpy as np
>>> from light_curve import LinexpFit
>>>
>>> fit = LinexpFit('mcmc')
>>> t = np.linspace(0, 10, 101)
>>> flux = 1 + (t - 3) ** 2
>>> fluxerr = np.sqrt(flux)
>>> result = fit(t, flux, fluxerr, sorted=True)
>>> # Result is built from a model parameters and reduced chi^2
>>> # So we can use as a `params` array of the static `.model()` method
>>> model = LinexpFit.model(t, result)
light_curve.VillarFit
¶
Bases: _FeatureEvaluator
Villar function fit
Seven fit parameters and goodness of fit (reduced \(\chi^2\)) of the Villar function developed for supernovae classification:
where \(A, \gamma, \tau_\mathrm{rise}, \tau_\mathrm{fall} > 0\), \(\nu \in [0; 1)\).
Here we introduce a new dimensionless parameter \(\nu\) instead of the plateau slope \(\beta\) from the orioginal paper: \(\nu \equiv -\beta \gamma / A\).
Note, that the Villar function is developed to be used with fluxes, not magnitudes.
- Depends on: time, magnitude, magnitude error
- Minimum number of observations: 8
- Number of features: 8
Villar et al. 2019 DOI:10.3847/1538-4357/ab418c Names and description of the output features: - villar_fit_amplitude: half amplitude of the Villar function (A) - villar_fit_baseline: baseline of the Villar function (c) - villar_fit_reference_time: reference time of the Villar function (t_0) - villar_fit_rise_time: rise time of the Villar function (tau_rise) - villar_fit_fall_time: decline time of the Villar function (tau_fall) - villar_fit_plateau_rel_amplitude: relative plateau amplitude of the Villar function (nu = beta gamma / A) - villar_fit_plateau_duration: plateau duration of the Villar function (gamma) - villar_fit_reduced_chi2: Villar fit quality (reduced chi2)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
algorithm
|
str
|
Non-linear least-square algorithm, supported values are: mcmc, ceres, mcmc-ceres, lmsder, mcmc-lmsder, nuts, nuts-ceres, nuts-lmsder. |
required |
mcmc_niter
|
int
|
Number of MCMC iterations |
128
|
ceres_niter
|
int
|
Number of Ceres iterations |
10
|
ceres_loss_reg
|
float or None
|
Ceres loss regularization. If set to a number, the loss function is
regularized to discriminate outlier residuals larger than this value.
|
None
|
lmsder_niter
|
int
|
Number of LMSDER iterations |
10
|
init
|
list or None
|
Initial conditions, must be |
None
|
bounds
|
list of tuples or None
|
Boundary conditions, must be |
None
|
ln_prior
|
str or list of ln_prior.LnPrior1D or None
|
Prior for MCMC, |
None
|
transform
|
bool or None
|
If
See |
None
|
bands
|
list of str or None
|
Passband names for multiband mode. If provided, the feature is evaluated independently per passband and the outputs are concatenated in passband order. If None (default), single-band mode is used. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
names |
list of str
|
Feature names |
descriptions |
list of str
|
Feature descriptions |
bands |
numpy.ndarray of str or None
|
Passband names for multiband mode, or None for single-band mode |
supported_algorithms |
list of str
|
Available argument values for the constructor |
Methods:
| Name | Description |
|---|---|
__call__ |
Extract features and return them as a numpy array |
many |
Extract features from multiple light curves in parallel |
model |
Underlying parametric model function Parameters¶
Returns¶
|
Examples:
>>> import numpy as np
>>> from light_curve import VillarFit
>>>
>>> fit = VillarFit('mcmc')
>>> t = np.linspace(0, 10, 101)
>>> flux = 1 + (t - 3) ** 2
>>> fluxerr = np.sqrt(flux)
>>> result = fit(t, flux, fluxerr, sorted=True)
>>> # Result is built from a model parameters and reduced chi^2
>>> # So we can use as a `params` array of the static `.model()` method
>>> model = VillarFit.model(t, result)