Prototypes | |
static void | strtoupper (CHAR *s) |
Convert string to uppercase. More... | |
void | nested_sampling_algorithm_wrapper (LALInferenceRunState *runState) |
A wrapper around LALInferenceNestedSamplingAlgorithm . More... | |
void | setup_live_points_array_wrapper (LALInferenceRunState *runState) |
A wrapper around LALInferenceSetupLivePointsArray . More... | |
void | initialise_algorithm (LALInferenceRunState *runState) |
Initialises the nested sampling algorithm control. More... | |
void | setup_lookup_tables (LALInferenceRunState *runState, LALSource *source) |
Sets the time angle antenna response lookup table. More... | |
void | add_initial_variables (LALInferenceVariables *ini, PulsarParameters *pars) |
Set up all the allowed variables for a known pulsar search This functions sets up all possible variables that are possible in a known pulsar search. More... | |
void | initialise_prior (LALInferenceRunState *runState) |
Sets up the parameters to be searched over and their prior ranges. More... | |
void | initialise_proposal (LALInferenceRunState *runState) |
Initialise the MCMC proposal distribution for sampling new points. More... | |
void | add_correlation_matrix (LALInferenceVariables *ini, LALInferenceVariables *priors, REAL8Array *corMat, LALStringVector *parMat) |
Adds a correlation matrix for a multi-variate Gaussian prior. More... | |
void | sum_data (LALInferenceRunState *runState) |
Calculates the sum of the square of the data and model terms. More... | |
REAL8Vector ** | parse_gmm_means (CHAR *meanstr, UINT4 npars, UINT4 nmodes) |
Parse data from a prior file containing Gaussian Mixture Model mean values. More... | |
gsl_matrix ** | parse_gmm_covs (CHAR *covstr, UINT4 npars, UINT4 nmodes) |
Parse data from a prior file containing Gaussian Mixture Model covariance matrix values. More... | |
CHAR * | get_bracketed_string (CHAR *dest, const CHAR *bstr, int openbracket, int closebracket) |
void | initialise_threads (LALInferenceRunState *state, INT4 nthreads) |
Go to the source code of this file.
Variables | |
static const CHAR | a2A [256] |
Array for conversion from lowercase to uppercase. More... | |
|
static |
Convert string to uppercase.
Definition at line 37 of file ppe_init.c.
void nested_sampling_algorithm_wrapper | ( | LALInferenceRunState * | runState | ) |
A wrapper around LALInferenceNestedSamplingAlgorithm
.
This function just calls LALInferenceNestedSamplingAlgorithm
, but will time the algorithm if required.
runState | [] A pointer to the LALInferenceRunState |
Definition at line 57 of file ppe_init.c.
void setup_live_points_array_wrapper | ( | LALInferenceRunState * | runState | ) |
A wrapper around LALInferenceSetupLivePointsArray
.
This function just calls LALInferenceSetupLivePointsArray
, but will time the algorithm if required.
runState | [] A pointer to the LALInferenceRunState |
Definition at line 100 of file ppe_init.c.
void initialise_algorithm | ( | LALInferenceRunState * | runState | ) |
Initialises the nested sampling algorithm control.
Memory is allocated for the parameters, priors and proposals. The nested sampling control parameters are set: the number of live points Nlive
, the number of points for each MCMC Nmcmc
, the number of independent runs within the algorithm Nruns
, and the stopping criterion tolerance
.
The random number generator is initialise (the GSL Mersenne Twister algorithm gsl_rng_mt19937
) using either a user defined seed randomseed
, the system defined /dev/urandom
file, or the system clock time.
runState | [in] A pointer to the LALInferenceRunState |
Definition at line 138 of file ppe_init.c.
void setup_lookup_tables | ( | LALInferenceRunState * | runState, |
LALSource * | source | ||
) |
Sets the time angle antenna response lookup table.
This function sets up an antenna response lookup table in time for each detector from which data exists (either real or fake). The time ranges over one sidereal day. The number of bins for the grid over time can be specified on the command line via time-bins
, but if this are not given then default values are used. The data times as a fraction of a sidereal day from the start time will also be calculated.
runState | [in] A pointer to the LALInferenceRunState |
source | [in] A pointer to a LALSource variable containing the source location |
Definition at line 296 of file ppe_init.c.
void add_initial_variables | ( | LALInferenceVariables * | ini, |
PulsarParameters * | pars | ||
) |
Set up all the allowed variables for a known pulsar search This functions sets up all possible variables that are possible in a known pulsar search.
Parameter values read in from a .par file and passed in via the pars
variable will be set.
ini | [in] A pointer to a LALInferenceVariables type that will be filled in with pulsar parameters |
pars | [in] A PulsarParameters type containing pulsar parameters read in from a TEMPO-style .par file |
Definition at line 386 of file ppe_init.c.
void initialise_prior | ( | LALInferenceRunState * | runState | ) |
Sets up the parameters to be searched over and their prior ranges.
This function sets up any parameters that you require the code to search over and specifies the prior range and type for each. This information is contained in a prior file specified by the command line argument prior-file
. There are currently five different allowed prior distributions:
Some examples of files are:
or
or
Any parameter specified in the file will have its vary type set to LALINFERENCE_PARAM_LINEAR
.
If a parameter correlation matrix is given by the cor-file
command then this is used to construct a multi-variate Gaussian prior for the given parameters (it is assumed that this file is created using TEMPO and the parameters it contains are the same as those for which a standard deviation is defined in the par file). This overrules the Gaussian priors that will have been set for these parameters.
runState | [in] A pointer to the LALInferenceRunState |
Definition at line 620 of file ppe_init.c.
void initialise_proposal | ( | LALInferenceRunState * | runState | ) |
Initialise the MCMC proposal distribution for sampling new points.
There are various proposal distributions that can be used to sample new live points via an MCMC. A combination of different ones can be used to help efficiency for awkward posterior distributions. Here the proposals that can be used are: diffev
Drawing a new point by differential evolution of two randomly chosen live points. All parameters are evolved during a single draw. freqBinJump
Jumps that are the size of the Fourier frequency bins (can be used if searching over frequency). ensembleStretch
Ensemble stretch moves (WARNING: These can lead to long autocorrelation lengths). ensembleWalk
Ensemble walk moves. These are used as the default proposal. uniformprop
Points for any parameters with uniform priors are drawn from those priors
This function sets up the relative weights with which each of above distributions is used.
runState | [in] A pointer to the run state |
Definition at line 918 of file ppe_init.c.
void add_correlation_matrix | ( | LALInferenceVariables * | ini, |
LALInferenceVariables * | priors, | ||
REAL8Array * | corMat, | ||
LALStringVector * | parMat | ||
) |
Adds a correlation matrix for a multi-variate Gaussian prior.
If a TEMPO-style parameter correlation coefficient file has been given, then this function will use it to set the prior distribution for the given parameters. It is assumed that the equivalent par file contained standard deviations for all parameters given in the correlation matrix file, but if the correlation matrix contains more parameters they will be ignored.
Definition at line 1012 of file ppe_init.c.
void sum_data | ( | LALInferenceRunState * | runState | ) |
Calculates the sum of the square of the data and model terms.
This function calculates the sum of the square of the data and model terms:
\[ \sum_i^N \Re{d_i}^2 + \Im{d_i}^2, \sum_i^N \Re{h_i}^2, \sum_i^N \Im{h_i}^2, \sum_i^N \Re{d_i}\Re{h_i}, \sum_i^N Im{d_i}\Im{h_i} \]
for each stationary segment given in the chunkLength
vector. These value are used in the likelihood calculation in pulsar_log_likelihood
and are precomputed here to speed that calculation up.
runState | [in] The analysis information structure |
Definition at line 1110 of file ppe_init.c.
REAL8Vector ** parse_gmm_means | ( | CHAR * | meanstr, |
UINT4 | npars, | ||
UINT4 | nmodes | ||
) |
Parse data from a prior file containing Gaussian Mixture Model mean values.
If a Gaussian Mixture Model prior has been specified then this function will parse the means for each parameter for each mode given. E.g. if the GMM provides multivariate Gaussian modes for two parameters, x and y, then the means would be specified in a string of the form "[[mux1,muy1],[mux2,muy2],....]". The string should have no whitespace between values, and mean values for a given mode must be separated by a comma.
These values are returned in an vector of REAL8Vectors. If an error occurred then NULL will be returned.
meanstr | [in] A string containing the mean values |
npars | [in] The number of parameters |
nmodes | [in] The number of modes |
Definition at line 1537 of file ppe_init.c.
Parse data from a prior file containing Gaussian Mixture Model covariance matrix values.
If a Gaussian Mixture Model prior has been specified then this function will parse the covariance matrices for each mode given. E.g. if the GMM provides multivariate Gaussian modes for two parameters, x and y, then the covariances for each mode would be specified in a string of the form "[[[covxx1,covxy1][covyx1,covyy1]],[[covxx2,covxy2][covyx2,covyy2]],...]". The string should have no whitespace between values, and covariance values for a given mode must be separated by a comma.
These values are returned in an array of GSL matrices. If an error occurred then NULL will be returned.
covstr | [in] A string containing the covariance matrix values |
npars | [in] The number of parameters |
nmodes | [in] The number of modes |
Definition at line 1608 of file ppe_init.c.
Definition at line 1700 of file ppe_init.c.
void initialise_threads | ( | LALInferenceRunState * | state, |
INT4 | nthreads | ||
) |
Definition at line 1719 of file ppe_init.c.
Array for conversion from lowercase to uppercase.
Definition at line 28 of file ppe_init.c.