GLAMERDOC++
Gravitational Lensing Code Library
Loading...
Searching...
No Matches
Slicer< V, L, R > Class Template Reference

#include <slicer.h>

Public Member Functions

 Slicer (int Dim, const V &scale, int kmax=10)
 
void run (L &lnprob, std::vector< V > &chain, V xo, R &ran, int step_type, bool verbose=false)
 run the MC chain
 
size_t number_evaluations ()
 returns the number of evaluations of the posterior during the last run
 

Detailed Description

template<typename V, typename L, typename R>
class Slicer< V, L, R >

This is a slice sampler that can be used to do a markov chain without repeated entries in the chain.

types; V is usuatly a std::vector<float> or std::vector<double> L is the functor type used for the likelihood function, this functure should have a opertor()(V p) that will return the log of the likeliwood

Constructor & Destructor Documentation

◆ Slicer()

template<typename V , typename L , typename R >
Slicer< V, L, R >::Slicer ( int Dim,
const V & scale,
int kmax = 10 )
inline
Parameters
Dimnumber of parameters
scaleinitial stepsize in parameter space
kmaxmaximuma number of attempts made in each step

Member Function Documentation

◆ run()

template<typename V , typename L , typename R >
void Slicer< V, L, R >::run ( L & lnprob,
std::vector< V > & chain,
V xo,
R & ran,
int step_type,
bool verbose = false )
inline

run the MC chain

Parameters
lnproblog likelihood function or funtor
chainwill contain the MC chain on return. should be initialized to the desired length
xoinitial point in parameter space
ranrendom number generator
step_type0 step_out, !=0 step_double

The documentation for this class was generated from the following file: