stacie.cost module¶
Cost function to optimize models for the low-frequency part of the spectrum.
- class LowFreqCost(freqs, ndofs, amplitudes, weights, model)[source]¶
Bases:
objectCost function to fit a model to the low-frequency part of the spectrum.
- Parameters:
freqs (NDArray[float])
ndofs (NDArray[int])
amplitudes (NDArray[float])
weights (NDArray[float])
model (SpectrumModel)
- model: SpectrumModel¶
The model to be fitted to the spectrum.
- entropy_gamma(alpha, theta, *, deriv=0)[source]¶
Compute the entropy of the Gamma distribution.
- Parameters:
- Return type:
- Returns:
results – A list of results (function value and requested derivatives.) All elements have the same shape as the
alphaandthetaarrays.
- logpdf_gamma(x, alpha, theta, *, deriv=0)[source]¶
Compute the logarithm of the probability density function of the Gamma distribution.
- Parameters:
x (
NDArray[float]) – The argument of the PDF (random variable). Array with shape(nfreq,).alpha (
NDArray[float]) – The shape parameter. Array with shape(nfreq,).theta (
NDArray[float]) – The scale parameter. Array with shape(..., nfreq,).deriv (
int) – The order of the derivatives toward theta to compute: 0, 1 or 2.
- Return type:
- Returns:
results – A list of results (function value and requested derivatives.) All elements have the same shape as the
thetaarray.