Skip to content

File lfmcmc-meat.hpp

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

Go to the source code of this file

  • #include "lfmcmc-bones.hpp"
  • #include "lfmcmc-meat-print.hpp"

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, epiworld_double ub)
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 DURCAST (tunit, txtunit) /* multi line expression */
define sqrt2pi () 2.5066282746310002416

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,
    epiworld_double ub
) 

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 DURCAST

#define DURCAST (
    tunit,
    txtunit
) `/* multi line expression */`

define sqrt2pi

#define sqrt2pi (

) `2.5066282746310002416`


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