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_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,
epiworld_double ub
)
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 DURCAST¶
define sqrt2pi¶
The documentation for this class was generated from the following file epiworld-src/include/epiworld/math/lfmcmc/lfmcmc-meat.hpp