Skip to content

File lfmcmc-bones.hpp

FileList > epiworld > math > lfmcmc > lfmcmc-bones.hpp

Go to the source code of this file

Classes

Type Name
class LFMCMC <typename TData>
Likelihood-Free Markov Chain Monte Carlo.

Public Types

Type Name
typedef std::function< epiworld_double(const std::vector< epiworld_double > &, const std::vector< epiworld_double > &, epiworld_double, LFMCMC< TData > *)> LFMCMCKernelFun
typedef std::function< void(std::vector< epiworld_double > &, const std::vector< epiworld_double > &, LFMCMC< TData > *)> LFMCMCProposalFun
typedef std::function< TData(const std::vector< epiworld_double > &, LFMCMC< TData > *)> LFMCMCSimFun
typedef std::function< void(std::vector< epiworld_double > &, const TData &, LFMCMC< TData > *)> LFMCMCSummaryFun

Public Functions

Type Name
epiworld_double kernel_fun_gaussian (const std::vector< epiworld_double > & simulated_stats, const std::vector< epiworld_double > & observed_stats, epiworld_double epsilon, LFMCMC< TData > * m)
Gaussian kernel.
epiworld_double kernel_fun_uniform (const std::vector< epiworld_double > & simulated_stats, const std::vector< epiworld_double > & observed_stats, epiworld_double epsilon, LFMCMC< TData > * m)
Uses the uniform kernel with euclidean distance.
LFMCMCProposalFun< TData > make_proposal_norm_reflective (epiworld_double scale, epiworld_double lb=std::numeric_limits< epiworld_double >::min(), epiworld_double ub=std::numeric_limits< epiworld_double >::max())
Factory for a reflective normal kernel.
void proposal_fun_normal (std::vector< epiworld_double > & new_params, const std::vector< epiworld_double > & old_params, LFMCMC< TData > * m)
Proposal function.
void proposal_fun_unif (std::vector< epiworld_double > & new_params, const std::vector< epiworld_double > & old_params, LFMCMC< TData > * m)
Uniform proposal kernel.

Macros

Type Name
define epiworld_double float

Public Types Documentation

typedef LFMCMCKernelFun

using LFMCMCKernelFun =  std::function<epiworld_double(const std::vector< epiworld_double >&,const std::vector< epiworld_double >&,epiworld_double,LFMCMC<TData>*)>;

typedef LFMCMCProposalFun

using LFMCMCProposalFun =  std::function<void(std::vector< epiworld_double >&,const std::vector< epiworld_double >&,LFMCMC<TData>*)>;

typedef LFMCMCSimFun

using LFMCMCSimFun =  std::function<TData(const std::vector< epiworld_double >&,LFMCMC<TData>*)>;

typedef LFMCMCSummaryFun

using LFMCMCSummaryFun =  std::function<void(std::vector< epiworld_double >&,const TData&,LFMCMC<TData>*)>;

Public Functions Documentation

function kernel_fun_gaussian

Gaussian kernel.

template<typename TData>
inline epiworld_double kernel_fun_gaussian (
    const std::vector< epiworld_double > & simulated_stats,
    const std::vector< epiworld_double > & observed_stats,
    epiworld_double epsilon,
    LFMCMC < TData > * m
) 

Template parameters:

  • TData

Parameters:

  • simulated_stats Vector of statistics based on simulated data
  • observed_stats Vector of observed statistics
  • epsilon Epsilon parameter
  • m LFMCMC model

Returns:

epiworld_double


function kernel_fun_uniform

Uses the uniform kernel with euclidean distance.

template<typename TData>
inline epiworld_double kernel_fun_uniform (
    const std::vector< epiworld_double > & simulated_stats,
    const std::vector< epiworld_double > & observed_stats,
    epiworld_double epsilon,
    LFMCMC < TData > * m
) 

Parameters:

  • simulated_stats Vector of statistics based on simulated data
  • observed_stats Vector of observed statistics
  • epsilon Epsilon parameter
  • m LFMCMC model

Returns:

epiworld_double


function make_proposal_norm_reflective

Factory for a reflective normal kernel.

template<typename TData>
inline LFMCMCProposalFun < TData > make_proposal_norm_reflective (
    epiworld_double scale,
    epiworld_double lb=std::numeric_limits< epiworld_double >::min(),
    epiworld_double ub=std::numeric_limits< epiworld_double >::max()
) 

Reflective kernel corrects proposals by forcing them to be within prespecified boundaries.

Template parameters:

  • TData

Parameters:

  • scale Scale of the normal kernel
  • lb Lower bound (applies the same to all parameters)
  • ub Upper bound (applies the same to all parameters)

Returns:

LFMCMCProposalFun<TData>


function proposal_fun_normal

Proposal function.

template<typename TData>
inline void proposal_fun_normal (
    std::vector< epiworld_double > & new_params,
    const std::vector< epiworld_double > & old_params,
    LFMCMC < TData > * m
) 

Parameters:

  • new_params Vector where to save the new parameters.
  • old_params Vector of reference parameters.
  • m LFMCMC model.

Template parameters:

  • TData

function proposal_fun_unif

Uniform proposal kernel.

template<typename TData>
inline void proposal_fun_unif (
    std::vector< epiworld_double > & new_params,
    const std::vector< epiworld_double > & old_params,
    LFMCMC < TData > * m
) 

Proposals are made within a radious 1 of the current state of the parameters.

Parameters:

  • new_params Where to write the new parameters
  • old_params Reference parameters

Template parameters:

  • TData

Parameters:


Macro Definition Documentation

define epiworld_double

#define epiworld_double `float`


The documentation for this class was generated from the following file epiworld-src/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp