diff --git a/epiworld.hpp b/epiworld.hpp index 947c41c3..920a64bf 100644 --- a/epiworld.hpp +++ b/epiworld.hpp @@ -1137,17 +1137,17 @@ inline void proposal_fun_unif( /** * @brief Uses the uniform kernel with euclidean distance * - * @param stats_now Vector of current statistics based on - * simulated data. - * @param stats_obs Vector of observed statistics + * @param simulated_stats Vector of statistics based on + * simulated data + * @param observed_stats Vector of observed statistics * @param epsilon Epsilon parameter - * @param m LFMCMC model. + * @param m LFMCMC model * @return epiworld_double */ template inline epiworld_double kernel_fun_uniform( - const std::vector< epiworld_double >& stats_now, - const std::vector< epiworld_double >& stats_obs, + const std::vector< epiworld_double >& simulated_stats, + const std::vector< epiworld_double >& observed_stats, epiworld_double epsilon, LFMCMC* m ); @@ -1156,14 +1156,17 @@ inline epiworld_double kernel_fun_uniform( * @brief Gaussian kernel * * @tparam TData - * @param epsilon - * @param m + * @param simulated_stats Vector of statistics based on + * simulated data + * @param observed_stats Vector of observed statistics + * @param epsilon Epsilon parameter + * @param m LFMCMC model * @return epiworld_double */ template inline epiworld_double kernel_fun_gaussian( - const std::vector< epiworld_double >& stats_now, - const std::vector< epiworld_double >& stats_obs, + const std::vector< epiworld_double >& simulated_stats, + const std::vector< epiworld_double >& observed_stats, epiworld_double epsilon, LFMCMC* m ); @@ -1425,17 +1428,17 @@ inline void proposal_fun_unif( /** * @brief Uses the uniform kernel with euclidean distance * - * @param stats_now Vector of current statistics based on - * simulated data. - * @param stats_obs Vector of observed statistics + * @param simulated_stats Vector of statistics based on + * simulated data + * @param observed_stats Vector of observed statistics * @param epsilon Epsilon parameter - * @param m LFMCMC model. + * @param m LFMCMC model * @return epiworld_double */ template inline epiworld_double kernel_fun_uniform( - const std::vector< epiworld_double >& stats_now, - const std::vector< epiworld_double >& stats_obs, + const std::vector< epiworld_double >& simulated_stats, + const std::vector< epiworld_double >& observed_stats, epiworld_double epsilon, LFMCMC* m ); @@ -1444,14 +1447,17 @@ inline epiworld_double kernel_fun_uniform( * @brief Gaussian kernel * * @tparam TData - * @param epsilon - * @param m + * @param simulated_stats Vector of statistics based on + * simulated data + * @param observed_stats Vector of observed statistics + * @param epsilon Epsilon parameter + * @param m LFMCMC model * @return epiworld_double */ template inline epiworld_double kernel_fun_gaussian( - const std::vector< epiworld_double >& stats_now, - const std::vector< epiworld_double >& stats_obs, + const std::vector< epiworld_double >& simulated_stats, + const std::vector< epiworld_double >& observed_stats, epiworld_double epsilon, LFMCMC* m ); @@ -1737,24 +1743,24 @@ inline void proposal_fun_unif( /** * @brief Uses the uniform kernel with euclidean distance * - * @param stats_now Vector of current statistics based on - * simulated data. - * @param stats_obs Vector of observed statistics + * @param simulated_stats Vector of statistics based on + * simulated data + * @param observed_stats Vector of observed statistics * @param epsilon Epsilon parameter - * @param m LFMCMC model. + * @param m LFMCMC model * @return epiworld_double */ template inline epiworld_double kernel_fun_uniform( - const std::vector< epiworld_double >& stats_now, - const std::vector< epiworld_double >& stats_obs, + const std::vector< epiworld_double >& simulated_stats, + const std::vector< epiworld_double >& observed_stats, epiworld_double epsilon, LFMCMC* m ) { epiworld_double ans = 0.0; for (size_t p = 0u; p < m->get_n_params(); ++p) - ans += std::pow(stats_obs[p] - stats_now[p], 2.0); + ans += std::pow(observed_stats[p] - simulated_stats[p], 2.0); return std::sqrt(ans) < epsilon ? 1.0 : 0.0; @@ -1766,21 +1772,24 @@ inline epiworld_double kernel_fun_uniform( * @brief Gaussian kernel * * @tparam TData - * @param epsilon - * @param m + * @param simulated_stats Vector of statistics based on + * simulated data + * @param observed_stats Vector of observed statistics + * @param epsilon Epsilon parameter + * @param m LFMCMC model * @return epiworld_double */ template inline epiworld_double kernel_fun_gaussian( - const std::vector< epiworld_double >& stats_now, - const std::vector< epiworld_double >& stats_obs, + const std::vector< epiworld_double >& simulated_stats, + const std::vector< epiworld_double >& observed_stats, epiworld_double epsilon, LFMCMC* m ) { epiworld_double ans = 0.0; for (size_t p = 0u; p < m->get_n_params(); ++p) - ans += std::pow(stats_obs[p] - stats_now[p], 2.0); + ans += std::pow(observed_stats[p] - simulated_stats[p], 2.0); return std::exp( -.5 * (ans/std::pow(1 + std::pow(epsilon, 2.0)/3.0, 2.0)) diff --git a/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp b/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp index 76a93bb1..7f21eba9 100755 --- a/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp +++ b/include/epiworld/math/lfmcmc/lfmcmc-bones.hpp @@ -75,17 +75,17 @@ inline void proposal_fun_unif( /** * @brief Uses the uniform kernel with euclidean distance * - * @param stats_now Vector of current statistics based on - * simulated data. - * @param stats_obs Vector of observed statistics + * @param simulated_stats Vector of statistics based on + * simulated data + * @param observed_stats Vector of observed statistics * @param epsilon Epsilon parameter - * @param m LFMCMC model. + * @param m LFMCMC model * @return epiworld_double */ template inline epiworld_double kernel_fun_uniform( - const std::vector< epiworld_double >& stats_now, - const std::vector< epiworld_double >& stats_obs, + const std::vector< epiworld_double >& simulated_stats, + const std::vector< epiworld_double >& observed_stats, epiworld_double epsilon, LFMCMC* m ); @@ -94,14 +94,17 @@ inline epiworld_double kernel_fun_uniform( * @brief Gaussian kernel * * @tparam TData - * @param epsilon - * @param m + * @param simulated_stats Vector of statistics based on + * simulated data + * @param observed_stats Vector of observed statistics + * @param epsilon Epsilon parameter + * @param m LFMCMC model * @return epiworld_double */ template inline epiworld_double kernel_fun_gaussian( - const std::vector< epiworld_double >& stats_now, - const std::vector< epiworld_double >& stats_obs, + const std::vector< epiworld_double >& simulated_stats, + const std::vector< epiworld_double >& observed_stats, epiworld_double epsilon, LFMCMC* m ); diff --git a/include/epiworld/math/lfmcmc/lfmcmc-meat.hpp b/include/epiworld/math/lfmcmc/lfmcmc-meat.hpp index d379d2c4..f63ced3d 100755 --- a/include/epiworld/math/lfmcmc/lfmcmc-meat.hpp +++ b/include/epiworld/math/lfmcmc/lfmcmc-meat.hpp @@ -124,24 +124,24 @@ inline void proposal_fun_unif( /** * @brief Uses the uniform kernel with euclidean distance * - * @param stats_now Vector of current statistics based on - * simulated data. - * @param stats_obs Vector of observed statistics + * @param simulated_stats Vector of statistics based on + * simulated data + * @param observed_stats Vector of observed statistics * @param epsilon Epsilon parameter - * @param m LFMCMC model. + * @param m LFMCMC model * @return epiworld_double */ template inline epiworld_double kernel_fun_uniform( - const std::vector< epiworld_double >& stats_now, - const std::vector< epiworld_double >& stats_obs, + const std::vector< epiworld_double >& simulated_stats, + const std::vector< epiworld_double >& observed_stats, epiworld_double epsilon, LFMCMC* m ) { epiworld_double ans = 0.0; for (size_t p = 0u; p < m->get_n_params(); ++p) - ans += std::pow(stats_obs[p] - stats_now[p], 2.0); + ans += std::pow(observed_stats[p] - simulated_stats[p], 2.0); return std::sqrt(ans) < epsilon ? 1.0 : 0.0; @@ -153,21 +153,24 @@ inline epiworld_double kernel_fun_uniform( * @brief Gaussian kernel * * @tparam TData - * @param epsilon - * @param m + * @param simulated_stats Vector of statistics based on + * simulated data + * @param observed_stats Vector of observed statistics + * @param epsilon Epsilon parameter + * @param m LFMCMC model * @return epiworld_double */ template inline epiworld_double kernel_fun_gaussian( - const std::vector< epiworld_double >& stats_now, - const std::vector< epiworld_double >& stats_obs, + const std::vector< epiworld_double >& simulated_stats, + const std::vector< epiworld_double >& observed_stats, epiworld_double epsilon, LFMCMC* m ) { epiworld_double ans = 0.0; for (size_t p = 0u; p < m->get_n_params(); ++p) - ans += std::pow(stats_obs[p] - stats_now[p], 2.0); + ans += std::pow(observed_stats[p] - simulated_stats[p], 2.0); return std::exp( -.5 * (ans/std::pow(1 + std::pow(epsilon, 2.0)/3.0, 2.0))