Model file
The model file is a simple Python file that, at minimum, needs to contain the following information:
- Names and prior distributions of the signal parameters.
- Parametrized form of the signal, which can either be stochastic (and parametrized via its power-spectrum), or deterministic (and parametrized as a times eries).
In the following, we will explain how these two quantities are defined in the model file.
Priors¶
The priors for the signal parameters are defined via the parameters
dictionary. The keys of this dictionary must be strings, which will be used as names for the model parameters. The values of this dictionary are [ENTERPRISE Parameter][enterprise.signals.parameter.Parameter] objects, the user can create these object via the prior
helper function that can be imported from the ptarcade.models_utils module. The first argument that the user needs to pass to the prior
function is a string with the name of the prior class they want to use for that parameter, the remaining arguments are used to set the attributes of the prior. By default, parameters are assumed to be common across all pulsars. If the user wants to define a pulsar-dependent parameter, this can be done by passing common=False
as a keyword argument.
Priors Example
The parameters
dictionary of a model described by the parameters \(a\) and \(b\), which are common among all the pulsars, will look as follows for different choices of the priors:
- In this case, we have chosen uniform priors in the range [0,1] for both parameters.
- In this case, we have chosen 1D normal priors with unit mean and variance for both parameters.
Constructing Priors
Notice, how we used both positional and keyword arguments: Both are allowed. These arguments correspond to the functions defined in either [enterprise.signals.parameter][] or ptarcade.models_utils. Below are links to all supported parameters:
- [enterprise.signals.parameter.Normal][]
- [enterprise.signals.parameter.Uniform][]
- [enterprise.signals.parameter.TruncNormal][]
- [enterprise.signals.parameter.LinearExp][]
- [enterprise.signals.parameter.Constant][]
- ptarcade.models_utils.Gamma.
Common Parameters vs. Pulsar-Dependent
Parameters are assumed to be common by default. If they are pulsar-dependent, you must pass common=False
as a keyword argument to prior
.
For example, if we want to set the b
parameters of previous examples to be pulsar-dependent, we can do that as follows
- In this example,
b
is a pulsar-dependent parameter. By default, the parameters are common to all pulsars in the PTA.
Stochastic Signals¶
Stochastic signals are defined via the spectrum
function. The first parameter of this function should be named f
and it is supposed to be a NumPy array containing the frequencies (in units of Hz) at which the spectrum will be evaluated. The names of the remaining parameters should match the keys of the parameters
dictionary. The spectrum
function should return a NumPy array containing the value of \(h^2\Omega_{\mathrm{GW}}\) at each of the frequencies in f
.
Stochastic Signal Example
The spectrum
function for a model with
is given by
Deterministic Signals¶
Deterministic signals are defined via the signal
function. The first parameter of this function should be named toas
and it is supposed to be a NumPy array containing the times of arrival (TOAs) (in units of seconds) at which the deterministic signal will be evaluated. The name of the remaining parameters should match the keys of the parameters
dictionary. The signal
function should return a NumPy array with the same dimensions as toas
containing the value of the induced shift for each TOA contained in toas
.
Deterministic Signal Example
For a deterministic signal,
the signal
is given by
Model File Example
This is a model file for a stochastic signal with a broken power-law spectrum,
whose parameters, \(A_*\) and \(f_*\), are assumed to have a log-uniform prior between \([10^{-14},10^{-6}]\) and \([10^{-10},10^{-6}]\), respectively.
This is a model file for a deterministic signal given by
and assuming log-uniform priors between \([10^{-14},10^{-6}]\) and \([10^{-10},10^{-6}]\) for the two model parameters \(A\) and \(k\), respectively.
Model File Flexibility
In defining the spectrum
or signal
functions in the model file, you have all the
flexibility of a normal Python file. You can, for example, define auxiliary functions,
import and interpolate tabulated data etc.
Additional Settings¶
The model file can also contain additional (optional) variables that can be used to control the new-physics signal in more detail. Specifically, you can control the following:
name
-
Default:
"np_model"
– This variable can be assigned to a string to specify the model name. This will be used to name the output directory. smbhb
-
Default:
False
– If set toTrue
, the expected signal from SMBHBs will be added to the user-specified signal. orf
-
Experimental – This function can be used to specify the Overlap Reduction Function (ORF) of stochastic signals. The first parameter of this function should be named
f
and it is supposed to be a NumPy array containing the frequencies (in units of Hz) at which the ORF will be evaluated (this parameter should be present in the definition of theorf
function even if the ORF that the user wants to specify does not depend on the frequency). The second and third parameters of theorf
function should be namedpos1
andpos2
respectively, and are supposed to represent the unit vectors pointing from Earth to a given pair of pulsars. The names of the remaining parameters should match the keys of theparameters
dictionary (even if the ORF does not depend on them). Thespectrum
function should return a NumPy array containing the value of ORF for the given pulsar pair at each of the frequencies inf
. If noorf
is specified in the model file, the ORF for the GWB is assumed to be the Hellings & Downs (HD) correlation. Notice that an ORF different from HD can be used only inenterprise
mode.
NG15 Model Files
The model files used in the NANOGrav 15-year new-physics search can be found here.