3 #ifndef GEESE_MEAT_PREDICT_SIM_HPP
4 #define GEESE_MEAT_PREDICT_SIM_HPP 1
7 const std::vector< double > & par,
8 bool use_reduced_sequence,
16 std::vector< std::vector< size_t > > tmp;
18 std::vector< double > zerovec(
nfuns(), 0.0);
19 std::vector< std::vector< double > > res_vec(
nnodes(), zerovec);
20 std::vector< int > counts(
nnodes(), 0);
26 for (
size_t i = 0u;
i < nsims; ++
i)
35 const Node & n =
j->second;
38 bool includeit =
true;
39 for (
auto &
id : annotated)
47 const auto & ord =
nodes[id].ord;
48 const auto & n_w_ann =
nodes[id].annotations;
49 for (
size_t f = 0u; f <
nfuns(); ++f)
56 if (n_w_ann[f] != tmp[ord][f])
72 for (
size_t f = 0u; f <
nfuns(); ++f)
73 if (tmp[n.
ord][f] == 1u)
74 res_vec[n.
ord][f] += 1.0;
94 for (
size_t f = 0u; f <
nfuns(); ++f)
95 res_vec[
i][f] /= (
static_cast< double >(counts[
i]) + 1e-10);
size_t nnodes() const noexcept
Number of nodes (interior + leaf)
std::vector< std::vector< double > > predict_sim(const std::vector< double > &par, bool only_annotated=false, size_t nsims=10000u)
std::vector< size_t > get_annotated_nodes() const
Returns the ids of the nodes with at least one annotation.
std::vector< std::vector< size_t > > simulate(const std::vector< double > &par)
std::map< size_t, Node > nodes
size_t nfuns() const noexcept
Number of functions analyzed.
A single node for the model.
size_t id
Id of the node (as specified in the input)
size_t ord
Order in which the node was created.