Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInference 4.1.9.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALInferenceNestedSampler.h
Go to the documentation of this file.
1/*
2 *
3 * LALInferenceNestedSampler: Nested sampler written for LALInference
4 * LALInferenceNestedSampler.h: main header file
5 *
6 * Copyright (C) 2011 John Veitch
7 *
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with with program; see the file COPYING. If not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 * MA 02110-1301 USA
23 */
24#ifndef LALInferenceNestedSampler_h
25#define LALInferenceNestedSampler_h
26
27#include <lal/LALInference.h>
28
29#ifdef SWIG // SWIG interface directives
30SWIGLAL(
31 FUNCTION_POINTER(
34 )
35);
36#endif
37
38
39
40/**
41 * \defgroup LALInferenceNestedSampler_h Header LALInferenceNestedSampler.h
42 * \ingroup lalinference_general
43 * \brief Nested sampler written for LALInference. Independent of model.
44 *
45 * Nested Sampling algorithm defined using the LALInference
46 * Infrastructure. This code should be independent of choice
47 * of model. Provided are a LALAlgorithm function and a
48 * LALEvolveOneStepFunction which implement the evidence
49 * calculation
50 */
51/** @{ */
52
53/* logadd(a,b) = log(exp(a) + exp(b)) using Stirling's approximation */
54/* double logadd(double a,double b); */
55
56/**
57 * Initialise the nested sampling algorithm by reading from the commandLine
58 * and setting up algorithmParams
59 */
61
62/**
63 * NestedSamplingAlgorithm implements the nested sampling algorithm,
64 * see e.g. Sivia "Data Analysis: A Bayesian Tutorial, 2nd edition
65 */
67
68/** A single iteration of the NS algorithm */
70
71/** Compute the autocorrelation length from the sampler at the current global iteration */
73
74/** Perform one MCMC iteration on runState->currentParams. Return 1 if accepted or 0 if not */
76
77/** Sample the prior N times, returns number of acceptances */
79
80/**
81 * Sample the limited prior distribution using the MCMC method as usual, but
82 * run a sub-chain of x iterations which doesn't check the likelihood bound.
83 * x=LALInferenceGetVariable(runState->algorithmParams,"sloppyratio")
84 */
86
87/* Cache wrapper around the sloppy sampler */
89
90/**
91 * Setup the live points by calling runState->initVariables on each of them
92 * if it is specified. Otherwise clones runState->currentParams (legacy)
93 */
95
96/** Project the sample in params onto the eigenvectors given in eigenvectors. */
97void LALInferenceProjectSampleOntoEigenvectors(LALInferenceVariables *params, gsl_matrix *eigenvectors, REAL8Vector **projection);
98
99/** @} */
100
101#endif
uint32_t UINT4
int32_t INT4
INT4(* LALInferenceEvolveOneStepFunction)(struct tagLALInferenceRunState *runState)
Perform one step of an algorithm, replaces runState ->currentParams.
Definition: LALInference.h:491
void LALInferenceNestedSamplingAlgorithm(LALInferenceRunState *runState)
NestedSamplingAlgorithm implements the nested sampling algorithm, see e.g.
INT4 LALInferenceNestedSamplingOneStep(LALInferenceRunState *runState)
A single iteration of the NS algorithm.
void LALInferenceSetupLivePointsArray(LALInferenceRunState *runState)
Setup the live points by calling runState->initVariables on each of them if it is specified.
LALInferenceVariables * LALInferenceComputeAutoCorrelation(LALInferenceRunState *runState, UINT4 max_iterations, LALInferenceEvolveOneStepFunction evolve)
Compute the autocorrelation length from the sampler at the current global iteration.
INT4 LALInferenceNestedSamplingSloppySample(LALInferenceRunState *runState)
Sample the limited prior distribution using the MCMC method as usual, but run a sub-chain of x iterat...
INT4 LALInferenceNestedSamplingCachedSampler(LALInferenceRunState *runState)
void LALInferenceNestedSamplingAlgorithmInit(LALInferenceRunState *runState)
Initialise the nested sampling algorithm by reading from the commandLine and setting up algorithmPara...
UINT4 LALInferenceMCMCSamplePriorNTimes(LALInferenceRunState *runState, UINT4 N)
Sample the prior N times, returns number of acceptances.
void LALInferenceProjectSampleOntoEigenvectors(LALInferenceVariables *params, gsl_matrix *eigenvectors, REAL8Vector **projection)
Project the sample in params onto the eigenvectors given in eigenvectors.
UINT4 LALInferenceMCMCSamplePrior(LALInferenceRunState *runState)
Perform one MCMC iteration on runState->currentParams.
Structure containing inference run state This includes pointers to the function types required to run...
Definition: LALInference.h:592
The LALInferenceVariables structure to contain a set of parameters Implemented as a linked list of LA...
Definition: LALInference.h:170