gwinferno.models.bsplines.single.Base1DBSplineModel#
- class Base1DBSplineModel(n_splines, xx, xx_inj, xrange=(0.0, 1.0), degree=3, basis=<class 'gwinferno.interpolation.BSpline'>, **kwargs)[source]#
Bases:
object
Base class for basis splines for population inference
- Parameters:
- n_splinesint
Number of basis functions, i.e., the number of degrees of freedom of the spline model.
- xxarray_like
Parameter estimation samples for basis evaluation.
- xx_injarray_like
Injection samples for basis evaluation.
- degreeint, default=3
Degree of the spline, i.e., 3 for cubic splines.
- xrangetuple, default=(0.0, 1.0)
Domain of the spline.
- basisclass, default=BSpline
Type of basis to use, e.g., LogYBSpline.
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.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 projection of the coefficients along the design matrix over the parameter estimation or injection samples. 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
The linear combination of the basis components evaluated at the parameter estimation or injection samples given the coefficients.
- __init__(n_splines, xx, xx_inj, xrange=(0.0, 1.0), degree=3, basis=<class 'gwinferno.interpolation.BSpline'>, **kwargs)[source]#
- eval_spline(bases, coefs)[source]#
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)[source]#
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.
- pe_pdf(coefs)[source]#
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.