LALInference  4.1.6.1-b72065a
Header LALInferenceProposal.h

Detailed Description

Jump proposals for exploring the GW signal parameter space.

Author
Ilya Mandel, Vivien Raymond, Christian Roever, Marc van der Sluys, John Veitch, and Will M. Farr.
Date
2011

For exploring the parameter space of GW signals, it is convenient to use many different types of jumps. For example, we supply in this module proposals that change one parameter at a time, based on a gaussian distribution centered at the current value with a fixed width; proposals that change a combination of parameters along a one-dimensional curve in parameter space; proposals that change a combination of parameters along a sub-manifold of parameter space; and proposals that change all parameters at once, attempting to generate a jump along the directions in parameter space corresponding to eigenvectors of the covariance matrix; etc.

Good jump proposals involve a combination of moves, or sub-proposals, chosen with various weights. Having such a combined jump proposal can cause difficulties with standard Metropolis sampling in an MCMC, depending on how the combined proposal is implemented. The reason involves the ratio of forward to backward jump probabilities that is used in the acceptance probability for a jump in Metropolis sampling. Many proposals are symmetric, having equal forward and backward jump probabilities, but not all.

If the combined proposal is implemented as a random choice among a list of sub-proposals, then the proper jump probability is a combination of the jump probabilities from all sub-propsals. That is, to properly compute the jump probability for such a combined proposal, every sub-proposal—whether it individually is symmetric or not—must be queried after each jump for its individual jump probability, and these must be combined into the correct jump probability for the overall proposal. The situation becomes even more complex when the sub-proposals act on sub-manifolds of parameter space of differing dimensions, because then the individual proposal jump probabilities involve varying numbers of delta-functions that act to restrict the support of the jump probability to the proper sub-manifold. Ugh.

We avoid this problem by implementing our combined proposal as a cyclic sequence of sub-proposals. At each MCMC step, only one of the sub-proposals is used, and therefore only this proposal's jump probability is relevant to the computation of the forward and backward jump probabilities. At the next step, the next proposal in the cycle is called, etc. The LALInferenceCyclicProposal() function implements this procedure. To add a number of copies of a proposal function to the end of the cycle, use LALInferenceAddProposalToCycle(); once all desired sub-proposals are added to the cycle, call LALInferenceRandomizeProposalCycle() in order to ensure that the ordering of the sub-proposals is random.

Prototypes

LALInferenceProposalLALInferenceInitProposal (LALInferenceProposalFunction func, const char *name)
 Creates a new proposal object from the given func pointer and name. More...
 
void LALInferenceRegisterProposal (LALInferenceVariables *propArgs, const char *name, INT4 *flag, ProcessParamsTable *command_line)
 Use a default flag and a check of the command-line to set proposal flags in proposal args. More...
 
void LALInferenceAddProposalToCycle (LALInferenceProposalCycle *cycle, LALInferenceProposal *prop, INT4 weight)
 Adds weight copies of the proposal prop to the end of the proposal cycle. More...
 
void LALInferenceRandomizeProposalCycle (LALInferenceProposalCycle *cycle, gsl_rng *rng)
 Randomizes the order of the proposals in the proposal cycle. More...
 
LALInferenceProposalCycleLALInferenceInitProposalCycle (void)
 Create a new proposal cycle. More...
 
LALInferenceVariablesLALInferenceParseProposalArgs (LALInferenceRunState *runState)
 Go through all logic for deciding proposals to use. More...
 
REAL8 LALInferenceCyclicProposal (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Proposes a jump from the next proposal in the proposal cycle. More...
 
void LALInferenceDeleteProposalCycle (LALInferenceProposalCycle *cycle)
 Completely remove the current proposal cycle, freeing the associated memory. More...
 
LALInferenceProposalCycleLALInferenceSetupDefaultInspiralProposalCycle (LALInferenceVariables *propArgs)
 A reasonable default proposal. More...
 
REAL8 LALInferenceSingleProposal (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Non-adaptive, sigle-variable update proposal with reasonable widths in each dimension. More...
 
REAL8 LALInferenceSingleAdaptProposal (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Like LALInferenceSingleProposal() but will use adaptation if the –adapt command-line flag given. More...
 
REAL8 LALInferencePolarizationPhaseJump (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Polarization-phase exact degeneracy. More...
 
REAL8 LALInferenceCorrPolarizationPhaseJump (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Polarization-phase correlation jump. More...
 
REAL8 LALInferenceCovarianceEigenvectorJump (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Choose a random covariance matrix eigenvector to jump along. More...
 
REAL8 LALInferenceSkyLocWanderJump (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Jump around by 0.01 radians in angle on the sky. More...
 
REAL8 LALInferenceDifferentialEvolutionFull (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Differential evolution, on all non-fixed, non-output parameters. More...
 
REAL8 LALInferenceDifferentialEvolutionNames (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams, const char *names[])
 Perform differential evolution on the parameters of the given names (the names array should be terminated by a NULL pointer). More...
 
REAL8 LALInferenceDifferentialEvolutionIntrinsic (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Perform differential evolution on only the intrinsic parameters. More...
 
REAL8 LALInferenceDifferentialEvolutionExtrinsic (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Perform a differential evolution step on only the extrinsic parameters. More...
 
REAL8 LALInferenceDrawApproxPrior (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Draws from an approximation to the true prior. More...
 
REAL8 LALInferenceDrawFlatPrior (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Draws from a flat prior for all variables where are flat prior is specified. More...
 
REAL8 LALInferenceSkyReflectDetPlane (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Reflects the sky location through the plane formed by three detectors. More...
 
REAL8 LALInferenceSkyRingProposal (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 
REAL8 LALInferenceGlitchMorletProposal (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 
REAL8 LALInferenceGlitchMorletReverseJump (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 
REAL8 LALInferencePSDFitJump (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 
REAL8 LALInferenceExtrinsicParamProposal (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Proposal for the extrinsic parameters. More...
 
REAL8 LALInferenceFrequencyBinJump (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Proposal to jump in frequency by one frequency bin. More...
 
REAL8 LALInferenceDistanceLikelihoodProposal (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 Proposal which draws a sample from the distance likelihood function Requires the currentParams to have optimal_snr and matched_filter_snr. More...
 
void LALInferenceZeroProposalStats (LALInferenceProposalCycle *cycle)
 
void LALInferenceTrackProposalAcceptance (LALInferenceThreadState *thread)
 Function for updating proposal acceptance rates if tracking. More...
 
void LALInferenceUpdateAdaptiveJumps (LALInferenceThreadState *thread, REAL8 targetAcceptance)
 Helper function to update the adaptive steps after each jump. More...
 
void LALInferenceSetupClusteredKDEProposalsFromASCII (LALInferenceThreadState *thread, FILE *input, INT4 burnin, REAL8 weight, INT4 ptmcmc)
 Setup all clustered-KDE proposals with samples read from file. More...
 
void LALInferenceAddClusteredKDEProposalToSet (LALInferenceVariables *propArgs, LALInferenceClusteredKDE *kde)
 Add a KDE proposal to the KDE proposal set. More...
 
void LALInferenceDestroyClusteredKDEProposal (LALInferenceClusteredKDE *proposal)
 Destroy an existing clustered-KDE proposal. More...
 
void LALInferenceSetupClusteredKDEProposalFromDEBuffer (LALInferenceThreadState *thread)
 Setup a clustered-KDE proposal from the differential evolution buffer. More...
 
void LALInferenceSetupClusteredKDEProposalFromRun (LALInferenceThreadState *thread, REAL8 *samples, INT4 size, INT4 cyclic_reflective, INT4 ntrials)
 Setup a clustered-KDE proposal from the parameters in a run. More...
 
REAL8 LALInferenceClusteredKDEProposal (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
 A proposal based on the clustered kernal density estimate of a set of samples. More...
 
REAL8 LALInferenceStoredClusteredKDEProposal (LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams, REAL8 *propDensity)
 An interface to the KDE proposal that avoids a KDE evaluation if possible. More...
 
void LALInferenceInitClusteredKDEProposal (LALInferenceThreadState *thread, LALInferenceClusteredKDE *kde, REAL8 *array, INT4 nSamps, LALInferenceVariables *params, const char *name, REAL8 weight, LALInferenceKmeans *(*cluster_method)(gsl_matrix *, INT4, gsl_rng *), INT4 cyclic_reflective, INT4 ntrials)
 Initialize a clustered-KDE proposal. More...
 
void LALInferenceDumpClusteredKDE (LALInferenceClusteredKDE *kde, char *outp_name, REAL8 *array)
 Dump draws from a KDE to file. More...
 
void LALInferenceDumpClusteredKDEDraws (LALInferenceClusteredKDE *kde, char *outp_name, INT4 nSamps)
 Dump clustered KDE information to file. More...
 
void LALInferenceComputeMaxAutoCorrLenFromDE (LALInferenceThreadState *thread, INT4 *maxACL)
 A wrapper for the KDE proposal that doesn't store KDE evaluations. More...
 
REAL8 LALInferenceComputeMaxAutoCorrLen (REAL8 *array, INT4 nPoints, INT4 nPar)
 Compute the maximum single-parameter autocorrelation length. More...
 
void LALInferenceUpdateMaxAutoCorrLen (LALInferenceThreadState *thread)
 Update the estimatate of the autocorrelation length. More...
 
INT4 LALInferenceComputeEffectiveSampleSize (LALInferenceThreadState *thread)
 Determine the effective sample size based on the DE buffer. More...
 
void LALInferenceSetupAdaptiveProposals (LALInferenceVariables *propArgs, LALInferenceVariables *params)
 Helper function to setup the adaptive step proposals before the run. More...
 
void LALInferenceSetupGlitchProposal (LALInferenceIFOData *data, LALInferenceVariables *propArgs)
 Setup glitch-related stuff. More...
 
int LALInferencePrintProposalTrackingHeader (FILE *fp, LALInferenceVariables *params)
 Output proposal tracking header to file *fp. More...
 
void LALInferencePrintProposalTracking (FILE *fp, LALInferenceProposalCycle *cycle, LALInferenceVariables *theta, LALInferenceVariables *theta_prime, REAL8 logPropRatio, INT4 accepted)
 Output proposal tracking information to file *fp. More...
 
REAL8 LALInferenceEnsembleStretchFull (LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *proposedParams)
 Ensemble stretch moves - see http://dx.doi.org/10.2140/camcos.2010.5.65. More...
 
REAL8 LALInferenceEnsembleStretchIntrinsic (LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *pp)
 
REAL8 LALInferenceEnsembleStretchExtrinsic (LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *pp)
 
REAL8 LALInferenceEnsembleStretchNames (LALInferenceThreadState *thread, LALInferenceVariables *cpi, LALInferenceVariables *ppi, const char **names)
 
REAL8 LALInferenceEnsembleWalkFull (LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *proposedParams)
 
REAL8 LALInferenceEnsembleWalkIntrinsic (LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *pp)
 
REAL8 LALInferenceEnsembleWalkExtrinsic (LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *pp)
 
REAL8 LALInferenceEnsembleWalkNames (LALInferenceThreadState *thread, LALInferenceVariables *cpi, LALInferenceVariables *ppi, const char **names)
 
REAL8 LALInferenceSplineCalibrationProposal (LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *pp)
 Proposes jumps in the spline calibration parameters, if present. More...
 

Data Structures

struct  LALInferenceClusteredKDE
 Struct to hold clustered-KDE estimates. More...
 

Macros

#define MAX_STRLEN   512
 
#define ADAPTSUFFIX   "adapt_sigma"
 
#define ACCEPTSUFFIX   "accepted"
 
#define PROPOSEDSUFFIX   "proposed"
 

Variables

const char *const cycleArrayName
 
const char *const cycleArrayLengthName
 
const char *const cycleArrayCounterName
 
const char *const nullProposalName
 
const char *const singleAdaptProposalName
 
const char *const singleProposalName
 
const char *const orbitalPhaseJumpName
 
const char *const covarianceEigenvectorJumpName
 
const char *const skyLocWanderJumpName
 
const char *const differentialEvolutionFullName
 
const char *const differentialEvolutionIntrinsicName
 
const char *const differentialEvolutionExtrinsicName
 
const char *const ensembleStretchFullName
 
const char *const ensembleStretchIntrinsicName
 
const char *const ensembleStretchExtrinsicName
 
const char *const drawApproxPriorName
 
const char *const drawFlatPriorName
 
const char *const skyReflectDetPlaneName
 
const char *const skyRingProposalName
 
const char *const PSDFitJumpName
 
const char *const polarizationPhaseJumpName
 
const char *const polarizationCorrPhaseJumpName
 
const char *const extrinsicParamProposalName
 
const char *const frequencyBinJumpName
 
const char *const GlitchMorletJumpName
 
const char *const GlitchMorletReverseJumpName
 
const char *const ensembleWalkFullName
 
const char *const ensembleWalkIntrinsicName
 
const char *const ensembleWalkExtrinsicName
 
const char *const clusteredKDEProposalName
 

Function Documentation

◆ LALInferenceInitProposal()

LALInferenceProposal* LALInferenceInitProposal ( LALInferenceProposalFunction  func,
const char name 
)

Creates a new proposal object from the given func pointer and name.

Definition at line 133 of file LALInferenceProposal.c.

◆ LALInferenceRegisterProposal()

void LALInferenceRegisterProposal ( LALInferenceVariables propArgs,
const char name,
INT4 flag,
ProcessParamsTable command_line 
)

Use a default flag and a check of the command-line to set proposal flags in proposal args.

Definition at line 144 of file LALInferenceProposal.c.

◆ LALInferenceAddProposalToCycle()

void LALInferenceAddProposalToCycle ( LALInferenceProposalCycle cycle,
LALInferenceProposal prop,
INT4  weight 
)

Adds weight copies of the proposal prop to the end of the proposal cycle.

After adding all desired sub-proposals, call LALInferenceRandomizeProposalCycle() to randomize the order of sub-proposal application.

Definition at line 159 of file LALInferenceProposal.c.

◆ LALInferenceRandomizeProposalCycle()

void LALInferenceRandomizeProposalCycle ( LALInferenceProposalCycle cycle,
gsl_rng *  rng 
)

Randomizes the order of the proposals in the proposal cycle.

Definition at line 190 of file LALInferenceProposal.c.

◆ LALInferenceInitProposalCycle()

LALInferenceProposalCycle* LALInferenceInitProposalCycle ( void  )

Create a new proposal cycle.

Definition at line 239 of file LALInferenceProposal.c.

◆ LALInferenceParseProposalArgs()

LALInferenceVariables* LALInferenceParseProposalArgs ( LALInferenceRunState runState)

Go through all logic for deciding proposals to use.

Definition at line 251 of file LALInferenceProposal.c.

◆ LALInferenceCyclicProposal()

REAL8 LALInferenceCyclicProposal ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Proposes a jump from the next proposal in the proposal cycle.

Definition at line 204 of file LALInferenceProposal.c.

◆ LALInferenceDeleteProposalCycle()

void LALInferenceDeleteProposalCycle ( LALInferenceProposalCycle cycle)

Completely remove the current proposal cycle, freeing the associated memory.

Definition at line 246 of file LALInferenceProposal.c.

◆ LALInferenceSetupDefaultInspiralProposalCycle()

LALInferenceProposalCycle* LALInferenceSetupDefaultInspiralProposalCycle ( LALInferenceVariables propArgs)

A reasonable default proposal.

Uses adaptation if the –adapt command-line flag active.

Definition at line 482 of file LALInferenceProposal.c.

◆ LALInferenceSingleProposal()

REAL8 LALInferenceSingleProposal ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Non-adaptive, sigle-variable update proposal with reasonable widths in each dimension.

Definition at line 672 of file LALInferenceProposal.c.

◆ LALInferenceSingleAdaptProposal()

REAL8 LALInferenceSingleAdaptProposal ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Like LALInferenceSingleProposal() but will use adaptation if the –adapt command-line flag given.

Definition at line 597 of file LALInferenceProposal.c.

◆ LALInferencePolarizationPhaseJump()

REAL8 LALInferencePolarizationPhaseJump ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Polarization-phase exact degeneracy.

◆ LALInferenceCorrPolarizationPhaseJump()

REAL8 LALInferenceCorrPolarizationPhaseJump ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Polarization-phase correlation jump.

Definition at line 2350 of file LALInferenceProposal.c.

◆ LALInferenceCovarianceEigenvectorJump()

REAL8 LALInferenceCovarianceEigenvectorJump ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Choose a random covariance matrix eigenvector to jump along.

Definition at line 755 of file LALInferenceProposal.c.

◆ LALInferenceSkyLocWanderJump()

REAL8 LALInferenceSkyLocWanderJump ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Jump around by 0.01 radians in angle on the sky.

Definition at line 803 of file LALInferenceProposal.c.

◆ LALInferenceDifferentialEvolutionFull()

REAL8 LALInferenceDifferentialEvolutionFull ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Differential evolution, on all non-fixed, non-output parameters.

Definition at line 834 of file LALInferenceProposal.c.

◆ LALInferenceDifferentialEvolutionNames()

REAL8 LALInferenceDifferentialEvolutionNames ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams,
const char names[] 
)

Perform differential evolution on the parameters of the given names (the names array should be terminated by a NULL pointer).

If names == NULL, then perform a LALInferenceDifferentialEvolutionFull() step.

◆ LALInferenceDifferentialEvolutionIntrinsic()

REAL8 LALInferenceDifferentialEvolutionIntrinsic ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Perform differential evolution on only the intrinsic parameters.

Definition at line 1144 of file LALInferenceProposal.c.

◆ LALInferenceDifferentialEvolutionExtrinsic()

REAL8 LALInferenceDifferentialEvolutionExtrinsic ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Perform a differential evolution step on only the extrinsic parameters.

Definition at line 1151 of file LALInferenceProposal.c.

◆ LALInferenceDrawApproxPrior()

REAL8 LALInferenceDrawApproxPrior ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Draws from an approximation to the true prior.

Flat in all variables except for: Mc^(-11/6), flat in cos(co-latitudes), flat in sin(dec), dist^2. WARNING: This seems to break detailed balance for the LALInferenceProposalTest

Definition at line 1261 of file LALInferenceProposal.c.

◆ LALInferenceDrawFlatPrior()

REAL8 LALInferenceDrawFlatPrior ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Draws from a flat prior for all variables where are flat prior is specified.

Variables that do not have a flat prior are not moved.

Definition at line 1356 of file LALInferenceProposal.c.

◆ LALInferenceSkyReflectDetPlane()

REAL8 LALInferenceSkyReflectDetPlane ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Reflects the sky location through the plane formed by three detectors.

Should only be used when there are exactly three different locations for detectors.

Definition at line 1758 of file LALInferenceProposal.c.

◆ LALInferenceSkyRingProposal()

REAL8 LALInferenceSkyRingProposal ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Definition at line 1592 of file LALInferenceProposal.c.

◆ LALInferenceGlitchMorletProposal()

REAL8 LALInferenceGlitchMorletProposal ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Definition at line 2014 of file LALInferenceProposal.c.

◆ LALInferenceGlitchMorletReverseJump()

REAL8 LALInferenceGlitchMorletReverseJump ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Definition at line 2163 of file LALInferenceProposal.c.

◆ LALInferencePSDFitJump()

REAL8 LALInferencePSDFitJump ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Definition at line 1845 of file LALInferenceProposal.c.

◆ LALInferenceExtrinsicParamProposal()

REAL8 LALInferenceExtrinsicParamProposal ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Proposal for the extrinsic parameters.

Uses the sky reflection for 3 independent detector locations, then computes the corresponding values of polarisation, inclination and distance for the proposed sky location. See Vivien's thesis for the details of the equations implemented.

Definition at line 2632 of file LALInferenceProposal.c.

◆ LALInferenceFrequencyBinJump()

REAL8 LALInferenceFrequencyBinJump ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Proposal to jump in frequency by one frequency bin.

The frequency bin size df must be given as a (fixed) variable in the proposedParams. The frequency parameter is presumed to have the variable name f0.

Definition at line 2391 of file LALInferenceProposal.c.

◆ LALInferenceDistanceLikelihoodProposal()

REAL8 LALInferenceDistanceLikelihoodProposal ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

Proposal which draws a sample from the distance likelihood function Requires the currentParams to have optimal_snr and matched_filter_snr.

Definition at line 2542 of file LALInferenceProposal.c.

◆ LALInferenceZeroProposalStats()

void LALInferenceZeroProposalStats ( LALInferenceProposalCycle cycle)

Definition at line 2872 of file LALInferenceProposal.c.

◆ LALInferenceTrackProposalAcceptance()

void LALInferenceTrackProposalAcceptance ( LALInferenceThreadState thread)

Function for updating proposal acceptance rates if tracking.

Function for updating proposal acceptance rates if tracking.

Definition at line 2851 of file LALInferenceProposal.c.

◆ LALInferenceUpdateAdaptiveJumps()

void LALInferenceUpdateAdaptiveJumps ( LALInferenceThreadState thread,
REAL8  targetAcceptance 
)

Helper function to update the adaptive steps after each jump.

Set accepted=1 if accepted, 0 otherwise

Helper function to update the adaptive steps after each jump.

Whether or not a jump was accepted is passed with accepted

Definition at line 2886 of file LALInferenceProposal.c.

◆ LALInferenceSetupClusteredKDEProposalsFromASCII()

void LALInferenceSetupClusteredKDEProposalsFromASCII ( LALInferenceThreadState thread,
FILE *  input,
INT4  burnin,
REAL8  weight,
INT4  ptmcmc 
)

Setup all clustered-KDE proposals with samples read from file.

Constructed clustered-KDE proposals from all sample lists provided in files given on the command line.

Parameters
threadThe LALInferenceThreadState to get command line options from and to the proposal cycle of.
inputThe input file pointer
burninThe number of burn-in points
weightThe weight?
ptmcmcFlag to determine if using parallel tempering MCMC

Definition at line 2979 of file LALInferenceProposal.c.

◆ LALInferenceAddClusteredKDEProposalToSet()

void LALInferenceAddClusteredKDEProposalToSet ( LALInferenceVariables propArgs,
LALInferenceClusteredKDE kde 
)

Add a KDE proposal to the KDE proposal set.

If other KDE proposals already exist, the provided KDE is appended to the list, otherwise it is added as the first of such proposals.

Parameters
propArgsThe proposal arguments to be added to.
[in]kdeThe proposal to be added to thread->cycle.

Definition at line 3215 of file LALInferenceProposal.c.

◆ LALInferenceDestroyClusteredKDEProposal()

void LALInferenceDestroyClusteredKDEProposal ( LALInferenceClusteredKDE proposal)

Destroy an existing clustered-KDE proposal.

Convenience function for freeing a clustered KDE proposal that already exists. This is particularly useful for a proposal that is updated during a run.

Parameters
proposalThe proposal to be destroyed.

Definition at line 3261 of file LALInferenceProposal.c.

◆ LALInferenceSetupClusteredKDEProposalFromDEBuffer()

void LALInferenceSetupClusteredKDEProposalFromDEBuffer ( LALInferenceThreadState thread)

Setup a clustered-KDE proposal from the differential evolution buffer.

Reads the samples currently in the differential evolution buffer and construct a jump proposal from its clustered kernel density estimate.

Parameters
threadThe LALInferenceThreadState to get the buffer from and add the proposal to.

Definition at line 3278 of file LALInferenceProposal.c.

◆ LALInferenceSetupClusteredKDEProposalFromRun()

void LALInferenceSetupClusteredKDEProposalFromRun ( LALInferenceThreadState thread,
REAL8 samples,
INT4  size,
INT4  cyclic_reflective,
INT4  ntrials 
)

Setup a clustered-KDE proposal from the parameters in a run.

Reads the samples currently in the differential evolution buffer and construct a jump proposal from its clustered kernel density estimate.

Parameters
threadThe LALInferenceThreadState to get the buffer from and add the proposal to.
samplesThe samples to estimate the distribution of. Column order expected to match the order in thread->currentParams.
sizeNumber of samples in samples.
cyclic_reflectiveFlag to check for cyclic/reflective bounds.
ntrialsNumber of tirals at fixed-k to find optimal BIC

Definition at line 3327 of file LALInferenceProposal.c.

◆ LALInferenceClusteredKDEProposal()

REAL8 LALInferenceClusteredKDEProposal ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams 
)

A proposal based on the clustered kernal density estimate of a set of samples.

Proposes samples from the estimated distribution of a collection of points. The distribution is estimated with a clustered kernel density estimator. This proposal is added to the proposal cycle with a specified weight, and in turn chooses at random a KDE-estimate from a linked list.

Parameters
threadThe current LALInferenceThreadState.
currentParamsThe current parameters.
[out]proposedParamsThe proposed parameters.
Returns
proposal_ratio The (log) proposal ratio for maintaining detailed balance

Definition at line 3370 of file LALInferenceProposal.c.

◆ LALInferenceStoredClusteredKDEProposal()

REAL8 LALInferenceStoredClusteredKDEProposal ( LALInferenceThreadState thread,
LALInferenceVariables currentParams,
LALInferenceVariables proposedParams,
REAL8 propDensity 
)

An interface to the KDE proposal that avoids a KDE evaluation if possible.

If the value of the KDE at the current location is known, use it. Otherwise calculate and return.

Parameters
threadThe current LALInferenceThreadState.
currentParamsThe current parameters.
[out]proposedParamsThe proposed parameters.
propDensityIf input is not NULL or >-INFINITY, assume this is the proposal density at currentParams, otherwise calculate. It is then replaced with the proposal density at proposedParams.
Returns
proposal_ratio The (log) proposal ratio for maintaining detailed balance

Definition at line 3392 of file LALInferenceProposal.c.

◆ LALInferenceInitClusteredKDEProposal()

void LALInferenceInitClusteredKDEProposal ( LALInferenceThreadState thread,
LALInferenceClusteredKDE kde,
REAL8 array,
INT4  nSamps,
LALInferenceVariables params,
const char name,
REAL8  weight,
LALInferenceKmeans *(*)(gsl_matrix *, INT4, gsl_rng *)  cluster_method,
INT4  cyclic_reflective,
INT4  ntrials 
)

Initialize a clustered-KDE proposal.

Estimates the underlying distribution of a set of points with a clustered kernel density estimate and constructs a jump proposal from the estimated distribution.

Parameters
threadThe current LALInferenceThreadState.
[out]kdeAn empty proposal structure to populate with the clustered-KDE estimate.
[in]arrayThe data to estimate the underlying distribution of.
[in]nSampsNumber of samples contained in array.
[in]paramsThe parameters contained in array.
[in]nameThe name of the proposal being constructed.
[in]weightThe relative weight this proposal is to have against other KDE proposals.
[in]cluster_methodA pointer to the clustering function to be used.
[in]cyclic_reflectiveFlag to check for cyclic/reflective bounds.
[in]ntrialsNumber of kmeans attempts at fixed k to find optimal BIC.

Definition at line 3098 of file LALInferenceProposal.c.

◆ LALInferenceDumpClusteredKDE()

void LALInferenceDumpClusteredKDE ( LALInferenceClusteredKDE kde,
char outp_name,
REAL8 array 
)

Dump draws from a KDE to file.

Print out the samples used to estimate the distribution, along with their cluster assignments, and the PDF evaluated at each sample.

Parameters
[in]kdeThe clustered KDE to dump the info of.
[in]outp_nameThe name of the output file.
[in]arrayThe array of samples used for the KDE (it only stores a whitened version).

Definition at line 3158 of file LALInferenceProposal.c.

◆ LALInferenceDumpClusteredKDEDraws()

void LALInferenceDumpClusteredKDEDraws ( LALInferenceClusteredKDE kde,
char outp_name,
INT4  nSamps 
)

Dump clustered KDE information to file.

Dump a requested number of draws from a clustered-KDE to file, along with the value of the PDF at each point.

Parameters
[in]kdeThe clustered-KDE proposal to draw from.
[in]outp_nameThe name of the file to write to.
[in]nSampsThe number of draws to write.

Definition at line 3186 of file LALInferenceProposal.c.

◆ LALInferenceComputeMaxAutoCorrLenFromDE()

void LALInferenceComputeMaxAutoCorrLenFromDE ( LALInferenceThreadState thread,
INT4 maxACL 
)

A wrapper for the KDE proposal that doesn't store KDE evaluations.

Compute the maximum ACL from the differential evolution buffer.

Given the current differential evolution buffer, the maximum one-dimensional autocorrelation length is found.

Parameters
threadThe thread state containing the differential evolution buffer.
maxACLUNDOCUMENTED

Definition at line 3474 of file LALInferenceProposal.c.

◆ LALInferenceComputeMaxAutoCorrLen()

REAL8 LALInferenceComputeMaxAutoCorrLen ( REAL8 array,
INT4  nPoints,
INT4  nPar 
)

Compute the maximum single-parameter autocorrelation length.

Each parameter's ACL is the smallest s such that

1 + 2*ACF(1) + 2*ACF(2) + ... + 2*ACF(M*s) < s,

The parameter M controls the length of the window over which we sum the ACF to estimate the ACL; there must be at least M*ACL samples summed. This ensures that we obtain a reliable estimate of the ACL by incorporating lags that are much longer that the estimated ACL.

The maximum window length is also restricted to be N/K as a safety precaution against relying on data near the extreme of the lags in the ACF, where there is a lot of noise.

By default, safe parameters are M = 5, K = 2.

If no estimate can be obtained, then return Infinity.

Parameters
arrayArray with rows containing samples.
nPointsUNDOCUMENTED
nParUNDOCUMENTED
Returns
The maximum one-dimensional autocorrelation length

Definition at line 3530 of file LALInferenceProposal.c.

◆ LALInferenceUpdateMaxAutoCorrLen()

void LALInferenceUpdateMaxAutoCorrLen ( LALInferenceThreadState thread)

Update the estimatate of the autocorrelation length.

Parameters
threadThe current LALInferenceThreadState.

Definition at line 3581 of file LALInferenceProposal.c.

◆ LALInferenceComputeEffectiveSampleSize()

INT4 LALInferenceComputeEffectiveSampleSize ( LALInferenceThreadState thread)

Determine the effective sample size based on the DE buffer.

Compute the number of independent samples in the differential evolution buffer.

Parameters
threadThe current LALInferenceThreadState.

Definition at line 3597 of file LALInferenceProposal.c.

◆ LALInferenceSetupAdaptiveProposals()

void LALInferenceSetupAdaptiveProposals ( LALInferenceVariables propArgs,
LALInferenceVariables params 
)

Helper function to setup the adaptive step proposals before the run.

Helper function to setup the adaptive step proposals before the run.

Should be called when state->currentParams is already filled with an initial sample

Definition at line 2793 of file LALInferenceProposal.c.

◆ LALInferenceSetupGlitchProposal()

void LALInferenceSetupGlitchProposal ( LALInferenceIFOData data,
LALInferenceVariables propArgs 
)

Setup glitch-related stuff.

Definition at line 2749 of file LALInferenceProposal.c.

◆ LALInferencePrintProposalTrackingHeader()

int LALInferencePrintProposalTrackingHeader ( FILE *  fp,
LALInferenceVariables params 
)

Output proposal tracking header to file *fp.

Definition at line 3612 of file LALInferenceProposal.c.

◆ LALInferencePrintProposalTracking()

void LALInferencePrintProposalTracking ( FILE *  fp,
LALInferenceProposalCycle cycle,
LALInferenceVariables theta,
LALInferenceVariables theta_prime,
REAL8  logPropRatio,
INT4  accepted 
)

Output proposal tracking information to file *fp.

Definition at line 3621 of file LALInferenceProposal.c.

◆ LALInferenceEnsembleStretchFull()

REAL8 LALInferenceEnsembleStretchFull ( LALInferenceThreadState thread,
LALInferenceVariables cp,
LALInferenceVariables proposedParams 
)

Ensemble stretch moves - see http://dx.doi.org/10.2140/camcos.2010.5.65.

Definition at line 840 of file LALInferenceProposal.c.

◆ LALInferenceEnsembleStretchIntrinsic()

REAL8 LALInferenceEnsembleStretchIntrinsic ( LALInferenceThreadState thread,
LALInferenceVariables cp,
LALInferenceVariables pp 
)

Definition at line 847 of file LALInferenceProposal.c.

◆ LALInferenceEnsembleStretchExtrinsic()

REAL8 LALInferenceEnsembleStretchExtrinsic ( LALInferenceThreadState thread,
LALInferenceVariables cp,
LALInferenceVariables pp 
)

Definition at line 855 of file LALInferenceProposal.c.

◆ LALInferenceEnsembleStretchNames()

REAL8 LALInferenceEnsembleStretchNames ( LALInferenceThreadState thread,
LALInferenceVariables cpi,
LALInferenceVariables ppi,
const char **  names 
)

Definition at line 868 of file LALInferenceProposal.c.

◆ LALInferenceEnsembleWalkFull()

REAL8 LALInferenceEnsembleWalkFull ( LALInferenceThreadState thread,
LALInferenceVariables cp,
LALInferenceVariables proposedParams 
)

Definition at line 959 of file LALInferenceProposal.c.

◆ LALInferenceEnsembleWalkIntrinsic()

REAL8 LALInferenceEnsembleWalkIntrinsic ( LALInferenceThreadState thread,
LALInferenceVariables cp,
LALInferenceVariables pp 
)

Definition at line 966 of file LALInferenceProposal.c.

◆ LALInferenceEnsembleWalkExtrinsic()

REAL8 LALInferenceEnsembleWalkExtrinsic ( LALInferenceThreadState thread,
LALInferenceVariables cp,
LALInferenceVariables pp 
)

Definition at line 974 of file LALInferenceProposal.c.

◆ LALInferenceEnsembleWalkNames()

REAL8 LALInferenceEnsembleWalkNames ( LALInferenceThreadState thread,
LALInferenceVariables cpi,
LALInferenceVariables ppi,
const char **  names 
)

Definition at line 981 of file LALInferenceProposal.c.

◆ LALInferenceSplineCalibrationProposal()

REAL8 LALInferenceSplineCalibrationProposal ( LALInferenceThreadState thread,
LALInferenceVariables cp,
LALInferenceVariables pp 
)

Proposes jumps in the spline calibration parameters, if present.

Definition at line 3631 of file LALInferenceProposal.c.

Macro Definition Documentation

◆ MAX_STRLEN

#define MAX_STRLEN   512

Definition at line 88 of file LALInferenceProposal.h.

◆ ADAPTSUFFIX

#define ADAPTSUFFIX   "adapt_sigma"

Definition at line 89 of file LALInferenceProposal.h.

◆ ACCEPTSUFFIX

#define ACCEPTSUFFIX   "accepted"

Definition at line 90 of file LALInferenceProposal.h.

◆ PROPOSEDSUFFIX

#define PROPOSEDSUFFIX   "proposed"

Definition at line 91 of file LALInferenceProposal.h.

Variable Documentation

◆ cycleArrayName

const char* const cycleArrayName
extern

Definition at line 62 of file LALInferenceProposal.c.

◆ cycleArrayLengthName

const char* const cycleArrayLengthName
extern

Definition at line 63 of file LALInferenceProposal.c.

◆ cycleArrayCounterName

const char* const cycleArrayCounterName
extern

Definition at line 64 of file LALInferenceProposal.c.

◆ nullProposalName

const char* const nullProposalName
extern

Definition at line 67 of file LALInferenceProposal.c.

◆ singleAdaptProposalName

const char* const singleAdaptProposalName
extern

Definition at line 68 of file LALInferenceProposal.c.

◆ singleProposalName

const char* const singleProposalName
extern

Definition at line 69 of file LALInferenceProposal.c.

◆ orbitalPhaseJumpName

const char* const orbitalPhaseJumpName
extern

Definition at line 70 of file LALInferenceProposal.c.

◆ covarianceEigenvectorJumpName

const char* const covarianceEigenvectorJumpName
extern

Definition at line 71 of file LALInferenceProposal.c.

◆ skyLocWanderJumpName

const char* const skyLocWanderJumpName
extern

Definition at line 72 of file LALInferenceProposal.c.

◆ differentialEvolutionFullName

const char* const differentialEvolutionFullName
extern

Definition at line 73 of file LALInferenceProposal.c.

◆ differentialEvolutionIntrinsicName

const char* const differentialEvolutionIntrinsicName
extern

Definition at line 74 of file LALInferenceProposal.c.

◆ differentialEvolutionExtrinsicName

const char* const differentialEvolutionExtrinsicName
extern

Definition at line 75 of file LALInferenceProposal.c.

◆ ensembleStretchFullName

const char* const ensembleStretchFullName
extern

Definition at line 76 of file LALInferenceProposal.c.

◆ ensembleStretchIntrinsicName

const char* const ensembleStretchIntrinsicName
extern

Definition at line 77 of file LALInferenceProposal.c.

◆ ensembleStretchExtrinsicName

const char* const ensembleStretchExtrinsicName
extern

Definition at line 78 of file LALInferenceProposal.c.

◆ drawApproxPriorName

const char* const drawApproxPriorName
extern

Definition at line 79 of file LALInferenceProposal.c.

◆ drawFlatPriorName

const char* const drawFlatPriorName
extern

Definition at line 80 of file LALInferenceProposal.c.

◆ skyReflectDetPlaneName

const char* const skyReflectDetPlaneName
extern

Definition at line 81 of file LALInferenceProposal.c.

◆ skyRingProposalName

const char* const skyRingProposalName
extern

Definition at line 82 of file LALInferenceProposal.c.

◆ PSDFitJumpName

const char* const PSDFitJumpName
extern

Definition at line 83 of file LALInferenceProposal.c.

◆ polarizationPhaseJumpName

const char* const polarizationPhaseJumpName
extern

Definition at line 84 of file LALInferenceProposal.c.

◆ polarizationCorrPhaseJumpName

const char* const polarizationCorrPhaseJumpName
extern

Definition at line 85 of file LALInferenceProposal.c.

◆ extrinsicParamProposalName

const char* const extrinsicParamProposalName
extern

Definition at line 86 of file LALInferenceProposal.c.

◆ frequencyBinJumpName

const char* const frequencyBinJumpName
extern

Definition at line 87 of file LALInferenceProposal.c.

◆ GlitchMorletJumpName

const char* const GlitchMorletJumpName
extern

Definition at line 88 of file LALInferenceProposal.c.

◆ GlitchMorletReverseJumpName

const char* const GlitchMorletReverseJumpName
extern

Definition at line 89 of file LALInferenceProposal.c.

◆ ensembleWalkFullName

const char* const ensembleWalkFullName
extern

Definition at line 90 of file LALInferenceProposal.c.

◆ ensembleWalkIntrinsicName

const char* const ensembleWalkIntrinsicName
extern

Definition at line 91 of file LALInferenceProposal.c.

◆ ensembleWalkExtrinsicName

const char* const ensembleWalkExtrinsicName
extern

Definition at line 92 of file LALInferenceProposal.c.

◆ clusteredKDEProposalName

const char* const clusteredKDEProposalName
extern

Definition at line 93 of file LALInferenceProposal.c.