synthesizer.parametric.sfh_kernels¶
A submodule defining covariance kernels for stochastic star formation.
These kernels define the auto-covariance of fluctuations in log10(SFR) used by
the SFH.Stochastic star formation history model. They follow the Gaussian
Process + Power Spectral Density formalism of Iyer et al. 2024
(arXiv:2208.05938), in which variability in galaxy star formation histories is
modelled as a Gaussian Process in log-SFR space whose covariance is set by a
(physically motivated) kernel.
A kernel only has to define its auto-covariance as a function of the time lag
between two epochs (the covariance method). For stationary kernels (where
the covariance depends only on the lag) the parent class then builds the full
covariance matrix on a time grid using an efficient Toeplitz construction. New
variability models (e.g. a general power-spectral-density kernel, or composite
multi-timescale kernels) are added simply by subclassing Kernel.
- NOTE: This module is imported as Kernels in parametric.__init__ enabling the
syntax shown below.
Example usage:
from synthesizer.parametric import Kernels from unyt import Gyr
kernel = Kernels.DampedRandomWalk(sigma=0.3, tau=1 * Gyr) cov = kernel.build_covariance_matrix(tarr) # tarr in years
Classes
- class synthesizer.parametric.sfh_kernels.DampedRandomWalk(sigma, tau)[source]¶
A damped random walk (single-timescale regulator) kernel.
This is the simplest member of the regulator/extended-regulator family of Iyer et al. 2024 (arXiv:2208.05938). The auto-covariance of the log10(SFR) fluctuations decays exponentially with the time lag:
C(dt) = sigma**2 * exp(-|dt| / tau)
which corresponds to a Lorentzian power spectral density with a break frequency set by
tau.- sigma¶
The standard deviation of the log10(SFR) fluctuations (in dex).
- Type:
float
- tau¶
The correlation timescale of the fluctuations (in years).
- Type:
float
- covariance(delta_t)[source]¶
Evaluate the damped random walk auto-covariance.
- Parameters:
delta_t (float/np.ndarray of float) – The time lag(s) (in years) at which to evaluate the covariance.
- Returns:
The auto-covariance at the passed lag(s).
- Return type:
float/np.ndarray of float
- classmethod init_from_prior(sigma, tau)[source]¶
Initialise the kernel by drawing parameters from uniform priors.
Each parameter is either a single fixed value or a length-2 sequence [low, high] defining a uniform prior. The
tauprior should carry units (e.g.tau=[0.5, 3] * Gyr).- Parameters:
sigma (float | length-2 sequence) – Fixed value or [low, high] uniform prior for sigma (dex).
tau (unyt_quantity | length-2 unyt_array) – Fixed value or [low, high] uniform prior for tau.
- Returns:
An instance with parameters drawn from the priors.
- Return type:
- class synthesizer.parametric.sfh_kernels.Kernel(name, **kwargs)[source]¶
The parent class for all SFH covariance kernels.
A kernel defines the auto-covariance of fluctuations in log10(SFR) as a function of the time lag between two epochs. Stationary kernels (where the covariance depends only on the lag) need only implement
covariance; the parent then builds the full covariance matrix on a time grid using an efficient symmetric Toeplitz construction. Non-stationary kernels should instead overridebuild_covariance_matrixdirectly.- name¶
The name of the kernel. This is set by the child class.
- Type:
str
- parameters¶
A dictionary containing the parameters of the kernel.
- Type:
dict
- build_covariance_matrix(tarr)[source]¶
Build the covariance matrix on a time grid.
This default implementation assumes a stationary kernel, i.e. the covariance depends only on the lag between two times. It exploits the resulting symmetric Toeplitz structure to fill the matrix from a single evaluation of
covarianceper lag, which makes drawing samples cheap once the matrix is built.Non-stationary kernels should override this method.
- Parameters:
tarr (np.ndarray of float) – A regularly spaced time grid (in years).
- Returns:
The (N, N) covariance matrix.
- Return type:
np.ndarray of float