Models utilising the george GPR library in Python and C++.
heron.models.georgebased.
Heron2dHodlr
[source]¶Bases: heron.models.georgebased.HodlrGPR
, heron.models.gw.BBHNonSpinSurrogate
, heron.models.gw.HofTSurrogate
Produce a BBH waveform generator using the Hodlr method.
Methods
|
Return a waveform from the GPR in a format expected by the Bilby ecosystem |
|
Construct the GP object |
|
Return the mean waveform and the variance at a given location in the BBH parameter space. |
|
Prepare the model to be evaluated. |
|
Evaluate the log-evidence of the model at a hyperparameter location k. |
|
Return the mean waveform at a given location in the BBH parameter space. |
|
Prepare the model to be trained. |
heron.models.georgebased.
Heron2dHodlrIMR
[source]¶Bases: heron.models.georgebased.HodlrGPR
, heron.models.gw.BBHNonSpinSurrogate
, heron.models.gw.HofTSurrogate
Produce a BBH waveform generator using the Hodlr method with IMRPhenomPv2 training data.
Methods
|
Return a waveform from the GPR in a format expected by the Bilby ecosystem |
|
Construct the GP object |
|
Return the mean waveform and the variance at a given location in the BBH parameter space. |
|
Prepare the model to be evaluated. |
|
Evaluate the log-evidence of the model at a hyperparameter location k. |
|
Return the mean waveform at a given location in the BBH parameter space. |
|
Prepare the model to be trained. |
heron.models.georgebased.
HeronHodlr
[source]¶Bases: heron.models.georgebased.HodlrGPR
, heron.models.gw.BBHSurrogate
, heron.models.gw.HofTSurrogate
Produce a BBH waveform generator using the Hodlr method.
Methods
|
Return a waveform from the GPR in a format expected by the Bilby ecosystem |
|
Construct the GP object |
|
Return the mean waveform and the variance at a given location in the BBH parameter space. |
|
Prepare the model to be evaluated. |
|
Evaluate the log-evidence of the model at a hyperparameter location k. |
|
Return the mean waveform at a given location in the BBH parameter space. |
|
Prepare the model to be trained. |
heron.models.georgebased.
HodlrGPR
[source]¶Bases: heron.models.Model
A GPR model using the hierarchical matrix approximation.
Methods
|
Construct the GP object |
|
Return the mean waveform and the variance at a given location in the BBH parameter space. |
|
Prepare the model to be evaluated. |
|
Evaluate the log-evidence of the model at a hyperparameter location k. |
|
Return the mean waveform at a given location in the BBH parameter space. |
|
Prepare the model to be trained. |
distribution
(self, p, times, samples=100, polarisation='h+')[source]¶Return the mean waveform and the variance at a given location in the BBH parameter space.
A dictionary of parameter locations.
The timestamps at which the model should be evaluated.
The number of samples to draw from the GP.
The polarisation which should be evaluated.
log_evidence
(self, k, n)[source]¶Evaluate the log-evidence of the model at a hyperparameter location k.
The number of points to be used to calculate the log likelihood.
heron.models.georgebased.
HodlrReducedGPR
[source]¶Bases: heron.models.ReducedModel
A Gaussian process regression surrogate using a reduced basis.
Notes
This model builds a surrogate over a reduced basis constructed by the
elk
package, and is intended to be a template which can be adapted for any
timeseries, and not just a GW waveform.
For this specific example implementation the basis is built using non-spinning waveforms from the IMRPhenomPv2 model, and as a result the model is itself non-spinning.
Examples
>>> model = HodlrReducedGPR()
>>> ts = model(0.55)
>>> ts.data[:10]
array([-3.0841799347631674e-20, -3.0866637782847267e-20,
-2.959224603984205e-20, -2.703825954077637e-20,
-2.32824648984726e-20, -1.8454458490397586e-20,
-1.273795996408389e-20, -6.358989280244452e-21,
4.1729998379767277e-22, 7.302559908465424e-21], dtype=object)
Methods
|
Call self as a function. |
|
Return the mean timeseries and its variance |
|
Returns the mean timeseries |
This module contains objects which provide the specifically-GW parts of waveform surrogate models.
heron.models.gw.
BBHNonSpinSurrogate
[source]¶Bases: object
c_ind
= {'h+': 8, 'hx': 9, 'mass ratio': 1, 'time': 0}¶columns
= {0: 'time', 1: 'mass ratio', 8: 'h+', 9: 'hx'}¶problem_dims
= 2¶heron.models.gw.
BBHSurrogate
[source]¶Bases: object
c_ind
= {'h+': 8, 'hx': 9, 'mass ratio': 1, 'spin 1x': 2, 'spin 1y': 3, 'spin 1z': 4, 'spin 2x': 5, 'spin 2y': 6, 'spin 2z': 7, 'time': 0}¶columns
= {0: 'time', 1: 'mass ratio', 2: 'spin 1x', 3: 'spin 1y', 4: 'spin 1z', 5: 'spin 2x', 6: 'spin 2y', 7: 'spin 2z', 8: 'h+', 9: 'hx'}¶parameters
= ('mass ratio', 'spin 1x', 'spin 1y', 'spin 1z', 'spin 2x', 'spin 2y', 'spin 2z')¶problem_dims
= 8¶heron.models.
Model
[source]¶Bases: object
This is the factory class for statistical models used for waveform generation.
A model class must expose the followi*** TODO Email about Away Dayc_ind = {j:i for i,j in columns.items()}c_ind = {j:i for i,j in columns.items()}ng methods: - distribution : produce a distribution of waveforms at a given point in the parameter space - mean : produce a mean waveform at a given point in the parameter space - train : provide an interface for training the model
heron.models.
ReducedModel
(data)[source]¶Bases: heron.models.Model
Construct a model using a reduced basis.