23 #ifndef LALInferenceProposal_h
24 #define LALInferenceProposal_h
26 #include <lal/LALInference.h>
27 #include <lal/LALInferenceClusteredKDE.h>
88 #define MAX_STRLEN 512
89 #define ADAPTSUFFIX "adapt_sigma"
90 #define ACCEPTSUFFIX "accepted"
91 #define PROPOSEDSUFFIX "proposed"
273 tagLALInferenceClusteredKDEProposal
280 struct tagLALInferenceClusteredKDEProposal *
next;
306 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);
LALInferenceVariables currentParams
REAL8(* LALInferenceProposalFunction)(struct tagLALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Jump proposal distribution Computes proposedParams based on currentParams and additional variables st...
REAL8 LALInferenceEnsembleWalkNames(LALInferenceThreadState *thread, LALInferenceVariables *cpi, LALInferenceVariables *ppi, const char **names)
REAL8 LALInferenceEnsembleStretchFull(LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *proposedParams)
Ensemble stretch moves - see http://dx.doi.org/10.2140/camcos.2010.5.65.
const char *const singleAdaptProposalName
void LALInferenceDumpClusteredKDEDraws(LALInferenceClusteredKDE *kde, char *outp_name, INT4 nSamps)
Dump clustered KDE information to file.
const char *const polarizationPhaseJumpName
REAL8 LALInferenceSkyRingProposal(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
const char *const GlitchMorletJumpName
void LALInferenceDestroyClusteredKDEProposal(LALInferenceClusteredKDE *proposal)
Destroy an existing clustered-KDE proposal.
REAL8 LALInferenceSkyLocWanderJump(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Jump around by 0.01 radians in angle on the sky.
const char *const frequencyBinJumpName
REAL8 LALInferenceEnsembleStretchIntrinsic(LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *pp)
const char *const ensembleWalkIntrinsicName
const char *const singleProposalName
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 termin...
void LALInferenceSetupAdaptiveProposals(LALInferenceVariables *propArgs, LALInferenceVariables *params)
Helper function to setup the adaptive step proposals before the run.
const char *const extrinsicParamProposalName
const char *const covarianceEigenvectorJumpName
const char *const ensembleStretchExtrinsicName
REAL8 LALInferenceEnsembleWalkFull(LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *proposedParams)
REAL8 LALInferenceCovarianceEigenvectorJump(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Choose a random covariance matrix eigenvector to jump along.
const char *const cycleArrayName
void LALInferenceUpdateMaxAutoCorrLen(LALInferenceThreadState *thread)
Update the estimatate of the autocorrelation length.
REAL8 LALInferenceGlitchMorletProposal(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
REAL8 LALInferenceExtrinsicParamProposal(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Proposal for the extrinsic parameters.
const char *const drawFlatPriorName
REAL8 LALInferenceGlitchMorletReverseJump(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
const char *const differentialEvolutionExtrinsicName
const char *const GlitchMorletReverseJumpName
REAL8 LALInferenceSplineCalibrationProposal(LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *pp)
Proposes jumps in the spline calibration parameters, if present.
REAL8 LALInferenceSingleAdaptProposal(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Like LALInferenceSingleProposal() but will use adaptation if the –adapt command-line flag given.
const char *const cycleArrayCounterName
const char *const ensembleStretchIntrinsicName
REAL8 LALInferenceComputeMaxAutoCorrLen(REAL8 *array, INT4 nPoints, INT4 nPar)
Compute the maximum single-parameter autocorrelation length.
LALInferenceProposalCycle * LALInferenceInitProposalCycle(void)
Create a new proposal cycle.
const char *const PSDFitJumpName
REAL8 LALInferenceEnsembleWalkIntrinsic(LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *pp)
REAL8 LALInferenceDifferentialEvolutionExtrinsic(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Perform a differential evolution step on only the extrinsic parameters.
REAL8 LALInferenceStoredClusteredKDEProposal(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams, REAL8 *propDensity)
An interface to the KDE proposal that avoids a KDE evaluation if possible.
const char *const skyRingProposalName
const char *const ensembleWalkExtrinsicName
const char *const clusteredKDEProposalName
REAL8 LALInferenceSingleProposal(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Non-adaptive, sigle-variable update proposal with reasonable widths in each dimension.
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.
LALInferenceVariables * LALInferenceParseProposalArgs(LALInferenceRunState *runState)
Go through all logic for deciding proposals to use.
REAL8 LALInferenceEnsembleStretchExtrinsic(LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *pp)
REAL8 LALInferenceDistanceLikelihoodProposal(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Proposal which draws a sample from the distance likelihood function Requires the currentParams to hav...
void LALInferenceUpdateAdaptiveJumps(LALInferenceThreadState *thread, REAL8 targetAcceptance)
Helper function to update the adaptive steps after each jump.
LALInferenceProposalCycle * LALInferenceSetupDefaultInspiralProposalCycle(LALInferenceVariables *propArgs)
A reasonable default proposal.
void LALInferenceAddProposalToCycle(LALInferenceProposalCycle *cycle, LALInferenceProposal *prop, INT4 weight)
Adds weight copies of the proposal prop to the end of the proposal cycle.
const char *const drawApproxPriorName
int LALInferencePrintProposalTrackingHeader(FILE *fp, LALInferenceVariables *params)
Output proposal tracking header to file *fp.
void LALInferenceDeleteProposalCycle(LALInferenceProposalCycle *cycle)
Completely remove the current proposal cycle, freeing the associated memory.
const char *const polarizationCorrPhaseJumpName
void LALInferenceComputeMaxAutoCorrLenFromDE(LALInferenceThreadState *thread, INT4 *maxACL)
A wrapper for the KDE proposal that doesn't store KDE evaluations.
void LALInferenceTrackProposalAcceptance(LALInferenceThreadState *thread)
Function for updating proposal acceptance rates if tracking.
LALInferenceProposal * LALInferenceInitProposal(LALInferenceProposalFunction func, const char *name)
Creates a new proposal object from the given func pointer and name.
void LALInferenceSetupClusteredKDEProposalFromDEBuffer(LALInferenceThreadState *thread)
Setup a clustered-KDE proposal from the differential evolution buffer.
void LALInferencePrintProposalTracking(FILE *fp, LALInferenceProposalCycle *cycle, LALInferenceVariables *theta, LALInferenceVariables *theta_prime, REAL8 logPropRatio, INT4 accepted)
Output proposal tracking information to file *fp.
void LALInferenceDumpClusteredKDE(LALInferenceClusteredKDE *kde, char *outp_name, REAL8 *array)
Dump draws from a KDE to file.
void LALInferenceZeroProposalStats(LALInferenceProposalCycle *cycle)
INT4 LALInferenceComputeEffectiveSampleSize(LALInferenceThreadState *thread)
Determine the effective sample size based on the DE buffer.
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.
void LALInferenceSetupClusteredKDEProposalsFromASCII(LALInferenceThreadState *thread, FILE *input, INT4 burnin, REAL8 weight, INT4 ptmcmc)
Setup all clustered-KDE proposals with samples read from file.
const char *const orbitalPhaseJumpName
REAL8 LALInferenceCorrPolarizationPhaseJump(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Polarization-phase correlation jump.
const char *const skyReflectDetPlaneName
const char *const skyLocWanderJumpName
const char *const ensembleWalkFullName
void LALInferenceAddClusteredKDEProposalToSet(LALInferenceVariables *propArgs, LALInferenceClusteredKDE *kde)
Add a KDE proposal to the KDE proposal set.
void LALInferenceRandomizeProposalCycle(LALInferenceProposalCycle *cycle, gsl_rng *rng)
Randomizes the order of the proposals in the proposal cycle.
REAL8 LALInferenceEnsembleStretchNames(LALInferenceThreadState *thread, LALInferenceVariables *cpi, LALInferenceVariables *ppi, const char **names)
REAL8 LALInferenceDifferentialEvolutionFull(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Differential evolution, on all non-fixed, non-output parameters.
REAL8 LALInferenceDifferentialEvolutionIntrinsic(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Perform differential evolution on only the intrinsic parameters.
REAL8 LALInferenceDrawFlatPrior(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Draws from a flat prior for all variables where are flat prior is specified.
const char *const differentialEvolutionIntrinsicName
REAL8 LALInferenceCyclicProposal(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Proposes a jump from the next proposal in the proposal cycle.
REAL8 LALInferencePolarizationPhaseJump(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Polarization-phase exact degeneracy.
void LALInferenceSetupGlitchProposal(LALInferenceIFOData *data, LALInferenceVariables *propArgs)
Setup glitch-related stuff.
const char *const cycleArrayLengthName
const char *const ensembleStretchFullName
void LALInferenceSetupClusteredKDEProposalFromRun(LALInferenceThreadState *thread, REAL8 *samples, INT4 size, INT4 cyclic_reflective, INT4 ntrials)
Setup a clustered-KDE proposal from the parameters in a run.
REAL8 LALInferenceDrawApproxPrior(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Draws from an approximation to the true prior.
REAL8 LALInferencePSDFitJump(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
REAL8 LALInferenceSkyReflectDetPlane(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Reflects the sky location through the plane formed by three detectors.
REAL8 LALInferenceEnsembleWalkExtrinsic(LALInferenceThreadState *thread, LALInferenceVariables *cp, LALInferenceVariables *pp)
REAL8 LALInferenceClusteredKDEProposal(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
A proposal based on the clustered kernal density estimate of a set of samples.
REAL8 LALInferenceFrequencyBinJump(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Proposal to jump in frequency by one frequency bin.
const char *const differentialEvolutionFullName
const char *const nullProposalName
Struct to hold clustered-KDE estimates.
LALInferenceKmeans * kmeans
struct tagLALInferenceClusteredKDEProposal * next
LALInferenceVariables * params
Structure to contain IFO data.
Structure for performing the kmeans clustering algorithm on a set of samples.
Structure for holding a proposal cycle.
Structure for holding a LALInference proposal, along with name and stats.
Structure containing inference run state This includes pointers to the function types required to run...
Structure containing chain-specific variables.
The LALInferenceVariables structure to contain a set of parameters Implemented as a linked list of LA...