gwinferno.models.bsplines.single.BSplineRedshift#
- class BSplineRedshift(n_splines, z, z_inj, dVdc, dVdc_inj, zmax=2.3, basis=<class 'gwinferno.interpolation.LogXBSpline'>, **kwargs)[source]#
Bases:
Base1DBSplineModel
A B-Spline model for redshift. The B-Spline will define the volumetric rate density \(r\), which relates to the merger-rate per unit redshift in the detector-frame \(R\) by
\[R(z) = \frac{r(z)}{1+z} \frac{dV_c}{dz},\]where \(dV_c/dz\) is the co-moving volume element and \(r(z)\) is the merger rate per unit co-moving volume.
- Parameters:
- n_splinesint
Number of basis functions, i.e., the number of degrees of freedom of the spline model.
- zarray_like
Redshift parameter estimation samples for basis evaluation.
- z_injarray_like
Redshift injection samples for basis evaluation.
- dVdcarray_like
Differential co-moving volume for each parameter estimation sample.
- dVdc_injarray_like
Differential co-moving volume for each injection sample.
- zmaxfloat, default=2.3
Maximum redshift. Ignored if
xrange
is provided.- basisclass, default=LogXBSpline
Type of basis to use.
Methods
eval_spline
(bases, coefs)Given design matrix
bases
and coefficientscoefs
, project coefficients onto the basis.inj_pdf
(coefs)Project the coefficients
coefs
onto the design matrix evaluated at the injection samples.normalization
(cs)Compute the normalization coefficient for the redshift basis spline; useful for computing the merger rate.
pe_pdf
(coefs)Project the coefficients
coefs
onto the design matrix evaluated at the parameter estimation samples.- __call__(coefs, pe_samples=True)[source]#
Evaluate the merger-rate per unit redshift in the detector-frame \(R\). Use flag pe_samples to specify which samples are being evaluated (parameter estimation or injection).
- Parameters:
- coefsarray_like
Basis spline coefficients.
- pe_samplesbool, default=True
If True, design matrix is evaluated across parameter estimation samples. If False, design matrix is evaluated across injection samples.
- Returns:
- array_like
Merger-rate per unit redshift in the detector-frame \(R\).
- __init__(n_splines, z, z_inj, dVdc, dVdc_inj, zmax=2.3, basis=<class 'gwinferno.interpolation.LogXBSpline'>, **kwargs)[source]#
- eval_spline(bases, coefs)#
Given design matrix
bases
and coefficientscoefs
, project coefficients onto the basis.- Parameters:
- basesarray_like
Design matrix of the spline, i.e., basis functions evaluated at samples.
- coefsarray_like
Basis spline coefficients.
- Returns:
- array_like
The linear combination of the basis components given the coefficients.
- inj_pdf(coefs)#
Project the coefficients
coefs
onto the design matrix evaluated at the injection samples.- Parameters:
- coefsarray_like
Basis spline coefficients.
- Returns:
- array_like
The linear combination of the basis components evaluated at the injection samples given the coefficients.
- normalization(cs)[source]#
Compute the normalization coefficient for the redshift basis spline; useful for computing the merger rate.
- Parameters:
- coefsarray_like
Basis spline coefficients.
- Returns:
- float
The redshift normalization constant.
- pe_pdf(coefs)#
Project the coefficients
coefs
onto the design matrix evaluated at the parameter estimation samples.- Parameters:
- coefsarray_like
Basis spline coefficients.
- Returns:
- array_like
The linear combination of the basis components evaluated at the parameter estimation samples given the coefficients.