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¶
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_statsVector of statistics based on simulated dataobserved_statsVector of observed statisticsepsilonEpsilon parametermLFMCMC 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_statsVector of statistics based on simulated dataobserved_statsVector of observed statisticsepsilonEpsilon parametermLFMCMC 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:
scaleScale of the normal kernellbLower bound (applies the same to all parameters)ubUpper 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_paramsVector where to save the new parameters.old_paramsVector of reference parameters.mLFMCMC 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_paramsWhere to write the new parametersold_paramsReference parameters
Template parameters:
TData
Parameters:
mLFMCMC model.
Macro Definition Documentation¶
define epiworld_double¶
The documentation for this class was generated from the following file epiworld-src/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp