Skip to content

Commit

Permalink
Add ESS information in regression ex
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesYang007 committed Jul 17, 2020
1 parent 48b1f5e commit 6874b33
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions benchmark/regression_autoppl.cpp
Expand Up @@ -5,6 +5,7 @@
#include <autoppl/expression/expr_builder.hpp>
#include <autoppl/mcmc/hmc/nuts/nuts.hpp>
#include <benchmark/benchmark.h>
#include <autoppl/math/ess.hpp>

namespace ppl {

Expand Down Expand Up @@ -49,6 +50,13 @@ static void BM_Regression(benchmark::State& state) {
ppl::nuts(model, config);
}

arma::cube out(storage.n_rows,
storage.n_cols,
1);
out.slice(0) = storage;
arma::vec ess_res = math::ess(out);
ess_res.print("ESS");

// print mean and stddev results
std::cout << "Bias: " << arma::mean(storage.col(3)) << std::endl;
std::cout << "Alcohol: " << arma::mean(storage.col(0)) << std::endl;
Expand Down

0 comments on commit 6874b33

Please sign in to comment.