stacie.cutoff module¶
Criteria for selecting the part of the spectrum to fit to.
- class CV2LCriterion(*, fcut_factor=1.25, log=False, cond=1000000.0, precondition=True, regularize=True)[source]¶
Bases:
CutoffCriterion
Criterion based on the difference between fits to two halves of the spectrum.
-
cond:
float
¶ The threshold for the condition number of the preconditioned covariance matrix.
Due to the preconditioning, the condition number should be close to 1.0. If not, the linear dependence of the parameters is too strong, making the fit unreliable. In this case, “inf” is returned as the criterion.
-
fcut_factor:
float
¶ The scale factor to apply to the cutoff frequency.
If 1.0, the same part of the spectrum is used as in the full non-linear regression. By using a larger value, the default, the criterion also tests whether the fitted parameters can (somewhat) extrapolate to larger frequencies, which reduces the risk of underfitting. This results in less bias on the autocorrelation integral, but slightly larger variance.
-
cond:
- class CutoffCriterion[source]¶
Bases:
object
Base class for cutoff criteria.
Subclasses should implement the
__call__
method.
- linear_weighted_regression(dm, ev, ws, lc=None, ridge=0.0)[source]¶
Perform a linear regression with multiple weight vectors.
This is a helper function for cv2l_criterion.
- Parameters:
dm (
ndarray
[tuple
[Any
,...
],dtype
[float
]]) – The design matrix. Shape(neq, npar)
, whereneq
is the number of equations andnpar
is the number of parameters.ev (
ndarray
[tuple
[Any
,...
],dtype
[float
]]) – The expected values, with standard normal measurement errors. Shape(neq,)
.ws (
ndarray
[tuple
[Any
,...
],dtype
[float
]]) – A set of weight vectors for the rows of dm (equations). Shape(nw, neq)
, wherenw
is the number of weight vectors.lc (
ndarray
[tuple
[Any
,...
],dtype
[float
]] |None
) – Linear combinations of solutions for different weights to be computed. Shape(nlc, nw)
, wherenlc
is the number of linear combinations. If None, the identity matrix is used with shape(nw, nw)
.ridge (float)
- Return type:
tuple
[ndarray
[tuple
[Any
,...
],dtype
[float
]],ndarray
[tuple
[Any
,...
],dtype
[float
]]]- Returns:
xs – The regression coefficients for each weight vector. Shape
(nw, npar)
.cs – The covariance matrices for each combination of weight vector. Shape
(nw, npar, nw, npar)
.