From 90a704a3c60533383eda739f04c400fd0f1ddb00 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Thu, 25 Jan 2024 00:16:11 -0500 Subject: [PATCH 01/93] Updates the Math submodule to c26bd8387d. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index b89e92c854..c26bd8387d 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit b89e92c85478bbf4636b706e432ec7e93ea9c879 +Subproject commit c26bd8387db780153fb9ef4ff055c2fa5c402544 From 3b72f011ff1c45f298ac4a7eb01fd8cec15831b9 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Thu, 25 Jan 2024 12:51:29 -0500 Subject: [PATCH 02/93] Add option to output hessian, disable LP calcs in Laplace --- src/stan/services/optimize/laplace_sample.hpp | 83 ++++++++++++++++--- .../services/optimize/laplace_sample_test.cpp | 57 +++++++++++++ 2 files changed, 130 insertions(+), 10 deletions(-) diff --git a/src/stan/services/optimize/laplace_sample.hpp b/src/stan/services/optimize/laplace_sample.hpp index 6ec1dfacad..c2d955734d 100644 --- a/src/stan/services/optimize/laplace_sample.hpp +++ b/src/stan/services/optimize/laplace_sample.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -17,9 +18,10 @@ namespace internal { template void laplace_sample(const Model& model, const Eigen::VectorXd& theta_hat, - int draws, unsigned int random_seed, int refresh, - callbacks::interrupt& interrupt, callbacks::logger& logger, - callbacks::writer& sample_writer) { + int draws, bool calculate_lp, unsigned int random_seed, + int refresh, callbacks::interrupt& interrupt, + callbacks::logger& logger, callbacks::writer& sample_writer, + callbacks::structured_writer& hessian_writer) { if (draws <= 0) { throw std::domain_error("Number of draws must be > 0; found draws = " + std::to_string(draws)); @@ -72,6 +74,13 @@ void laplace_sample(const Model& model, const Eigen::VectorXd& theta_hat, if (refresh > 0 && log_density_msgs.peek() != std::char_traits::eof()) logger.info(log_density_msgs); + interrupt(); + hessian_writer.begin_record(); + hessian_writer.write("lp_mode", log_p); + hessian_writer.write("gradient", grad); + hessian_writer.write("Hessian", hessian); + hessian_writer.end_record(); + // calculate Cholesky factor and inverse interrupt(); if (refresh > 0) { @@ -109,7 +118,13 @@ void laplace_sample(const Model& model, const Eigen::VectorXd& theta_hat, logger.info(write_array_msgs); // output draw, log_p, log_q std::vector draw(&draw_vec(0), &draw_vec(0) + draw_size); - double log_p = log_density_fun(unc_draw).val(); + + double log_p; + if (calculate_lp) { + log_p = log_density_fun(unc_draw).val(); + } else { + log_p = std::numeric_limits::quiet_NaN(); + } draw.insert(draw.begin(), log_p); Eigen::VectorXd diff = unc_draw - theta_hat; double log_q = diff.transpose() * half_hessian * diff; @@ -139,6 +154,8 @@ void laplace_sample(const Model& model, const Eigen::VectorXd& theta_hat, * @param[in] theta_hat unconstrained mode at which to center the * Laplace approximation * @param[in] draws number of draws to generate + * @param[in] calculate_lp whether to calculate the log probability of the + * approximate draws * @param[in] random_seed seed for generating random numbers in the * Stan program and in sampling * @param[in] refresh period between iterations at which updates are @@ -148,23 +165,69 @@ void laplace_sample(const Model& model, const Eigen::VectorXd& theta_hat, * sampler and from Stan programs * @param[in,out] sample_writer callback for writing parameter names * and then draws + * @param[in,out] hessian_writer callback for writing the log probability, + * gradient, and Hessian at the mode for diagnostic purposes * @return a return code, with 0 indicating success */ template int laplace_sample(const Model& model, const Eigen::VectorXd& theta_hat, - int draws, unsigned int random_seed, int refresh, - callbacks::interrupt& interrupt, callbacks::logger& logger, - callbacks::writer& sample_writer) { + int draws, bool calculate_lp, unsigned int random_seed, + int refresh, callbacks::interrupt& interrupt, + callbacks::logger& logger, callbacks::writer& sample_writer, + callbacks::structured_writer& hessian_writer) { try { - internal::laplace_sample(model, theta_hat, draws, random_seed, - refresh, interrupt, logger, - sample_writer); + internal::laplace_sample(model, theta_hat, draws, calculate_lp, + random_seed, refresh, interrupt, logger, + sample_writer, hessian_writer); } catch (const std::exception& e) { logger.error(e.what()); return error_codes::CONFIG; } return error_codes::OK; } + +/** + * Take the specified number of draws from the Laplace approximation + * for the model at the specified unconstrained mode, writing the + * draws, unnormalized log density, and unnormalized density of the + * approximation to the sample writer and writing messages to the + * logger, returning a return code of zero if successful. + * + * Interrupts are called between compute-intensive operations. To + * turn off all console messages sent to the logger, set refresh to 0. + * If an exception is thrown by the model, the return value is + * non-zero, and if refresh > 0, its message is given to the logger as + * an error. + * + * @tparam jacobian `true` to include Jacobian adjustment for + * constrained parameters + * @tparam Model a Stan model + * @param[in] model model from which to sample + * @param[in] theta_hat unconstrained mode at which to center the + * Laplace approximation + * @param[in] draws number of draws to generate + * @param[in] random_seed seed for generating random numbers in the + * Stan program and in sampling + * @param[in] refresh period between iterations at which updates are + * given, with a value of 0 turning off all messages + * @param[in] interrupt callback for interrupting sampling + * @param[in,out] logger callback for writing console messages from + * sampler and from Stan programs + * @param[in,out] sample_writer callback for writing parameter names + * and then draws + * @return a return code, with 0 indicating success + */ +template +int laplace_sample(const Model& model, const Eigen::VectorXd& theta_hat, + int draws, unsigned int random_seed, int refresh, + callbacks::interrupt& interrupt, callbacks::logger& logger, + callbacks::writer& sample_writer) { + callbacks::structured_writer dummy_hessian_writer; + return laplace_sample(model, theta_hat, draws, true, random_seed, + refresh, interrupt, logger, sample_writer, + dummy_hessian_writer); +} + } // namespace services } // namespace stan diff --git a/src/test/unit/services/optimize/laplace_sample_test.cpp b/src/test/unit/services/optimize/laplace_sample_test.cpp index 82c6c131d7..1e967eed82 100644 --- a/src/test/unit/services/optimize/laplace_sample_test.cpp +++ b/src/test/unit/services/optimize/laplace_sample_test.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -100,6 +101,62 @@ TEST_F(ServicesLaplaceSample, values) { EXPECT_NEAR(0.8, cov, 0.05); } +struct deleter_noop { + template + constexpr void operator()(T* arg) const {} +}; + +TEST_F(ServicesLaplaceSample, hessianOutput) { + Eigen::VectorXd theta_hat(2); + theta_hat << 2, 3; + int draws = 10; + bool calculate_lp = true; + unsigned int seed = 1234; + int refresh = 100; + std::stringstream sample_ss; + stan::callbacks::stream_writer sample_writer(sample_ss, ""); + + std::stringstream hessian_ss; + stan::callbacks::json_writer hessian_writer{ + std::unique_ptr(&hessian_ss)}; + + int return_code = stan::services::laplace_sample( + *model, theta_hat, draws, calculate_lp, seed, refresh, interrupt, logger, + sample_writer, hessian_writer); + EXPECT_EQ(stan::services::error_codes::OK, return_code); + + std::string hessian_str = hessian_ss.str(); + + ASSERT_TRUE(stan::test::is_valid_JSON(hessian_str)); + EXPECT_EQ(count_matches("lp_mode", hessian_str), 1); + EXPECT_EQ(count_matches("gradient", hessian_str), 1); + EXPECT_EQ(count_matches("Hessian", hessian_str), 1); +} + + +TEST_F(ServicesLaplaceSample, noLP) { + Eigen::VectorXd theta_hat(2); + theta_hat << 2, 3; + unsigned int seed = 1234; + int refresh = 100; + std::stringstream sample_ss; + stan::callbacks::stream_writer sample_writer(sample_ss, ""); + stan::callbacks::structured_writer dummy_hessian_writer; + + int draws = 11; + bool calculate_lp = false; + + int return_code = stan::services::laplace_sample( + *model, theta_hat, draws, calculate_lp, seed, refresh, interrupt, logger, + sample_writer, dummy_hessian_writer); + EXPECT_EQ(stan::services::error_codes::OK, return_code); + + std::string samples_str = sample_ss.str(); + EXPECT_EQ(1, count_matches("log_p__", samples_str)); + EXPECT_EQ(draws, count_matches("nan", samples_str)); + +} + TEST_F(ServicesLaplaceSample, wrongSizeModeError) { Eigen::VectorXd theta_hat(3); theta_hat << 2, 3, 4; From 32032d8d2fc4b9f8fe218272f72119f632e725d2 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Thu, 25 Jan 2024 12:57:01 -0500 Subject: [PATCH 03/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- src/test/unit/services/optimize/laplace_sample_test.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/test/unit/services/optimize/laplace_sample_test.cpp b/src/test/unit/services/optimize/laplace_sample_test.cpp index 1e967eed82..ba3008262c 100644 --- a/src/test/unit/services/optimize/laplace_sample_test.cpp +++ b/src/test/unit/services/optimize/laplace_sample_test.cpp @@ -133,7 +133,6 @@ TEST_F(ServicesLaplaceSample, hessianOutput) { EXPECT_EQ(count_matches("Hessian", hessian_str), 1); } - TEST_F(ServicesLaplaceSample, noLP) { Eigen::VectorXd theta_hat(2); theta_hat << 2, 3; @@ -154,7 +153,6 @@ TEST_F(ServicesLaplaceSample, noLP) { std::string samples_str = sample_ss.str(); EXPECT_EQ(1, count_matches("log_p__", samples_str)); EXPECT_EQ(draws, count_matches("nan", samples_str)); - } TEST_F(ServicesLaplaceSample, wrongSizeModeError) { From 68df3c67b3bb2ecd08def4ae4d580cfa1c32a7d4 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Fri, 26 Jan 2024 16:55:36 -0500 Subject: [PATCH 04/93] Properly allow multiple downstream jenkins runs --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c58282a5bf..2d6ae4e46b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -96,7 +96,7 @@ pipeline { preserveStashes(buildCount: 7) parallelsAlwaysFailFast() buildDiscarder(logRotator(numToKeepStr: '20', daysToKeepStr: '30')) - disableConcurrentBuilds(abortPrevious: env.BRANCH_NAME != "downstream_tests" || env.BRANCH_NAME != "downstream_hotfix") + disableConcurrentBuilds(abortPrevious: env.BRANCH_NAME != "downstream_tests" && env.BRANCH_NAME != "downstream_hotfix") } environment { GCC = 'g++' From d402c36c94c807985ae1949ded4151180008bbd4 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Sun, 28 Jan 2024 03:12:05 -0500 Subject: [PATCH 05/93] Updates the Math submodule to 9b6bc3d3fd. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index c26bd8387d..9b6bc3d3fd 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit c26bd8387db780153fb9ef4ff055c2fa5c402544 +Subproject commit 9b6bc3d3fdf3ada03478e05b696372b686209ce6 From bb4ab32cdd37bf017dcf33f44d43ca415d6285c5 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Tue, 30 Jan 2024 03:35:11 -0500 Subject: [PATCH 06/93] Updates the Math submodule to 4b40ec51a5. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 9b6bc3d3fd..4b40ec51a5 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 9b6bc3d3fdf3ada03478e05b696372b686209ce6 +Subproject commit 4b40ec51a5c050ccbf5c32c2b99db4d5c32d4bbc From 88173ccc7bd2d4d24f87045d364cf9896503fb56 Mon Sep 17 00:00:00 2001 From: aleksgorica Date: Tue, 30 Jan 2024 11:06:42 +0100 Subject: [PATCH 07/93] newrhat --- .../compute_potential_scale_reduction.hpp | 137 +++++++++++++++--- 1 file changed, 113 insertions(+), 24 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 5ae43c8205..25675b0e8c 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -16,6 +17,101 @@ namespace stan { namespace analyze { +inline double median( Eigen::MatrixXd d){ + auto r { d.reshaped() }; + std::sort( r.begin(), r.end() ); + return r.size() % 2 == 0 ? + r.segment( (r.size()-2)/2, 2 ).mean() : + r( r.size()/2 ); +} + +Eigen::MatrixXd rankTransform(const Eigen::MatrixXd& matrix) { + int rows = matrix.rows(); + int cols = matrix.cols(); + int size = rows * cols; + Eigen::MatrixXd rankMatrix = Eigen::MatrixXd::Zero(rows, cols); + + // Create a vector of pairs (value, original index) + std::vector> valueWithIndex(size); + + for (int col = 0; col < cols; ++col) { + for (int row = 0; row < rows; ++row) { + int index = col * rows + row; // Calculating linear index in column-major order + valueWithIndex[index] = {matrix(row, col), index}; + } + } + + // Sorting the pairs by value + std::sort(valueWithIndex.begin(), valueWithIndex.end()); + + // Assigning average ranks + for (int i = 0; i < size; ++i) { + // Handle ties by averaging ranks + int j = i; + double sumRanks = 0; + int count = 0; + + while (j < size && valueWithIndex[j].first == valueWithIndex[i].first) { + sumRanks += j + 1; // Rank starts from 1 + ++j; + ++count; + } + + double avgRank = sumRanks / count; + for (int k = i; k < j; ++k) { + int index = valueWithIndex[k].second; + int row = index % rows; // Adjusting row index for column-major order + int col = index / rows; // Adjusting column index for column-major order + rankMatrix(row, col) = (avgRank - 3.0/8.0) / (size - 2.0 * 3.0/8.0 + 1.0); + + } + i = j - 1; // Skip over tied elements + } + + auto ndtri = [](double p) { + boost::math::normal_distribution dist; // Standard normal distribution + return boost::math::quantile(dist, p); // Inverse CDF (quantile function) + }; + + rankMatrix = rankMatrix.unaryExpr(ndtri); + return rankMatrix; +} + + +inline double rhat(const Eigen::MatrixXd& draws) { + using boost::accumulators::accumulator_set; + using boost::accumulators::stats; + using boost::accumulators::tag::mean; + using boost::accumulators::tag::variance; + + int num_chains = draws.cols(); + int num_draws = draws.rows(); + std::cout << num_chains << " " << num_draws << std::endl; + Eigen::VectorXd chain_mean(num_chains); + accumulator_set> acc_chain_mean; + Eigen::VectorXd chain_var(num_chains); + double unbiased_var_scale = num_draws / (num_draws - 1.0); + for (int chain = 0; chain < num_chains; ++chain) { + accumulator_set> acc_draw; + for (int n = 0; n < num_draws; ++n) { + acc_draw(draws(n, chain)); + } + chain_mean(chain) = boost::accumulators::mean(acc_draw); + acc_chain_mean(chain_mean(chain)); + chain_var(chain) = boost::accumulators::variance(acc_draw) * unbiased_var_scale; + } + + double var_between = num_draws * boost::accumulators::variance(acc_chain_mean) + * num_chains / (num_chains - 1); + double var_within = chain_var.mean(); + + // rewrote [(n-1)*W/n + B/n]/W as (n-1+ B/W)/n + return sqrt((var_between / var_within + num_draws - 1) / num_draws); +} + + + + /** * Computes the potential scale reduction (Rhat) for the specified * parameter across all kept samples. @@ -31,8 +127,14 @@ namespace analyze { * @param sizes stores sizes of chains * @return potential scale reduction for the specified parameter */ + + inline double compute_potential_scale_reduction( std::vector draws, std::vector sizes) { + std::cout << "DRAWS POINTERS: " << std::endl; + for (int i = 0; i < draws.size(); ++i) { + std::cout << "Index: " << i << " P: " << draws[i] << " EXPECTED END: " << draws[i] + sizes[i] << std::endl; + } int num_chains = sizes.size(); size_t num_draws = sizes[0]; if (num_draws == 0) { @@ -71,35 +173,22 @@ inline double compute_potential_scale_reduction( } } - using boost::accumulators::accumulator_set; - using boost::accumulators::stats; - using boost::accumulators::tag::mean; - using boost::accumulators::tag::variance; - - Eigen::VectorXd chain_mean(num_chains); - accumulator_set> acc_chain_mean; - Eigen::VectorXd chain_var(num_chains); - double unbiased_var_scale = num_draws / (num_draws - 1.0); + Eigen::MatrixXd matrix(num_draws, num_chains); - for (int chain = 0; chain < num_chains; ++chain) { - accumulator_set> acc_draw; - for (int n = 0; n < num_draws; ++n) { - acc_draw(draws[chain][n]); + // Copy data from arrays to matrix + for (int col = 0; col < num_chains; ++col) { + for (int row = 0; row < num_draws; ++row) { + matrix(row, col) = draws[col][row]; + } } - chain_mean(chain) = boost::accumulators::mean(acc_draw); - acc_chain_mean(chain_mean(chain)); - chain_var(chain) - = boost::accumulators::variance(acc_draw) * unbiased_var_scale; - } + double rhat_bulk = rhat(rankTransform(matrix)); + double rhat_tail = rhat(rankTransform((matrix.array() - median(matrix)).abs())); + return std::max(rhat_bulk, rhat_tail); +} + - double var_between = num_draws * boost::accumulators::variance(acc_chain_mean) - * num_chains / (num_chains - 1); - double var_within = chain_var.mean(); - // rewrote [(n-1)*W/n + B/n]/W as (n-1+ B/W)/n - return sqrt((var_between / var_within + num_draws - 1) / num_draws); -} /** * Computes the potential scale reduction (Rhat) for the specified From 60882b8dce3df4a1d36eec1500dad3cf79197951 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 30 Jan 2024 10:51:52 -0500 Subject: [PATCH 08/93] Start: use type alias rng_t consistently --- src/stan/mcmc/chains.hpp | 3 --- src/stan/model/model_base.hpp | 8 +++----- src/stan/model/model_base_crtp.hpp | 4 ++-- src/stan/services/diagnose/diagnose.hpp | 2 +- src/stan/services/experimental/advi/fullrank.hpp | 4 ++-- src/stan/services/experimental/advi/meanfield.hpp | 4 ++-- src/stan/services/optimize/bfgs.hpp | 2 +- src/stan/services/optimize/laplace_sample.hpp | 2 +- src/stan/services/optimize/lbfgs.hpp | 2 +- src/stan/services/optimize/newton.hpp | 2 +- src/stan/services/pathfinder/multi.hpp | 8 +++----- src/stan/services/pathfinder/single.hpp | 5 ++--- src/stan/services/sample/fixed_param.hpp | 4 ++-- src/stan/services/sample/hmc_nuts_dense_e.hpp | 8 ++++---- src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp | 8 ++++---- src/stan/services/sample/hmc_nuts_diag_e.hpp | 8 ++++---- src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp | 8 ++++---- src/stan/services/sample/hmc_nuts_unit_e.hpp | 8 ++++---- src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp | 8 ++++---- src/stan/services/sample/hmc_static_dense_e.hpp | 4 ++-- src/stan/services/sample/hmc_static_dense_e_adapt.hpp | 5 ++--- src/stan/services/sample/hmc_static_diag_e.hpp | 4 ++-- src/stan/services/sample/hmc_static_diag_e_adapt.hpp | 5 ++--- src/stan/services/sample/hmc_static_unit_e.hpp | 4 ++-- src/stan/services/sample/hmc_static_unit_e_adapt.hpp | 5 ++--- src/stan/services/sample/standalone_gqs.hpp | 4 ++-- src/stan/services/util/create_rng.hpp | 11 ++++++----- 27 files changed, 65 insertions(+), 75 deletions(-) diff --git a/src/stan/mcmc/chains.hpp b/src/stan/mcmc/chains.hpp index a0c8e78972..4fd6372bf6 100644 --- a/src/stan/mcmc/chains.hpp +++ b/src/stan/mcmc/chains.hpp @@ -13,8 +13,6 @@ #include #include #include -#include -#include #include #include #include @@ -44,7 +42,6 @@ using Eigen::Dynamic; * *

Storage Order: Storage is column/last-index major. */ -template class chains { private: std::vector param_names_; diff --git a/src/stan/model/model_base.hpp b/src/stan/model/model_base.hpp index bb9a50c20d..1f6de972f9 100644 --- a/src/stan/model/model_base.hpp +++ b/src/stan/model/model_base.hpp @@ -7,7 +7,7 @@ #include #endif #include -#include +#include #include #include #include @@ -367,8 +367,7 @@ class model_base : public prob_grad { * in output * @param[in,out] msgs msgs stream to which messages are written */ - virtual void write_array(boost::ecuyer1988& base_rng, - Eigen::VectorXd& params_r, + virtual void write_array(stan::rng_t& base_rng, Eigen::VectorXd& params_r, Eigen::VectorXd& params_constrained_r, bool include_tparams = true, bool include_gqs = true, std::ostream* msgs = 0) const = 0; @@ -618,8 +617,7 @@ class model_base : public prob_grad { * in output * @param[in,out] msgs msgs stream to which messages are written */ - virtual void write_array(boost::ecuyer1988& base_rng, - std::vector& params_r, + virtual void write_array(stan::rng_t& base_rng, std::vector& params_r, std::vector& params_i, std::vector& params_r_constrained, bool include_tparams = true, bool include_gqs = true, diff --git a/src/stan/model/model_base_crtp.hpp b/src/stan/model/model_base_crtp.hpp index 5a64ced8c0..1868b3e056 100644 --- a/src/stan/model/model_base_crtp.hpp +++ b/src/stan/model/model_base_crtp.hpp @@ -133,7 +133,7 @@ class model_base_crtp : public stan::model::model_base { msgs); } - void write_array(boost::ecuyer1988& rng, Eigen::VectorXd& theta, + void write_array(stan::rng_t& rng, Eigen::VectorXd& theta, Eigen::VectorXd& vars, bool include_tparams = true, bool include_gqs = true, std::ostream* msgs = 0) const override { @@ -202,7 +202,7 @@ class model_base_crtp : public stan::model::model_base { theta, theta_i, msgs); } - void write_array(boost::ecuyer1988& rng, std::vector& theta, + void write_array(stan::rng_t& rng, std::vector& theta, std::vector& theta_i, std::vector& vars, bool include_tparams = true, bool include_gqs = true, std::ostream* msgs = 0) const override { diff --git a/src/stan/services/diagnose/diagnose.hpp b/src/stan/services/diagnose/diagnose.hpp index 25b3907643..caf5872169 100644 --- a/src/stan/services/diagnose/diagnose.hpp +++ b/src/stan/services/diagnose/diagnose.hpp @@ -43,7 +43,7 @@ int diagnose(Model& model, const stan::io::var_context& init, double epsilon, double error, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& parameter_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector = util::initialize( diff --git a/src/stan/services/experimental/advi/fullrank.hpp b/src/stan/services/experimental/advi/fullrank.hpp index 6eb8181ac2..5c651773de 100644 --- a/src/stan/services/experimental/advi/fullrank.hpp +++ b/src/stan/services/experimental/advi/fullrank.hpp @@ -60,7 +60,7 @@ int fullrank(Model& model, const stan::io::var_context& init, callbacks::writer& diagnostic_writer) { util::experimental_message(logger); - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; @@ -84,7 +84,7 @@ int fullrank(Model& model, const stan::io::var_context& init, = Eigen::Map(&cont_vector[0], cont_vector.size(), 1); stan::variational::advi + stan::rng_t> cmd_advi(model, cont_params, rng, grad_samples, elbo_samples, eval_elbo, output_samples); cmd_advi.run(eta, adapt_engaged, adapt_iterations, tol_rel_obj, diff --git a/src/stan/services/experimental/advi/meanfield.hpp b/src/stan/services/experimental/advi/meanfield.hpp index 87772dda7b..a89aa521cd 100644 --- a/src/stan/services/experimental/advi/meanfield.hpp +++ b/src/stan/services/experimental/advi/meanfield.hpp @@ -60,7 +60,7 @@ int meanfield(Model& model, const stan::io::var_context& init, callbacks::writer& diagnostic_writer) { util::experimental_message(logger); - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; @@ -83,7 +83,7 @@ int meanfield(Model& model, const stan::io::var_context& init, = Eigen::Map(&cont_vector[0], cont_vector.size(), 1); stan::variational::advi + stan::rng_t> cmd_advi(model, cont_params, rng, grad_samples, elbo_samples, eval_elbo, output_samples); cmd_advi.run(eta, adapt_engaged, adapt_iterations, tol_rel_obj, diff --git a/src/stan/services/optimize/bfgs.hpp b/src/stan/services/optimize/bfgs.hpp index 12f1df5659..2819b853a6 100644 --- a/src/stan/services/optimize/bfgs.hpp +++ b/src/stan/services/optimize/bfgs.hpp @@ -57,7 +57,7 @@ int bfgs(Model& model, const stan::io::var_context& init, bool save_iterations, int refresh, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& parameter_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; diff --git a/src/stan/services/optimize/laplace_sample.hpp b/src/stan/services/optimize/laplace_sample.hpp index 6ec1dfacad..17b78ee5f7 100644 --- a/src/stan/services/optimize/laplace_sample.hpp +++ b/src/stan/services/optimize/laplace_sample.hpp @@ -88,7 +88,7 @@ void laplace_sample(const Model& model, const Eigen::VectorXd& theta_hat, } // generate draws std::stringstream refresh_msg; - boost::ecuyer1988 rng = util::create_rng(random_seed, 0); + stan::rng_t rng = util::create_rng(random_seed, 0); Eigen::VectorXd draw_vec; // declare draw_vec, msgs here to avoid re-alloc for (int m = 0; m < draws; ++m) { interrupt(); // allow interpution each iteration diff --git a/src/stan/services/optimize/lbfgs.hpp b/src/stan/services/optimize/lbfgs.hpp index 9955e8f863..083e37ffed 100644 --- a/src/stan/services/optimize/lbfgs.hpp +++ b/src/stan/services/optimize/lbfgs.hpp @@ -59,7 +59,7 @@ int lbfgs(Model& model, const stan::io::var_context& init, int refresh, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& parameter_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; diff --git a/src/stan/services/optimize/newton.hpp b/src/stan/services/optimize/newton.hpp index 65d29f9088..081365f0a9 100644 --- a/src/stan/services/optimize/newton.hpp +++ b/src/stan/services/optimize/newton.hpp @@ -44,7 +44,7 @@ int newton(Model& model, const stan::io::var_context& init, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& parameter_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; diff --git a/src/stan/services/pathfinder/multi.hpp b/src/stan/services/pathfinder/multi.hpp index f7836b7341..e87eaa63e3 100644 --- a/src/stan/services/pathfinder/multi.hpp +++ b/src/stan/services/pathfinder/multi.hpp @@ -194,11 +194,9 @@ inline int pathfinder_lbfgs_multi( 3 * std::sqrt(num_returned_samples)); Eigen::Array weight_vals = stan::services::psis::psis_weights(lp_ratios, tail_len, logger); - boost::ecuyer1988 rng - = util::create_rng(random_seed, stride_id); - boost::variate_generator< - boost::ecuyer1988&, - boost::random::discrete_distribution> + stan::rng_t rng = util::create_rng(random_seed, stride_id); + boost::variate_generator> rand_psis_idx( rng, boost::random::discrete_distribution( boost::iterator_range( diff --git a/src/stan/services/pathfinder/single.hpp b/src/stan/services/pathfinder/single.hpp index 5b163c519e..fb7f3295a4 100644 --- a/src/stan/services/pathfinder/single.hpp +++ b/src/stan/services/pathfinder/single.hpp @@ -221,7 +221,7 @@ inline elbo_est_t est_approx_draws(LPF&& lp_fun, ConstrainF&& constrain_fun, size_t num_samples, const EigVec& alpha, const std::string& iter_msg, Logger&& logger, bool calculate_lp = true) { - boost::variate_generator> + boost::variate_generator> rand_unit_gaus(rng, boost::normal_distribution<>()); const auto num_params = taylor_approx.x_center.size(); size_t lp_fun_calls = 0; @@ -607,8 +607,7 @@ inline auto pathfinder_lbfgs_single( callbacks::writer& init_writer, ParamWriter& parameter_writer, DiagnosticWriter& diagnostic_writer, bool calculate_lp = true) { const auto start_pathfinder_time = std::chrono::steady_clock::now(); - boost::ecuyer1988 rng - = util::create_rng(random_seed, stride_id); + stan::rng_t rng = util::create_rng(random_seed, stride_id); std::vector disc_vector; std::vector cont_vector; diff --git a/src/stan/services/sample/fixed_param.hpp b/src/stan/services/sample/fixed_param.hpp index efe75c2f40..f407b14f57 100644 --- a/src/stan/services/sample/fixed_param.hpp +++ b/src/stan/services/sample/fixed_param.hpp @@ -49,7 +49,7 @@ int fixed_param(Model& model, const stan::io::var_context& init, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; @@ -134,7 +134,7 @@ int fixed_param(Model& model, const std::size_t num_chains, init_writer[0], sample_writers[0], diagnostic_writers[0]); } - std::vector rngs; + std::vector rngs; std::vector cont_vectors; std::vector writers; std::vector samples; diff --git a/src/stan/services/sample/hmc_nuts_dense_e.hpp b/src/stan/services/sample/hmc_nuts_dense_e.hpp index b2a4142eb8..bd20ad6c86 100644 --- a/src/stan/services/sample/hmc_nuts_dense_e.hpp +++ b/src/stan/services/sample/hmc_nuts_dense_e.hpp @@ -56,7 +56,7 @@ int hmc_nuts_dense_e(Model& model, const stan::io::var_context& init, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; @@ -73,7 +73,7 @@ int hmc_nuts_dense_e(Model& model, const stan::io::var_context& init, return error_codes::CONFIG; } - stan::mcmc::dense_e_nuts sampler(model, rng); + stan::mcmc::dense_e_nuts sampler(model, rng); sampler.set_metric(inv_metric); @@ -197,11 +197,11 @@ int hmc_nuts_dense_e(Model& model, size_t num_chains, stepsize, stepsize_jitter, max_depth, interrupt, logger, init_writer[0], sample_writer[0], diagnostic_writer[0]); } - std::vector rngs; + std::vector rngs; rngs.reserve(num_chains); std::vector> cont_vectors; cont_vectors.reserve(num_chains); - using sample_t = stan::mcmc::dense_e_nuts; + using sample_t = stan::mcmc::dense_e_nuts; std::vector samplers; samplers.reserve(num_chains); try { diff --git a/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp index 66d0f954f4..6ea6e38e10 100644 --- a/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp @@ -66,7 +66,7 @@ int hmc_nuts_dense_e_adapt( callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer, callbacks::structured_writer& metric_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector cont_vector; @@ -82,7 +82,7 @@ int hmc_nuts_dense_e_adapt( return error_codes::CONFIG; } - stan::mcmc::adapt_dense_e_nuts sampler(model, rng); + stan::mcmc::adapt_dense_e_nuts sampler(model, rng); sampler.set_metric(inv_metric); @@ -347,8 +347,8 @@ int hmc_nuts_dense_e_adapt( init_buffer, term_buffer, window, interrupt, logger, init_writer[0], sample_writer[0], diagnostic_writer[0], metric_writer[0]); } - using sample_t = stan::mcmc::adapt_dense_e_nuts; - std::vector rngs; + using sample_t = stan::mcmc::adapt_dense_e_nuts; + std::vector rngs; rngs.reserve(num_chains); std::vector> cont_vectors; cont_vectors.reserve(num_chains); diff --git a/src/stan/services/sample/hmc_nuts_diag_e.hpp b/src/stan/services/sample/hmc_nuts_diag_e.hpp index 7cdc2de3cc..321608bd0b 100644 --- a/src/stan/services/sample/hmc_nuts_diag_e.hpp +++ b/src/stan/services/sample/hmc_nuts_diag_e.hpp @@ -56,7 +56,7 @@ int hmc_nuts_diag_e(Model& model, const stan::io::var_context& init, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; @@ -72,7 +72,7 @@ int hmc_nuts_diag_e(Model& model, const stan::io::var_context& init, return error_codes::CONFIG; } - stan::mcmc::diag_e_nuts sampler(model, rng); + stan::mcmc::diag_e_nuts sampler(model, rng); sampler.set_metric(inv_metric); sampler.set_nominal_stepsize(stepsize); @@ -194,11 +194,11 @@ int hmc_nuts_diag_e(Model& model, size_t num_chains, stepsize, stepsize_jitter, max_depth, interrupt, logger, init_writer[0], sample_writer[0], diagnostic_writer[0]); } - std::vector rngs; + std::vector rngs; rngs.reserve(num_chains); std::vector> cont_vectors; cont_vectors.reserve(num_chains); - using sample_t = stan::mcmc::diag_e_nuts; + using sample_t = stan::mcmc::diag_e_nuts; std::vector samplers; samplers.reserve(num_chains); try { diff --git a/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp index fc1d1f69d5..8f6abed49b 100644 --- a/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp @@ -66,7 +66,7 @@ int hmc_nuts_diag_e_adapt( callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer, callbacks::structured_writer& metric_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector cont_vector; @@ -83,7 +83,7 @@ int hmc_nuts_diag_e_adapt( return error_codes::CONFIG; } - stan::mcmc::adapt_diag_e_nuts sampler(model, rng); + stan::mcmc::adapt_diag_e_nuts sampler(model, rng); sampler.set_metric(inv_metric); sampler.set_nominal_stepsize(stepsize); @@ -347,8 +347,8 @@ int hmc_nuts_diag_e_adapt( init_buffer, term_buffer, window, interrupt, logger, init_writer[0], sample_writer[0], diagnostic_writer[0], metric_writer[0]); } - using sample_t = stan::mcmc::adapt_diag_e_nuts; - std::vector rngs; + using sample_t = stan::mcmc::adapt_diag_e_nuts; + std::vector rngs; rngs.reserve(num_chains); std::vector> cont_vectors; cont_vectors.reserve(num_chains); diff --git a/src/stan/services/sample/hmc_nuts_unit_e.hpp b/src/stan/services/sample/hmc_nuts_unit_e.hpp index e1d85079fc..01c9fe2e1b 100644 --- a/src/stan/services/sample/hmc_nuts_unit_e.hpp +++ b/src/stan/services/sample/hmc_nuts_unit_e.hpp @@ -52,7 +52,7 @@ int hmc_nuts_unit_e(Model& model, const stan::io::var_context& init, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; @@ -64,7 +64,7 @@ int hmc_nuts_unit_e(Model& model, const stan::io::var_context& init, logger.error(e.what()); return error_codes::CONFIG; } - stan::mcmc::unit_e_nuts sampler(model, rng); + stan::mcmc::unit_e_nuts sampler(model, rng); sampler.set_nominal_stepsize(stepsize); sampler.set_stepsize_jitter(stepsize_jitter); sampler.set_max_depth(max_depth); @@ -133,8 +133,8 @@ int hmc_nuts_unit_e(Model& model, size_t num_chains, max_depth, interrupt, logger, init_writer[0], sample_writer[0], diagnostic_writer[0]); } - using sample_t = stan::mcmc::unit_e_nuts; - std::vector rngs; + using sample_t = stan::mcmc::unit_e_nuts; + std::vector rngs; rngs.reserve(num_chains); std::vector> cont_vectors; cont_vectors.reserve(num_chains); diff --git a/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp index 6af9c74234..889c6d8920 100644 --- a/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp @@ -59,7 +59,7 @@ int hmc_nuts_unit_e_adapt( callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer, callbacks::structured_writer& metric_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; @@ -72,7 +72,7 @@ int hmc_nuts_unit_e_adapt( return error_codes::CONFIG; } - stan::mcmc::adapt_unit_e_nuts sampler(model, rng); + stan::mcmc::adapt_unit_e_nuts sampler(model, rng); sampler.set_nominal_stepsize(stepsize); sampler.set_stepsize_jitter(stepsize_jitter); sampler.set_max_depth(max_depth); @@ -200,8 +200,8 @@ int hmc_nuts_unit_e_adapt( max_depth, delta, gamma, kappa, t0, interrupt, logger, init_writer[0], sample_writer[0], diagnostic_writer[0], metric_writer[0]); } - using sample_t = stan::mcmc::adapt_unit_e_nuts; - std::vector rngs; + using sample_t = stan::mcmc::adapt_unit_e_nuts; + std::vector rngs; rngs.reserve(num_chains); std::vector> cont_vectors; cont_vectors.reserve(num_chains); diff --git a/src/stan/services/sample/hmc_static_dense_e.hpp b/src/stan/services/sample/hmc_static_dense_e.hpp index 45ecb496ba..4d2ac82881 100644 --- a/src/stan/services/sample/hmc_static_dense_e.hpp +++ b/src/stan/services/sample/hmc_static_dense_e.hpp @@ -53,7 +53,7 @@ int hmc_static_dense_e( double stepsize_jitter, double int_time, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; @@ -70,7 +70,7 @@ int hmc_static_dense_e( return error_codes::CONFIG; } - stan::mcmc::dense_e_static_hmc sampler(model, rng); + stan::mcmc::dense_e_static_hmc sampler(model, rng); sampler.set_metric(inv_metric); sampler.set_nominal_stepsize_and_T(stepsize, int_time); diff --git a/src/stan/services/sample/hmc_static_dense_e_adapt.hpp b/src/stan/services/sample/hmc_static_dense_e_adapt.hpp index 98fcdbcefc..709a875e59 100644 --- a/src/stan/services/sample/hmc_static_dense_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_dense_e_adapt.hpp @@ -65,7 +65,7 @@ int hmc_static_dense_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; @@ -82,8 +82,7 @@ int hmc_static_dense_e_adapt( return error_codes::CONFIG; } - stan::mcmc::adapt_dense_e_static_hmc sampler(model, - rng); + stan::mcmc::adapt_dense_e_static_hmc sampler(model, rng); sampler.set_metric(inv_metric); sampler.set_nominal_stepsize_and_T(stepsize, int_time); diff --git a/src/stan/services/sample/hmc_static_diag_e.hpp b/src/stan/services/sample/hmc_static_diag_e.hpp index 1e5d1f9b12..d478307744 100644 --- a/src/stan/services/sample/hmc_static_diag_e.hpp +++ b/src/stan/services/sample/hmc_static_diag_e.hpp @@ -56,7 +56,7 @@ int hmc_static_diag_e(Model& model, const stan::io::var_context& init, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; @@ -73,7 +73,7 @@ int hmc_static_diag_e(Model& model, const stan::io::var_context& init, return error_codes::CONFIG; } - stan::mcmc::diag_e_static_hmc sampler(model, rng); + stan::mcmc::diag_e_static_hmc sampler(model, rng); sampler.set_metric(inv_metric); sampler.set_nominal_stepsize_and_T(stepsize, int_time); diff --git a/src/stan/services/sample/hmc_static_diag_e_adapt.hpp b/src/stan/services/sample/hmc_static_diag_e_adapt.hpp index 83b282ee73..86d0ee6acf 100644 --- a/src/stan/services/sample/hmc_static_diag_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_diag_e_adapt.hpp @@ -64,7 +64,7 @@ int hmc_static_diag_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; @@ -80,8 +80,7 @@ int hmc_static_diag_e_adapt( return error_codes::CONFIG; } - stan::mcmc::adapt_diag_e_static_hmc sampler(model, - rng); + stan::mcmc::adapt_diag_e_static_hmc sampler(model, rng); sampler.set_metric(inv_metric); sampler.set_nominal_stepsize_and_T(stepsize, int_time); diff --git a/src/stan/services/sample/hmc_static_unit_e.hpp b/src/stan/services/sample/hmc_static_unit_e.hpp index d46cc6dc1f..d50c902479 100644 --- a/src/stan/services/sample/hmc_static_unit_e.hpp +++ b/src/stan/services/sample/hmc_static_unit_e.hpp @@ -52,7 +52,7 @@ int hmc_static_unit_e(Model& model, const stan::io::var_context& init, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; @@ -64,7 +64,7 @@ int hmc_static_unit_e(Model& model, const stan::io::var_context& init, logger.error(e.what()); return error_codes::CONFIG; } - stan::mcmc::unit_e_static_hmc sampler(model, rng); + stan::mcmc::unit_e_static_hmc sampler(model, rng); sampler.set_nominal_stepsize_and_T(stepsize, int_time); sampler.set_stepsize_jitter(stepsize_jitter); diff --git a/src/stan/services/sample/hmc_static_unit_e_adapt.hpp b/src/stan/services/sample/hmc_static_unit_e_adapt.hpp index 96459d57a1..fb0da9aff5 100644 --- a/src/stan/services/sample/hmc_static_unit_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_unit_e_adapt.hpp @@ -57,7 +57,7 @@ int hmc_static_unit_e_adapt( double kappa, double t0, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - boost::ecuyer1988 rng = util::create_rng(random_seed, chain); + stan::rng_t rng = util::create_rng(random_seed, chain); std::vector disc_vector; std::vector cont_vector; @@ -69,8 +69,7 @@ int hmc_static_unit_e_adapt( logger.error(e.what()); return error_codes::CONFIG; } - stan::mcmc::adapt_unit_e_static_hmc sampler(model, - rng); + stan::mcmc::adapt_unit_e_static_hmc sampler(model, rng); sampler.set_nominal_stepsize_and_T(stepsize, int_time); sampler.set_stepsize_jitter(stepsize_jitter); diff --git a/src/stan/services/sample/standalone_gqs.hpp b/src/stan/services/sample/standalone_gqs.hpp index 85f7ec5a5b..378be61106 100644 --- a/src/stan/services/sample/standalone_gqs.hpp +++ b/src/stan/services/sample/standalone_gqs.hpp @@ -63,7 +63,7 @@ int standalone_generate(const Model &model, const Eigen::MatrixXd &draws, util::gq_writer writer(sample_writer, logger, p_names.size()); writer.write_gq_names(model); - boost::ecuyer1988 rng = util::create_rng(seed, 1); + stan::rng_t rng = util::create_rng(seed, 1); std::vector unconstrained_params_r; std::vector row(draws.cols()); @@ -125,7 +125,7 @@ int standalone_generate(const Model &model, const int num_chains, } std::vector writers; writers.reserve(num_chains); - std::vector rngs; + std::vector rngs; rngs.reserve(num_chains); for (int i = 0; i < num_chains; ++i) { if (draws[i].size() == 0) { diff --git a/src/stan/services/util/create_rng.hpp b/src/stan/services/util/create_rng.hpp index cbc742c668..9d3b79a1d3 100644 --- a/src/stan/services/util/create_rng.hpp +++ b/src/stan/services/util/create_rng.hpp @@ -4,6 +4,9 @@ #include namespace stan { + +using rng_t = boost::ecuyer1988; + namespace services { namespace util { @@ -18,16 +21,14 @@ namespace util { * that the draws used to initialized transformed data are not * duplicated. * - * @tparam RngType type of RNG to return, default is `boost::ecuyer1988` * @param[in] seed the random seed * @param[in] chain the chain id - * @return an RNG instance + * @return an stan::rng_t instance */ -template -inline RngType create_rng(unsigned int seed, unsigned int chain) { +inline rng_t create_rng(unsigned int seed, unsigned int chain) { using boost::uintmax_t; static constexpr uintmax_t DISCARD_STRIDE = static_cast(1) << 50; - RngType rng(seed); + rng_t rng(seed); // always discard at least 1 to avoid issue with small seeds for certain RNG // distributions. See stan#3167 and boostorg/random#92 rng.discard(std::max(static_cast(1), DISCARD_STRIDE * chain)); From 467762d307d47df34b0af1592a5359dfa37bafd8 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 30 Jan 2024 11:59:49 -0500 Subject: [PATCH 09/93] Update first round of tests --- src/test/unit/model/model_base_test.cpp | 4 ++-- .../unit/services/pathfinder/eight_schools_test.cpp | 2 +- src/test/unit/services/util/create_rng_test.cpp | 12 ++++++------ .../unit/services/util/generate_transitions_test.cpp | 4 ++-- src/test/unit/services/util/gq_writer_test.cpp | 4 ++-- src/test/unit/services/util/mcmc_writer_test.cpp | 4 ++-- .../variational/stochastic_gradient_ascent_test.cpp | 3 --- 7 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/test/unit/model/model_base_test.cpp b/src/test/unit/model/model_base_test.cpp index a015588948..c4a81f7132 100644 --- a/src/test/unit/model/model_base_test.cpp +++ b/src/test/unit/model/model_base_test.cpp @@ -79,7 +79,7 @@ struct mock_model : public stan::model::model_base { Eigen::VectorXd& params_r, std::ostream* msgs) const override {} - void write_array(boost::ecuyer1988& base_rng, Eigen::VectorXd& params_r, + void write_array(stan::rng_t& base_rng, Eigen::VectorXd& params_r, Eigen::VectorXd& params_constrained_r, bool include_tparams, bool include_gqs, std::ostream* msgs) const override {} @@ -139,7 +139,7 @@ struct mock_model : public stan::model::model_base { std::vector& params_r, std::ostream* msgs) const override {} - void write_array(boost::ecuyer1988& base_rng, std::vector& params_r, + void write_array(stan::rng_t& base_rng, std::vector& params_r, std::vector& params_i, std::vector& params_r_constrained, bool include_tparams, bool include_gqs, diff --git a/src/test/unit/services/pathfinder/eight_schools_test.cpp b/src/test/unit/services/pathfinder/eight_schools_test.cpp index 8955f5e9e4..5d5626b901 100644 --- a/src/test/unit/services/pathfinder/eight_schools_test.cpp +++ b/src/test/unit/services/pathfinder/eight_schools_test.cpp @@ -192,7 +192,7 @@ TEST_F(ServicesPathfinderEightSchools, single) { Eigen::MatrixXd r_constrainted_draws_mat(20, 100); { - auto rng = stan::services::util::create_rng(0123, 0); + stan::rng_t rng = stan::services::util::create_rng(0123, 0); auto fn = [&model = ServicesPathfinderEightSchools::model](auto&& u) { return -model.log_prob_propto_jacobian(u, 0); }; diff --git a/src/test/unit/services/util/create_rng_test.cpp b/src/test/unit/services/util/create_rng_test.cpp index adca8ecccd..5dee9c8656 100644 --- a/src/test/unit/services/util/create_rng_test.cpp +++ b/src/test/unit/services/util/create_rng_test.cpp @@ -2,8 +2,8 @@ #include TEST(rng, initialize_with_seed) { - boost::ecuyer1988 rng1 = stan::services::util::create_rng(0, 1); - boost::ecuyer1988 rng2 = stan::services::util::create_rng(0, 1); + stan::rng_t rng1 = stan::services::util::create_rng(0, 1); + stan::rng_t rng2 = stan::services::util::create_rng(0, 1); EXPECT_EQ(rng1, rng2); rng2(); // generate a random number @@ -11,9 +11,9 @@ TEST(rng, initialize_with_seed) { } TEST(rng, initialize_with_id) { - boost::ecuyer1988 rng1 = stan::services::util::create_rng(0, 1); + stan::rng_t rng1 = stan::services::util::create_rng(0, 1); for (unsigned int n = 2; n < 20; n++) { - boost::ecuyer1988 rng2 = stan::services::util::create_rng(0, n); + stan::rng_t rng2 = stan::services::util::create_rng(0, n); EXPECT_NE(rng1, rng2); } } @@ -21,8 +21,8 @@ TEST(rng, initialize_with_id) { // warning---this will reuse draws from transformed data // if we initialize with zero TEST(rng, initialize_with_zero) { - boost::ecuyer1988 rng1 = stan::services::util::create_rng(0, 0); - boost::ecuyer1988 rng2 = stan::services::util::create_rng(0, 0); + stan::rng_t rng1 = stan::services::util::create_rng(0, 0); + stan::rng_t rng2 = stan::services::util::create_rng(0, 0); EXPECT_EQ(rng1, rng2); rng2(); diff --git a/src/test/unit/services/util/generate_transitions_test.cpp b/src/test/unit/services/util/generate_transitions_test.cpp index e4cbb5d4ba..0de3c69986 100644 --- a/src/test/unit/services/util/generate_transitions_test.cpp +++ b/src/test/unit/services/util/generate_transitions_test.cpp @@ -30,7 +30,7 @@ TEST_F(ServicesSamplesGenerateTransitions, call_counting) { stan::test::unit::instrumented_interrupt interrupt; EXPECT_EQ(interrupt.call_count(), 0); - boost::ecuyer1988 rng = stan::services::util::create_rng(seed, chain); + stan::rng_t rng = stan::services::util::create_rng(seed, chain); std::vector disc_vector; std::vector cont_vector = stan::services::util::initialize( @@ -86,7 +86,7 @@ TEST_F(ServicesSamplesGenerateTransitions, output_sizes) { stan::test::unit::instrumented_interrupt interrupt; EXPECT_EQ(interrupt.call_count(), 0); - boost::ecuyer1988 rng = stan::services::util::create_rng(seed, chain); + stan::rng_t rng = stan::services::util::create_rng(seed, chain); std::vector disc_vector; std::vector cont_vector = stan::services::util::initialize( diff --git a/src/test/unit/services/util/gq_writer_test.cpp b/src/test/unit/services/util/gq_writer_test.cpp index 04b93d9ec3..7b3017887a 100644 --- a/src/test/unit/services/util/gq_writer_test.cpp +++ b/src/test/unit/services/util/gq_writer_test.cpp @@ -35,7 +35,7 @@ TEST_F(ServicesUtilGQWriter, t2) { stan::callbacks::stream_writer sample_writer(sample_ss, ""); stan::callbacks::stream_logger logger(logger_ss, logger_ss, logger_ss, logger_ss, logger_ss); - boost::ecuyer1988 rng1 = stan::services::util::create_rng(0, 1); + stan::rng_t rng1 = stan::services::util::create_rng(0, 1); std::vector draw; draw.push_back(-2.345); draw.push_back(-6.789); @@ -50,7 +50,7 @@ TEST_F(ServicesUtilGQWriter, TestExceptions) { stan::callbacks::stream_writer sample_writer(sample_ss, ""); stan::callbacks::stream_logger logger(logger_ss, logger_ss, logger_ss, logger_ss, logger_ss); - boost::ecuyer1988 rng1 = stan::services::util::create_rng(0, 1); + stan::rng_t rng1 = stan::services::util::create_rng(0, 1); std::vector draw; draw.push_back(2.345); draw.push_back(6.789); diff --git a/src/test/unit/services/util/mcmc_writer_test.cpp b/src/test/unit/services/util/mcmc_writer_test.cpp index 6c0cba15b0..c9840a6880 100644 --- a/src/test/unit/services/util/mcmc_writer_test.cpp +++ b/src/test/unit/services/util/mcmc_writer_test.cpp @@ -247,7 +247,7 @@ TEST_F(ServicesUtil, write_sample_names) { } TEST_F(ServicesUtil, write_sample_params) { - boost::ecuyer1988 rng = stan::services::util::create_rng(0, 1); + stan::rng_t rng = stan::services::util::create_rng(0, 1); Eigen::VectorXd x = Eigen::VectorXd::Zero(2); stan::mcmc::sample sample(x, 1, 2); mock_sampler sampler; @@ -314,7 +314,7 @@ TEST_F(ServicesUtil, write_timing) { } TEST_F(ServicesUtil, throwing_model__write_sample_parameters) { - boost::ecuyer1988 rng = stan::services::util::create_rng(0, 1); + stan::rng_t rng = stan::services::util::create_rng(0, 1); Eigen::VectorXd x = Eigen::VectorXd::Zero(2); stan::mcmc::sample sample(x, 1, 2); mock_sampler sampler; diff --git a/src/test/unit/variational/stochastic_gradient_ascent_test.cpp b/src/test/unit/variational/stochastic_gradient_ascent_test.cpp index a9bf7e6273..a51f3dc5a3 100644 --- a/src/test/unit/variational/stochastic_gradient_ascent_test.cpp +++ b/src/test/unit/variational/stochastic_gradient_ascent_test.cpp @@ -8,9 +8,6 @@ #include #include #include -#include // L'Ecuyer RNG - -typedef boost::ecuyer1988 rng_t; // Mock Model class mock_model : public stan::model::prob_grad { From a92cdb1c5b423ce9185d25bc3939beae2f2e1925 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 30 Jan 2024 12:31:49 -0500 Subject: [PATCH 10/93] Update remaining tests to use rng_t --- src/stan/model/model_header.hpp | 3 - .../services/experimental/advi/fullrank.hpp | 1 - .../services/experimental/advi/meanfield.hpp | 1 - src/test/unit/io/random_var_context_test.cpp | 6 +- src/test/unit/mcmc/chains_test.cpp | 1 - src/test/unit/mcmc/hmc/base_hmc_test.cpp | 26 ++++----- .../hamiltonians/base_hamiltonian_test.cpp | 6 +- .../hmc/hamiltonians/dense_e_metric_test.cpp | 15 ++--- .../hmc/hamiltonians/diag_e_metric_test.cpp | 16 ++---- .../hmc/hamiltonians/softabs_metric_test.cpp | 16 ++---- .../hmc/hamiltonians/unit_e_metric_test.cpp | 16 ++---- .../hmc/integrators/expl_leapfrog2_test.cpp | 22 +++----- .../hmc/integrators/expl_leapfrog_test.cpp | 33 ++++++----- .../hmc/integrators/impl_leapfrog2_test.cpp | 41 ++++++-------- .../hmc/integrators/impl_leapfrog_test.cpp | 46 ++++++++-------- .../unit/mcmc/hmc/nuts/base_nuts_test.cpp | 55 +++++++++---------- .../unit/mcmc/hmc/nuts/derived_nuts_test.cpp | 29 +++++----- .../unit/mcmc/hmc/nuts/instantiation_test.cpp | 21 +++---- .../unit/mcmc/hmc/nuts/softabs_nuts_test.cpp | 18 +++--- .../unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp | 18 +++--- .../nuts_classic/base_nuts_classic_test.cpp | 29 +++++----- .../derived_nuts_classic_test.cpp | 16 +++--- .../hmc/nuts_classic/instantiation_test.cpp | 20 +++---- .../mcmc/hmc/static/base_static_hmc_test.cpp | 20 +++---- .../base_static_uniform_test.cpp | 18 +++--- .../derived_static_uniform_test.cpp | 41 +++++++------- .../unit/mcmc/hmc/xhmc/base_xhmc_test.cpp | 34 ++++++------ .../unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp | 14 ++--- .../unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp | 12 ++-- .../model/array_functions_roundtrip_test.cpp | 3 +- .../unit/services/util/initialize_test.cpp | 3 +- .../util/run_adaptive_sampler_test.cpp | 5 +- .../unit/services/util/run_sampler_test.cpp | 3 +- .../unit/variational/advi_messages_test.cpp | 13 ++--- .../advi_multivar_no_constraint_test.cpp | 11 ++-- .../advi_multivar_with_constraint_test.cpp | 13 +++-- .../advi_univar_no_constraint_test.cpp | 13 +++-- .../advi_univar_with_constraint_test.cpp | 13 +++-- .../unit/variational/eta_adapt_big_test.cpp | 14 ++--- .../unit/variational/eta_adapt_fail_test.cpp | 14 ++--- .../eta_adapt_mock_models_test.cpp | 3 - .../unit/variational/eta_adapt_small_test.cpp | 14 ++--- .../unit/variational/gradient_warn_test.cpp | 14 ++--- .../variational/hier_logistic_cp_test.cpp | 8 +-- .../unit/variational/hier_logistic_test.cpp | 14 ++--- 45 files changed, 344 insertions(+), 408 deletions(-) diff --git a/src/stan/model/model_header.hpp b/src/stan/model/model_header.hpp index 75ac6c19cb..34948377f7 100644 --- a/src/stan/model/model_header.hpp +++ b/src/stan/model/model_header.hpp @@ -13,9 +13,6 @@ #include #include -#include -#include - #include #include #include diff --git a/src/stan/services/experimental/advi/fullrank.hpp b/src/stan/services/experimental/advi/fullrank.hpp index 5c651773de..96cf5d05c0 100644 --- a/src/stan/services/experimental/advi/fullrank.hpp +++ b/src/stan/services/experimental/advi/fullrank.hpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include diff --git a/src/stan/services/experimental/advi/meanfield.hpp b/src/stan/services/experimental/advi/meanfield.hpp index a89aa521cd..6cffe548ac 100644 --- a/src/stan/services/experimental/advi/meanfield.hpp +++ b/src/stan/services/experimental/advi/meanfield.hpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include diff --git a/src/test/unit/io/random_var_context_test.cpp b/src/test/unit/io/random_var_context_test.cpp index 18bfeb7f2b..64ea370f17 100644 --- a/src/test/unit/io/random_var_context_test.cpp +++ b/src/test/unit/io/random_var_context_test.cpp @@ -1,7 +1,7 @@ #include #include +#include #include -#include // L'Ecuyer RNG #include #include #include @@ -95,12 +95,12 @@ class random_var_context : public testing::Test { random_var_context() : empty_context(), model(empty_context, 0, static_cast(0)), - rng(0), + rng(stan::services::util::create_rng(0, 0)), throwing_model() {} stan::io::empty_var_context empty_context; stan_model model; - boost::ecuyer1988 rng; + stan::rng_t rng; test::mock_throwing_model_in_write_array throwing_model; }; diff --git a/src/test/unit/mcmc/chains_test.cpp b/src/test/unit/mcmc/chains_test.cpp index 987279de66..0862b96221 100644 --- a/src/test/unit/mcmc/chains_test.cpp +++ b/src/test/unit/mcmc/chains_test.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include diff --git a/src/test/unit/mcmc/hmc/base_hmc_test.cpp b/src/test/unit/mcmc/hmc/base_hmc_test.cpp index 0074253207..ce3d8f51f4 100644 --- a/src/test/unit/mcmc/hmc/base_hmc_test.cpp +++ b/src/test/unit/mcmc/hmc/base_hmc_test.cpp @@ -1,22 +1,20 @@ #include #include #include -#include +#include #include #include #include -typedef boost::ecuyer1988 rng_t; - namespace stan { namespace mcmc { -class mock_hmc - : public base_hmc { +class mock_hmc : public base_hmc { public: - mock_hmc(const mock_model& m, rng_t& rng) - : base_hmc(m, rng) { - } + mock_hmc(const mock_model& m, stan::rng_t& rng) + : base_hmc( + m, rng) {} sample transition(sample& init_sample, callbacks::logger& logger) { this->seed(init_sample.cont_params()); @@ -33,7 +31,7 @@ class mock_hmc } // namespace stan TEST(McmcBaseHMC, point_construction) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; @@ -47,14 +45,14 @@ TEST(McmcBaseHMC, point_construction) { } TEST(McmcBaseHMC, point_access_from_const_hmc) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); const stan::mcmc::mock_hmc sampler(stan::mcmc::mock_model(2), base_rng); EXPECT_EQ(2, sampler.z().q.size()); EXPECT_EQ(2, sampler.z().g.size()); } TEST(McmcBaseHMC, seed) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; @@ -70,7 +68,7 @@ TEST(McmcBaseHMC, seed) { } TEST(McmcBaseHMC, set_nominal_stepsize) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; @@ -88,7 +86,7 @@ TEST(McmcBaseHMC, set_nominal_stepsize) { } TEST(McmcBaseHMC, set_stepsize_jitter) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; @@ -108,7 +106,7 @@ TEST(McmcBaseHMC, set_stepsize_jitter) { TEST(McmcBaseHMC, streams) { stan::test::capture_std_streams(); - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; diff --git a/src/test/unit/mcmc/hmc/hamiltonians/base_hamiltonian_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/base_hamiltonian_test.cpp index 4926f6daef..41537c282c 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/base_hamiltonian_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/base_hamiltonian_test.cpp @@ -3,12 +3,10 @@ #include #include #include -#include +#include #include #include -typedef boost::ecuyer1988 rng_t; - TEST(BaseHamiltonian, update_potential_gradient) { stan::io::empty_var_context data_var_context; @@ -16,7 +14,7 @@ TEST(BaseHamiltonian, update_potential_gradient) { funnel_model_namespace::funnel_model model(data_var_context, 0, &model_output); - stan::mcmc::mock_hamiltonian + stan::mcmc::mock_hamiltonian metric(model); stan::mcmc::ps_point z(11); z.q.setOnes(); diff --git a/src/test/unit/mcmc/hmc/hamiltonians/dense_e_metric_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/dense_e_metric_test.cpp index 31f5bcbcd7..9f78a43024 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/dense_e_metric_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/dense_e_metric_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include @@ -8,10 +8,8 @@ #include #include -typedef boost::ecuyer1988 rng_t; - TEST(McmcDenseEMetric, sample_p) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::Matrix2d m(2, 2); m(0, 0) = 3.0; @@ -23,7 +21,7 @@ TEST(McmcDenseEMetric, sample_p) { stan::mcmc::mock_model model(2); - stan::mcmc::dense_e_metric metric(model); + stan::mcmc::dense_e_metric metric(model); stan::mcmc::dense_e_point z(2); z.set_metric(m_inv); @@ -62,7 +60,6 @@ TEST(McmcDenseEMetric, sample_p) { } TEST(McmcDenseEMetric, gradients) { - rng_t base_rng(0); Eigen::VectorXd q = Eigen::VectorXd::Ones(11); @@ -79,7 +76,7 @@ TEST(McmcDenseEMetric, gradients) { funnel_model_namespace::funnel_model model(data_var_context, 0, &model_output); - stan::mcmc::dense_e_metric + stan::mcmc::dense_e_metric metric(model); double epsilon = 1e-6; @@ -156,7 +153,6 @@ TEST(McmcDenseEMetric, gradients) { TEST(McmcDenseEMetric, streams) { stan::test::capture_std_streams(); - rng_t base_rng(0); Eigen::VectorXd q(2); q(0) = 5; @@ -165,7 +161,8 @@ TEST(McmcDenseEMetric, streams) { stan::mcmc::mock_model model(q.size()); // typedef to use within Google Test macros - typedef stan::mcmc::dense_e_metric dense_e; + typedef stan::mcmc::dense_e_metric + dense_e; EXPECT_NO_THROW(dense_e metric(model)); diff --git a/src/test/unit/mcmc/hmc/hamiltonians/diag_e_metric_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/diag_e_metric_test.cpp index 1d11e26db9..475afbf56d 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/diag_e_metric_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/diag_e_metric_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include @@ -8,17 +8,15 @@ #include #include -typedef boost::ecuyer1988 rng_t; - TEST(McmcDiagEMetric, sample_p) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; q(1) = 1; stan::mcmc::mock_model model(q.size()); - stan::mcmc::diag_e_metric metric(model); + stan::mcmc::diag_e_metric metric(model); stan::mcmc::diag_e_point z(q.size()); int n_samples = 1000; @@ -44,7 +42,6 @@ TEST(McmcDiagEMetric, sample_p) { } TEST(McmcDiagEMetric, gradients) { - rng_t base_rng(0); Eigen::VectorXd q = Eigen::VectorXd::Ones(11); @@ -61,8 +58,8 @@ TEST(McmcDiagEMetric, gradients) { std::stringstream debug, info, warn, error, fatal; stan::callbacks::stream_logger logger(debug, info, warn, error, fatal); - stan::mcmc::diag_e_metric metric( - model); + stan::mcmc::diag_e_metric + metric(model); double epsilon = 1e-6; @@ -137,7 +134,6 @@ TEST(McmcDiagEMetric, gradients) { TEST(McmcDiagEMetric, streams) { stan::test::capture_std_streams(); - rng_t base_rng(0); Eigen::VectorXd q(2); q(0) = 5; @@ -146,7 +142,7 @@ TEST(McmcDiagEMetric, streams) { stan::mcmc::mock_model model(q.size()); // typedef to use within Google Test macros - typedef stan::mcmc::diag_e_metric diag_e; + typedef stan::mcmc::diag_e_metric diag_e; EXPECT_NO_THROW(diag_e metric(model)); diff --git a/src/test/unit/mcmc/hmc/hamiltonians/softabs_metric_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/softabs_metric_test.cpp index c1a477c1a1..0804105101 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/softabs_metric_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/softabs_metric_test.cpp @@ -1,27 +1,24 @@ #include #include +#include #include #include #include #include -#include - #include #include -typedef boost::ecuyer1988 rng_t; - TEST(McmcSoftAbs, sample_p) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; q(1) = 1; stan::mcmc::mock_model model(q.size()); - stan::mcmc::softabs_metric metric(model); + stan::mcmc::softabs_metric metric(model); stan::mcmc::softabs_point z(q.size()); int n_samples = 1000; @@ -60,7 +57,6 @@ TEST(McmcSoftAbs, sample_p) { } TEST(McmcSoftAbs, gradients) { - rng_t base_rng(0); Eigen::VectorXd q = Eigen::VectorXd::Ones(11); @@ -77,7 +73,7 @@ TEST(McmcSoftAbs, gradients) { funnel_model_namespace::funnel_model model(data_var_context, 0, &model_output); - stan::mcmc::softabs_metric + stan::mcmc::softabs_metric metric(model); double epsilon = 1e-6; @@ -152,7 +148,6 @@ TEST(McmcSoftAbs, gradients) { TEST(McmcSoftAbs, streams) { stan::test::capture_std_streams(); - rng_t base_rng(0); Eigen::VectorXd q(2); q(0) = 5; @@ -160,7 +155,8 @@ TEST(McmcSoftAbs, streams) { stan::mcmc::mock_model model(q.size()); // for use in Google Test macros below - typedef stan::mcmc::softabs_metric softabs; + typedef stan::mcmc::softabs_metric + softabs; EXPECT_NO_THROW(softabs metric(model)); diff --git a/src/test/unit/mcmc/hmc/hamiltonians/unit_e_metric_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/unit_e_metric_test.cpp index 635386f55f..177c8905aa 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/unit_e_metric_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/unit_e_metric_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include @@ -8,17 +8,15 @@ #include #include -typedef boost::ecuyer1988 rng_t; - TEST(McmcUnitEMetric, sample_p) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; q(1) = 1; stan::mcmc::mock_model model(q.size()); - stan::mcmc::unit_e_metric metric(model); + stan::mcmc::unit_e_metric metric(model); stan::mcmc::unit_e_point z(q.size()); int n_samples = 1000; @@ -44,7 +42,6 @@ TEST(McmcUnitEMetric, sample_p) { } TEST(McmcUnitEMetric, gradients) { - rng_t base_rng(0); Eigen::VectorXd q = Eigen::VectorXd::Ones(11); @@ -61,8 +58,8 @@ TEST(McmcUnitEMetric, gradients) { funnel_model_namespace::funnel_model model(data_var_context, 0, &model_output); - stan::mcmc::unit_e_metric metric( - model); + stan::mcmc::unit_e_metric + metric(model); double epsilon = 1e-6; @@ -136,7 +133,6 @@ TEST(McmcUnitEMetric, gradients) { TEST(McmcUnitEMetric, streams) { stan::test::capture_std_streams(); - rng_t base_rng(0); Eigen::VectorXd q(2); q(0) = 5; @@ -144,7 +140,7 @@ TEST(McmcUnitEMetric, streams) { stan::mcmc::mock_model model(q.size()); // for use in Google Test macros below - typedef stan::mcmc::unit_e_metric unit_e; + typedef stan::mcmc::unit_e_metric unit_e; EXPECT_NO_THROW(unit_e metric(model)); diff --git a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog2_test.cpp b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog2_test.cpp index 489eddf5d2..dee3dc18cf 100644 --- a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog2_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog2_test.cpp @@ -7,12 +7,9 @@ #include #include #include -#include // L'Ecuyer RNG - -typedef boost::ecuyer1988 rng_t; +#include TEST(McmcHmcIntegratorsExplLeapfrog, energy_conservation) { - rng_t base_rng(0); stan::io::empty_var_context data_var_context; @@ -22,12 +19,12 @@ TEST(McmcHmcIntegratorsExplLeapfrog, energy_conservation) { gauss_model_namespace::gauss_model model(data_var_context, 0, &model_output); - stan::mcmc::expl_leapfrog< - stan::mcmc::unit_e_metric > + stan::mcmc::expl_leapfrog > integrator; - stan::mcmc::unit_e_metric metric( - model); + stan::mcmc::unit_e_metric + metric(model); stan::mcmc::unit_e_point z(1); z.q(0) = 1; @@ -61,7 +58,6 @@ TEST(McmcHmcIntegratorsExplLeapfrog, energy_conservation) { } TEST(McmcHmcIntegratorsExplLeapfrog, symplecticness) { - rng_t base_rng(0); stan::io::empty_var_context data_var_context; @@ -71,12 +67,12 @@ TEST(McmcHmcIntegratorsExplLeapfrog, symplecticness) { gauss_model_namespace::gauss_model model(data_var_context, 0, &model_output); - stan::mcmc::expl_leapfrog< - stan::mcmc::unit_e_metric > + stan::mcmc::expl_leapfrog > integrator; - stan::mcmc::unit_e_metric metric( - model); + stan::mcmc::unit_e_metric + metric(model); // Create a circle of points const int n_points = 1000; diff --git a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp index 6dd6eaf419..24a8b388e5 100644 --- a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp @@ -9,13 +9,12 @@ #include #include -#include // L'Ecuyer RNG +#include #include // namespace //************************************************************ -typedef boost::ecuyer1988 rng_t; class McmcHmcIntegratorsExplLeapfrogF : public testing::Test { public: @@ -45,11 +44,11 @@ class McmcHmcIntegratorsExplLeapfrogF : public testing::Test { // integrator under test stan::mcmc::expl_leapfrog< - stan::mcmc::unit_e_metric > + stan::mcmc::unit_e_metric > unit_e_integrator; stan::mcmc::expl_leapfrog< - stan::mcmc::diag_e_metric > + stan::mcmc::diag_e_metric > diag_e_integrator; // model @@ -72,7 +71,7 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, begin_update_p) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -104,7 +103,7 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, update_q) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -136,7 +135,7 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, end_update_p) { EXPECT_NEAR(z.g(0), 1.67264975797776, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -168,7 +167,7 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, evolve_1) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -200,7 +199,7 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, evolve_2) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -232,7 +231,7 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, evolve_3) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -264,7 +263,7 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, evolve_4) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -296,7 +295,7 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, evolve_5) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -327,7 +326,7 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, evolve_6) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -359,7 +358,7 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, evolve_7) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -391,7 +390,7 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, evolve_8) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -424,7 +423,7 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, evolve_9) { EXPECT_NEAR(z.g(0), 1.27097196280777, 1e-15); // setup hamiltonian - stan::mcmc::diag_e_metric + stan::mcmc::diag_e_metric hamiltonian(*model); // setup epsilon @@ -447,7 +446,7 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, streams) { stan::test::capture_std_streams(); typedef stan::mcmc::expl_leapfrog< - stan::mcmc::unit_e_metric > + stan::mcmc::unit_e_metric > integrator; EXPECT_NO_THROW(integrator i); diff --git a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp index 47606be8eb..088de2066e 100644 --- a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -6,16 +7,11 @@ #include -#include // L'Ecuyer RNG - #include #include -typedef boost::ecuyer1988 rng_t; - TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_energy_conservation) { - rng_t base_rng(0); stan::io::empty_var_context data_var_context; @@ -25,12 +21,12 @@ TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_energy_conservation) { gauss_model_namespace::gauss_model model(data_var_context, 0, &model_output); - stan::mcmc::impl_leapfrog< - stan::mcmc::unit_e_metric > + stan::mcmc::impl_leapfrog > integrator; - stan::mcmc::unit_e_metric metric( - model); + stan::mcmc::unit_e_metric + metric(model); stan::mcmc::unit_e_point z(1); z.q(0) = 1; @@ -64,7 +60,6 @@ TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_energy_conservation) { } TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_symplecticness) { - rng_t base_rng(0); stan::io::empty_var_context data_var_context; @@ -74,12 +69,12 @@ TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_symplecticness) { gauss_model_namespace::gauss_model model(data_var_context, 0, &model_output); - stan::mcmc::impl_leapfrog< - stan::mcmc::unit_e_metric > + stan::mcmc::impl_leapfrog > integrator; - stan::mcmc::unit_e_metric metric( - model); + stan::mcmc::unit_e_metric + metric(model); // Create a circle of points const int n_points = 1000; @@ -151,7 +146,6 @@ TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_symplecticness) { } TEST(McmcHmcIntegratorsImplLeapfrog, softabs_energy_conservation) { - rng_t base_rng(0); stan::io::empty_var_context data_var_context; @@ -161,12 +155,12 @@ TEST(McmcHmcIntegratorsImplLeapfrog, softabs_energy_conservation) { gauss_model_namespace::gauss_model model(data_var_context, 0, &model_output); - stan::mcmc::impl_leapfrog< - stan::mcmc::softabs_metric > + stan::mcmc::impl_leapfrog > integrator; - stan::mcmc::softabs_metric metric( - model); + stan::mcmc::softabs_metric + metric(model); stan::mcmc::softabs_point z(1); z.q(0) = 1; @@ -200,7 +194,6 @@ TEST(McmcHmcIntegratorsImplLeapfrog, softabs_energy_conservation) { } TEST(McmcHmcIntegratorsImplLeapfrog, softabs_symplecticness) { - rng_t base_rng(0); stan::io::empty_var_context data_var_context; @@ -210,12 +203,12 @@ TEST(McmcHmcIntegratorsImplLeapfrog, softabs_symplecticness) { gauss_model_namespace::gauss_model model(data_var_context, 0, &model_output); - stan::mcmc::impl_leapfrog< - stan::mcmc::softabs_metric > + stan::mcmc::impl_leapfrog > integrator; - stan::mcmc::softabs_metric metric( - model); + stan::mcmc::softabs_metric + metric(model); // Create a circle of points const int n_points = 1000; diff --git a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp index 8aba1b21df..ce5a632528 100644 --- a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -8,7 +9,6 @@ #include #include -#include // L'Ecuyer RNG #include @@ -17,8 +17,6 @@ // namespace //************************************************************ -typedef boost::ecuyer1988 rng_t; - class McmcHmcIntegratorsImplLeapfrogF : public testing::Test { public: McmcHmcIntegratorsImplLeapfrogF() @@ -47,15 +45,15 @@ class McmcHmcIntegratorsImplLeapfrogF : public testing::Test { // integrator under test stan::mcmc::impl_leapfrog< - stan::mcmc::unit_e_metric > + stan::mcmc::unit_e_metric > unit_e_integrator; stan::mcmc::impl_leapfrog< - stan::mcmc::diag_e_metric > + stan::mcmc::diag_e_metric > diag_e_integrator; stan::mcmc::impl_leapfrog > + command_model_namespace::command_model, stan::rng_t> > softabs_integrator; // model @@ -75,7 +73,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, begin_update_p) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -107,7 +105,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, softabs_begin_update_p) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::softabs_metric + stan::mcmc::softabs_metric hamiltonian(*model); // setup epsilon @@ -141,7 +139,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, update_q) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -173,7 +171,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, softabs_update_q) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::softabs_metric + stan::mcmc::softabs_metric hamiltonian(*model); // setup epsilon @@ -207,7 +205,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, end_update_p) { EXPECT_NEAR(z.g(0), 1.67264975797776, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -239,7 +237,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, softabs_end_update_p) { EXPECT_NEAR(z.g(0), 1.67264975797776, 1e-15); // setup hamiltonian - stan::mcmc::softabs_metric + stan::mcmc::softabs_metric hamiltonian(*model); // setup epsilon @@ -273,7 +271,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, evolve_1) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -305,7 +303,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, evolve_2) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -337,7 +335,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, evolve_3) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -369,7 +367,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, evolve_4) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -401,7 +399,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, evolve_5) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -432,7 +430,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, evolve_6) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -464,7 +462,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, evolve_7) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -496,7 +494,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, evolve_8) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::unit_e_metric + stan::mcmc::unit_e_metric hamiltonian(*model); // setup epsilon @@ -529,7 +527,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, evolve_9) { EXPECT_NEAR(z.g(0), 1.27097196280777, 1e-15); // setup hamiltonian - stan::mcmc::diag_e_metric + stan::mcmc::diag_e_metric hamiltonian(*model); // setup epsilon @@ -561,7 +559,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, softabs_evolve) { EXPECT_NEAR(z.g(0), 1.27097196280777, 1e-15); // setup hamiltonian - stan::mcmc::softabs_metric + stan::mcmc::softabs_metric hamiltonian(*model); // setup epsilon @@ -586,7 +584,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, streams) { stan::test::capture_std_streams(); typedef stan::mcmc::impl_leapfrog< - stan::mcmc::unit_e_metric > + stan::mcmc::unit_e_metric > integrator; EXPECT_NO_THROW(integrator i); @@ -600,7 +598,7 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, softabs_streams) { stan::test::capture_std_streams(); typedef stan::mcmc::impl_leapfrog > + command_model_namespace::command_model, stan::rng_t> > integrator; EXPECT_NO_THROW(integrator i); diff --git a/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp b/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp index 50527c03cd..87b2297b5c 100644 --- a/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp @@ -3,20 +3,18 @@ #include #include #include -#include +#include #include -typedef boost::ecuyer1988 rng_t; - namespace stan { namespace mcmc { -class mock_nuts - : public base_nuts { +class mock_nuts : public base_nuts { public: - mock_nuts(const mock_model& m, rng_t& rng) - : base_nuts(m, - rng) {} + mock_nuts(const mock_model& m, stan::rng_t& rng) + : base_nuts( + m, rng) {} bool compute_criterion(Eigen::VectorXd& p_sharp_minus, Eigen::VectorXd& p_sharp_plus, Eigen::VectorXd& rho) { @@ -24,13 +22,13 @@ class mock_nuts } }; -class rho_inspector_mock_nuts - : public base_nuts { +class rho_inspector_mock_nuts : public base_nuts { public: std::vector rho_values; - rho_inspector_mock_nuts(const mock_model& m, rng_t& rng) - : base_nuts(m, - rng) {} + rho_inspector_mock_nuts(const mock_model& m, stan::rng_t& rng) + : base_nuts( + m, rng) {} bool compute_criterion(Eigen::VectorXd& p_sharp_minus, Eigen::VectorXd& p_sharp_plus, Eigen::VectorXd& rho) { @@ -40,13 +38,14 @@ class rho_inspector_mock_nuts }; class edge_inspector_mock_nuts - : public base_nuts { + : public base_nuts { public: std::vector p_sharp_minus_values; std::vector p_sharp_plus_values; - edge_inspector_mock_nuts(const mock_model& m, rng_t& rng) - : base_nuts(m, - rng) {} + edge_inspector_mock_nuts(const mock_model& m, stan::rng_t& rng) + : base_nuts( + m, rng) {} bool compute_criterion(Eigen::VectorXd& p_sharp_minus, Eigen::VectorXd& p_sharp_plus, Eigen::VectorXd& rho) { @@ -92,18 +91,18 @@ class divergent_hamiltonian : public base_hamiltonian { }; class divergent_nuts : public base_nuts { + expl_leapfrog, stan::rng_t> { public: - divergent_nuts(const mock_model& m, rng_t& rng) - : base_nuts( - m, rng) {} + divergent_nuts(const mock_model& m, stan::rng_t& rng) + : base_nuts(m, rng) {} }; } // namespace mcmc } // namespace stan TEST(McmcNutsBaseNuts, set_max_depth_test) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; @@ -123,7 +122,7 @@ TEST(McmcNutsBaseNuts, set_max_depth_test) { } TEST(McmcNutsBaseNuts, set_max_delta_test) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; @@ -138,7 +137,7 @@ TEST(McmcNutsBaseNuts, set_max_delta_test) { } TEST(McmcNutsBaseNuts, build_tree_test) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; double init_momentum = 1.5; @@ -199,7 +198,7 @@ TEST(McmcNutsBaseNuts, build_tree_test) { } TEST(McmcNutsBaseNuts, rho_aggregation_test) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; double init_momentum = 1.5; @@ -267,7 +266,7 @@ TEST(McmcNutsBaseNuts, rho_aggregation_test) { } TEST(McmcNutsBaseNuts, divergence_test) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; double init_momentum = 1.5; @@ -334,7 +333,7 @@ TEST(McmcNutsBaseNuts, divergence_test) { } TEST(McmcNutsBaseNuts, transition) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; double init_momentum = 1.5; @@ -374,7 +373,7 @@ TEST(McmcNutsBaseNuts, transition) { } TEST(McmcNutsBaseNuts, transition_egde_momenta) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; double init_momentum = 1.5; diff --git a/src/test/unit/mcmc/hmc/nuts/derived_nuts_test.cpp b/src/test/unit/mcmc/hmc/nuts/derived_nuts_test.cpp index 1bf6e3dbb1..a6d0669ed6 100644 --- a/src/test/unit/mcmc/hmc/nuts/derived_nuts_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/derived_nuts_test.cpp @@ -5,17 +5,14 @@ #include #include #include +#include #include -#include - #include -typedef boost::ecuyer1988 rng_t; - TEST(McmcNutsDerivedNuts, compute_criterion_unit_e) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; @@ -26,8 +23,8 @@ TEST(McmcNutsDerivedNuts, compute_criterion_unit_e) { Eigen::VectorXd rho(model_size); stan::mcmc::mock_model model(model_size); - stan::mcmc::unit_e_nuts sampler(model, - base_rng); + stan::mcmc::unit_e_nuts sampler( + model, base_rng); start.q(0) = 1; start.p(0) = 1; @@ -55,7 +52,7 @@ TEST(McmcNutsDerivedNuts, compute_criterion_unit_e) { } TEST(McmcNutsDerivedNuts, compute_criterion_diag_e) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; @@ -66,8 +63,8 @@ TEST(McmcNutsDerivedNuts, compute_criterion_diag_e) { Eigen::VectorXd rho(model_size); stan::mcmc::mock_model model(model_size); - stan::mcmc::diag_e_nuts sampler(model, - base_rng); + stan::mcmc::diag_e_nuts sampler( + model, base_rng); start.q(0) = 1; start.p(0) = 1; @@ -95,7 +92,7 @@ TEST(McmcNutsDerivedNuts, compute_criterion_diag_e) { } TEST(McmcNutsDerivedNuts, compute_criterion_dense_e) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; @@ -106,8 +103,8 @@ TEST(McmcNutsDerivedNuts, compute_criterion_dense_e) { Eigen::VectorXd rho(model_size); stan::mcmc::mock_model model(model_size); - stan::mcmc::dense_e_nuts sampler(model, - base_rng); + stan::mcmc::dense_e_nuts sampler( + model, base_rng); start.q(0) = 1; start.p(0) = 1; @@ -135,7 +132,7 @@ TEST(McmcNutsDerivedNuts, compute_criterion_dense_e) { } TEST(McmcNutsDerivedNuts, compute_criterion_softabs) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; @@ -146,8 +143,8 @@ TEST(McmcNutsDerivedNuts, compute_criterion_softabs) { Eigen::VectorXd rho(model_size); stan::mcmc::mock_model model(model_size); - stan::mcmc::softabs_nuts sampler(model, - base_rng); + stan::mcmc::softabs_nuts sampler( + model, base_rng); start.q(0) = 1; start.p(0) = 1; diff --git a/src/test/unit/mcmc/hmc/nuts/instantiation_test.cpp b/src/test/unit/mcmc/hmc/nuts/instantiation_test.cpp index 241d2e38f6..bd0070944f 100644 --- a/src/test/unit/mcmc/hmc/nuts/instantiation_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/instantiation_test.cpp @@ -6,16 +6,14 @@ #include #include #include -#include +#include #include #include #include -typedef boost::ecuyer1988 rng_t; - TEST(McmcNuts, instantiaton_test) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); std::stringstream output; stan::callbacks::stream_writer writer(output); @@ -25,21 +23,24 @@ TEST(McmcNuts, instantiaton_test) { stan::io::empty_var_context data_var_context; gauss3D_model_namespace::gauss3D_model model(data_var_context); - stan::mcmc::unit_e_nuts + stan::mcmc::unit_e_nuts unit_e_sampler(model, base_rng); - stan::mcmc::diag_e_nuts + stan::mcmc::diag_e_nuts diag_e_sampler(model, base_rng); - stan::mcmc::dense_e_nuts + stan::mcmc::dense_e_nuts dense_e_sampler(model, base_rng); - stan::mcmc::adapt_unit_e_nuts + stan::mcmc::adapt_unit_e_nuts adapt_unit_e_sampler(model, base_rng); - stan::mcmc::adapt_diag_e_nuts + stan::mcmc::adapt_diag_e_nuts adapt_diag_e_sampler(model, base_rng); - stan::mcmc::adapt_dense_e_nuts + stan::mcmc::adapt_dense_e_nuts adapt_dense_e_sampler(model, base_rng); } diff --git a/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp b/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp index 7d4506b788..f537eea022 100644 --- a/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp @@ -1,16 +1,14 @@ #include #include #include -#include +#include #include #include #include -typedef boost::ecuyer1988 rng_t; - TEST(McmcSoftAbsNuts, build_tree_test) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::softabs_point z_init(3); z_init.q(0) = 1; @@ -26,7 +24,7 @@ TEST(McmcSoftAbsNuts, build_tree_test) { stan::io::empty_var_context data_var_context; gauss3D_model_namespace::gauss3D_model model(data_var_context); - stan::mcmc::softabs_nuts + stan::mcmc::softabs_nuts sampler(model, base_rng); sampler.z() = z_init; @@ -97,7 +95,7 @@ TEST(McmcSoftAbsNuts, build_tree_test) { } TEST(McmcSoftAbsNuts, tree_boundary_test) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::softabs_point z_init(3); z_init.q(0) = 1; @@ -116,7 +114,7 @@ TEST(McmcSoftAbsNuts, tree_boundary_test) { model_t model(data_var_context); // Compute expected tree boundaries - typedef stan::mcmc::softabs_metric metric_t; + typedef stan::mcmc::softabs_metric metric_t; metric_t metric(model); stan::mcmc::impl_leapfrog softabs_integrator; @@ -169,7 +167,7 @@ TEST(McmcSoftAbsNuts, tree_boundary_test) { Eigen::VectorXd p_sharp_backward_4 = metric.dtau_dp(z_test); // Check expected tree boundaries to those dynamically generated by NUTS - stan::mcmc::softabs_nuts sampler(model, base_rng); + stan::mcmc::softabs_nuts sampler(model, base_rng); sampler.set_nominal_stepsize(epsilon); sampler.set_stepsize_jitter(0); @@ -311,7 +309,7 @@ TEST(McmcSoftAbsNuts, tree_boundary_test) { } TEST(McmcSoftAbsNuts, transition_test) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::softabs_point z_init(3); z_init.q(0) = 1; @@ -327,7 +325,7 @@ TEST(McmcSoftAbsNuts, transition_test) { stan::io::empty_var_context data_var_context; gauss3D_model_namespace::gauss3D_model model(data_var_context); - stan::mcmc::softabs_nuts + stan::mcmc::softabs_nuts sampler(model, base_rng); sampler.z() = z_init; diff --git a/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp b/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp index bd77c25b9a..aeccff91bf 100644 --- a/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp @@ -1,16 +1,14 @@ #include #include #include -#include +#include #include #include #include -typedef boost::ecuyer1988 rng_t; - TEST(McmcUnitENuts, build_tree_test) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::unit_e_point z_init(3); z_init.q(0) = 1; @@ -26,7 +24,7 @@ TEST(McmcUnitENuts, build_tree_test) { stan::io::empty_var_context data_var_context; gauss3D_model_namespace::gauss3D_model model(data_var_context); - stan::mcmc::unit_e_nuts + stan::mcmc::unit_e_nuts sampler(model, base_rng); sampler.z() = z_init; @@ -97,7 +95,7 @@ TEST(McmcUnitENuts, build_tree_test) { } TEST(McmcUnitENuts, tree_boundary_test) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::unit_e_point z_init(3); z_init.q(0) = 1; @@ -116,7 +114,7 @@ TEST(McmcUnitENuts, tree_boundary_test) { model_t model(data_var_context); // Compute expected tree boundaries - typedef stan::mcmc::unit_e_metric metric_t; + typedef stan::mcmc::unit_e_metric metric_t; metric_t metric(model); stan::mcmc::expl_leapfrog unit_e_integrator; @@ -169,7 +167,7 @@ TEST(McmcUnitENuts, tree_boundary_test) { Eigen::VectorXd p_sharp_backward_4 = metric.dtau_dp(z_test); // Check expected tree boundaries to those dynamically generated by NUTS - stan::mcmc::unit_e_nuts sampler(model, base_rng); + stan::mcmc::unit_e_nuts sampler(model, base_rng); sampler.set_nominal_stepsize(epsilon); sampler.set_stepsize_jitter(0); @@ -311,7 +309,7 @@ TEST(McmcUnitENuts, tree_boundary_test) { } TEST(McmcUnitENuts, transition_test) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::unit_e_point z_init(3); z_init.q(0) = 1; @@ -327,7 +325,7 @@ TEST(McmcUnitENuts, transition_test) { stan::io::empty_var_context data_var_context; gauss3D_model_namespace::gauss3D_model model(data_var_context); - stan::mcmc::unit_e_nuts + stan::mcmc::unit_e_nuts sampler(model, base_rng); sampler.z() = z_init; diff --git a/src/test/unit/mcmc/hmc/nuts_classic/base_nuts_classic_test.cpp b/src/test/unit/mcmc/hmc/nuts_classic/base_nuts_classic_test.cpp index 7fbd6304cf..c3862c2c88 100644 --- a/src/test/unit/mcmc/hmc/nuts_classic/base_nuts_classic_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts_classic/base_nuts_classic_test.cpp @@ -2,20 +2,19 @@ #include #include #include -#include +#include #include -typedef boost::ecuyer1988 rng_t; - namespace stan { namespace mcmc { -class mock_nuts_classic : public base_nuts_classic { +class mock_nuts_classic + : public base_nuts_classic { public: - mock_nuts_classic(const mock_model& m, rng_t& rng) - : base_nuts_classic( - m, rng) {} + mock_nuts_classic(const mock_model& m, stan::rng_t& rng) + : base_nuts_classic(m, rng) {} private: bool compute_criterion(ps_point& start, ps_point& finish, @@ -61,11 +60,11 @@ class divergent_hamiltonian : public base_hamiltonian { class divergent_nuts_classic : public base_nuts_classic { + stan::rng_t> { public: - divergent_nuts_classic(const mock_model& m, rng_t& rng) + divergent_nuts_classic(const mock_model& m, stan::rng_t& rng) : base_nuts_classic(m, rng) {} + stan::rng_t>(m, rng) {} private: bool compute_criterion(ps_point& start, ps_point& finish, @@ -78,7 +77,7 @@ class divergent_nuts_classic } // namespace stan TEST(McmcNutsBaseNutsClassic, set_max_depth) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; @@ -98,7 +97,7 @@ TEST(McmcNutsBaseNutsClassic, set_max_depth) { } TEST(McmcNutsBaseNuts, set_max_delta) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; @@ -113,7 +112,7 @@ TEST(McmcNutsBaseNuts, set_max_delta) { } TEST(McmcNutsBaseNutsClassic, build_tree) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; double init_momentum = 1.5; @@ -167,7 +166,7 @@ TEST(McmcNutsBaseNutsClassic, build_tree) { } TEST(McmcNutsBaseNutsClassic, slice_criterion) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; double init_momentum = 1.5; diff --git a/src/test/unit/mcmc/hmc/nuts_classic/derived_nuts_classic_test.cpp b/src/test/unit/mcmc/hmc/nuts_classic/derived_nuts_classic_test.cpp index e9f4637ab4..593c1e5618 100644 --- a/src/test/unit/mcmc/hmc/nuts_classic/derived_nuts_classic_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts_classic/derived_nuts_classic_test.cpp @@ -7,12 +7,10 @@ #include #include #include -#include - -typedef boost::ecuyer1988 rng_t; +#include TEST(McmcDerivedNutsClassic, compute_criterion_unit_e) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; @@ -21,7 +19,7 @@ TEST(McmcDerivedNutsClassic, compute_criterion_unit_e) { Eigen::VectorXd rho(model_size); stan::mcmc::mock_model model(model_size); - stan::mcmc::unit_e_nuts_classic sampler( + stan::mcmc::unit_e_nuts_classic sampler( model, base_rng); start.q(0) = 1; @@ -46,7 +44,7 @@ TEST(McmcDerivedNutsClassic, compute_criterion_unit_e) { } TEST(McmcDerivedNutsClassic, compute_criterion_diag_e) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; @@ -55,7 +53,7 @@ TEST(McmcDerivedNutsClassic, compute_criterion_diag_e) { Eigen::VectorXd rho(model_size); stan::mcmc::mock_model model(model_size); - stan::mcmc::diag_e_nuts_classic sampler( + stan::mcmc::diag_e_nuts_classic sampler( model, base_rng); start.q(0) = 1; @@ -80,7 +78,7 @@ TEST(McmcDerivedNutsClassic, compute_criterion_diag_e) { } TEST(McmcDerivedNutsClassic, compute_criterion_dense_e) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; @@ -89,7 +87,7 @@ TEST(McmcDerivedNutsClassic, compute_criterion_dense_e) { Eigen::VectorXd rho(model_size); stan::mcmc::mock_model model(model_size); - stan::mcmc::dense_e_nuts_classic sampler( + stan::mcmc::dense_e_nuts_classic sampler( model, base_rng); start.q(0) = 1; diff --git a/src/test/unit/mcmc/hmc/nuts_classic/instantiation_test.cpp b/src/test/unit/mcmc/hmc/nuts_classic/instantiation_test.cpp index 70f8f38977..654f75079c 100644 --- a/src/test/unit/mcmc/hmc/nuts_classic/instantiation_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts_classic/instantiation_test.cpp @@ -6,16 +6,14 @@ #include #include #include -#include +#include #include #include #include -typedef boost::ecuyer1988 rng_t; - TEST(McmcNutsClassic, instantiaton_test) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); std::stringstream output; stan::callbacks::stream_writer writer(output); @@ -25,25 +23,27 @@ TEST(McmcNutsClassic, instantiaton_test) { stan::io::empty_var_context data_var_context; gauss3D_model_namespace::gauss3D_model model(data_var_context); - stan::mcmc::unit_e_nuts_classic + stan::mcmc::unit_e_nuts_classic unit_e_sampler(model, base_rng); - stan::mcmc::diag_e_nuts_classic + stan::mcmc::diag_e_nuts_classic diag_e_sampler(model, base_rng); stan::mcmc::dense_e_nuts_classic + stan::rng_t> dense_e_sampler(model, base_rng); stan::mcmc::adapt_unit_e_nuts_classic + stan::rng_t> adapt_unit_e_sampler(model, base_rng); stan::mcmc::adapt_diag_e_nuts_classic + stan::rng_t> adapt_diag_e_sampler(model, base_rng); stan::mcmc::adapt_dense_e_nuts_classic + stan::rng_t> adapt_dense_e_sampler(model, base_rng); } diff --git a/src/test/unit/mcmc/hmc/static/base_static_hmc_test.cpp b/src/test/unit/mcmc/hmc/static/base_static_hmc_test.cpp index 632426ff27..4d571f6a92 100644 --- a/src/test/unit/mcmc/hmc/static/base_static_hmc_test.cpp +++ b/src/test/unit/mcmc/hmc/static/base_static_hmc_test.cpp @@ -2,28 +2,26 @@ #include #include #include -#include +#include #include -typedef boost::ecuyer1988 rng_t; - namespace stan { namespace mcmc { // Mock Static HMC class mock_static_hmc : public base_static_hmc { + mock_integrator, stan::rng_t> { public: - mock_static_hmc(const mock_model& m, rng_t& rng) - : base_static_hmc( - m, rng) {} + mock_static_hmc(const mock_model& m, stan::rng_t& rng) + : base_static_hmc(m, rng) {} }; } // namespace mcmc } // namespace stan TEST(McmcStaticBaseStaticHMC, set_nominal_stepsize) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); std::vector q(5, 1.0); std::vector r(2, 2); @@ -43,7 +41,7 @@ TEST(McmcStaticBaseStaticHMC, set_nominal_stepsize) { } TEST(McmcStaticBaseStaticHMC, set_T) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); std::vector q(5, 1.0); std::vector r(2, 2); @@ -63,7 +61,7 @@ TEST(McmcStaticBaseStaticHMC, set_T) { } TEST(McmcStaticBaseStaticHMC, set_nominal_stepsize_and_T) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); std::vector q(5, 1.0); std::vector r(2, 2); @@ -90,7 +88,7 @@ TEST(McmcStaticBaseStaticHMC, set_nominal_stepsize_and_T) { } TEST(McmcStaticBaseStaticHMC, set_nominal_stepsize_and_L) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); std::vector q(5, 1.0); std::vector r(2, 2); diff --git a/src/test/unit/mcmc/hmc/static_uniform/base_static_uniform_test.cpp b/src/test/unit/mcmc/hmc/static_uniform/base_static_uniform_test.cpp index 4b8892eb76..a9f81458d2 100644 --- a/src/test/unit/mcmc/hmc/static_uniform/base_static_uniform_test.cpp +++ b/src/test/unit/mcmc/hmc/static_uniform/base_static_uniform_test.cpp @@ -5,27 +5,25 @@ #include #include -#include +#include #include -typedef boost::ecuyer1988 rng_t; - namespace stan { namespace mcmc { // Mock Static HMC class mock_static_uniform : public base_static_uniform { + stan::rng_t> { public: - mock_static_uniform(const mock_model& m, rng_t& rng) + mock_static_uniform(const mock_model& m, stan::rng_t& rng) : base_static_uniform(m, rng) {} + stan::rng_t>(m, rng) {} }; } // namespace mcmc } // namespace stan TEST(McmcBaseStaticUniform, set_nominal_stepsize) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); std::vector q(5, 1.0); std::vector r(2, 2); @@ -45,7 +43,7 @@ TEST(McmcBaseStaticUniform, set_nominal_stepsize) { } TEST(McmcBaseStaticUniform, set_T) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); std::vector q(5, 1.0); std::vector r(2, 2); @@ -65,7 +63,7 @@ TEST(McmcBaseStaticUniform, set_T) { } TEST(McmcBaseStaticUniform, set_nominal_stepsize_and_T) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); std::vector q(5, 1.0); std::vector r(2, 2); @@ -92,7 +90,7 @@ TEST(McmcBaseStaticUniform, set_nominal_stepsize_and_T) { } TEST(McmcBaseStaticUniform, set_nominal_stepsize_and_L) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); std::vector q(5, 1.0); std::vector r(2, 2); diff --git a/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp b/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp index 89f16df1ed..f1c9057d16 100644 --- a/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp +++ b/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp @@ -8,17 +8,14 @@ #include #include #include +#include #include -#include - #include -typedef boost::ecuyer1988 rng_t; - TEST(McmcStaticUniform, unit_e_transition) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::unit_e_point z_init(1); z_init.q(0) = 1; @@ -30,7 +27,8 @@ TEST(McmcStaticUniform, unit_e_transition) { stan::io::empty_var_context data_var_context; gauss_model_namespace::gauss_model model(data_var_context); - stan::mcmc::unit_e_static_uniform + stan::mcmc::unit_e_static_uniform sampler(model, base_rng); sampler.z() = z_init; @@ -54,7 +52,7 @@ TEST(McmcStaticUniform, unit_e_transition) { } TEST(McmcStaticUniform, diag_e_transition) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::diag_e_point z_init(1); z_init.q(0) = 1; @@ -66,7 +64,8 @@ TEST(McmcStaticUniform, diag_e_transition) { stan::io::empty_var_context data_var_context; gauss_model_namespace::gauss_model model(data_var_context); - stan::mcmc::diag_e_static_uniform + stan::mcmc::diag_e_static_uniform sampler(model, base_rng); sampler.z() = z_init; @@ -90,7 +89,7 @@ TEST(McmcStaticUniform, diag_e_transition) { } TEST(McmcStaticUniform, dense_e_transition) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::dense_e_point z_init(1); z_init.q(0) = 1; @@ -102,7 +101,8 @@ TEST(McmcStaticUniform, dense_e_transition) { stan::io::empty_var_context data_var_context; gauss_model_namespace::gauss_model model(data_var_context); - stan::mcmc::dense_e_static_uniform + stan::mcmc::dense_e_static_uniform sampler(model, base_rng); sampler.z() = z_init; @@ -126,7 +126,7 @@ TEST(McmcStaticUniform, dense_e_transition) { } TEST(McmcStaticUniform, softabs_transition) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::softabs_point z_init(1); z_init.q(0) = 1; @@ -138,7 +138,8 @@ TEST(McmcStaticUniform, softabs_transition) { stan::io::empty_var_context data_var_context; gauss_model_namespace::gauss_model model(data_var_context); - stan::mcmc::softabs_static_uniform + stan::mcmc::softabs_static_uniform sampler(model, base_rng); sampler.z() = z_init; @@ -162,7 +163,7 @@ TEST(McmcStaticUniform, softabs_transition) { } TEST(McmcStaticUniform, adapt_unit_e_transition) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::unit_e_point z_init(1); z_init.q(0) = 1; @@ -175,7 +176,7 @@ TEST(McmcStaticUniform, adapt_unit_e_transition) { gauss_model_namespace::gauss_model model(data_var_context); stan::mcmc::adapt_unit_e_static_uniform + stan::rng_t> sampler(model, base_rng); sampler.z() = z_init; @@ -199,7 +200,7 @@ TEST(McmcStaticUniform, adapt_unit_e_transition) { } TEST(McmcStaticUniform, adapt_diag_e_transition) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::diag_e_point z_init(1); z_init.q(0) = 1; @@ -212,7 +213,7 @@ TEST(McmcStaticUniform, adapt_diag_e_transition) { gauss_model_namespace::gauss_model model(data_var_context); stan::mcmc::adapt_diag_e_static_uniform + stan::rng_t> sampler(model, base_rng); sampler.z() = z_init; @@ -236,7 +237,7 @@ TEST(McmcStaticUniform, adapt_diag_e_transition) { } TEST(McmcStaticUniform, adapt_dense_e_transition) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::dense_e_point z_init(1); z_init.q(0) = 1; @@ -249,7 +250,7 @@ TEST(McmcStaticUniform, adapt_dense_e_transition) { gauss_model_namespace::gauss_model model(data_var_context); stan::mcmc::adapt_dense_e_static_uniform + stan::rng_t> sampler(model, base_rng); sampler.z() = z_init; @@ -273,7 +274,7 @@ TEST(McmcStaticUniform, adapt_dense_e_transition) { } TEST(McmcStaticUniform, adapt_softabs_e_transition) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::softabs_point z_init(1); z_init.q(0) = 1; @@ -286,7 +287,7 @@ TEST(McmcStaticUniform, adapt_softabs_e_transition) { gauss_model_namespace::gauss_model model(data_var_context); stan::mcmc::adapt_softabs_static_uniform + stan::rng_t> sampler(model, base_rng); sampler.z() = z_init; diff --git a/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp b/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp index f27eb9f37c..e2bb9200a5 100644 --- a/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp +++ b/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp @@ -2,20 +2,18 @@ #include #include #include -#include +#include #include -typedef boost::ecuyer1988 rng_t; - namespace stan { namespace mcmc { -class mock_xhmc - : public base_xhmc { +class mock_xhmc : public base_xhmc { public: - mock_xhmc(const mock_model& m, rng_t& rng) - : base_xhmc(m, - rng) {} + mock_xhmc(const mock_model& m, stan::rng_t& rng) + : base_xhmc( + m, rng) {} }; // Mock Hamiltonian @@ -54,18 +52,18 @@ class divergent_hamiltonian : public base_hamiltonian { }; class divergent_xhmc : public base_xhmc { + expl_leapfrog, stan::rng_t> { public: - divergent_xhmc(const mock_model& m, rng_t& rng) - : base_xhmc( - m, rng) {} + divergent_xhmc(const mock_model& m, stan::rng_t& rng) + : base_xhmc(m, rng) {} }; } // namespace mcmc } // namespace stan TEST(McmcXHMCBaseXHMC, set_max_depth) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; @@ -83,7 +81,7 @@ TEST(McmcXHMCBaseXHMC, set_max_depth) { } TEST(McmcXHMCBaseXHMC, set_max_deltaH) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; @@ -98,7 +96,7 @@ TEST(McmcXHMCBaseXHMC, set_max_deltaH) { } TEST(McmcXHMCBaseXHMC, set_x_delta) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); Eigen::VectorXd q(2); q(0) = 5; @@ -113,7 +111,7 @@ TEST(McmcXHMCBaseXHMC, set_x_delta) { } TEST(McmcXHMCBaseXHMC, build_tree) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; double init_momentum = 1.5; @@ -164,7 +162,7 @@ TEST(McmcXHMCBaseXHMC, build_tree) { } TEST(McmcXHMCBaseXHMC, divergence_test) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; double init_momentum = 1.5; @@ -223,7 +221,7 @@ TEST(McmcXHMCBaseXHMC, divergence_test) { } TEST(McmcXHMCBaseXHMC, transition) { - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; double init_momentum = 1.5; diff --git a/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp b/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp index 600785eaf7..9aaf38dfae 100644 --- a/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp +++ b/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp @@ -1,16 +1,14 @@ #include #include -#include +#include #include #include #include #include -typedef boost::ecuyer1988 rng_t; - TEST(McmcUnitEXHMC, build_tree) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::softabs_point z_init(3); z_init.q(0) = 1; @@ -26,7 +24,7 @@ TEST(McmcUnitEXHMC, build_tree) { stan::io::empty_var_context data_var_context; gauss3D_model_namespace::gauss3D_model model(data_var_context); - stan::mcmc::softabs_xhmc + stan::mcmc::softabs_xhmc sampler(model, base_rng); sampler.z() = z_init; @@ -81,7 +79,7 @@ TEST(McmcUnitEXHMC, build_tree) { } TEST(McmcUnitEXHMC, transition) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::softabs_point z_init(3); z_init.q(0) = 1; @@ -97,7 +95,7 @@ TEST(McmcUnitEXHMC, transition) { stan::io::empty_var_context data_var_context; gauss3D_model_namespace::gauss3D_model model(data_var_context); - stan::mcmc::softabs_xhmc + stan::mcmc::softabs_xhmc sampler(model, base_rng); sampler.z() = z_init; @@ -121,4 +119,4 @@ TEST(McmcUnitEXHMC, transition) { EXPECT_EQ("", warn.str()); EXPECT_EQ("", error.str()); EXPECT_EQ("", fatal.str()); -} \ No newline at end of file +} diff --git a/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp b/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp index a9c5345975..8580905f3f 100644 --- a/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp +++ b/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp @@ -1,16 +1,14 @@ #include #include -#include +#include #include #include #include #include -typedef boost::ecuyer1988 rng_t; - TEST(McmcUnitEXHMC, build_tree) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::unit_e_point z_init(3); z_init.q(0) = 1; @@ -26,7 +24,7 @@ TEST(McmcUnitEXHMC, build_tree) { stan::io::empty_var_context data_var_context; gauss3D_model_namespace::gauss3D_model model(data_var_context); - stan::mcmc::unit_e_xhmc + stan::mcmc::unit_e_xhmc sampler(model, base_rng); sampler.z() = z_init; @@ -81,7 +79,7 @@ TEST(McmcUnitEXHMC, build_tree) { } TEST(McmcUnitEXHMC, transition) { - rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::unit_e_point z_init(3); z_init.q(0) = 1; @@ -97,7 +95,7 @@ TEST(McmcUnitEXHMC, transition) { stan::io::empty_var_context data_var_context; gauss3D_model_namespace::gauss3D_model model(data_var_context); - stan::mcmc::unit_e_xhmc + stan::mcmc::unit_e_xhmc sampler(model, base_rng); sampler.z() = z_init; diff --git a/src/test/unit/model/array_functions_roundtrip_test.cpp b/src/test/unit/model/array_functions_roundtrip_test.cpp index 0f37719c42..9c5cffa4a8 100644 --- a/src/test/unit/model/array_functions_roundtrip_test.cpp +++ b/src/test/unit/model/array_functions_roundtrip_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -20,7 +21,7 @@ class ModelArrayFunctionsRoundtripTest : public testing::Test { stan::io::empty_var_context context; stan_model model; - boost::ecuyer1988 rng; + stan::rng_t rng; std::unique_ptr inits; std::stringstream out; diff --git a/src/test/unit/services/util/initialize_test.cpp b/src/test/unit/services/util/initialize_test.cpp index 768929da5c..a0acf6db68 100644 --- a/src/test/unit/services/util/initialize_test.cpp +++ b/src/test/unit/services/util/initialize_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -24,7 +25,7 @@ class ServicesUtilInitialize : public testing::Test { stan::callbacks::stream_writer message; stan::test::unit::instrumented_logger logger; stan::test::unit::instrumented_writer init; - boost::ecuyer1988 rng; + stan::rng_t rng; }; TEST_F(ServicesUtilInitialize, radius_zero__print_false) { diff --git a/src/test/unit/services/util/run_adaptive_sampler_test.cpp b/src/test/unit/services/util/run_adaptive_sampler_test.cpp index 476d4cbad7..9c7d892707 100644 --- a/src/test/unit/services/util/run_adaptive_sampler_test.cpp +++ b/src/test/unit/services/util/run_adaptive_sampler_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -27,12 +28,12 @@ class ServicesUtil : public testing::Test { stan::io::empty_var_context context; stan_model model; std::vector cont_vector; - boost::ecuyer1988 rng; + stan::rng_t rng; stan::test::unit::instrumented_interrupt interrupt; stan::test::unit::instrumented_writer sample_writer, diagnostic_writer; stan::callbacks::structured_writer dummy_metric_writer; stan::test::unit::instrumented_logger logger; - stan::mcmc::adapt_unit_e_nuts sampler; + stan::mcmc::adapt_unit_e_nuts sampler; int num_warmup, num_samples, num_thin, refresh; bool save_warmup; }; diff --git a/src/test/unit/services/util/run_sampler_test.cpp b/src/test/unit/services/util/run_sampler_test.cpp index 1b51781569..4b63d61d68 100644 --- a/src/test/unit/services/util/run_sampler_test.cpp +++ b/src/test/unit/services/util/run_sampler_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -73,7 +74,7 @@ class ServicesUtil : public testing::Test { stan::io::empty_var_context context; stan_model model; std::vector cont_vector; - boost::ecuyer1988 rng; + stan::rng_t rng; stan::test::unit::instrumented_interrupt interrupt; stan::test::unit::instrumented_writer sample_writer, diagnostic_writer; stan::test::unit::instrumented_logger logger; diff --git a/src/test/unit/variational/advi_messages_test.cpp b/src/test/unit/variational/advi_messages_test.cpp index 486a8240c7..5441891dfd 100644 --- a/src/test/unit/variational/advi_messages_test.cpp +++ b/src/test/unit/variational/advi_messages_test.cpp @@ -6,9 +6,8 @@ #include #include #include -#include // L'Ecuyer RNG +#include -typedef boost::ecuyer1988 rng_t; class advi_test : public ::testing::Test { public: @@ -39,10 +38,10 @@ class advi_test : public ::testing::Test { diagnostic_stream_.str(""); advi_meanfield_ = new stan::variational::advi< - stan_model, stan::variational::normal_meanfield, rng_t>( + stan_model, stan::variational::normal_meanfield, stan::rng_t>( *model_, cont_params_, base_rng_, 1, 100, 1, 1); advi_fullrank_ = new stan::variational::advi< - stan_model, stan::variational::normal_fullrank, rng_t>( + stan_model, stan::variational::normal_fullrank, stan::rng_t>( *model_, cont_params_, base_rng_, 1, 100, 1, 1); } @@ -56,8 +55,8 @@ class advi_test : public ::testing::Test { std::string err_msg2; stan::variational::advi *advi_meanfield_; - stan::variational::advi + stan::rng_t> *advi_meanfield_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream log_stream_; @@ -69,7 +68,7 @@ class advi_test : public ::testing::Test { private: stan_model *model_; - rng_t base_rng_; + stan::rng_t base_rng_; Eigen::VectorXd cont_params_; }; diff --git a/src/test/unit/variational/advi_multivar_no_constraint_test.cpp b/src/test/unit/variational/advi_multivar_no_constraint_test.cpp index 4310938aec..9c5fc96007 100644 --- a/src/test/unit/variational/advi_multivar_no_constraint_test.cpp +++ b/src/test/unit/variational/advi_multivar_no_constraint_test.cpp @@ -5,9 +5,8 @@ #include #include #include -#include // L'Ecuyer RNG +#include -typedef boost::ecuyer1988 rng_t; typedef multivariate_no_constraint_model_namespace:: multivariate_no_constraint_model Model; @@ -21,7 +20,7 @@ TEST(advi_test, multivar_no_constraint_fullrank) { Model my_model(dummy_context); // RNG - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); // Other params int n_monte_carlo_grad = 10; @@ -36,7 +35,7 @@ TEST(advi_test, multivar_no_constraint_fullrank) { cont_params(1) = 0.75; // ADVI - stan::variational::advi + stan::variational::advi test_advi(my_model, cont_params, base_rng, n_monte_carlo_grad, n_grad_samples, 100, 1); @@ -139,7 +138,7 @@ TEST(advi_test, multivar_no_constraint_meanfield) { Model my_model(dummy_context); // RNG - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); // Other params int n_monte_carlo_grad = 10; @@ -153,7 +152,7 @@ TEST(advi_test, multivar_no_constraint_meanfield) { cont_params(1) = 0.75; // ADVI - stan::variational::advi + stan::variational::advi test_advi(my_model, cont_params, base_rng, n_monte_carlo_grad, 1e4, // absurdly high! 100, 1); diff --git a/src/test/unit/variational/advi_multivar_with_constraint_test.cpp b/src/test/unit/variational/advi_multivar_with_constraint_test.cpp index 8730b3b067..ae6bcf6d88 100644 --- a/src/test/unit/variational/advi_multivar_with_constraint_test.cpp +++ b/src/test/unit/variational/advi_multivar_with_constraint_test.cpp @@ -5,9 +5,8 @@ #include #include #include -#include // L'Ecuyer RNG +#include -typedef boost::ecuyer1988 rng_t; typedef multivariate_with_constraint_model_namespace:: multivariate_with_constraint_model Model; @@ -21,7 +20,7 @@ TEST(advi_test, multivar_with_constraint_fullrank) { Model my_model(dummy_context); // RNG - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); // Other params int n_monte_carlo_grad = 10; @@ -36,7 +35,8 @@ TEST(advi_test, multivar_with_constraint_fullrank) { cont_params(1) = 0.75; // ADVI - stan::variational::advi + stan::variational::advi test_advi(my_model, cont_params, base_rng, n_monte_carlo_grad, n_monte_carlo_elbo, 100, 1); @@ -78,7 +78,7 @@ TEST(advi_test, multivar_with_constraint_meanfield) { Model my_model(dummy_context); // RNG - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); // Other params int n_monte_carlo_grad = 10; @@ -93,7 +93,8 @@ TEST(advi_test, multivar_with_constraint_meanfield) { cont_params(1) = 0.75; // ADVI - stan::variational::advi + stan::variational::advi test_advi(my_model, cont_params, base_rng, n_monte_carlo_grad, n_monte_carlo_elbo, 100, 1); diff --git a/src/test/unit/variational/advi_univar_no_constraint_test.cpp b/src/test/unit/variational/advi_univar_no_constraint_test.cpp index f1394948ff..ef8d5fd1dc 100644 --- a/src/test/unit/variational/advi_univar_no_constraint_test.cpp +++ b/src/test/unit/variational/advi_univar_no_constraint_test.cpp @@ -2,13 +2,12 @@ #include #include #include -#include // L'Ecuyer RNG +#include #include #include #include #include -typedef boost::ecuyer1988 rng_t; typedef univariate_no_constraint_model_namespace::univariate_no_constraint_model Model; @@ -22,7 +21,7 @@ TEST(advi_test, univar_no_constraint_fullrank) { Model my_model(dummy_context); // RNG - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); // Other params int n_monte_carlo_grad = 10; @@ -35,7 +34,8 @@ TEST(advi_test, univar_no_constraint_fullrank) { cont_params(0) = -0.75; // ADVI - stan::variational::advi + stan::variational::advi test_advi(my_model, cont_params, base_rng, n_monte_carlo_grad, 1e4, // absurdly high! 100, 1); @@ -146,7 +146,7 @@ TEST(advi_test, univar_no_constraint_meanfield) { Model my_model(dummy_context); // RNG - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); // Other params int n_monte_carlo_grad = 10; @@ -159,7 +159,8 @@ TEST(advi_test, univar_no_constraint_meanfield) { cont_params(0) = -0.75; // ADVI - stan::variational::advi + stan::variational::advi test_advi(my_model, cont_params, base_rng, n_monte_carlo_grad, 1e4, // absurdly high! 100, 1); diff --git a/src/test/unit/variational/advi_univar_with_constraint_test.cpp b/src/test/unit/variational/advi_univar_with_constraint_test.cpp index c12ac4f4b2..d28844a01f 100644 --- a/src/test/unit/variational/advi_univar_with_constraint_test.cpp +++ b/src/test/unit/variational/advi_univar_with_constraint_test.cpp @@ -2,13 +2,12 @@ #include #include #include -#include // L'Ecuyer RNG +#include #include #include #include #include -typedef boost::ecuyer1988 rng_t; typedef univariate_with_constraint_model_namespace:: univariate_with_constraint_model Model; @@ -22,7 +21,7 @@ TEST(advi_test, univar_with_constraint_fullrank) { Model my_model(dummy_context); // RNG - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); // Other params int n_monte_carlo_grad = 10; @@ -35,7 +34,8 @@ TEST(advi_test, univar_with_constraint_fullrank) { cont_params(0) = -0.75; // ADVI - stan::variational::advi + stan::variational::advi test_advi(my_model, cont_params, base_rng, n_monte_carlo_grad, 5e5, // absurdly high! 100, 1); @@ -151,7 +151,7 @@ TEST(advi_test, univar_with_constraint_meanfield) { Model my_model(dummy_context); // RNG - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); // Other params int n_monte_carlo_grad = 10; @@ -164,7 +164,8 @@ TEST(advi_test, univar_with_constraint_meanfield) { cont_params(0) = -0.75; // ADVI - stan::variational::advi + stan::variational::advi test_advi(my_model, cont_params, base_rng, n_monte_carlo_grad, 5e5, // absurdly high! 100, 1); diff --git a/src/test/unit/variational/eta_adapt_big_test.cpp b/src/test/unit/variational/eta_adapt_big_test.cpp index 080c666b32..b07808b716 100644 --- a/src/test/unit/variational/eta_adapt_big_test.cpp +++ b/src/test/unit/variational/eta_adapt_big_test.cpp @@ -1,14 +1,12 @@ #include #include #include +#include #include #include #include #include #include -#include // L'Ecuyer RNG - -typedef boost::ecuyer1988 rng_t; class eta_adapt_big_test : public ::testing::Test { public: @@ -28,11 +26,11 @@ class eta_adapt_big_test : public ::testing::Test { log_stream_.str(""); advi_meanfield_ = new stan::variational::advi< - stan_model, stan::variational::normal_meanfield, rng_t>( + stan_model, stan::variational::normal_meanfield, stan::rng_t>( *model_, cont_params_, base_rng_, 1, 100, 100, 1); advi_fullrank_ = new stan::variational::advi< - stan_model, stan::variational::normal_fullrank, rng_t>( + stan_model, stan::variational::normal_fullrank, stan::rng_t>( *model_, cont_params_, base_rng_, 1, 100, 100, 1); } @@ -43,15 +41,15 @@ class eta_adapt_big_test : public ::testing::Test { } stan::variational::advi *advi_meanfield_; - stan::variational::advi + stan::rng_t> *advi_meanfield_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream log_stream_; stan::callbacks::stream_logger logger; stan_model *model_; - rng_t base_rng_; + stan::rng_t base_rng_; Eigen::VectorXd cont_params_; }; diff --git a/src/test/unit/variational/eta_adapt_fail_test.cpp b/src/test/unit/variational/eta_adapt_fail_test.cpp index 1b98f930f6..36d770aa02 100644 --- a/src/test/unit/variational/eta_adapt_fail_test.cpp +++ b/src/test/unit/variational/eta_adapt_fail_test.cpp @@ -1,14 +1,12 @@ #include #include #include +#include #include #include #include #include #include -#include // L'Ecuyer RNG - -typedef boost::ecuyer1988 rng_t; class eta_should_fail_test : public ::testing::Test { public: @@ -28,11 +26,11 @@ class eta_should_fail_test : public ::testing::Test { log_stream_.str(""); advi_meanfield_ = new stan::variational::advi< - stan_model, stan::variational::normal_meanfield, rng_t>( + stan_model, stan::variational::normal_meanfield, stan::rng_t>( *model_, cont_params_, base_rng_, 1, 1, 100, 1); advi_fullrank_ = new stan::variational::advi< - stan_model, stan::variational::normal_fullrank, rng_t>( + stan_model, stan::variational::normal_fullrank, stan::rng_t>( *model_, cont_params_, base_rng_, 1, 1, 100, 1); } @@ -43,15 +41,15 @@ class eta_should_fail_test : public ::testing::Test { } stan::variational::advi *advi_meanfield_; - stan::variational::advi + stan::rng_t> *advi_meanfield_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream log_stream_; stan::callbacks::stream_logger logger; stan_model *model_; - rng_t base_rng_; + stan::rng_t base_rng_; Eigen::VectorXd cont_params_; }; diff --git a/src/test/unit/variational/eta_adapt_mock_models_test.cpp b/src/test/unit/variational/eta_adapt_mock_models_test.cpp index 26d9ecb4b5..e4f7b3a627 100644 --- a/src/test/unit/variational/eta_adapt_mock_models_test.cpp +++ b/src/test/unit/variational/eta_adapt_mock_models_test.cpp @@ -7,9 +7,6 @@ #include #include #include -#include // L'Ecuyer RNG - -typedef boost::ecuyer1988 rng_t; // Mock Model class mock_model : public stan::model::prob_grad { diff --git a/src/test/unit/variational/eta_adapt_small_test.cpp b/src/test/unit/variational/eta_adapt_small_test.cpp index 0b2fd28f79..4328e6ff6a 100644 --- a/src/test/unit/variational/eta_adapt_small_test.cpp +++ b/src/test/unit/variational/eta_adapt_small_test.cpp @@ -6,11 +6,9 @@ #include #include #include -#include // L'Ecuyer RNG +#include #include -typedef boost::ecuyer1988 rng_t; - class eta_adapt_small_test : public ::testing::Test { public: eta_adapt_small_test() @@ -29,11 +27,11 @@ class eta_adapt_small_test : public ::testing::Test { log_stream_.str(""); advi_meanfield_ = new stan::variational::advi< - stan_model, stan::variational::normal_meanfield, rng_t>( + stan_model, stan::variational::normal_meanfield, stan::rng_t>( *model_, cont_params_, base_rng_, 1, 100, 100, 1); advi_fullrank_ = new stan::variational::advi< - stan_model, stan::variational::normal_fullrank, rng_t>( + stan_model, stan::variational::normal_fullrank, stan::rng_t>( *model_, cont_params_, base_rng_, 1, 100, 100, 1); } @@ -44,15 +42,15 @@ class eta_adapt_small_test : public ::testing::Test { } stan::variational::advi *advi_meanfield_; - stan::variational::advi + stan::rng_t> *advi_meanfield_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream log_stream_; stan::callbacks::stream_logger logger; stan_model *model_; - rng_t base_rng_; + stan::rng_t base_rng_; Eigen::VectorXd cont_params_; }; diff --git a/src/test/unit/variational/gradient_warn_test.cpp b/src/test/unit/variational/gradient_warn_test.cpp index 2dab70c96d..c8ac490b88 100644 --- a/src/test/unit/variational/gradient_warn_test.cpp +++ b/src/test/unit/variational/gradient_warn_test.cpp @@ -2,14 +2,14 @@ #include #include #include +#include + #include #include #include #include #include -#include // L'Ecuyer RNG -typedef boost::ecuyer1988 rng_t; class advi_test : public ::testing::Test { public: @@ -35,10 +35,10 @@ class advi_test : public ::testing::Test { diagnostic_stream_.str(""); advi_meanfield_ = new stan::variational::advi< - stan_model, stan::variational::normal_meanfield, rng_t>( + stan_model, stan::variational::normal_meanfield, stan::rng_t>( *model_, cont_params_, base_rng_, 1, 100, 100, 1); advi_fullrank_ = new stan::variational::advi< - stan_model, stan::variational::normal_fullrank, rng_t>( + stan_model, stan::variational::normal_fullrank, stan::rng_t>( *model_, cont_params_, base_rng_, 1, 100, 100, 1); } @@ -49,8 +49,8 @@ class advi_test : public ::testing::Test { } stan::variational::advi *advi_meanfield_; - stan::variational::advi + stan::rng_t> *advi_meanfield_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream message_stream_; @@ -63,7 +63,7 @@ class advi_test : public ::testing::Test { private: stan_model *model_; - rng_t base_rng_; + stan::rng_t base_rng_; Eigen::VectorXd cont_params_; }; diff --git a/src/test/unit/variational/hier_logistic_cp_test.cpp b/src/test/unit/variational/hier_logistic_cp_test.cpp index 0905aeedc8..1c1fea788b 100644 --- a/src/test/unit/variational/hier_logistic_cp_test.cpp +++ b/src/test/unit/variational/hier_logistic_cp_test.cpp @@ -2,14 +2,13 @@ #include #include #include +#include #include #include #include #include #include -#include // L'Ecuyer RNG -typedef boost::ecuyer1988 rng_t; typedef hier_logistic_cp_model_namespace::hier_logistic_cp_model Model_cp; TEST(advi_test, hier_logistic_cp_constraint_meanfield) { @@ -27,13 +26,14 @@ TEST(advi_test, hier_logistic_cp_constraint_meanfield) { Model_cp my_model(data_var_context); // RNG - rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); // Dummy input Eigen::VectorXd cont_params = Eigen::VectorXd::Zero(my_model.num_params_r()); // ADVI - stan::variational::advi + stan::variational::advi test_advi(my_model, cont_params, base_rng, 10, 100, 100, 1); stan::callbacks::writer writer; diff --git a/src/test/unit/variational/hier_logistic_test.cpp b/src/test/unit/variational/hier_logistic_test.cpp index df0092aa12..c7e8ada23d 100644 --- a/src/test/unit/variational/hier_logistic_test.cpp +++ b/src/test/unit/variational/hier_logistic_test.cpp @@ -5,11 +5,9 @@ #include #include #include -#include // L'Ecuyer RNG +#include #include -typedef boost::ecuyer1988 rng_t; - class advi_test : public ::testing::Test { public: advi_test() @@ -38,10 +36,10 @@ class advi_test : public ::testing::Test { diagnostic_stream_.str(""); advi_ = new stan::variational::advi< - stan_model, stan::variational::normal_meanfield, rng_t>( + stan_model, stan::variational::normal_meanfield, stan::rng_t>( *model_, cont_params_, base_rng_, 10, 100, 100, 1); advi_fullrank_ = new stan::variational::advi< - stan_model, stan::variational::normal_fullrank, rng_t>( + stan_model, stan::variational::normal_fullrank, stan::rng_t>( *model_, cont_params_, base_rng_, 10, 100, 100, 1); } @@ -53,8 +51,8 @@ class advi_test : public ::testing::Test { } stan::variational::advi *advi_; - stan::variational::advi + stan::rng_t> *advi_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream message_stream_; @@ -67,7 +65,7 @@ class advi_test : public ::testing::Test { private: stan_model *model_; stan_model *model_null_stream_; - rng_t base_rng_; + stan::rng_t base_rng_; Eigen::VectorXd cont_params_; }; From ebe8da206e0bdb3c6b62afdb8d47fd5e58f7610e Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Tue, 30 Jan 2024 12:35:31 -0500 Subject: [PATCH 11/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- .../hamiltonians/base_hamiltonian_test.cpp | 3 ++- .../hmc/hamiltonians/dense_e_metric_test.cpp | 2 -- .../hmc/hamiltonians/diag_e_metric_test.cpp | 2 -- .../hmc/hamiltonians/softabs_metric_test.cpp | 1 - .../hmc/hamiltonians/unit_e_metric_test.cpp | 1 - .../hmc/integrators/expl_leapfrog2_test.cpp | 2 -- .../hmc/integrators/expl_leapfrog_test.cpp | 13 +++++----- .../hmc/integrators/impl_leapfrog2_test.cpp | 4 --- .../hmc/integrators/impl_leapfrog_test.cpp | 25 +++++++++++-------- .../unit/variational/advi_messages_test.cpp | 5 ++-- .../advi_multivar_no_constraint_test.cpp | 6 +++-- .../unit/variational/eta_adapt_big_test.cpp | 4 +-- .../unit/variational/eta_adapt_fail_test.cpp | 4 +-- .../unit/variational/eta_adapt_small_test.cpp | 4 +-- .../unit/variational/gradient_warn_test.cpp | 5 ++-- .../unit/variational/hier_logistic_test.cpp | 4 +-- 16 files changed, 38 insertions(+), 47 deletions(-) diff --git a/src/test/unit/mcmc/hmc/hamiltonians/base_hamiltonian_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/base_hamiltonian_test.cpp index 41537c282c..1e70c18259 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/base_hamiltonian_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/base_hamiltonian_test.cpp @@ -14,7 +14,8 @@ TEST(BaseHamiltonian, update_potential_gradient) { funnel_model_namespace::funnel_model model(data_var_context, 0, &model_output); - stan::mcmc::mock_hamiltonian + stan::mcmc::mock_hamiltonian metric(model); stan::mcmc::ps_point z(11); z.q.setOnes(); diff --git a/src/test/unit/mcmc/hmc/hamiltonians/dense_e_metric_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/dense_e_metric_test.cpp index 9f78a43024..fc351755f3 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/dense_e_metric_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/dense_e_metric_test.cpp @@ -60,7 +60,6 @@ TEST(McmcDenseEMetric, sample_p) { } TEST(McmcDenseEMetric, gradients) { - Eigen::VectorXd q = Eigen::VectorXd::Ones(11); stan::mcmc::dense_e_point z(q.size()); @@ -153,7 +152,6 @@ TEST(McmcDenseEMetric, gradients) { TEST(McmcDenseEMetric, streams) { stan::test::capture_std_streams(); - Eigen::VectorXd q(2); q(0) = 5; q(1) = 1; diff --git a/src/test/unit/mcmc/hmc/hamiltonians/diag_e_metric_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/diag_e_metric_test.cpp index 475afbf56d..1e56a41b46 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/diag_e_metric_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/diag_e_metric_test.cpp @@ -42,7 +42,6 @@ TEST(McmcDiagEMetric, sample_p) { } TEST(McmcDiagEMetric, gradients) { - Eigen::VectorXd q = Eigen::VectorXd::Ones(11); stan::mcmc::diag_e_point z(q.size()); @@ -134,7 +133,6 @@ TEST(McmcDiagEMetric, gradients) { TEST(McmcDiagEMetric, streams) { stan::test::capture_std_streams(); - Eigen::VectorXd q(2); q(0) = 5; q(1) = 1; diff --git a/src/test/unit/mcmc/hmc/hamiltonians/softabs_metric_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/softabs_metric_test.cpp index 0804105101..194abacc0f 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/softabs_metric_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/softabs_metric_test.cpp @@ -57,7 +57,6 @@ TEST(McmcSoftAbs, sample_p) { } TEST(McmcSoftAbs, gradients) { - Eigen::VectorXd q = Eigen::VectorXd::Ones(11); stan::mcmc::softabs_point z(q.size()); diff --git a/src/test/unit/mcmc/hmc/hamiltonians/unit_e_metric_test.cpp b/src/test/unit/mcmc/hmc/hamiltonians/unit_e_metric_test.cpp index 177c8905aa..51262a16dd 100644 --- a/src/test/unit/mcmc/hmc/hamiltonians/unit_e_metric_test.cpp +++ b/src/test/unit/mcmc/hmc/hamiltonians/unit_e_metric_test.cpp @@ -42,7 +42,6 @@ TEST(McmcUnitEMetric, sample_p) { } TEST(McmcUnitEMetric, gradients) { - Eigen::VectorXd q = Eigen::VectorXd::Ones(11); stan::mcmc::unit_e_point z(q.size()); diff --git a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog2_test.cpp b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog2_test.cpp index dee3dc18cf..175a4b2e0b 100644 --- a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog2_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog2_test.cpp @@ -10,7 +10,6 @@ #include TEST(McmcHmcIntegratorsExplLeapfrog, energy_conservation) { - stan::io::empty_var_context data_var_context; std::stringstream model_output; @@ -58,7 +57,6 @@ TEST(McmcHmcIntegratorsExplLeapfrog, energy_conservation) { } TEST(McmcHmcIntegratorsExplLeapfrog, symplecticness) { - stan::io::empty_var_context data_var_context; std::stringstream model_output; diff --git a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp index 24a8b388e5..629ff3ac5a 100644 --- a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp @@ -15,7 +15,6 @@ // namespace //************************************************************ - class McmcHmcIntegratorsExplLeapfrogF : public testing::Test { public: McmcHmcIntegratorsExplLeapfrogF() @@ -43,12 +42,12 @@ class McmcHmcIntegratorsExplLeapfrogF : public testing::Test { stan::callbacks::stream_logger logger; // integrator under test - stan::mcmc::expl_leapfrog< - stan::mcmc::unit_e_metric > + stan::mcmc::expl_leapfrog > unit_e_integrator; - stan::mcmc::expl_leapfrog< - stan::mcmc::diag_e_metric > + stan::mcmc::expl_leapfrog > diag_e_integrator; // model @@ -445,8 +444,8 @@ TEST_F(McmcHmcIntegratorsExplLeapfrogF, evolve_9) { TEST_F(McmcHmcIntegratorsExplLeapfrogF, streams) { stan::test::capture_std_streams(); - typedef stan::mcmc::expl_leapfrog< - stan::mcmc::unit_e_metric > + typedef stan::mcmc::expl_leapfrog > integrator; EXPECT_NO_THROW(integrator i); diff --git a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp index 088de2066e..23f72a40fa 100644 --- a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp @@ -12,7 +12,6 @@ #include TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_energy_conservation) { - stan::io::empty_var_context data_var_context; std::stringstream model_output; @@ -60,7 +59,6 @@ TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_energy_conservation) { } TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_symplecticness) { - stan::io::empty_var_context data_var_context; std::stringstream model_output; @@ -146,7 +144,6 @@ TEST(McmcHmcIntegratorsImplLeapfrog, unit_e_symplecticness) { } TEST(McmcHmcIntegratorsImplLeapfrog, softabs_energy_conservation) { - stan::io::empty_var_context data_var_context; std::stringstream model_output; @@ -194,7 +191,6 @@ TEST(McmcHmcIntegratorsImplLeapfrog, softabs_energy_conservation) { } TEST(McmcHmcIntegratorsImplLeapfrog, softabs_symplecticness) { - stan::io::empty_var_context data_var_context; std::stringstream model_output; diff --git a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp index ce5a632528..3944f0d5e2 100644 --- a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp @@ -9,7 +9,6 @@ #include #include - #include #include @@ -44,12 +43,12 @@ class McmcHmcIntegratorsImplLeapfrogF : public testing::Test { stan::callbacks::stream_logger logger; // integrator under test - stan::mcmc::impl_leapfrog< - stan::mcmc::unit_e_metric > + stan::mcmc::impl_leapfrog > unit_e_integrator; - stan::mcmc::impl_leapfrog< - stan::mcmc::diag_e_metric > + stan::mcmc::impl_leapfrog > diag_e_integrator; stan::mcmc::impl_leapfrog + stan::mcmc::softabs_metric hamiltonian(*model); // setup epsilon @@ -171,7 +171,8 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, softabs_update_q) { EXPECT_NEAR(z.g(0), 1.99987371079118, 1e-15); // setup hamiltonian - stan::mcmc::softabs_metric + stan::mcmc::softabs_metric hamiltonian(*model); // setup epsilon @@ -237,7 +238,8 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, softabs_end_update_p) { EXPECT_NEAR(z.g(0), 1.67264975797776, 1e-15); // setup hamiltonian - stan::mcmc::softabs_metric + stan::mcmc::softabs_metric hamiltonian(*model); // setup epsilon @@ -559,7 +561,8 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, softabs_evolve) { EXPECT_NEAR(z.g(0), 1.27097196280777, 1e-15); // setup hamiltonian - stan::mcmc::softabs_metric + stan::mcmc::softabs_metric hamiltonian(*model); // setup epsilon @@ -583,8 +586,8 @@ TEST_F(McmcHmcIntegratorsImplLeapfrogF, softabs_evolve) { TEST_F(McmcHmcIntegratorsImplLeapfrogF, streams) { stan::test::capture_std_streams(); - typedef stan::mcmc::impl_leapfrog< - stan::mcmc::unit_e_metric > + typedef stan::mcmc::impl_leapfrog > integrator; EXPECT_NO_THROW(integrator i); diff --git a/src/test/unit/variational/advi_messages_test.cpp b/src/test/unit/variational/advi_messages_test.cpp index 5441891dfd..3371186cba 100644 --- a/src/test/unit/variational/advi_messages_test.cpp +++ b/src/test/unit/variational/advi_messages_test.cpp @@ -8,7 +8,6 @@ #include #include - class advi_test : public ::testing::Test { public: advi_test() @@ -56,8 +55,8 @@ class advi_test : public ::testing::Test { stan::variational::advi *advi_meanfield_; - stan::variational::advi - *advi_fullrank_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream log_stream_; std::stringstream parameter_stream_; diff --git a/src/test/unit/variational/advi_multivar_no_constraint_test.cpp b/src/test/unit/variational/advi_multivar_no_constraint_test.cpp index 9c5fc96007..a0513690c7 100644 --- a/src/test/unit/variational/advi_multivar_no_constraint_test.cpp +++ b/src/test/unit/variational/advi_multivar_no_constraint_test.cpp @@ -35,7 +35,8 @@ TEST(advi_test, multivar_no_constraint_fullrank) { cont_params(1) = 0.75; // ADVI - stan::variational::advi + stan::variational::advi test_advi(my_model, cont_params, base_rng, n_monte_carlo_grad, n_grad_samples, 100, 1); @@ -152,7 +153,8 @@ TEST(advi_test, multivar_no_constraint_meanfield) { cont_params(1) = 0.75; // ADVI - stan::variational::advi + stan::variational::advi test_advi(my_model, cont_params, base_rng, n_monte_carlo_grad, 1e4, // absurdly high! 100, 1); diff --git a/src/test/unit/variational/eta_adapt_big_test.cpp b/src/test/unit/variational/eta_adapt_big_test.cpp index b07808b716..2d7f7a2ce5 100644 --- a/src/test/unit/variational/eta_adapt_big_test.cpp +++ b/src/test/unit/variational/eta_adapt_big_test.cpp @@ -42,8 +42,8 @@ class eta_adapt_big_test : public ::testing::Test { stan::variational::advi *advi_meanfield_; - stan::variational::advi - *advi_fullrank_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream log_stream_; stan::callbacks::stream_logger logger; diff --git a/src/test/unit/variational/eta_adapt_fail_test.cpp b/src/test/unit/variational/eta_adapt_fail_test.cpp index 36d770aa02..84229f839c 100644 --- a/src/test/unit/variational/eta_adapt_fail_test.cpp +++ b/src/test/unit/variational/eta_adapt_fail_test.cpp @@ -42,8 +42,8 @@ class eta_should_fail_test : public ::testing::Test { stan::variational::advi *advi_meanfield_; - stan::variational::advi - *advi_fullrank_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream log_stream_; stan::callbacks::stream_logger logger; diff --git a/src/test/unit/variational/eta_adapt_small_test.cpp b/src/test/unit/variational/eta_adapt_small_test.cpp index 4328e6ff6a..715d68c4c7 100644 --- a/src/test/unit/variational/eta_adapt_small_test.cpp +++ b/src/test/unit/variational/eta_adapt_small_test.cpp @@ -43,8 +43,8 @@ class eta_adapt_small_test : public ::testing::Test { stan::variational::advi *advi_meanfield_; - stan::variational::advi - *advi_fullrank_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream log_stream_; stan::callbacks::stream_logger logger; diff --git a/src/test/unit/variational/gradient_warn_test.cpp b/src/test/unit/variational/gradient_warn_test.cpp index c8ac490b88..de9b476b26 100644 --- a/src/test/unit/variational/gradient_warn_test.cpp +++ b/src/test/unit/variational/gradient_warn_test.cpp @@ -10,7 +10,6 @@ #include #include - class advi_test : public ::testing::Test { public: advi_test() @@ -50,8 +49,8 @@ class advi_test : public ::testing::Test { stan::variational::advi *advi_meanfield_; - stan::variational::advi - *advi_fullrank_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream message_stream_; std::stringstream parameter_stream_; diff --git a/src/test/unit/variational/hier_logistic_test.cpp b/src/test/unit/variational/hier_logistic_test.cpp index c7e8ada23d..a469fba98e 100644 --- a/src/test/unit/variational/hier_logistic_test.cpp +++ b/src/test/unit/variational/hier_logistic_test.cpp @@ -52,8 +52,8 @@ class advi_test : public ::testing::Test { stan::variational::advi *advi_; - stan::variational::advi - *advi_fullrank_; + stan::variational::advi *advi_fullrank_; std::stringstream model_stream_; std::stringstream message_stream_; std::stringstream parameter_stream_; From bf1d10b425a1d1dc960c2e5c3f5ac5d09b58393a Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 30 Jan 2024 12:38:33 -0500 Subject: [PATCH 12/93] Make mcmc::chains a template again to fix compilation --- src/stan/mcmc/chains.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stan/mcmc/chains.hpp b/src/stan/mcmc/chains.hpp index 4fd6372bf6..507a5bc537 100644 --- a/src/stan/mcmc/chains.hpp +++ b/src/stan/mcmc/chains.hpp @@ -42,6 +42,7 @@ using Eigen::Dynamic; * *

Storage Order: Storage is column/last-index major. */ +template class chains { private: std::vector param_names_; From 35444e1584549758d51c7f4311645130970bff80 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 30 Jan 2024 14:50:26 -0500 Subject: [PATCH 13/93] Revert any seed-dependent changed tests --- src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp | 4 ++-- .../unit/mcmc/hmc/nuts/softabs_nuts_test.cpp | 2 +- src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp | 2 +- .../derived_static_uniform_test.cpp | 16 ++++++++-------- src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp | 2 +- .../unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp | 4 ++-- src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp b/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp index 87b2297b5c..ba814578cf 100644 --- a/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp @@ -333,7 +333,7 @@ TEST(McmcNutsBaseNuts, divergence_test) { } TEST(McmcNutsBaseNuts, transition) { - stan::rng_t base_rng = stan::services::util::create_rng(0, 0); + stan::rng_t base_rng(0); int model_size = 1; double init_momentum = 1.5; @@ -373,7 +373,7 @@ TEST(McmcNutsBaseNuts, transition) { } TEST(McmcNutsBaseNuts, transition_egde_momenta) { - stan::rng_t base_rng = stan::services::util::create_rng(0, 0); + stan::rng_t base_rng(0); int model_size = 1; double init_momentum = 1.5; diff --git a/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp b/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp index f537eea022..62fc69aa5b 100644 --- a/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp @@ -309,7 +309,7 @@ TEST(McmcSoftAbsNuts, tree_boundary_test) { } TEST(McmcSoftAbsNuts, transition_test) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::softabs_point z_init(3); z_init.q(0) = 1; diff --git a/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp b/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp index aeccff91bf..076e12ce7b 100644 --- a/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp @@ -309,7 +309,7 @@ TEST(McmcUnitENuts, tree_boundary_test) { } TEST(McmcUnitENuts, transition_test) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::unit_e_point z_init(3); z_init.q(0) = 1; diff --git a/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp b/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp index f1c9057d16..0791f94319 100644 --- a/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp +++ b/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp @@ -15,7 +15,7 @@ #include TEST(McmcStaticUniform, unit_e_transition) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::unit_e_point z_init(1); z_init.q(0) = 1; @@ -52,7 +52,7 @@ TEST(McmcStaticUniform, unit_e_transition) { } TEST(McmcStaticUniform, diag_e_transition) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::diag_e_point z_init(1); z_init.q(0) = 1; @@ -89,7 +89,7 @@ TEST(McmcStaticUniform, diag_e_transition) { } TEST(McmcStaticUniform, dense_e_transition) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::dense_e_point z_init(1); z_init.q(0) = 1; @@ -126,7 +126,7 @@ TEST(McmcStaticUniform, dense_e_transition) { } TEST(McmcStaticUniform, softabs_transition) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::softabs_point z_init(1); z_init.q(0) = 1; @@ -163,7 +163,7 @@ TEST(McmcStaticUniform, softabs_transition) { } TEST(McmcStaticUniform, adapt_unit_e_transition) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::unit_e_point z_init(1); z_init.q(0) = 1; @@ -200,7 +200,7 @@ TEST(McmcStaticUniform, adapt_unit_e_transition) { } TEST(McmcStaticUniform, adapt_diag_e_transition) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::diag_e_point z_init(1); z_init.q(0) = 1; @@ -237,7 +237,7 @@ TEST(McmcStaticUniform, adapt_diag_e_transition) { } TEST(McmcStaticUniform, adapt_dense_e_transition) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::dense_e_point z_init(1); z_init.q(0) = 1; @@ -274,7 +274,7 @@ TEST(McmcStaticUniform, adapt_dense_e_transition) { } TEST(McmcStaticUniform, adapt_softabs_e_transition) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::softabs_point z_init(1); z_init.q(0) = 1; diff --git a/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp b/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp index e2bb9200a5..f09b4374ed 100644 --- a/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp +++ b/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp @@ -221,7 +221,7 @@ TEST(McmcXHMCBaseXHMC, divergence_test) { } TEST(McmcXHMCBaseXHMC, transition) { - stan::rng_t base_rng = stan::services::util::create_rng(0, 0); + stan::rng_t base_rng(0); int model_size = 1; double init_momentum = 1.5; diff --git a/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp b/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp index 9aaf38dfae..274732fc14 100644 --- a/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp +++ b/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp @@ -8,7 +8,7 @@ #include TEST(McmcUnitEXHMC, build_tree) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::softabs_point z_init(3); z_init.q(0) = 1; @@ -79,7 +79,7 @@ TEST(McmcUnitEXHMC, build_tree) { } TEST(McmcUnitEXHMC, transition) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::softabs_point z_init(3); z_init.q(0) = 1; diff --git a/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp b/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp index 8580905f3f..87726ad499 100644 --- a/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp +++ b/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp @@ -8,7 +8,7 @@ #include TEST(McmcUnitEXHMC, build_tree) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::unit_e_point z_init(3); z_init.q(0) = 1; @@ -79,7 +79,7 @@ TEST(McmcUnitEXHMC, build_tree) { } TEST(McmcUnitEXHMC, transition) { - stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); + stan::rng_t base_rng(4839294); stan::mcmc::unit_e_point z_init(3); z_init.q(0) = 1; From 98450d76a1cbb37513dc0cd205649a7e464353be Mon Sep 17 00:00:00 2001 From: aleksgorica Date: Wed, 31 Jan 2024 12:37:11 +0100 Subject: [PATCH 14/93] resolved some of pr1 --- .../compute_potential_scale_reduction.hpp | 82 ++++++++++--------- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 25675b0e8c..a908d7f25e 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -17,17 +17,18 @@ namespace stan { namespace analyze { -inline double median( Eigen::MatrixXd d){ - auto r { d.reshaped() }; - std::sort( r.begin(), r.end() ); - return r.size() % 2 == 0 ? - r.segment( (r.size()-2)/2, 2 ).mean() : - r( r.size()/2 ); -} -Eigen::MatrixXd rankTransform(const Eigen::MatrixXd& matrix) { - int rows = matrix.rows(); - int cols = matrix.cols(); +/** + * Computes normalized average ranks for draws. Transforming them to normal scores using inverse normal transformation and a fractional offset. + * Based on paper https://arxiv.org/abs/1903.08008 + * @param draws stores chains in columns + * @return normal scores for average ranks of draws + * + */ + +Eigen::MatrixXd rank_transform(const Eigen::MatrixXd& draws) { + int rows = draws.rows(); + int cols = draws.cols(); int size = rows * cols; Eigen::MatrixXd rankMatrix = Eigen::MatrixXd::Zero(rows, cols); @@ -37,11 +38,10 @@ Eigen::MatrixXd rankTransform(const Eigen::MatrixXd& matrix) { for (int col = 0; col < cols; ++col) { for (int row = 0; row < rows; ++row) { int index = col * rows + row; // Calculating linear index in column-major order - valueWithIndex[index] = {matrix(row, col), index}; + valueWithIndex[index] = {draws(row, col), index}; } } - // Sorting the pairs by value std::sort(valueWithIndex.begin(), valueWithIndex.end()); // Assigning average ranks @@ -58,41 +58,51 @@ Eigen::MatrixXd rankTransform(const Eigen::MatrixXd& matrix) { } double avgRank = sumRanks / count; + boost::math::normal_distribution dist; // Standard normal distribution for (int k = i; k < j; ++k) { int index = valueWithIndex[k].second; int row = index % rows; // Adjusting row index for column-major order int col = index / rows; // Adjusting column index for column-major order - rankMatrix(row, col) = (avgRank - 3.0/8.0) / (size - 2.0 * 3.0/8.0 + 1.0); - + double p = (avgRank - 3.0/8.0) / (size - 2.0 * 3.0/8.0 + 1.0); + rankMatrix(row, col) = boost::math::quantile(dist, p); } i = j - 1; // Skip over tied elements } - auto ndtri = [](double p) { - boost::math::normal_distribution dist; // Standard normal distribution - return boost::math::quantile(dist, p); // Inverse CDF (quantile function) - }; - rankMatrix = rankMatrix.unaryExpr(ndtri); - return rankMatrix; + // Eigen::MatrixXd mat(3, 3); + // mat << 9, 3, 6, + // 4, 7, 2, + // 5, 2, 8; + // // Print the original matrix + // std::cout << "Original matrix:\n" << mat << "\n\n"; + // Eigen::Map vec(mat.data(), mat.size()); + // std::cout << "vec:\n" << vec << std::endl; + // // Use stan::math::sort_indices_asc to get the sorting indices + // std::vector ranks = math::sort_indices_asc(vec); + // Eigen::Map eigen_vec(ranks.data(), ranks.size()); + + // std::cout << "Sorted indices:\n" << eigen_vec << std::endl; + return rankMatrix; } - -inline double rhat(const Eigen::MatrixXd& draws) { - using boost::accumulators::accumulator_set; - using boost::accumulators::stats; - using boost::accumulators::tag::mean; - using boost::accumulators::tag::variance; +/** + * Computes square root of marginal posterior variance of the estimand by weigted average of within-chain variance W and between-chain variance B. + * + * @param draws stores chains in columns + * @return square root of ((N-1)/N)W + B/N + * + */ +inline double rhat(const Eigen::MatrixXd& draws) { int num_chains = draws.cols(); int num_draws = draws.rows(); - std::cout << num_chains << " " << num_draws << std::endl; Eigen::VectorXd chain_mean(num_chains); - accumulator_set> acc_chain_mean; + boost::accumulators::accumulator_set> acc_chain_mean; Eigen::VectorXd chain_var(num_chains); double unbiased_var_scale = num_draws / (num_draws - 1.0); for (int chain = 0; chain < num_chains; ++chain) { - accumulator_set> acc_draw; + boost::accumulators::accumulator_set> acc_draw; for (int n = 0; n < num_draws; ++n) { acc_draw(draws(n, chain)); } @@ -105,7 +115,6 @@ inline double rhat(const Eigen::MatrixXd& draws) { * num_chains / (num_chains - 1); double var_within = chain_var.mean(); - // rewrote [(n-1)*W/n + B/n]/W as (n-1+ B/W)/n return sqrt((var_between / var_within + num_draws - 1) / num_draws); } @@ -128,13 +137,9 @@ inline double rhat(const Eigen::MatrixXd& draws) { * @return potential scale reduction for the specified parameter */ - inline double compute_potential_scale_reduction( std::vector draws, std::vector sizes) { - std::cout << "DRAWS POINTERS: " << std::endl; - for (int i = 0; i < draws.size(); ++i) { - std::cout << "Index: " << i << " P: " << draws[i] << " EXPECTED END: " << draws[i] + sizes[i] << std::endl; - } + int num_chains = sizes.size(); size_t num_draws = sizes[0]; if (num_draws == 0) { @@ -175,15 +180,16 @@ inline double compute_potential_scale_reduction( Eigen::MatrixXd matrix(num_draws, num_chains); - // Copy data from arrays to matrix for (int col = 0; col < num_chains; ++col) { for (int row = 0; row < num_draws; ++row) { matrix(row, col) = draws[col][row]; } } - double rhat_bulk = rhat(rankTransform(matrix)); - double rhat_tail = rhat(rankTransform((matrix.array() - median(matrix)).abs())); + double rhat_bulk = rhat(rank_transform(matrix)); + double rhat_tail = rhat(rank_transform((matrix.array() - math::quantile(matrix.reshaped() , 0.5)).abs())); + + std::cout << "bulk, tail: " << rhat_bulk << " " << rhat_tail << std::endl; return std::max(rhat_bulk, rhat_tail); } From b09f512ababb354ae7afa74f8c523bdff476509e Mon Sep 17 00:00:00 2001 From: aleksgorica Date: Wed, 31 Jan 2024 18:02:00 +0100 Subject: [PATCH 15/93] comments deleted --- .../mcmc/compute_potential_scale_reduction.hpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index a908d7f25e..1081cc1145 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -32,7 +32,6 @@ Eigen::MatrixXd rank_transform(const Eigen::MatrixXd& draws) { int size = rows * cols; Eigen::MatrixXd rankMatrix = Eigen::MatrixXd::Zero(rows, cols); - // Create a vector of pairs (value, original index) std::vector> valueWithIndex(size); for (int col = 0; col < cols; ++col) { @@ -68,21 +67,6 @@ Eigen::MatrixXd rank_transform(const Eigen::MatrixXd& draws) { } i = j - 1; // Skip over tied elements } - - - // Eigen::MatrixXd mat(3, 3); - // mat << 9, 3, 6, - // 4, 7, 2, - // 5, 2, 8; - // // Print the original matrix - // std::cout << "Original matrix:\n" << mat << "\n\n"; - // Eigen::Map vec(mat.data(), mat.size()); - // std::cout << "vec:\n" << vec << std::endl; - // // Use stan::math::sort_indices_asc to get the sorting indices - // std::vector ranks = math::sort_indices_asc(vec); - // Eigen::Map eigen_vec(ranks.data(), ranks.size()); - - // std::cout << "Sorted indices:\n" << eigen_vec << std::endl; return rankMatrix; } From 322d2ed4235de4e9bfb3c32907823db0f07b3c67 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Thu, 1 Feb 2024 00:12:18 -0500 Subject: [PATCH 16/93] Updates the Math submodule to babb1adabd. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 4b40ec51a5..babb1adabd 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 4b40ec51a5c050ccbf5c32c2b99db4d5c32d4bbc +Subproject commit babb1adabd41e58592b3881ce49810a36df446f8 From dcd21f2eec34810a43def6626d9fa90e98cf6238 Mon Sep 17 00:00:00 2001 From: aleksgorica Date: Thu, 1 Feb 2024 13:55:07 +0100 Subject: [PATCH 17/93] Test changed --- .../compute_potential_scale_reduction.hpp | 1 - ...compute_potential_scale_reduction_test.cpp | 70 ++++++++----------- 2 files changed, 30 insertions(+), 41 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 1081cc1145..d2104e45e3 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -173,7 +173,6 @@ inline double compute_potential_scale_reduction( double rhat_bulk = rhat(rank_transform(matrix)); double rhat_tail = rhat(rank_transform((matrix.array() - math::quantile(matrix.reshaped() , 0.5)).abs())); - std::cout << "bulk, tail: " << rhat_bulk << " " << rhat_tail << std::endl; return std::max(rhat_bulk, rhat_tail); } diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 9e4df6d09f..7ea51847ed 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -32,13 +32,11 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, - 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, - 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, - 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, - 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, - 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, - 1.00735; + rhat << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, 1.00201, + 0.999558, 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, 1.00134, 1.00895, + 1.00079, 1.00368, 1.00092, 1.00133, 1.01005, 1.00107, 1.00151, 1.00229, 0.999998, + 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, 1.001, 1.01267, 1.00011, 1.00066, 1.00091, + 1.00237, 1.00019, 1.00104, 1.00341, 0.999815, 1.00033, 0.999672, 1.00306, 1.00072, 1.00191, 1.00658; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -54,7 +52,7 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction) { } ASSERT_NEAR(rhat(index - 4), stan::analyze::compute_potential_scale_reduction(draws, sizes), - 1.0) + 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } @@ -72,13 +70,11 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, - 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, - 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, - 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, - 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, - 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, - 1.00735; + rhat << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, 1.00201, + 0.999558, 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, 1.00134, 1.00895, + 1.00079, 1.00368, 1.00092, 1.00133, 1.01005, 1.00107, 1.00151, 1.00229, 0.999998, + 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, 1.001, 1.01267, 1.00011, 1.00066, 1.00091, + 1.00237, 1.00019, 1.00104, 1.00341, 0.999815, 1.00033, 0.999672, 1.00306, 1.00072, 1.00191, 1.00658; Eigen::Matrix samples( chains.num_chains()); @@ -92,13 +88,13 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { size_t size = samples(0).size(); ASSERT_NEAR(rhat(index - 4), stan::analyze::compute_potential_scale_reduction(draws, size), - 1.0) + 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } } -TEST_F(ComputeRhat, chains_compute_potential_scale_reduction) { +TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction) { std::stringstream out; stan::io::stan_csv blocker1 = stan::io::stan_csv_reader::parse(blocker1_stream, &out); @@ -110,13 +106,11 @@ TEST_F(ComputeRhat, chains_compute_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, - 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, - 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, - 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, - 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, - 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, - 1.00735; + rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, 1.00095, 1.00906, + 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, + 1.00303, 1.00976, 1.00295, 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, + 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, 1.00381, 1.00283, 1.00188, + 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; for (int index = 4; index < chains.num_params(); index++) { ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), @@ -145,13 +139,11 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, - 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, - 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, - 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, - 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, - 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, - 1.00735; + rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, 1.00095, 1.00906, + 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, + 1.00303, 1.00976, 1.00295, 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, + 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, 1.00381, 1.00283, 1.00188, + 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -168,7 +160,7 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction) { ASSERT_NEAR( rhat(index - 4), stan::analyze::compute_split_potential_scale_reduction(draws, sizes), - 1.0) + 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } @@ -186,13 +178,11 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, - 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, - 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, - 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, - 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, - 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, - 1.00735; + rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, 1.00095, 1.00906, + 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, + 1.00303, 1.00976, 1.00295, 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, + 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, 1.00381, 1.00283, 1.00188, + 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; Eigen::Matrix samples( chains.num_chains()); @@ -207,7 +197,7 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience) { ASSERT_NEAR( rhat(index - 4), stan::analyze::compute_split_potential_scale_reduction(draws, size), - 1.0) + 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } From 57fb925fc3fa70616389bc6a3c64a8dd5e14ea00 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Fri, 2 Feb 2024 07:01:44 -0500 Subject: [PATCH 18/93] Updates the Math submodule to 967e86d08a. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index babb1adabd..967e86d08a 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit babb1adabd41e58592b3881ce49810a36df446f8 +Subproject commit 967e86d08a76e561c779f4d3aee72fdb95420cd7 From a0154340ce1f195de01839075adad25e10bf28d5 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Sat, 3 Feb 2024 04:44:47 -0500 Subject: [PATCH 19/93] Updates the Math submodule to 8e4e4e6ffc. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 967e86d08a..8e4e4e6ffc 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 967e86d08a76e561c779f4d3aee72fdb95420cd7 +Subproject commit 8e4e4e6ffcf643a47849f18da64bc98ea2a37331 From c20ce616e8d313abb1c38898506cb3a94e2db27f Mon Sep 17 00:00:00 2001 From: aleksgorica Date: Sun, 4 Feb 2024 15:10:53 +0100 Subject: [PATCH 20/93] chains_test modified --- src/test/unit/mcmc/chains_test.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/test/unit/mcmc/chains_test.cpp b/src/test/unit/mcmc/chains_test.cpp index 987279de66..65b3d6d962 100644 --- a/src/test/unit/mcmc/chains_test.cpp +++ b/src/test/unit/mcmc/chains_test.cpp @@ -854,13 +854,11 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, - 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, - 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, - 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, - 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, - 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, - 1.00735; + rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, 1.00095, 1.00906, + 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, + 1.00303, 1.00976, 1.00295, 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, + 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, 1.00381, 1.00283, 1.00188, + 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; for (int index = 4; index < chains.num_params(); index++) { ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), From 5630c51d0c4e0977ccf8ef003fb3a50af9611dc1 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Tue, 6 Feb 2024 16:45:13 -0500 Subject: [PATCH 21/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- .../compute_potential_scale_reduction.hpp | 126 +++++++++--------- ...compute_potential_scale_reduction_test.cpp | 55 ++++---- src/test/unit/mcmc/chains_test.cpp | 11 +- 3 files changed, 100 insertions(+), 92 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index d2104e45e3..17a0197104 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -17,82 +17,90 @@ namespace stan { namespace analyze { - /** - * Computes normalized average ranks for draws. Transforming them to normal scores using inverse normal transformation and a fractional offset. - * Based on paper https://arxiv.org/abs/1903.08008 + * Computes normalized average ranks for draws. Transforming them to normal + * scores using inverse normal transformation and a fractional offset. Based on + * paper https://arxiv.org/abs/1903.08008 * @param draws stores chains in columns * @return normal scores for average ranks of draws - * + * */ Eigen::MatrixXd rank_transform(const Eigen::MatrixXd& draws) { - int rows = draws.rows(); - int cols = draws.cols(); - int size = rows * cols; - Eigen::MatrixXd rankMatrix = Eigen::MatrixXd::Zero(rows, cols); - - std::vector> valueWithIndex(size); - - for (int col = 0; col < cols; ++col) { - for (int row = 0; row < rows; ++row) { - int index = col * rows + row; // Calculating linear index in column-major order - valueWithIndex[index] = {draws(row, col), index}; - } + int rows = draws.rows(); + int cols = draws.cols(); + int size = rows * cols; + Eigen::MatrixXd rankMatrix = Eigen::MatrixXd::Zero(rows, cols); + + std::vector> valueWithIndex(size); + + for (int col = 0; col < cols; ++col) { + for (int row = 0; row < rows; ++row) { + int index + = col * rows + row; // Calculating linear index in column-major order + valueWithIndex[index] = {draws(row, col), index}; + } + } + + std::sort(valueWithIndex.begin(), valueWithIndex.end()); + + // Assigning average ranks + for (int i = 0; i < size; ++i) { + // Handle ties by averaging ranks + int j = i; + double sumRanks = 0; + int count = 0; + + while (j < size && valueWithIndex[j].first == valueWithIndex[i].first) { + sumRanks += j + 1; // Rank starts from 1 + ++j; + ++count; } - std::sort(valueWithIndex.begin(), valueWithIndex.end()); - - // Assigning average ranks - for (int i = 0; i < size; ++i) { - // Handle ties by averaging ranks - int j = i; - double sumRanks = 0; - int count = 0; - - while (j < size && valueWithIndex[j].first == valueWithIndex[i].first) { - sumRanks += j + 1; // Rank starts from 1 - ++j; - ++count; - } - - double avgRank = sumRanks / count; - boost::math::normal_distribution dist; // Standard normal distribution - for (int k = i; k < j; ++k) { - int index = valueWithIndex[k].second; - int row = index % rows; // Adjusting row index for column-major order - int col = index / rows; // Adjusting column index for column-major order - double p = (avgRank - 3.0/8.0) / (size - 2.0 * 3.0/8.0 + 1.0); - rankMatrix(row, col) = boost::math::quantile(dist, p); - } - i = j - 1; // Skip over tied elements + double avgRank = sumRanks / count; + boost::math::normal_distribution + dist; // Standard normal distribution + for (int k = i; k < j; ++k) { + int index = valueWithIndex[k].second; + int row = index % rows; // Adjusting row index for column-major order + int col = index / rows; // Adjusting column index for column-major order + double p = (avgRank - 3.0 / 8.0) / (size - 2.0 * 3.0 / 8.0 + 1.0); + rankMatrix(row, col) = boost::math::quantile(dist, p); } - return rankMatrix; + i = j - 1; // Skip over tied elements + } + return rankMatrix; } - /** - * Computes square root of marginal posterior variance of the estimand by weigted average of within-chain variance W and between-chain variance B. - * + * Computes square root of marginal posterior variance of the estimand by + * weigted average of within-chain variance W and between-chain variance B. + * * @param draws stores chains in columns * @return square root of ((N-1)/N)W + B/N - * + * */ inline double rhat(const Eigen::MatrixXd& draws) { int num_chains = draws.cols(); int num_draws = draws.rows(); Eigen::VectorXd chain_mean(num_chains); - boost::accumulators::accumulator_set> acc_chain_mean; + boost::accumulators::accumulator_set< + double, boost::accumulators::stats> + acc_chain_mean; Eigen::VectorXd chain_var(num_chains); double unbiased_var_scale = num_draws / (num_draws - 1.0); for (int chain = 0; chain < num_chains; ++chain) { - boost::accumulators::accumulator_set> acc_draw; + boost::accumulators::accumulator_set< + double, boost::accumulators::stats> + acc_draw; for (int n = 0; n < num_draws; ++n) { acc_draw(draws(n, chain)); } chain_mean(chain) = boost::accumulators::mean(acc_draw); acc_chain_mean(chain_mean(chain)); - chain_var(chain) = boost::accumulators::variance(acc_draw) * unbiased_var_scale; + chain_var(chain) + = boost::accumulators::variance(acc_draw) * unbiased_var_scale; } double var_between = num_draws * boost::accumulators::variance(acc_chain_mean) @@ -102,9 +110,6 @@ inline double rhat(const Eigen::MatrixXd& draws) { return sqrt((var_between / var_within + num_draws - 1) / num_draws); } - - - /** * Computes the potential scale reduction (Rhat) for the specified * parameter across all kept samples. @@ -123,7 +128,6 @@ inline double rhat(const Eigen::MatrixXd& draws) { inline double compute_potential_scale_reduction( std::vector draws, std::vector sizes) { - int num_chains = sizes.size(); size_t num_draws = sizes[0]; if (num_draws == 0) { @@ -164,21 +168,19 @@ inline double compute_potential_scale_reduction( Eigen::MatrixXd matrix(num_draws, num_chains); - for (int col = 0; col < num_chains; ++col) { - for (int row = 0; row < num_draws; ++row) { - matrix(row, col) = draws[col][row]; - } + for (int col = 0; col < num_chains; ++col) { + for (int row = 0; row < num_draws; ++row) { + matrix(row, col) = draws[col][row]; } + } double rhat_bulk = rhat(rank_transform(matrix)); - double rhat_tail = rhat(rank_transform((matrix.array() - math::quantile(matrix.reshaped() , 0.5)).abs())); - + double rhat_tail = rhat(rank_transform( + (matrix.array() - math::quantile(matrix.reshaped(), 0.5)).abs())); + return std::max(rhat_bulk, rhat_tail); } - - - /** * Computes the potential scale reduction (Rhat) for the specified * parameter across all kept samples. diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 7ea51847ed..2f64f659eb 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -32,11 +32,12 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, 1.00201, - 0.999558, 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, 1.00134, 1.00895, - 1.00079, 1.00368, 1.00092, 1.00133, 1.01005, 1.00107, 1.00151, 1.00229, 0.999998, - 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, 1.001, 1.01267, 1.00011, 1.00066, 1.00091, - 1.00237, 1.00019, 1.00104, 1.00341, 0.999815, 1.00033, 0.999672, 1.00306, 1.00072, 1.00191, 1.00658; + rhat << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, + 1.00201, 0.999558, 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, + 1.00134, 1.00895, 1.00079, 1.00368, 1.00092, 1.00133, 1.01005, 1.00107, + 1.00151, 1.00229, 0.999998, 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, + 1.001, 1.01267, 1.00011, 1.00066, 1.00091, 1.00237, 1.00019, 1.00104, + 1.00341, 0.999815, 1.00033, 0.999672, 1.00306, 1.00072, 1.00191, 1.00658; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -70,11 +71,12 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, 1.00201, - 0.999558, 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, 1.00134, 1.00895, - 1.00079, 1.00368, 1.00092, 1.00133, 1.01005, 1.00107, 1.00151, 1.00229, 0.999998, - 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, 1.001, 1.01267, 1.00011, 1.00066, 1.00091, - 1.00237, 1.00019, 1.00104, 1.00341, 0.999815, 1.00033, 0.999672, 1.00306, 1.00072, 1.00191, 1.00658; + rhat << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, + 1.00201, 0.999558, 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, + 1.00134, 1.00895, 1.00079, 1.00368, 1.00092, 1.00133, 1.01005, 1.00107, + 1.00151, 1.00229, 0.999998, 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, + 1.001, 1.01267, 1.00011, 1.00066, 1.00091, 1.00237, 1.00019, 1.00104, + 1.00341, 0.999815, 1.00033, 0.999672, 1.00306, 1.00072, 1.00191, 1.00658; Eigen::Matrix samples( chains.num_chains()); @@ -106,11 +108,12 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, 1.00095, 1.00906, - 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, - 1.00303, 1.00976, 1.00295, 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, - 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, 1.00381, 1.00283, 1.00188, - 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; + rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, + 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, + 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, + 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, + 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, + 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; for (int index = 4; index < chains.num_params(); index++) { ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), @@ -139,11 +142,12 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, 1.00095, 1.00906, - 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, - 1.00303, 1.00976, 1.00295, 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, - 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, 1.00381, 1.00283, 1.00188, - 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; + rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, + 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, + 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, + 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, + 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, + 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -178,11 +182,12 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, 1.00095, 1.00906, - 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, - 1.00303, 1.00976, 1.00295, 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, - 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, 1.00381, 1.00283, 1.00188, - 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; + rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, + 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, + 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, + 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, + 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, + 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; Eigen::Matrix samples( chains.num_chains()); diff --git a/src/test/unit/mcmc/chains_test.cpp b/src/test/unit/mcmc/chains_test.cpp index 8eed679d43..41bd645a75 100644 --- a/src/test/unit/mcmc/chains_test.cpp +++ b/src/test/unit/mcmc/chains_test.cpp @@ -853,11 +853,12 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, 1.00095, 1.00906, - 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, - 1.00303, 1.00976, 1.00295, 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, - 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, 1.00381, 1.00283, 1.00188, - 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; + rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, + 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, + 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, + 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, + 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, + 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; for (int index = 4; index < chains.num_params(); index++) { ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), From 924e062f893b745d80314638cee5671e08a3fc27 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Wed, 7 Feb 2024 15:54:47 -0500 Subject: [PATCH 22/93] Remove unused includes of dump.hpp --- src/stan/variational/advi.hpp | 1 - src/test/unit/services/optimize/laplace_jacobian_test.cpp | 1 - src/test/unit/services/optimize/laplace_sample_test.cpp | 1 - src/test/unit/services/pathfinder/normal_glm_test.cpp | 1 - src/test/unit/variational/eta_adapt_mock_models_test.cpp | 1 - src/test/unit/variational/stochastic_gradient_ascent_test.cpp | 1 - 6 files changed, 6 deletions(-) diff --git a/src/stan/variational/advi.hpp b/src/stan/variational/advi.hpp index 87391382f0..681ce65e82 100644 --- a/src/stan/variational/advi.hpp +++ b/src/stan/variational/advi.hpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include diff --git a/src/test/unit/services/optimize/laplace_jacobian_test.cpp b/src/test/unit/services/optimize/laplace_jacobian_test.cpp index 67a88eed59..7abeadc945 100644 --- a/src/test/unit/services/optimize/laplace_jacobian_test.cpp +++ b/src/test/unit/services/optimize/laplace_jacobian_test.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include diff --git a/src/test/unit/services/optimize/laplace_sample_test.cpp b/src/test/unit/services/optimize/laplace_sample_test.cpp index ba3008262c..e292305cb7 100644 --- a/src/test/unit/services/optimize/laplace_sample_test.cpp +++ b/src/test/unit/services/optimize/laplace_sample_test.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include diff --git a/src/test/unit/services/pathfinder/normal_glm_test.cpp b/src/test/unit/services/pathfinder/normal_glm_test.cpp index b391e0036f..445c2ff53b 100644 --- a/src/test/unit/services/pathfinder/normal_glm_test.cpp +++ b/src/test/unit/services/pathfinder/normal_glm_test.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include diff --git a/src/test/unit/variational/eta_adapt_mock_models_test.cpp b/src/test/unit/variational/eta_adapt_mock_models_test.cpp index e4f7b3a627..9a2a52714b 100644 --- a/src/test/unit/variational/eta_adapt_mock_models_test.cpp +++ b/src/test/unit/variational/eta_adapt_mock_models_test.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include #include diff --git a/src/test/unit/variational/stochastic_gradient_ascent_test.cpp b/src/test/unit/variational/stochastic_gradient_ascent_test.cpp index a51f3dc5a3..fb29c67ef4 100644 --- a/src/test/unit/variational/stochastic_gradient_ascent_test.cpp +++ b/src/test/unit/variational/stochastic_gradient_ascent_test.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include #include From f4d91fcb925320db28d01cc4e52296fcab4c9929 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Wed, 7 Feb 2024 15:58:19 -0500 Subject: [PATCH 23/93] Remove usages of dump from tests --- .../good/services/bernoulli.data.R | 2 - .../good/variational/gradient_warn.data.R | 4 - .../good/variational/gradient_warn.data.json | 6 + .../good/variational/hier_logistic.data.R | 1745 ----------------- .../good/variational/hier_logistic.data.json | 1007 ++++++++++ .../test-models/performance/logistic.data.R | 52 - .../performance/logistic.data.json | 135 ++ .../hmc/integrators/expl_leapfrog_test.cpp | 6 +- .../hmc/integrators/impl_leapfrog_test.cpp | 6 +- .../sample/standalone_gqs_parallel_test.cpp | 8 +- .../services/sample/standalone_gqs_test.cpp | 6 +- .../unit/variational/gradient_warn_test.cpp | 5 +- .../variational/hier_logistic_cp_test.cpp | 5 +- .../unit/variational/hier_logistic_test.cpp | 5 +- 14 files changed, 1170 insertions(+), 1822 deletions(-) delete mode 100644 src/test/test-models/good/services/bernoulli.data.R delete mode 100644 src/test/test-models/good/variational/gradient_warn.data.R create mode 100644 src/test/test-models/good/variational/gradient_warn.data.json delete mode 100644 src/test/test-models/good/variational/hier_logistic.data.R create mode 100644 src/test/test-models/good/variational/hier_logistic.data.json delete mode 100644 src/test/test-models/performance/logistic.data.R create mode 100644 src/test/test-models/performance/logistic.data.json diff --git a/src/test/test-models/good/services/bernoulli.data.R b/src/test/test-models/good/services/bernoulli.data.R deleted file mode 100644 index 5443d8ba76..0000000000 --- a/src/test/test-models/good/services/bernoulli.data.R +++ /dev/null @@ -1,2 +0,0 @@ -N <- 10 -y <- c(0,1,0,0,0,0,0,0,0,1) \ No newline at end of file diff --git a/src/test/test-models/good/variational/gradient_warn.data.R b/src/test/test-models/good/variational/gradient_warn.data.R deleted file mode 100644 index f464de0ace..0000000000 --- a/src/test/test-models/good/variational/gradient_warn.data.R +++ /dev/null @@ -1,4 +0,0 @@ -N <- 10 -p <- c(63.1, 108.3, 1.0, 46.0, 22.9, 14.8, 28.8, 52.5, 60.1, 81.3) -Ngrps <- 5 -grp_index <- c(1, 1, 1, 1, 1, 1, 2, 3, 4, 5) diff --git a/src/test/test-models/good/variational/gradient_warn.data.json b/src/test/test-models/good/variational/gradient_warn.data.json new file mode 100644 index 0000000000..f56038bf0c --- /dev/null +++ b/src/test/test-models/good/variational/gradient_warn.data.json @@ -0,0 +1,6 @@ +{ + "Ngrps": 5, + "N": 10, + "grp_index": [1, 1, 1, 1, 1, 1, 2, 3, 4, 5], + "p": [63.1, 108.3, 1, 46, 22.9, 14.8, 28.8, 52.5, 60.1, 81.3] +} diff --git a/src/test/test-models/good/variational/hier_logistic.data.R b/src/test/test-models/good/variational/hier_logistic.data.R deleted file mode 100644 index f7c16eca39..0000000000 --- a/src/test/test-models/good/variational/hier_logistic.data.R +++ /dev/null @@ -1,1745 +0,0 @@ -ids <- -c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, -4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, -9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, -12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, -15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, -19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, -22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, -25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, -28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31, -31, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, -35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 38, 38, -38, 38, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, -41, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, -44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47, 47, 47, 47, -47, 47, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, -51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 54, 54, -54, 54, 54, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 57, 57, 57, 57, -57, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, -60, 60, 60, 60, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63, -63, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, -67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 70, 70, -70, 70, 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, -73, 73, 73, 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, 76, 76, 76, 76, -76, 76, 76, 76, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, -79, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, -83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, -86, 86, 86, 86, 86, 86, 86, 86, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 89, 89, 89, 89, -89, 89, 89, 89, 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 92, 92, 92, 92, 92, 92, -92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 95, 95, 95, 95, 95, 95, 95, 95, -95, 95, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, -99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100) -X <- -structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2.57917716199775, -2.38744893329618, -0.749536484986239, -1.11672385999519, --0.619933558578326, 0.015368117156971, -0.851727066684374, -0.666147957941832, -0.361482321664015, 1.11524383605807, -0.496373931775554, -0.840281282726482, -0.325804797259299, 0.604651280746919, 1.70449767691726, -0.114335498600736, --0.631518751815811, 0.0107337799941104, -0.861221921347218, -1.32221082826268, 0.821959021860556, 1.55006007804385, -0.744476299020508, -0.195245168143584, 1.85542714805721, 0.0802060884833868, -0.612168718386911, -0.607737013410983, --0.979373909961232, 0.652603040183717, 1.09669973329903, 0.424317060681982, -0.800164697318374, -0.212406972339471, -0.36885397480859, 0.760742055593667, 0.30928693128092, 0.559264817847443, -0.620323590398783, 0.793357261643947, --0.149931356597717, 0.185785774021925, 0.740859262317599, -0.100345505384714, 1.38805075639723, -0.538744853336703, --0.427377223197364, -0.295084350190647, -1.72630734966235, -0.520706040294143, -1.55416016672806, 0.4914493190968, --1.28440190821979, -0.670098871322636, 0.099676024127, 2.05678131414237, 0.819772349832892, -0.114034723822362, --0.322306156520015, 0.112530185817529, 0.0805965979255399, 0.664508505655029, -0.697620129214756, 0.230787518959929, -0.443242476569146, 0.408469484798353, -0.598882792879348, -0.268835216517759, 1.179292747124, -1.06542562632417, --1.45411054672898, -1.30081085904273, -1.27486791769539, -0.492268806181647, -0.401524174728404, 1.20490230170249, --1.61902655341544, 0.87395240882498, 0.264829055514425, 1.01838583491309, 0.0452486294860993, 0.140893873378869, -0.472636297749296, 0.453988993374329, 0.221824847190939, -0.49121900845089, -0.338728889096545, -1.12451364512268, --0.054676023791613, -0.789137291581214, 1.12360991099833, 0.16532665354239, -0.332213691397305, 1.58098999053467, -0.269202140822671, 0.862308220499829, 0.871606440022216, 0.912365770221251, -0.0922804005073777, -0.436043055655883, --1.50785281398054, 0.866897603703387, -0.117033262541989, 1.02669096232982, 1.11996718932965, 1.08003509403607, --1.44294959844884, 0.246455745609291, -0.659558493039642, -0.138238210064953, 2.21149540624235, -1.04405897002309, --0.0322558648852745, -1.02005214027875, 2.04899661787197, -0.0537844269138957, -1.1218869376864, 0.345378336561381, -0.88532502913169, 0.74158287878403, 1.66741364922882, 0.79733208396446, -0.347066108274102, -1.08303350242797, --1.60426917218837, 1.72435940011563, -0.369218344467639, 0.659210152441182, 0.175984069665674, 0.33936365060071, -0.915183168611525, 0.110439562647599, -1.54284997459478, -0.197439405023526, -0.217114404815543, 0.75349987354686, --0.636275400966915, 1.18407479487827, -0.0465755243960001, 0.856353426458313, 0.289415833666859, -1.31478014653586, --0.381550000684025, -0.726943754683938, -1.53108034454659, 1.15182810627127, -0.768073129962994, 2.57593504313787, -0.395255485561876, -0.622760022269917, 0.412783931497303, -0.0150470730489512, 1.13036354583681, 0.346447734694128, --1.56303765999488, 1.45459502624196, 0.0257877712917972, 0.213755858982387, 1.12070735038337, -1.27849826380686, -0.0541718224545231, -1.23352752082946, -0.86457484200129, -1.87975828872711, -0.399545610032572, -0.661886963333136, -0.237522440965149, 0.79225390242904, -0.227520656260621, -0.640972930241129, -0.517273361439859, -2.6847436536213, --0.115217693774055, 0.250684068331081, 1.24855635305514, 0.14936080019548, 1.03898637582768, 1.47866452056941, --0.28635713774773, 1.96368966225037, -0.125211498170713, 2.27961195497506, 0.374247627182289, 1.24992816698627, -0.749729049744348, 1.48082635267505, 0.719525591713462, -0.175792984174014, 1.11259465684422, 1.35789616188178, --1.1327803569429, -0.474070837728571, -1.07891904000059, 0.877057615032182, -1.74014315158575, -0.757708103632285, -1.06020844322666, -0.224649219213155, -2.11285011236415, 0.991844463245075, 0.711082346798216, 0.07309438564432, --1.87468709867654, -1.0841873078096, 0.00511042335489403, -0.68800424685653, -1.67779814201743, -0.978168859279978, -0.71338184625673, 3.31096178995616, 0.788055650246968, 1.0626400408268, -0.237356816200989, 0.194809861374024, 1.3154804386651, --1.00261834888739, 0.715292694074492, 0.832496764909325, 0.983638125896721, 0.690050300390903, -1.67345463704483, --0.463320192480573, -1.01882892827265, 0.760449503075122, 0.631462346962772, 0.152089528341247, 0.0438057736109355, --1.5946309751888, 0.0688272186262918, -0.0614758604269467, -0.915260907426811, -1.12500234930438, 0.815842751470703, --1.643761247516, 0.960590659020648, 0.154563407957009, 1.20414288452861, 1.52714308875996, -0.0978163502789948, --1.17211790254478, -0.526342263192258, 0.270258988553755, 2.46432777655785, 0.635408332426448, -1.34492765902435, --0.103796799131733, -0.624816762682257, -0.175182134696764, 0.903559057855837, -0.322619977552535, -0.0519921846873054, -0.402801835219623, 0.356277834225734, 0.233775712259531, -1.07859223276538, 0.852757050409697, -2.05115274904634, --0.250767159079008, 0.816003428407337, 0.412918776293678, -0.629332144273191, 0.0255794374900549, 0.480792413133131, -0.426344298457363, 1.13975802762172, 1.44007289549687, -0.686914095583759, 0.682698020349823, 0.282995495994091, -0.847375365627917, -0.557388070865319, -0.486467233939374, 0.491533174286661, 0.516823271697658, -0.153522576018854, -0.0121833020918519, 0.326671752510455, 0.655232067649395, -0.155410338508849, 0.223980809881515, -1.12805287923897, -0.213294532612493, 0.334375616025451, -0.548248314315769, -0.963246041437229, 0.110892588299581, -0.263721387781111, --0.00452382218149236, -0.0980963153850163, 0.0129580648206859, 1.8086281642806, -0.861778946566748, 1.08184798693107, -1.41142123851869, -0.0788739528842272, 1.14690931585666, -0.149357567661004, 1.13997463759644, 0.656907120662454, -0.677804190987119, -0.752804055778311, -0.415686642936759, 0.0588178752614041, -0.189756414780667, 1.40705924255622, --0.199095830154534, -1.21408224917478, -0.75945563147921, 0.953046805353977, -0.279798406582525, -1.61625045994981, --1.50371211769016, 0.755819950692786, -0.418939928855064, -0.587469129841068, -0.741212328608131, 0.481149155127202, --0.705612032275991, 0.183788276104339, 0.600656225105272, 0.617525568011613, 1.74718856977734, -1.05789599097706, --0.0128845025688867, 0.148896539698808, 0.138436603499358, 0.878713171604731, 0.746752366174888, 1.98261039647957, --0.321473636714235, -0.3962069865309, -2.0091598177349, -0.385700778790221, -0.571001919956464, -0.101540418363153, -0.537041055364273, -0.700222795680817, -0.398843711336123, -0.414980863070009, 3.03861709779262, -0.056490358667454, --0.293958455340442, 0.930666390217005, 0.98314836246845, -0.030118238061042, 0.0329989842570078, 0.423908366430969, --0.538336146291458, 1.18241051526938, 0.340622980829039, 1.58993228126739, 0.969362053925189, 0.0204059826918115, -1.01075151248235, -1.03409499976402, -0.258269962287116, -0.597843421623756, -0.551093145521334, 0.344006044284329, --0.048935019594509, -2.11590806150954, 0.811239549280564, -0.0188357874175357, -0.467033235491769, -0.0337804793665571, -0.535291347278067, -1.24899291424908, -2.02185551351332, -1.10640729715445, 1.35187428550271, 0.65841299887006, -0.198726791336318, -1.48437266386136, -1.34918627967778, -0.849754405932367, 0.46123691965914, 0.114762062961294, --2.01546718177331, -0.0233249432038224, -0.214911016680328, -0.122516232985227, 1.89940192598234, -0.611773145502149, --1.66841612272989, -1.32702672106747, 1.19185715359804, 1.26974845763713, -0.663550953231539, -1.19289770334523, --0.521383523016945, 0.803444031203972, -0.475342970177399, 0.000117638153677518, 0.752827675431345, -0.976785607710908, --0.531377560605919, 0.507620923278945, 0.690307063959115, -0.837290711509647, 0.611857204249062, 1.91363224208618, --0.551818973156168, -2.25712849958209, -0.720011799916443, -0.172063508085432, -0.764934470720001, -0.721802833617963, --1.29591944415496, -0.581680141178465, -0.577326428032413, 0.700195430025435, 0.955333008728362, -0.584236726116399, -0.46806718020092, 0.71414906734371, 0.0612188593514147, -1.19122023435804, 1.31740478045852, -1.23785919263601, --1.21823821851261, 0.534003480397082, -0.511970003692923, -1.39214838239579, 0.169179541560513, -2.50862142104189, --0.000336821596343713, 1.13087812520896, -1.18532722224868, -0.32474656237854, 0.726944070300359, 1.09096602919821, --0.28002546743048, -1.09097588737979, 0.106049617720956, 0.289042825511518, -0.269143411352672, -0.292576361171863, -0.0852221416849093, -0.559769477660722, 0.349077728482034, -0.632992765227897, 0.723627230906733, 2.51082888411618, --0.930710969061106, -0.427628408332228, -0.00342249547406149, 0.658905981348834, 1.86188954317038, -0.105303830039517, -2.4160200520961, -0.1056459448476, -0.330308726644029, -0.434757521717994, -1.33112438605445, -0.0917220977598405, -0.465753378784445, 0.390063992831445, -1.34991646335485, -1.34660262542311, 1.0624781741676, -0.910491385466653, -0.641785024341111, 0.729421269968578, -0.116226157933932, -2.27175744759152, 0.0495506001849403, 1.16071630009677, --0.214861134267734, 0.91327474971498, 0.232494023800816, 0.909122184680017, -0.0113839791785105, 1.13871624335478, -1.63672355910765, -0.206250751364165, -1.56402499242079, 1.11224073360735, 1.6552560484182, -0.310441913708745, --1.5846196281031, -0.791647133153011, -1.41093526106575, -0.142454210782027, -1.19850693644167, -1.21253836098383, --0.781677405826666, 0.222029827141011, -0.0626785281196579, -0.229790477919473, 1.06352818439189, -0.00339490942752137, --0.519842424639104, -0.108419289559285, -1.48832846498391, -0.00795016526783572, -2.00354675638069, 0.928083607088763, --0.338967536683273, 0.550358447495185, 0.477304291289361, -0.848224958949812, -0.915487502616714, -0.886427687067517, -0.7905350364555, -2.88534434494891, 0.422683219350245, 0.216596086568832, -0.393133370940212, 0.928347599401518, -0.38047017997063, 1.54744345795672, 1.5308688314644, -0.491061289196447, -0.411487389481661, 0.285415700684578, --1.01609319446697, 1.80116689820191, 1.15478762326293, 1.5184667892194, 2.09286672948644, -0.951319979780386, --0.954863435515016, -0.724100276354502, -0.155692220952375, -0.118643469710392, -0.328092323902875, -0.352792589758423, --0.0415648767059906, 0.386827838668361, -0.455449089542254, 1.12943555829996, -2.28034034403401, -0.0749869556970217, -0.390956069262321, 1.39725943986245, 0.358457970625527, -0.954270800466769, -0.760782092995879, -1.0704862723226, -0.789659158481062, 0.753382064646552, 0.937808412365745, -0.816975318891458, -1.5570425060218, 1.15618268542984, --0.0946026465394819, -0.485475412541147, -0.186726849384212, -0.181037583483198, 2.3634869038246, 0.643875923247045, -0.246906426977911, 0.145126546830667, -1.43704294915033, -0.738750376267537, -0.923686766256931, -0.321075867554797, --0.990269919403795, -0.870327221186581, 0.843880198731204, -0.624446813211324, 0.2922812166109, -0.375917801707658, -0.507843093577615, -1.00765426349502, 0.550730220847561, 0.898314284509625, -0.126323067746812, -0.659874962173825, -1.10373892117108, -0.117269718629325, -0.279399277494002, 0.020369372829298, 1.27114209674145, -0.469440297170567, -0.813625873176463, -1.66967840586141, 0.605736734010114, 0.106758386278598, 0.330929523866984, -0.532791555974071, --0.320279125057995, 0.214743630543651, 2.14717520125991, 0.450432174460318, -0.378278965722875, 0.0273645503404752, --0.101116334756211, -1.01917946523513, -2.38290970182575, -1.40023306130291, -0.0473147666374628, -1.15373794330809, -0.22247482913915, 0.551868272039797, -0.47986472809419, -0.552649136836953, -0.703897469982243, -0.0864374734000218, -0.320852200291768, 0.509666619374225, 0.431095333213149, 0.472167689970559, 0.293811773201704, 0.295663139097878, --1.18117035103131, 0.584172064285411, 0.325331615104818, 0.86797116533987, 0.101914633372752, 0.361506777415872, -0.995110105047131, -0.748394121695574, 1.23601185419553, 2.2304687859627, -1.83271010045781, -0.489648426237403, --0.890624504104954, -0.976021444206189, -1.94203329720926, 0.357524775134926, -0.600583918040074, -0.921535800496582, --0.908961640328406, -1.87308338771041, -0.670578400342234, 1.26174547044336, -0.332122102811065, -1.90683081664613, -1.00720825662281, 1.83080707732046, 0.601204844011037, 0.555141124825395, 1.00077993917208, 0.829878845045995, --0.369152579051588, 0.13818973162329, 0.594273302862094, 0.622873236159409, 0.53812065078791, -0.918889724201684, --0.160936036101088, -0.195063249025143, -0.575568986620426, 0.364624922887837, 1.04321632136462, -0.818334847783596, -0.849074825056222, 2.59381382510354, -0.199905216355677, -2.07571515085809, 1.46725189898227, 1.22132596341281, -0.218302883960088, -1.09547801726531, -1.18162872612409, 1.16971105370125, 0.146587349822864, 1.19244405209895, --0.692179191012648, 0.394973774219342, -0.65281364662526, 0.619250552917653, 0.704079996986889, -1.40628388132932, -0.754849812013316, -0.603076633703155, 0.68897580064517, -0.778664551223035, -0.907389205002648, 0.00828644881989187, -0.212009380254421, -0.515675789902043, -1.17549838615693, 0.00643806602904379, 1.064360067316, 0.554314534894229, -1.77123992047204, -0.581885263739233, -0.256795174324747, 0.518644594060234, 0.976505061874071, -0.263816528301179, -1.69995165801473, 1.54486854089795, -1.13294859512257, -1.12492419414656, 0.107023282720214, 0.201213574915957, -2.35054447599264, -0.0746650294027303, 0.933784602748028, 1.5836453198821, -0.306942599460782, -0.603955750833064, --0.784022930254033, -0.680297144289173, 1.9111725339816, -1.02418687243285, -0.480460342631481, -0.390382036995179, -0.612727970868975, 1.30957956511383, -0.167173748569449, -0.173045730316091, 0.454597661604916, 1.65488463493057, -1.80473171774289, 1.36757659233381, 0.382959595546615, 0.879896334223858, 0.404800096082289, 1.43140043703361, --0.210440890341642, -0.958072728182832, 1.94234177410803, 1.06150241324185, -1.04223710808924, -1.3754294499764, -0.182933658605359, -1.14648228657337, -0.320919776004399, 0.686151748383153, -0.430248751593959, 1.01456784919804, -1.17964274414655, 0.587055224287241, 0.681810831241758, 0.528398231706119, 1.11415963623083, 0.856989773179712, --1.55104128506571, -1.46880081200149, -1.94397517196994, 0.445875245449484, -1.37415982788588, -0.483810900095382, --1.50646543603637, 1.00589846256889, -0.762001359204519, -0.139375687281065, 0.155818340703159, 2.24459797772659, -0.461569098967689, -0.801778939744131, 0.559010895310733, 0.519817571633177, 0.287456147528234, 0.373424614332421, -0.75159201964458, 2.33419724242886, 1.47193198550903, 0.41336502740929, -0.252820571099468, -1.75989338399133, 1.06983760787876, --1.40946707959358, -0.560096968671034, 1.42265055391271, -0.651184175873325, -1.36521412492034, 0.158771425802283, --0.847582409842585, -0.966562404119503, 0.739587545269517, -1.01902700090682, -0.783786904048515, 0.869853530033134, -1.05854937961927, 0.303681579902868, -1.56749419611232, 0.674539297275526, -0.91046409728286, -0.784644774112209, --1.41527534901989, 0.58578312002541, -1.15476980420679, -0.703852741861704, 2.69682107753385, 0.279614613407993, --1.32109118030726, 0.938279080561347, -2.27129114203649, 0.176965379609567, 1.68409066079605, 0.474154531041827, -0.336626991694928, 0.303081704383306, -0.482261116411679, -0.367884876746884, -0.816009874326294, -0.919190375196461, -0.951668100235934, -1.23107513938234, -0.52201421260151, 0.619208548812865, 1.94390857955151, -0.878684520878814, -1.32470431201012, -0.534083620362317, -0.468454796815347, 0.325056952872152, -0.662577733842967, 1.15315218835596, -0.245695228309862, 0.902096867570319, -0.533366865508062, 0.820811728268122, -0.603166197365474, -0.00668196272593409, -0.529134033235507, -0.855072814307352, -0.11211617743286, -0.0318837626055996, -0.378486602509987, -0.0578689008901032, -0.53226539561296, -1.3563175633858, 0.15103696979777, -2.87932683687846, 0.520392750233268, -0.934779351079078, --0.873391606663193, -0.24949369253496, -0.251078739210541, -0.767814074106437, 0.477935435492444, -1.10740819499445, -0.307999572889197, 0.0925354440541058, 0.429681313001613, 0.862915991946444, -1.69742805707435, -0.0242836423889243, --1.60203448602209, 2.15284023841208, 1.59995247289608, 0.375707424053679, 1.48685515044136, -0.354890336641492, --1.38663309123978, 0.0202953933913542, -2.2172347599894, 0.238348165521037, 1.19385464125804, -2.74815403789515, -0.952510804358767, 1.53914046903851, 1.12417960209976, -1.1712054287726, -1.12161957658702, 0.00950941526293878, -0.910618056470928, -0.73966871253334, 0.0196348307389257, 1.0354262472925, -0.502598929090275, -0.240721120542849, -0.328441046065344, -1.19467380214863, 0.217399748342267, 0.614459694171602, -0.23246500469148, 0.430942513411393, -0.054215041198201, 0.174138502121905, 1.32125628001809, 0.279914331642124, 1.40867936311928, 0.941406618746418, --0.2763369594895, 1.21551928349672, 0.6661823868262, -0.704053864802352, 0.949167822077244, 0.539443032892569, --0.071500034635824, 1.0192909222211, -0.772191349737247, 1.62572439027096, 2.9735351660946, 0.617985010131547, --0.594433564656849, -0.685016885203487, -0.93174529581385, -1.06102319447077, -1.22681036872071, 1.72384693161568, -1.24857988814068, 0.622991355894054, 1.7440571243546, 1.46562808581244, 0.832307893932855, -0.254205271337925, --0.851729472840558, 1.06320768117474, 0.910556112359681, 0.857602167480099, -1.95754335092832, 0.946333755695818, -0.6323430988869, 0.294156343846853, -0.457188522402376, -1.18504080299351, -0.239442798935616, 0.813435409004093, -1.16314864102657, 1.17763006382269, 0.964195485614609, 0.105492561582905, -0.00836699303779103, 0.0329869313163281, --3.03320444561043, -0.364662925150715, 0.126557302179385, 0.347065078637917, -0.974777523999182, -0.378299280031317, -0.494538743827999, 0.282464832513637, -0.29830470090347, 1.40342110110382, 0.206276241528266, 0.515438732339433, -1.11309751082698, 0.497153660805445, -1.48956984711657, -1.44520521164319, 0.387334276976964, 0.164778582868795, --0.128687355931227, -0.544215526351516, -0.458310387629439, 1.97506488985878, -0.969000022621263, 0.807684515377059, --0.129392414258196, 1.60947373567375, 0.527121294603182, 0.4452119985412, -1.02146962214456, -0.0812096129614166, -0.110376876864517, 0.448367511165614, 0.825121664103146, -0.27825626754638, 1.39688125527035, -0.237351886771058, --0.529318490219205, 0.472671476495609, 1.22049240663511, -0.965257445673168, 0.718269290686733, -0.209369945482088, --1.68492229620007, -0.0590078641386063, 0.20376374138827, -0.103298579714125, -0.213475991371015, -0.237728329035281, -0.412511898072628, 0.26255110117525, -0.746353408990687, -0.163344442761733, 2.38593905900221, -1.38778139798434, -0.702301138898146, 1.13081619830849, -0.778879506199033, 1.21368830099368, 0.834063005583098, 0.221315863080882, --0.88998468855992, 0.667190097153623, 0.516138071670446, 0.648899605073196, 0.693653682358234, -1.8735541830099, --1.73180768797382, 0.421123584887627, 1.00965484327849, -2.37565513152811, -0.105219097714593, 0.49850039148782, -0.802441524954512, -1.99255748041697, -0.702745591957903, 0.379894480629561, 2.08042938621585, 0.257791519051102, --0.283732446994841, -0.0190015555738483, -1.00553517385343, -1.0896675272145, 0.718223773378655, 1.4724712639388, -1.08303460891901, 0.730695477396637, 0.460086859539689, -0.562587897936453, -0.0348321257238794, 0.951360498262548, --1.31979618091471, -1.08763505619974, 0.786884226812518, -0.516776310120882, -1.72389173782849, -0.504332493803526, --1.142981668459, 0.869637479071448, -1.34622852486657, 1.08908132877102, 0.863677553722814, -1.45611671157852, -0.522968748129384, -1.37625209248846, 1.62241682518376, -0.760248971555083, -0.0692477905852415, 0.932255985999559, -0.828708915295613, 0.701197064553088, -0.555455346328636, -0.199562351104511, -0.98606305432237, -1.11649656959053, -0.217837287925338, -0.0478754321134561, 2.24639009029605, 0.407495387022595, 1.14736002457732, 1.55757287011763, --0.134385216440685, -0.175215195387592, -0.797483030733454, 0.656875414326964, -0.580708200824838, 1.06964998010558, -0.0545566889605223, 0.840166482575712, -0.989792233321963, -0.7841286709649, 2.11248020134409, 1.02702222196354, --0.192016780150674, -0.0131057436245737, -1.52785245327333, -2.24475360672899, -0.0459092281378865, 0.136751741473048, -0.439120160331514, -0.346416691593661, -0.595605220112669, -0.937164517029391, -1.24233729850698, 0.105420205078933, -0.862388312936453, 0.706285359402943, 1.25429071612454, -0.640140630721747, -0.203365255676363, 0.275638521812389, --1.94611127858211, -2.28659325519973, 0.884333335898872, -0.0450273887296529, 0.544552476683243, 1.67748501030115, --1.16611591126963, 0.138119560375408, -0.758099603174791, 1.22575492492934, 1.15804927622785, -0.174622564734439, --1.79686193306009, -2.78070492850344, 1.85906490777249, 0.0592597014068605, 2.07800430565351, 0.28480087019264, -1.12865058079281, 1.21784891873184, 2.69255607747957, -1.80322091781934, -0.0147596502042235, 0.539242292756731, --1.07080564940211, -0.0881517772961169, 1.13219603404546, 0.0324891571816732, 1.04502439488494, 0.539432011007613, -1.40214980543282, -0.494615537807563, -2.24427200661453, 0.0729926336328388, 0.0460588985717286, -0.736286518421324, -1.06225451504473, 0.0563408951560306, -0.661117832684992, -0.620241463130989, -1.35764031062474, -1.26868782208513, -2.05687964618772, -0.787553914918604, 0.864845998162136, -0.0455694434488654, 1.5163806536136, -0.37077127658939, --0.881965958753822, 2.51164426391649, 0.692036388043303, -1.19309837971574, 1.10107742027424, -2.52911634122704, --0.505641317730878, 1.78058664544542, -0.261586931607344, 0.71518388492669, -1.5578263052916, -0.467878529774703, --0.500013222683255, -0.208772720782439, -0.656711668164851, -0.649028492587928, -0.592453757488815, -0.862940032251989, --0.583477322951094, -0.344674112197226, -0.860393480788985, -1.73433859563284, -0.0634467228815642, 1.23498569925455, --1.62844635715085, 0.947997658934685, -0.857321092860208, -0.737604629308954, -0.731563306012409, -1.58269423741672, --1.34002599971376, -1.61830070306391, -0.378584103172379, 1.40939537031487, 0.699820812010614, 1.17124296030972, --0.316000315465388, -0.0416890758117048, -0.206288596466174, -0.354551680859143, -0.691746980231792, 0.565160833061701, -1.04545375731684, 0.775923572393234, -0.542442043732349, 0.0480104898330525, -0.370251206938078, -0.0147038209271157, --0.502493998429975, 1.22534286236477, 0.718876854377301, -1.80585978899202, 1.01325905218663, -0.290572267344484, -1.03307147293035, -1.16037316445312, 1.99665730075496, 0.834934343558725, -0.375634198574288, 2.32488685446622, --1.78263470067673, 0.433050620880986, 0.317928036081373, -0.718790094333811, -0.663519175341733, 0.616980465918783, --0.660875577818193, -1.38115585616826, 0.100738151564935, 1.81160018122651, 1.69649021409983, -0.121099383211787, --1.62350288863857, -0.494615915300045, -0.965911803606376, -0.11409868874502, 1.01980326060581, 0.988838767085715, --0.69983817188553, 0.294171006484038, 0.578032532424658, -0.219883182167584, -0.117384671268236, 0.600552483103985, --1.28554934378014, 0.125914559480549, -0.805712629927298, -0.23658827353597, 0.160230164873416, -1.13818705629596, -0.117450594096964, -0.655924820602222, -1.66283089379801, -2.33927436590022, 0.412913052075734, 0.385196229619431, -0.408968199540759, 0.450236249431465, -0.181999811662092, -1.36776841081285, -0.886918846472489, 1.99288443865408, --0.0127190700911846, 0.789736740972101, 0.72610701693439, 1.20213928938457, -1.07631310447848, -0.845777828726429, --0.511133232278131, 0.183511344018215, -0.0581494576625651, 1.7475261187211, 0.12680991325714, 0.346577549747043, --0.347658768853803, 0.102907617348921, 1.83947777098775, -2.02064920302065, 0.836017201666817, 1.76704132543546, --0.233990797262648, -0.540709319301531, 0.902340754964724, 1.43413421686782, -1.26940807455248, -0.718502824990578, --0.791028745288815, -1.07296554654045, 0.57064300415661, -0.908685108559307, 0.504619491982736, 0.0114885880754705, --0.591023644715147, 0.821907462153012, -0.313599080980229, 0.984697726152067, 1.6042331932178, -1.9067165430729, --1.66242996068999, 1.07991449794185, -0.289572992978744, 0.244404706687852, 0.114683491912248, 0.859154015140903, -1.62073348679355, 0.908097519584182, -0.0635107229443917, 0.845735298658901, 0.159779037909362, -2.01168711302063, -0.56134978128214, -2.13715349991833, -0.492575414524149, -0.499557153958622, -0.974485133790933, 0.182283890814196, --0.636207904794637, 0.190764154069807, -0.513681839577887, 1.07655929301921, -0.555467244486122, 1.48810548314868, -0.719964268444804, 2.00371480288332, -1.25903889665307, 1.44594857347247, -1.85098542088696, -0.242709663226575, --1.83837577965203, 0.355868992170541, -0.459356823810236, -0.358217393101149, 0.66249422296794, 1.23156928861004, -0.771000707966811, -3.01655720566266, -0.92888168582889, -1.05478709324795, 1.01643525439374, 0.839953163471089, --0.477912123158324, -0.70978564289933, 0.480296393904533, -1.24637417477841, -0.21735443381969, 0.185139635390681, -1.2486509186276, -0.877213132365973, 0.521109296803826, 1.25661517398149, -0.80037137555918, 0.0160246670907747, -1.74265546551436, 0.00821764886844355, 0.479810507118277, -1.66764641296175, 0.0843861670411541, -0.524527637551885, -0.954827057439205, 1.544747812829, -1.73492087988394, -2.27936826166698, 0.346645640245259, 2.12382778023308, 1.10356640946751, -1.14294628641766, 0.135173793440227, -0.374153633218723, 0.990346929530961, 0.201501003990921, 1.23032936363403, --1.03752214521355, 0.259077979883814, -0.65168161308097, 0.0624989870560525, -1.93025514512641, 0.131308665064303, --0.0497701858539252, 0.896610800952206, -0.922626359484469, -0.969691303587961, 0.776810241617836, -0.776340794466553, --0.535975020837464, -1.66024209030759, -0.415496639376537, -0.0313489539587311, 0.117353347861516, -1.63010394740844, --0.805294178720336, -0.408543779952842, -0.257062454417471, 0.343084484433762, -1.08041676726552, -1.38968067566983, --0.0711531574784798, 1.63995167739707, -1.94725304084738, 0.813737727266945, 0.17472204277198, -0.416294873434723, -0.477169932952988, 0.839338936680759, -0.277437903589826, -0.0573092136502171, -0.185796315700205, -1.34158582700499, -0.627713882914884, -0.298212183756091, -0.723869861105233, -1.05661680335153, 0.394326544434367, 1.1258755605712, --0.0737996923888308, 1.12034899718234, 1.51671207277987, 0.304866197234222, 1.39897674226074, -0.668667615083039, -2.42737871894465, 0.868898366229165, -2.43084541089623, 0.932645982179598, -0.584174850069564, -0.0195173205954154, -1.49368446928118, -0.0584060326017302, 0.334729429412629, 2.07661544820275, 1.19563949306412, -0.289075471220607, -0.657061212760735, -0.437019821341279, 0.974108221814754, -0.189111955516497, -0.57068685996425, -1.17909519155749, -0.0749738674290073, -0.56340267526492, -1.20280547629251, -0.521512213856057, 0.381065882170825, 0.238264380160856, --0.189918375475086, -0.962297157618472, -0.738741284077295, 1.89899642237899, 0.200422289868486, -1.04813470864603, --0.291812038697694, 1.05634676828442, -0.879399082754231, 0.572318632040802, 0.179825985573935, 1.58628907419342, -0.599053103026693, -0.389874695400191, 0.432481632489265, -0.217029802244256, -1.92331907527144, -0.164390840982567, -2.04115886546677, 0.60678484555203, 0.802596865931211, -0.332600706357878, -0.713002833509426, -0.36257737450554, -0.185020148129782, 1.60690513887937, -0.225815763643355, -0.144255044451259, 1.239624001106, -1.45686634404976, -0.691935886148055, -0.555386106623758, -0.165947311017069, -0.668598616837216, 0.723232301147594, 1.04548062662312, -1.00402962062361, -1.80657936886579, -0.803315224239672, -0.814755156906396, 1.72505066170158, 0.510768618175269, -0.432359878578433, -0.634988908073769, 0.508412891454818, -0.480373776379203, -0.607702057713757, 0.975327170338433, --0.859213291672511, 0.623263965649302, -0.0789792238324504, -0.782871562620874, -0.849571667202668, -0.729443192881121, -0.353603412130606, -0.649903921859555, -0.326054549883573, 0.726001953146045, -1.29783953088857, 0.630020608996262, --0.175255554720604, 0.415794414809314, 0.224943011363629, 1.31183106899197, -0.0359574021071124, 0.542537600583883, --1.57964748706995, -2.51073309975745, 1.22622723871508, -0.971783267524907, 0.335788072104965, 0.477179771060133, -0.783516474825178, 2.663006849943, 1.37460225992546, -1.13799021133302, -0.19114804251339, 1.50493644184031, -0.683272174801773, --1.18024424737692, -0.715893645127731, 0.0640464866401612, 2.19497594911539, 1.19648004900645, -0.392352530552162, --0.0254598942305087, 0.36865496501937, -0.149784994784462, -0.644735846494903, 0.338570172027913, -0.71057549759177, --1.69610221467636, -0.6575382747393, 1.1024994860412, -0.61098952387198, 0.166236728521037, -0.15813820702465, --1.34295888796672, 0.0748030560005267, -0.0945468121464586, -0.567976071872457, -0.10230742132952, -0.410561754072878, -0.189024365514865, 0.623682217096984, -1.11798724685448, 2.57110368437613, -1.80941023919421, -1.2232523449647, --0.484241724369674, -1.27744463406295, 0.915957268870147, -0.240337980767307, -0.152174877634385, 1.18149237154364, -1.20235445231339, -1.24420140617395, 1.90130643742841, 0.356124444409775, 0.0814739317142539, 0.445741514570346, -0.632830064334205, 0.736613560851102, 0.915394602018423, -1.78967122933774, -0.965526190679311, 1.30574607493287, --1.11062367139948, -0.898400497495654, 0.807118294050927, 0.137315605863546, 1.57066544702808, -1.12108918694198, -4.50259235846073e-05, -1.46093259376602, -0.868063129524065, -2.26138591680919, 1.17801989521958, -0.586673038641123, -0.720145402547367, -1.07865636661019, 1.10046791652892, 0.294019371644099, -0.369329929683335, 2.52093421442711, --0.412395922106032, 0.443162777267726, -1.31942309820401, 1.9346460767674, 0.184716695867874, -1.47419956268031, --1.06782097443231, 1.83568047303722, 0.922696771681339, 0.615503632558611, -0.00359746099843569, -0.538068451910469, -0.850476695028726, -2.58055365898789, 0.00583058808778218, 1.13190603209645, 0.123192252091845, -0.65960854077897, -0.643674916018188, 0.0181305003417085, -0.164224136834759, 0.171611683184534, -1.36054836383117, -0.909788505065595, --1.31559271567382, -0.331543562607949, -1.37901963669782, 1.14358017487288, 0.332863564160723, 0.352804342924601, --0.0255327470444975, -0.861776561068059, -0.972252519634583, 1.41096363386725, 0.146124656369987, 1.06950955947412, -1.24174484189162, -0.430291430118163, -0.137297596550127, -1.31596778149785, -0.188003535114191, -0.458661887030219, --0.280884806065698, 0.255068050202249, 0.562609512209848, 0.694245437948715, 1.37694846429711, 0.507172241924487, -0.244014174331882, -0.234760353777071, 0.931528279818238, 0.649081162227254, -0.441617535538874, -0.13451224502778, -1.49358625955126, -1.04008186036801, -0.0880604520856529, 0.802178655259116, 1.75856249829138, 1.01041408226125, -0.252100889926526, -1.2672912656672, -0.209408335516557, 0.278668474028459, 0.305652350900664, -0.720061637452352, --1.44342312163268, -0.159558448044733, 1.03880092081564, 1.35187498742933, -0.513178988202847, -0.372890928515022, --0.403785777273248, -0.133038520381682, -2.30801908027455, 1.50789305857152, -1.17528121042571, -0.145020317627208, --1.07036146549938, -1.07512219898301, 0.0875356410546551, 0.297501430206376, 0.607124364142768, -0.278049726685233, -0.815279754269731, 0.0205913683678314, 0.588006567048692, -0.219283627570602, -1.02337835597087, 0.107563449287424, --0.124647381543562, 0.840728249222776, -1.26926830540385, -0.164826587578063, -0.0918900143098216, -0.769088659032906, -1.44003439404655, -1.36541666428274, -0.380963052865275, -0.19120765242749, -1.11148702648575, 0.982359204815205, --0.476480088037147, 0.366730365737216, 0.730743572678458, 1.19202534478195, -0.242940224587045, -0.588174414424711, --1.31347862828171, -0.811623356923857, 0.045772383538682, 1.42561769701154, 2.52204242175825, -1.39194208532878, -1.01862701748242, 1.62530847636836, -1.16273714316427, 0.743988851685655, -0.250510178033325, -1.48132678802693, -0.37707661560334, 0.554455672074975, 0.599152081906622, 0.775131325803916, -0.941839605421087, -1.13030924482278, -0.593516313286061, -0.666089092793221, -0.627378988455333, 0.277796454102244, -1.77836647279706, -1.39015756627873, -0.522054401801662, -1.1000471266371, -0.24885801295955, 0.556587271051903, -0.462028098012777, 0.421075065824309, -0.260841633965526, 0.180937467617942, -2.01990880050548, -0.642068944977364, -0.196817565304383, -1.22600034424079, -1.99983948934109, 0.31516581216697, 0.0871636491999297, -0.886211128168438, -1.81516217305346, 0.679094181222204, -1.46726686202777, 1.03021725265732, 0.556050884828039, 0.838083397690029, 0.61162558505053, -0.283548657532079, -0.623646844857113, 0.180299072687556, 0.989283090631373, 0.00860686135101289, 0.674372945709632, -0.913931081605209, --1.601148306633, -2.44353986419761, 1.09934832304785, -0.593995940934495, 0.354015887571534, 1.69452624756803, 0.10062648647793, --0.749601967599805, -0.207055308022061, 2.01259023319167, -0.590521924509568, 2.03735472540559, -0.980013443601623, -0.782081627856407, 0.438848731546319, -1.56461782853383, -1.47321667460632, 0.18374503923404, -1.693229661089, 1.33384447188907, -0.525651052369496, -0.727940076574138, -0.411663853624183, -1.52159670573236, -1.28450284945411, 0.21126932308974, -0.400658243417291, -1.58856017144616, -0.561586158241826, 1.31959043354246, -1.65073902720827, -1.64697990423745, -0.497079851744304, -1.41916639972418, 0.755117638238231, 1.63588354360217, -1.08871221411288, 0.34733989700057, -0.262000146504765, -0.0731264415284123, -0.296043961327395, -0.320236523983157, 0.3242596472957, 1.23404859808586, -2.07868483143679, 0.653020679833005, 0.283383887844783, 0.990838960656795, -0.681322221796344, -0.27219738720089, -0.7093720188081, 0.722715412884079, -2.5017310797349, 0.0494379211904567, 1.14716840758524, 0.48106878682512, --0.0950581084269564, 1.83445763812645, -1.85759767806398, 3.74420149290016, -0.196714360673978, -2.45128078132629, --0.405084691053262, 0.745443532895389, -0.217701938011781, 0.0600139929289447, 0.0644270138653453, 0.828087477259995, -2.41222095621059, -1.94726130347487, 0.675229643747019, -0.645090070197937, -0.513543617797286, -1.44063155508163, -0.230014845675668, -0.8599126006584, 0.833462545262289, 0.558117519494534, 0.986658617572268, 2.25562370740413, --0.631242577896926, -1.3216984825145, 1.05613381338947, -0.529237989734255, 0.503424043940422, -0.758200376195171, --0.147210782101746, 1.81373643660559, 0.685830862316194, -0.437887235883775, -2.1037007035352, -1.452998046444, -0.731969380400852, 0.753180053075347, 0.00496399384847594, -0.763546243375559, 0.610238237054396, -1.74092516483057, -1.49613559272435, -0.0281259724952576, -0.651259181214439, -0.644763960879774, 0.385545913462656, -0.424044450940692, -1.25610251016238, 0.376615171712147, 0.0833697032086776, 1.28145632706208, 0.322500810508579, 0.606334032768206, -0.360502724762235, -0.868831549126975, -0.463282053046925, -1.01722987512384, -2.41268166296142, -0.877645481069115, -0.71490752392489, 0.791067902527973, 0.837259455312118, 0.360748452858734, -0.856061168035642, 1.36550187092889, --1.15756445551869, -0.150775259144802, -0.330864220346338, 1.35675556563257, -0.634658744071964, 0.752482217989334, -0.999324322795972, -0.306773224189931, -0.868006007760488, -0.905779419615912, -0.607250712328048, 0.487048136624791, --0.337183809106253, 0.102951749353911, 0.544501243559897, -1.01699656882139, -0.227055421977601, -0.349354959549795, --0.772637718614898, -0.17798044742495, 0.452392128946779, 0.840846223330017, 0.0406622304815918, 0.547671155850216, --1.6783644121941, -0.701195220319686, 0.305545922161997, 1.00709593530296, -1.37981014625554, 0.153828916628079, -0.925139256994705, -0.205753129963412, 0.301269526178115, 0.075920475425019, 1.34960799681079, 0.590412256899033, -0.607655350631777, 0.132851123519871, -0.144833362699161, 0.494308942187153, -0.93574525812581, -0.98609259355006, --2.0052624563358, 0.0390420165009069, 0.670371730083108, -0.193482734163494, 0.238429624279532, 1.51757217547735, --1.24438060433033, -0.609724613443666, -1.69026590325673, 0.685048105109371, -0.0100556671957269, 1.4013986365938, -0.868601181246126, -1.19475339620928, -1.86953391451262, 0.920379129649868, -1.18949970892545, -0.958864034048322, --2.7424150037536, 2.2289310068978, -0.513587099084902, 0.980868299478053, 0.874276850552634, 1.71227567711734, 1.28405798840044, -2.18360979295492, 1.09100828752394, 0.527936688226681, -1.54162336082202, 1.67087620045011, -1.71463610343865, --2.94476215882639, -0.083554651920782, -0.465484792579747, -1.74752690589908, 1.44829836755897, -0.139768114526439, --0.154952908242528, -0.911922082888691, 1.3922287321666, -0.543628269402737, 0.114686282883398, -0.196662844326625, --1.41754321175357, -1.01350190242624, 0.287688804133854, -0.832259436872436, 0.541410695450004, 0.695471439936616, --2.03601705455446, 0.79314716133689, 0.933957393105774, -1.33809758476099, 0.119221928789072, 2.00148333756039, --0.515949104689266, 1.11654236235935, -1.38429359334867, 1.03489877245873, -0.0396837073251049, 0.603101971599917, --1.0140267523321, 0.220347322721702, -0.059375742709994, -0.249996003835183, -0.301179153313668, -1.21650932149279, --1.44423334127816, 1.90437290722641, 0.479702169042656, -0.158146114789921, -1.55577376419868, -0.242376155505216, --0.0187086036743671, 0.121490391607575, 0.529608155864286, -0.603217471993787, -0.674629338479653, 2.41475820853492, --0.724159666623, -0.517452277737852, -0.533830927823549, 0.528449234883961, -1.85394831889267, 0.438061964694434, -1.30045867427045, 1.20813404160755, -0.047481153869649, -0.214902457716818, -0.728824679142889, 0.772455331035215, -2.48081817213988, 0.825545064859602, 1.17591197197134, -0.46437866877145, -0.846357176246362, 1.32366413553859, --1.43726790421629, 0.583536381473618, 0.117365091709443, -1.50041013435308, 1.11995596517927, -0.391083916419514, --1.2627187415195, -1.53184544124751, -0.583681803498012, 0.902200926291631, -0.922536172021043, 0.645636841154643, -0.54165037217532, -0.885240692159938, 0.885466729031407, -0.372427592839556, -0.0695718540206667, 0.862273445542995, --1.12181782931092, 1.28504178394656, -0.489871848987026, 1.52846085311843, 0.19605316592762, -0.551953059844806, --0.159703157602388, -0.0651234988745126, 0.452913853797053, 0.504741851083371, 0.622768463900631, 0.816674011202948, -0.104778804464658, 1.08573489739494, -0.528029862164413, 0.0327688798603419, 0.234106732065385, -0.385317514391063, --0.692302969793542, -0.463083842825973, 0.390694169340507, -0.722119837886351, -0.254502175102988, 1.60535491277753, -1.37500101626621, 0.180855488757987, -1.19047181963855, -1.46132594627286, 0.0330102370824705, 0.571930085158133, --1.19883056427719, 1.06314033099996, -0.420118351798116, -0.617375030104416, 0.4391698741018, -0.0457834091012115, --0.0287118233368874, 1.17662070429722, -0.97935624471049, -1.89285104597983, 1.07978345003726, -0.262089403932588, --1.43677207392493, -1.23884158783146, -1.00073108280695, -0.555235486522018, 0.879935761493538, 1.26174877061941, -0.731524752422609, 0.775118212051823, -0.604001102696297, 0.224452048854299, 0.304171769065205, -0.102244042164429, --0.99328395796649, -1.31409748343542, -0.889251570748722, -1.12212807264228, -0.522273216385187, -1.30370653052614, -0.61843773319556, 1.62524410443268, -0.929906310428374, -2.09638243369458, -0.507248121227788, -0.474958008165473, -1.59188009555742, 0.928124922312575, 0.287195896223284, -0.195457419454389, 0.353010691748332, -0.586688611426205, --0.910540281288637, -0.662211989276492, -0.491604396262942, 0.586189367376227, 1.30776228071731, 0.75972986554818, --0.878136811260066, 0.107795770322281, 1.12902567233128, 0.447293566060931, -1.17711631416495, -0.973944387140202, -0.225833977346034, -2.40050433588545, -1.51953230903702, 0.980223653027183, -0.170450038822228, 1.08644134775569, -0.787302270533097, -0.0910547150953861, -0.309313690683166, 0.0172073229263382, -0.801279589214151, -1.18857609013151, -0.512941168787184, 1.03861577494425, 0.213181512758313, -1.14427579122844, -0.694854080349734, -0.393441810496811, --0.488612937244456, -1.23633831963208, -1.59540062383997, -0.892228183164052, 0.925677058749021, -0.220666887224635, -0.0052686269285507, -0.501252686666203, 1.71000516857035, 0.507114952858729, 0.388402660198106, 1.46782542271278, --0.319241545825161, -0.811174021898494, -0.365739750568774, 1.06991485483143, 0.847526496960662, 1.49388122592419, --0.592260966722841, -0.490493432254849, -1.27261930261387, 0.481219111694695, 1.04242898064809, -0.730257796708091, -0.0910932455067344, 0.328271752837879, 0.0239566411411615, 0.76959341200323, -0.943058164197848, 0.0180394139518344, --0.115362883202373, 1.1936322016132, -0.0818655576015089, 0.414503018783339, -0.75457904065538, -1.28642868412683, -1.20965674526623, -0.752013357315815, 0.682718912812363, -1.19305981606806, 0.152410120453575, -0.224728374961496, -1.08877022320099, 0.436943394823431, -0.189026755269878, -0.634279674538215, 0.823119726646554, 0.880172134686172, --0.0447156930486705, -0.963801612188454, -0.416791424720539, -1.69160737668884, 1.39855152605617, -0.725808341462432, -0.416194708395776, 0.670447396679833, -0.965178737620457, 0.147570332832117, 1.50208650968351, -2.10325090788906, -0.51489111179983, -0.489473860260901, -0.846035087909233, -0.606456345093166, -2.29037933795033, -0.858798944599084, -0.386800650765045, 0.163983278715495, 0.89020622646001, -0.534592078562149, -0.113524651167587, 1.50211826053142, --0.879280199890418, 0.198155402696382, -0.333357638782843, 1.19535304249807, 0.0849840756155935, 0.314253119488943, -1.48517850966252, 0.256782508543902, 0.296046429821462, -2.07984479549609, -0.361596459442319, -1.5947729688399, -0.300524462143029, 0.014095977907088, 1.90173424334073, -0.506415407701605, 0.749415081634598, -1.55769537440991, --0.587861842660947, -0.476142557788917, -0.288813280102892, -0.7608141850186, 0.239267155861965, -1.55632418841623, -1.12563501687176, 1.8124188084714, 0.336732462460169, 0.315308354887601, -2.67072142783041, 0.536785534595554, --1.37227132708417, -0.416161389284952, 0.641173778547103, 1.17446050599937, 0.505607683603784, -0.459995866605658, -0.84311521767527, 1.11849937424014, -0.0197533136649941, 0.0746435156734318, 0.995137765783989, -3.33776970825525, --0.313900137029393, -0.613677430364697, -0.408775764633731, -0.240694874017913, -1.70184108207645, -0.0430527468534835, --1.44061237209769, -0.833977953827917, 0.314875907598394, 0.401023573210229, 0.103876482427885, -0.950495505236488, --1.01645713680908, -0.452513136280408, 0.158689784326942, 0.864968645395036, 0.224666266363358, -0.23654092498969, --0.982245474091511, -0.305013002781893, 0.577534394195128, 0.394106636890583, -0.0876924188597212, -1.27480289176902, --0.488873621741308, -0.744021306384625, 0.00588777425268877, -0.126199225957729, 0.377331200402941, -0.217040234639827, -0.114116683614131, 1.40187278441875, 0.22884571084671, 0.0523774007161087, 2.40043019266197, 0.414921912787461, -0.269671156522759, -0.592868126515396, 1.22487280967423, 0.724088640741634, -0.46506034545425, 0.155556315101235, -0.179973371918225, 0.497459009961722, -0.175275313377792, -1.90347358622619, 0.0627286855722903, 0.676022760430271, -0.00543396862788553, -0.368507407908448, -2.18261913314613, 0.492184880704127, 0.249945506386625, 1.11026879129376, -0.96663021871109, 1.15765975857363, 0.449229569983505, 0.157538798309015, -2.89243338667229, 1.64833340915353, -0.793659947082685, 0.459068312862946, -0.39360310992306, -0.625984289008391, -0.895066504319677, -1.14548259964535, --1.00104763621386, 0.144695922002916, 0.547872574522133, 1.62436592160338, -0.709827060773357, 0.0149829239774565, --0.274627219067887, 0.868934571361812, 0.437572859749185, 1.71152144434291, -0.147316532136273, 1.11546279396419, -1.03421227139897, -0.524846139039139, -0.0948251105713194, 0.0291608590904736, -0.825758981485767, -0.549308321431302, --1.1649342990865, -0.371289723932661, 0.515335208641767, -0.702965393225223, 1.6837547703668, -0.50983562655377, --0.461380502006488, -1.5185997847507, -1.17940431505679, 0.0105785987842987, -1.05321829732528, 1.61307843557808, --0.819071845993046, 0.117275550915765, 0.303389880903329, -0.57372712136489, 0.411406113879405, -1.11248359096276, --0.804776191458503, -0.131377648688595, -0.190569678138867, -0.954889529412167, 1.45673425493669, -0.0234525773266622, -0.77449988898121, 0.490784957446195, 1.54659220575458, 0.0265403322222445, -1.20942285041198, -1.63429089692243, --0.0748703161911561, 2.6059284370775, -1.53572110336136, -0.983368283397652, -0.264904112353301, 0.417621321628038, --0.0623869660753054, 1.48259161353872, 1.00037282371051, -1.30295516388447, 0.0306395888084127, -0.38174945348081, -0.682724530374844, -0.928378497169629, -0.591634896802373, 0.537821925645159, 0.122926679774786, -0.569700534422496, -1.0720010480951, 0.478321387201596, 0.335098045087374, -1.13239435900684, -0.590779119692552, -0.563362252250031, -0.681672936328145, 0.659251235999499, -2.11639181429213, 0.19695973175728, -0.0557209813842546, 0.526003514414002, -1.49446229819161, -0.296284413249257, -0.285522473142868, 0.521988172958165, -1.81514459455943, 1.07026673738878, --0.394494238015966, -0.403713675972838, -0.563012645367835, 1.19582586153523, -1.19958788708462, -0.0891645549135418, -0.998270305644457, -1.56163352136722, -0.923449834232745, 0.708973876474614, 0.105017778274589, 1.16261013821389, --2.18220817609864, 0.781924262630188, -1.27371338299456, 0.960366571678854, 0.497996279679021, -0.353939394511852, -1.10767484324117, 1.36868039311475, -0.716847669708878, -3.40627913884099, -0.405516772524844, -1.76510573216848, -0.835272508094015, 0.304826966539743, 1.40967159692527, 1.70046028985901, 1.37444848134925, 0.162060759202135, --0.324707220944139, -1.04233651943355, -0.841208425957212, -0.0914796408711367, 1.20964154234929, -1.44041485633938, --1.74653163500763, -1.61904028940651, 0.765826829148783, -0.858767027950641, -0.217489443913257, 1.27857618497344, -0.166742634435604, -0.28657589411211, -1.55022392425857, 1.18522329881917, 1.61249207098121, -0.881790104988677, -1.09130872917435, 1.99128099512706, -2.02851363650594, 0.699204806773316, -0.212088081594598, 0.701917048236424, -1.95835643819231, 0.248634838552023, -0.833520936433902, 0.907890615500798, 1.15068178291335, 0.126223445401361, -0.877657970418475, -0.926837421130733, -0.249071689929248, 0.440747378730898, -0.619171955452592, -0.277642384257391, --0.42649918721058, 0.323203816634237, 0.586141210566742, 1.77592996472685, 0.869605346756887, 0.859012713707563, -1.7446217606337, -1.30247407875009, -0.404598634750408, -0.600952775182009, 0.339938717984097, 0.803008308406856, -0.242401030991514, -0.238496392943892, 0.532285239284656, 0.915520573469877, -0.663570284719937, -0.252636923845207, -0.365932270534091, -1.67935972680056, -0.471359403914049, -0.909450027773377, 0.0924919007767871, -0.676038204466263, --1.48261949943218, -0.14872628412988, 1.49263667566715, 1.08806098269958, 0.350521514128544, -2.6384853573851, --1.62044245567207, 0.528643078925186, 0.490376796389848, 1.21748071563102, -0.868242925804245, 0.851523107052554, --0.451502820781498, 0.387504592102721, 1.6249181154754, -0.515603366099278, 1.19804856977725, 0.407842641195093, -0.693510955933961, 1.57785503832991, -0.35198448572148, -0.777965738404467, 1.14817881491364, 0.825121143883656, --0.623624087432592, 0.641906331687957, -0.775389381104951, 1.11829735912651, 0.508221360322064, -0.246938828617406, --0.644933906590653, 1.85680105328145, 0.710070266262205, -1.36813238687702, -1.53214656614242, -0.195840329981101, --1.16938515552777, 0.772334901513589, 2.0274162852817, 0.912814298164919, -1.44817001404664, -0.794249844022514, -0.423826419529836, 0.573649459803515, 0.303242842240415, -0.210877173862807, -0.604678034489242, 0.28948815947047, -0.00517172508007832, 0.0177858009795179, -0.626193982885731, -0.23554944343405, -1.28480929882158, -0.0840503186333428, -1.73424439138206, 0.598055983626345, -3.27412074156162, 0.136777373656113, -0.474495069767028, -1.90173109253391, -0.453438623267501, 0.20446897854053, 0.487343105007377, -0.170595805805571, -0.565956995194415, 0.287411615760936, -0.431339910829127, 1.72232181166321, 0.213578163320812, 2.15400663923342, -0.386428911556757, -0.0810307643185016, -0.0481346241779248, 0.425959810332466, -2.35603802066369, 0.664642528566765, -0.221355366635686, -0.906265688039477, --0.550931090091875, -0.106789179767064, 0.227543015040075, -1.59526397489797, -0.663889799576384, 0.382118866166986, -0.560801041701771, -0.370513295692473, 1.05971999294685, 0.0328297006852786, -1.22579558674634, -1.74082067941716, -0.0160998795496592, -0.157882798408332, 0.597795893613907, 0.913659327637649, -0.5895634414763, -1.90714191933219, -1.89297387574516, -0.0116879431856029, -1.15764754429027, -0.112947373027393, -0.589062847477925, 1.46748201638156, -0.0417301600825901, 0.889054085970965, -0.0862262716049879, 0.230588289131395, -0.720872490787245, 0.117501896336234, -0.776108328680504, 0.639261239347282, -1.4110601951825, -1.73098380534289, -1.83136409088455, -0.166672195735054, -1.12840739099333, -0.564256238257891, 0.0827029968161687, -1.44298380220381, 1.14144446759051, -1.3279351404928, --0.948762208138735, -0.606518243611425, -0.575583636723711, 0.170889526608319, 0.810070310972348, 0.683547666852017, -0.620520614916275, 2.6376159003694, -1.00446322858682, 1.32983503260022, -0.833612314218252, 1.16470956284931, --1.94645808503105, 0.541370870321096, -0.569259970433027, 0.252306384755654, 0.912482912589704, 0.368289791020854, --1.66062915980244, 1.35860844861717, 0.250589379113161, 0.128328008732725, -0.682164893777092, -0.899430048457108, -1.63906918925839, 0.857011275445598, -0.0199338050756313, -0.054712102853279, -0.598028036898542, 0.662775301077336, -0.42189687858654, -0.44455594234139, 1.50876776349078, -0.992033536950185, 1.74700516928621, -0.868998307457853, --1.91426425286015, 0.982483535784173, 1.23646490301956, 0.340648207100606, 0.417982005781174, -0.706795289941678, --0.736857921401918, -0.523952830132619, -0.875962929781466, -1.8285380873783, 0.337169744489456, 0.360654343541392, -0.478416979497256, -0.732463449105832, -0.15785065480725, 0.173773071706126, -1.74489894185161, -1.17383324464839, --0.230954005835891, 0.960652716118998, 0.60602420296439, -1.98931860029417, -1.08917161412584, 0.454985701566058, --0.531835258067243, 0.764110605247308, -0.0819686485133494, 0.277720209936118, -1.06097510343744, -1.33138250917244, --0.323567421210413, 0.4787906109219, -0.612236700561976, 0.39387246291345, -1.00077416483459, -0.275512999935775, --0.875217077728472, 1.11056590905028, -1.68157851704947, 1.83482177306002, 1.44487907217346, -0.428639628980824, --0.77999738083666, -0.668549571380242, -0.479929713300946, 0.391004936544739, -0.157148011931097, 1.67481093731411, -1.00294473931934, -1.2290889648819, 0.757890044599369, -1.14638421664005, -1.4994679230309, -1.34185462569408, 0.98515272117472, -0.200285766083351, 0.0854951565731757, -0.189575844287034, 0.157483650075946, 2.4289026152442, -0.825020344549312, --0.436113277165971, -0.337630893245779, 0.815432583577486, -0.884249528045601, 2.17853399590229, -1.20460781691575, --0.377235781824331, 1.10373225739648, -1.17458720571168, -1.12958169690289, 1.54708261575313, 0.199839272159252, -0.831298761776383, -1.10332592488133, -0.5549231826542, 0.378387087138659, 0.372494566978646, -0.449607036876476, -0.437486497926686, -0.982955023022519, 0.452602622651348, 0.0825521595494212, -0.326812062686985, 0.832643558840222, --0.708151574955301, 0.805902160781741, 0.539068051094765, -1.15458424494409, 0.410367824080005, 1.2021594118627, -0.239427824025259, -0.090005841044823, -1.15328725214624, 0.197847462351308, 0.94488832718051, 0.504243586150205, --1.50766920201619, -1.09871002770372, -1.6078782528487, -1.30776646597021, -0.0589736824602939, -1.48705153076799, --0.136194006800959, -0.402504507706494, 1.22859875446381, 0.444136517536289, -0.181845206793202, 1.08859657181147, --0.336805957275501, -1.42694664405392, -1.78684215072188, 1.09892533461685, -0.30579042616781, -0.566046312319842, --1.71245268386562, -0.505318696137457, -0.352146914640957, -0.632826715781648, 1.50385767701593, -0.43918477668762, -0.438704440878257, 1.48023587355193, 0.209943527278552, -1.84686672080471, -1.37381910135801, 0.0475157690963251, --0.78449435563021, -1.39325329793425, -0.428343104759049, 1.78202593003416, -2.03254001335879, -0.156633483076023, --0.309669205924216, -1.01519301656018, -0.0897286475752248, -0.892594602000219, 0.206973455176728, -1.82623265165107, -1.03983321881693, -1.34470465809401, 0.305873608357415, 1.04626303730347, -0.955910870407996, 0.957119513348806, -0.925656637374024, -0.384438990534413, -0.614131186439384, -0.0147761867015231, -0.778587742329379, 1.47906440793067, -0.161900024162051, -0.741616741010153, 0.444689460805033, -0.175938991826459, 2.37472674551352, -0.0494419663886837, -0.655127640518765, -0.861371228247139, -0.0282537201498121, 1.03262868316592, -2.6063487422958, -0.693657282017213, -0.247854725645786, -0.219570295232754, -0.503267908604094, 1.19168995114743, -0.306876491345661, 0.350928991344612, -0.991753218231546, 0.596671489375331, 1.24893211125811, 0.40032470157887, 0.447118567870377, 0.243462783454202, -0.513902517668952, 0.321676559197953, -0.425923831600431, -0.198518188045413, -0.670235267701958, -0.898463874786154, --1.21048545322765, 0.83720076990269, -1.06528274141401, 0.53233896805553, -0.0835787480130151, -0.113454839900376, -2.20812907775948, -1.09480453960499, -1.26863423695808, 1.45535890375428, 0.840058975462831, -1.52695912468778, -0.170365557554929, -0.805982962356975, 0.471892557626206, 0.10869997696508, 2.01455366037265, -1.2699180426591, --0.384155761755901, -0.0235272347822185, -1.17748756414784, 0.305310055960868, -0.625638772923144, -0.714962350566834, -0.549719517775185, 0.344472247315064, 0.540429278196908, 1.02079710213298, 0.119600845399067, 0.100288125965191, --0.489039775130291, -0.662846597613106, -1.13026250197095, 0.131479766263882, -0.0125275225289782, -0.0877757044870778, --0.299487275755982, 1.26854959458272, 0.25705269105216, 0.341089186718264, 0.345099809636558, -0.970191146846263, -1.8264930242581, -1.24924286321739, -0.0295240488800823, -1.62013972398385, 0.114796928762367, -0.420636323260762, -0.20879524610279, -1.18154312942209, 0.311423466451, 0.73536356324213, 0.419871712641118, 0.793337700313134, -0.767577172506193, -0.281388349603991, 1.72827140634102, -2.43031042206642, 0.48142625603874, 1.42725771954708, -1.08776446134425, -0.534412651191843, -1.31928939330644, -1.4737007175126, -0.0884746744264758, -0.282868603893982, -1.51484340578365, --0.510328344208779, 0.613353433506262, -0.623193280997066, -0.308755246789904, 0.124056032149149, 2.07224306772823, -1.29935979241835, 0.871769629942711, 0.817185506116108, 0.557018307304839, 1.11561839064919, 0.390915001711932, -0.189737262631524, -0.0828207333696314, 0.706970887987222, -1.50221686788416, -1.31734579052602, 0.210953061156245, --0.531652302588179, 0.872230653119666, -0.275349264392408, 0.359268556808796, -1.22925394273602, -0.764715176489264, -0.346067871256298, 0.574345140441132, 0.926319797114362, -1.13534175710701, 0.180706618570202, -0.0500635954619509, -0.220223587452199, 0.18263248328062, -1.54850000136067, -1.94062000800588, 1.04685965876802, 0.13319399252132, --0.205717574888209, -1.12232982652721, -1.72478674249267, -2.35938121798099, 0.0991482360676786, -0.278182175235481, -0.557572083802879, 0.0157682729655227, -0.86185563492336, -0.0269863749317823, 0.797943767209136, -1.22344714914758, -0.616488674464164, 0.745597582744067, -0.151868121842804, -0.616171281175043, -1.9342316735701, 1.04719809159679, -0.126169297651628, -0.435884209867197, 1.24005465670033, 0.324687367113607, -0.139757304919371, 1.2120567663575, --0.519687796220638, 0.109862457836965, -0.382704055872224, -1.39889206519774, -1.40094819297178, 0.543940233665197, --0.181744696145154, 1.50834412418208, 1.91551023733204, 0.866626770515173, -0.363256133364127, 0.0526880100300545, -0.927953633701019, -1.70940830089082, 0.933949123408569, -1.34832751297425, 0.484079542067548, -0.0331825473012523, -2.31424142675311, -1.05272331111529, -1.07374425194689, 0.605312058497415, 1.08030318654749, 1.99231452603605, -0.00327832768646913, 0.890217719132376, -0.456423863967802, -0.306252219093865, 1.09131428858736, 0.464457525993265, -1.31653584382377, -1.30003258615527, 1.20488217620105, -1.13472941213657, 1.3911551666834, -0.257305865718615, -0.515497060761168, 0.571019065309533, -0.288577525573997, 0.658570490458951, 0.77281663602855, 0.918308702269429, --0.284374298054888, 1.76874425153429, 0.53990164548151, 0.049606435750488, 0.250794824924444, -2.31722898370417, -0.200358115900863, -1.81734078518517, -0.150041254747449, -0.24622420989221, 1.57511830528178, 1.27376337296086, --0.782094969358559, 0.867622819784422, 0.526271908487527, -2.37014550962822, -1.68701956951567, 0.206801988380831, -0.642503569756369, -0.11786573209627, -0.979245349212138, -0.505384816782853, 0.439932313623542, -0.637231325206092, -0.631586851978588, -1.26648562195719, -1.3520211221035, 0.914370722755252, 0.171458298797048, -0.145654336480909, -1.53198812011363, 0.630306213180128, 0.547278194170927, 0.170200730254245, 0.0605384081510611, 0.0636776137471783, -0.866295569448035, 0.867847034650347, -1.00757457211965, -0.621336955831796, 0.310168915801165, 0.651836359352243, -0.231160889615635, -1.22574852353819, 2.69019440788199, -0.696092244696305, -0.415680745052475, 0.157586794840594, --1.1107316241956, -0.112426484135226, 0.553266052319703, -0.722453423729968, 0.20962404178469, 0.0987110701573598, --0.109314669558112, 0.474992452527201, 0.657537618570311, -0.26160531495232, -0.0804471507299054, 0.816216268076882, --0.939535806437119, 1.16901552216559, 0.325221424167738, 2.26432999445083, -0.617900528823766, 1.11750103595582, --0.460581374832559, 0.393365573930767, 1.07476705018218, -0.958007540029886, 0.36973280859453, -0.456537386374151, --1.03306033098588, 0.581069423688402, -2.11842049929415, -1.3278643957806, -1.51398007166845, -0.34565371319696, --1.59725285037877, -0.59212673536256, 0.0311890653814737, 0.392302908971647, -1.57890778212524, 0.179509585737979, -0.289586980063629, 0.807644981255497, 0.151100622646287, 0.303614044825513, 0.872169730850451, 0.58693819689413, -0.156771157774847, -1.07492592307486, -0.895372640866238, 0.212162912904251, -0.0961102710661513, -0.194469276422664, --0.42539961028174, -1.47765051313287, 1.15516986229365, 0.777983256465292, -0.670241105230494, -0.47063813718095, --0.59483342983408, -0.224786057504133, -0.18638446736537, -1.14434567001474, 0.629065377689324, 0.98271633100275, -0.67098091573378, 0.100774958058887, -0.618144776903803, 0.726721769051415, -0.0579028506453517, 1.9583723839426, --0.27961440807859, 0.207844803682323, 0.297558323997326, -0.953987829242271, 0.0358641494569674, 0.635835548146137, --0.129577652812665, -1.95367672545353, -0.224729570684868, 0.23745454648151, -0.296205867344559, 0.187067413998713, -0.774339453889433, 0.239273142363148, -1.35353225918912, 0.41179935803692, -1.34220484779532, -0.09410347388729, --0.752907222493914, 0.312095553657885, 0.107175722776883, -2.09340595480844, 2.63943637594235, 0.745576263800836, --1.72519675264434, 1.48228324988244, 0.435076100450997, -1.02138844953709, 1.07537249207568, 0.425227459457305, -1.64902445269646, -0.262818729311129, -0.829269263200198, -0.0702233081930539, -0.563294921423415, -0.822023971696543, -0.350795987922701, 1.04833340826122, -0.242197295254762, 0.791932684525532, -1.54302750059725, 0.356649397138778, --0.21303792156479, -0.436523744712912, -0.319846254353622, 0.431970988307004, 1.46512536643139, -1.0166269191291, --0.443062206973839, 0.871832323584903, -0.172683912343996, 2.11317872981407, 1.08822925616407, 1.84185234700568, -0.915223052496004, 0.738842249678943, -1.3248002350905, 0.704434261709433, -0.0963474637563128, 0.473135039100486, -0.276157232412421, -0.697399663856365, -0.0226145592132506, 0.240581019613406, -2.3926791916351, 0.87210649709499, --0.398867027451092, -2.69115425085837, 0.189039161871914, -0.969721655789241, 0.141191051077223, -0.570297036056226, --1.69595237293123, 0.336205709519303, 1.19254324218825, 0.821122680705742, 2.3151185052982, -1.93477607212062, 1.40944180858748, -1.16873689571824, 0.738239321986172, 1.40250110065242, 0.442314207689339, 0.53968982917529, 1.76827453144644, --0.222024473998492, -0.271112703609234, -3.05515412142685, -0.993072231649324, 0.132907847613425, 1.05933602881877, -1.90816027356437, -1.18094237393181, 0.897185067116582, -1.93028128666534, -0.129367993528905, 0.294037728125743, --0.0484409066053376, 0.402034316566401, 0.0587419151353402, 0.223883145026718, -0.198715973211082, -0.512632878169763, -1.12771337769273, 1.7634937489595, 0.515022250623139, -0.888977471957812, 1.69103245110447, 0.320855259660323, --0.605603980110899, -1.38540047096603, 1.02482850569836, 1.91922392968882, 0.957935266476087, 0.451282052378319, -0.0508775751501725, -0.65572082813317, -0.69721562055968, -0.0186199240270164, 0.314152765837001, 0.495564212029439, -0.198299403379932, -0.0825036348131544, 0.277251375386147, -0.339434831608078, 0.296405832672205, 1.29022896186729, --1.11338828625918, 0.210715573445627, 0.612578053274798, -0.11859335349638, -2.59019571460861, 1.43565730910564, --1.58968729660999, -1.2541974980453, 0.0822872658666755, 0.379016760803531, -1.60755566592272, 1.02263975828624, -0.981030565394271, 0.497702802712945, -0.345689394585296, -1.65044715322888, 0.702210561047191, 1.51922015054356, -1.27340812654402, 1.87276772067901, 0.701181623250603, -0.746234014540964, -0.749484864611746, 0.837394669719113, -0.972521692657187, -1.20388770155128, -1.23474322795458, -1.4379608804842, -0.6771949185621, -1.10108333231247, --1.32615254430061, 1.06486529531715, 0.83335365697047, -0.155056349438279, -0.899425226474062, 0.157654936114623, --2.18220607868867, -0.372482710122811, -1.00661401267864, -0.160347598058086, -0.495112145581025, -0.762432116101992, -0.230226903514656, 0.0796916197855206, -1.76659885049259, 1.94402451889293, 0.821898527898587, -1.04928958118244, --0.590735778696244, 0.0743791471207893, 0.00442790945887391, 0.846425759692521, 1.22167516526069, -0.484151335970577, -1.73514467061434, -0.436229730433633, 1.57453926652303, 0.216493792806901, 0.642897124257289, -1.05419173373894, -0.558048695602108, 0.124218225302014, -0.00786512525292688, 1.48467131744997, -0.336965814252221, 0.300176128354916, -2.0025944888563, 0.578631103004985, 1.23696871108957, -1.48296741325882, -0.924204094708291, -0.833252576393751, -0.925827671797588, 1.21121688293563, 0.604249438578625, -1.40513509223086, -1.74378018843892, 0.132849833491562, --0.29264638793793, -0.705506297202938, 0.137373565655511, -0.309448228690439, -0.539030297769144, 1.2087996322619, --1.04689912194355, 0.353710258525669, 0.110354954004858, 0.181249621979462, 1.18551624270153, -0.9489689028392, --0.67659076447159, 1.95165647167184, -0.256172664794566, 0.123018818364011, 0.257841380014095, 0.856166261426656, --1.16644593807385, 0.0134614956989079, -1.10863092120993, 0.303537692709154, -1.41773944725836, -0.900609825117432, --0.322804208837855, -0.604927497184723, 0.0874221717585555, 1.63165254297711, -1.33737594250694, -1.50521592853662, -1.75446485075999, 1.24194066850016, 0.109373070565896, -0.314305738551574, 0.119097935978052, 1.12110781985266, --0.521919628780204, 1.40676994458224, -0.481338181472851, 0.123775647067427, -1.8308515309642, -0.0369239044009395, -0.996418086585829, -0.257599421935913, -1.33569923521143, 0.0576481361832372, 0.138412554859758, -0.934932016640056, --0.179599249442556, 1.29446754569069, -0.974359069504124, -0.515305114232146, 1.24789536214026, 0.554000467451896, -2.10312230775837, 0.979034097202763, -0.194977669023146, -0.851703603404847, -0.606553774274131, -0.0423268169584658, --1.20744519243785, -0.69686103939525, 0.68625132659975, 0.197871953240167, -0.86441842648903, -0.271887520501576, --1.58070292649677, 0.500298593487968, 0.45177913969389, 0.551302478941007, -0.940006871145194, 0.408861214317684, -1.37086352052492, 0.664246924979728, -1.57762830805247, -0.502516474610773, -0.889216222709527, -0.174733028215441, --0.406481284273447, 0.0909549551812133, 0.692121845785003, -0.354754986667173, -0.782196206230475, 0.159772159628149, -0.046994414325189, -1.63548949952878, -1.38046825452181, -0.893448588533602, 1.20705914698526, -0.291143552722926, --0.168327749410092, 2.00402113497221, 0.762171608332494, -0.0873564007187299, 1.42019390864229, -0.782991272297674, -0.430702390955035, -0.54386248205833, 0.548191671949958, -1.61201835788169, 1.39963796048482, 1.1914195129182, --0.350549641312007, 0.25119493982508, -0.889583750132093, 0.214080955710834, 0.570329598202603, -0.29419355027643, -0.504139415892461, -1.24682350573416, 0.700161538704354, 0.101671614077478, 0.30492713080189, 0.584789003456315, --0.240395634147833, 1.44388725726878, 0.286943886528225, -0.93766093553712, 0.103599507862508, -1.27130722074533, -0.0690374842312148, -0.230200885251949, -1.10957637773732, -0.757787933605034, 1.39487501545148, 1.57501577357582, --1.62629615590982, 1.49313384666499, -0.896068813708575, 0.236357946167678, -0.626199250306484, 1.77660973658305, --0.174297956075482, -2.30754783841637, -0.336965510913843, 0.68954076485346, -0.0255193383934405, -1.0580439841949, -0.763345732227247, -0.995987900736007, -1.13919133909446, 1.31557874476469, -0.0378913360995319, 0.139364729852477, -0.993833294083229, -0.876484661106202, -1.01975296940074, 0.268576352447383, 0.775710948097738, 0.892735202328985, -1.06938435430041, -0.562357434150252, 1.03835046654676, -1.71901396214009, -0.226256496528986, -0.875876322139106, -0.13155033837648, -0.800737724285143, 2.89578558709366, -1.16793801624369, -1.26170047383967, 1.28475315431468, --0.608133465116403, 1.01456404983023, 0.354313848955494, 0.33176145121122, 0.0470586856421805, -0.237349622607488, --0.252203318621072, 1.2722612301617, 1.42407816555254, 0.303826429886823, 0.804119804327232, 0.235547153623332, --1.42084648035413, 0.312914696099519, -0.525232490435175, -0.896416140513023, 1.17450541829195, -0.344150457141036, --0.918264816931044, -0.421143338876507, -0.201902734244314, -1.11427960317842, 1.93474582806447, 1.36808792925526, --1.52772708262267, 1.0565287777658, -0.172613458099997, 0.637228500851453, -1.2819430967692, 0.119774834216218, --0.348693776139167, 1.46543941542893, -2.22558710131327, 0.484220279285974, 0.833644210834157, 0.827577869933721, -1.26089051682425, -0.293365153483549, 0.45028241347697, 1.08766113543765, 1.69637741409593, -1.27794079618106, 0.78840457103186, -0.682361044374798, -0.606860696755704, -0.00436318543357702, -0.60984578188298, -0.207169124363607, -2.22353641846619, -0.262146344873866, 0.951405052699036, 0.389770424115866, -2.84384857640525, 0.351657119029045, -1.2855414864291, -0.166627575606811, 0.245147250904305, -1.3058587900246, -0.67919717425948, -0.96356090993076, 0.903652551776629, -0.277482355391705, 1.26177016548608, -1.81194755647493, 1.4883327383365, -0.435808446030869, -0.677027617995138, -1.26791788100561, 0.0493563918584629, 0.00817565248775007, 1.25500645200982, 0.0802292823464393, 0.0553439499631001, -0.86700364471867, -1.37590695520108, 1.46395102154634, 0.322862148469757, -1.03659319666315, 1.91296226318399, --2.62309071269567, -0.515197788110447, 1.68985819383873, 0.909697759163242, -0.944350086517898, 1.00355028431501, -2.18266799283546, 2.43498743968898, 0.476304289465285, -0.238464264021377, 1.97183378895148, -1.11236036871691, --1.00025281378292, -1.11737021602315, -0.44927165644793, 0.102712154355515, 0.864442619381631, -0.632793002553936, --0.0654828936059277, -2.40703938978762, -0.733191641293416, -2.16633578608707, -0.184422385693049, 1.07408867996093, -1.09718588867218, 0.709004343495026, -1.15492237016496, 1.6177509428739, -0.229676477068295, -2.03149931183714, --0.336106521119026, -0.419607758827468, -0.0429901759034176, 0.505667757861679, -0.148235171406011, 0.97816067051406, -0.0951142673509497, -0.0998795801828412, 0.586127263749583, 0.613861939974541, -0.37914557485189, 1.64519810763259, -0.0433899037002999, -0.0408689131809471, -0.636591180394804, -1.28138961305125, 0.549354348392737, -0.486268229526772, --1.10977483119691, -1.40495394217203, 0.91145485421702, 1.1093388254999, -0.879598584767838, -0.0275251434866269, -0.240395651247659, 0.386488672060183, -1.91854184851584, 0.531316390848958, 0.184434742776452, -1.39604204009279, -1.63622675773227, 0.468720775583983, 0.837071055097299, 1.14124935504545, -1.83054543668092, -0.170200664031269, --0.812436869321195, -1.7081194809523, -0.580608704675407, 0.933904018147296, 2.54182721875224, -1.00993125797045, -0.254457027303886, -0.127916504979554, -1.00150717250635, 0.358203738826477, 0.179492667916384, 0.736005049345153, -0.143753278291343, -2.47957613120261, 0.148055055451489, 0.656794674503689, 0.932334623711114, 0.311869981500672, --0.0566412735638611, 2.68213304326753, -0.382727178798782, -1.57546261461102, -0.819325042774344, 1.40934368599936, --1.11021649592335, -1.75421415876346, -0.191529964530684, -0.161272641188106, -0.110524498446083, 0.0740933439116165, --0.196633494176295, -0.220873554390657, -0.160601738382447, 1.19665812724116, -1.06725277803968, 0.687123838496067, -0.576893117514356, -1.68124958518144, -0.242738199725905, 1.24782779663469, -1.20384573402576, -0.0259519425423814, --0.448593215001446, 0.925331783596181, -0.781302234572225, -0.661809504317365, 0.587385943446777, -1.5252180533371, -0.562769129453659, 1.01034582882259, 1.85949305666629, 0.0552609795911957, -0.369984968247879, 0.09337327781846, -0.379505929956794, 1.00511508656422, -0.0557065226778126, 1.0285394953111, 2.02469425609347, 1.62514962488503, -0.196993094655876, 0.714656902658499, 1.09763800888472, -0.187062029671667, -0.493694891178948, -0.81533806545182, --1.00214396593963, -0.924050644984103, 1.5102159309635, -0.267362163381074, 0.427487219634776, -0.759546219393167, -1.16788410188192, 1.0010917332238, -0.712729710645177, 0.552850995574003, 0.0852176931780819, -1.12649065502172, -0.160488323139275, 0.0551342867089065, -1.39505182382638, -1.93591730555222, 0.115472893085158, 0.348915755029709, --0.336593347182585, -1.14385433821768, 1.1084097861228, 0.886788286720468, -0.597287789399437, 0.355457653267887, -1.28442070645025, -0.220914566488925, 0.458065485540469, -0.019073555964426, 0.191359960383421, 0.447796644014051, -1.75668275806111, -0.307050554160319, 0.574052800712522, -1.77557365993746, -0.108006005586717, -0.935452516336098, -0.0750706106322691, 0.134797494791568, 0.188604739753813, -0.278658980160581, -0.378685334337458, -0.612567362985868, --0.0112311178141201, -0.124829077189526, -1.60451221467736, 0.431607784013478, 0.807760739424685, -0.741841157079197, -0.478803418600539, 1.64139428340992, -0.456223260834848, -2.76574277405701, -1.30836479675401, -0.482326905027926, --1.11789053682684, -0.380684205553192, 0.651645073947711, 1.33376948327055, 0.774887616239558, -0.422235871892712, -0.508882480445295, 1.21487374471135, -1.60602464330085, 0.834036553471539, 0.335974506359503, 2.20201227471925, --0.842466992314895, 1.39313296196537, -1.17113112508245, -1.53086302494053, 0.790665867703108, 0.0697042163721167, -0.142455044421873, 0.279165687489487, -1.04792308932046, -0.0376376040008341, -0.173511062570841, 1.75921477287461, --1.58961900538076, 0.746817332025977, -0.240451938617267, 1.07592727302523, 0.479585373800897, -0.563095792316096, -0.791268892178889, -0.0694329935897259, 0.420640203737072, 0.636770967924288, -1.44877911971572, 0.283178709281529, -0.377255088555636, -1.49049247041607, -0.287869867466666, -0.227135923384063, -0.763297629662477, 0.295937478694729, -0.986396618269161, 0.341368485709965, 2.08159498095176, -2.16822974695062, -1.20315284971228, -1.08412655808897, --0.686451425631075, -0.423801333138335, -2.70331783052825, 0.480272267345097, -0.275321596240357, -0.400137705957457, -0.947570225072062, 0.93437645117632, -0.0700907832518047, -0.569063003564249, -0.316644948546192, 0.841723750755311, -0.562632353678782, 0.352509365951723, 0.727292001954686, 1.40156987675477, 2.15342188694488, 0.922468518941349, -0.499833494152477, -0.971970409399283, -2.2015083760078, 0.0696520153125382, 1.09110047688203, -0.0100730187033746, --1.22377731836253, 0.45454475742562, 0.330469003720448, 0.928092323897434, 0.629823199294849, 0.375042170787476, -1.1498425860317, 1.55268317366673, 1.25802727706073, 0.487705109384675, 1.02962443779143, -2.28174240692111, 1.06853001229338, --0.507406047630356, 1.26797587652261, 1.02511093680983, -0.401302409001517, -1.7222460474859, 0.456760098915082, --0.790933910647696, -0.0603319580143669, 1.19419180252922, 2.58234908343897, 0.953837473519676, 0.0800665374363567, --1.68580471733473, 2.54078400679656, -0.393301962123334, -1.31809606143902, 0.807584368489897, 1.38497141324027, --2.06312597256211, -0.22549662511908, 0.333530520591872, -2.38398291714227, -2.59885677183695, -0.0148067833559549, -1.7250109663604, -0.991218707243706, -0.708235732322369, -1.29883676427852, -2.50487617387459, -0.0903613710271801, --0.575102997115776, -1.46643309358774, -1.06973098875653, -0.0784360426701248, 0.486936325426757, 0.126908353354954, --0.259878754475587, -0.516603653840304, -0.790326421917779, -0.335597548330373, 0.619091564183552, -0.406011838880605, -0.317066419386034, -1.72913068198736, -1.67470766144596, -0.588393955212509, -0.420914675630553, 0.605703777797809, --0.255817761167365, -0.563099222378557, -0.0307132326124902, 0.654183377382184, -0.817267504366991, -1.45730131377965, --0.00838321778836851, -0.185383952421179, -0.234014701778877, 1.0227112527571, -0.282847166290946, -0.137199313281811, --1.07927574352235, 1.65261008984341, -0.600033633902645, -0.417168922303029, -2.31221222834467, -1.40191666923433, -0.0544134574770299, -0.327394292803723, 0.872874493328989, -2.34831033603946, 0.111878433088551, -0.734985063097244, -0.894189862435433, -0.227570002181527, 0.76613426797407, -0.260656000507174, 0.19559907752954, 2.11841882366024, --0.894624934483288, -0.555994481778552, 0.716590755910618, -1.38567873948247, -0.598452996406576, -0.504839585891577, --1.34591453892682, 0.523476428579686, -0.0743227705192407, 0.729007009242066, 0.344040453675485, -0.0130192873748471, --0.0109466836258253, 1.27816871458544, -0.065058469206371, 0.897104241150634, -0.0538691628426288, -1.81054811851185, --0.905952192287389, 0.374604550044607, -0.46251388106218, 0.149895999391666, 0.0892666628693018, 1.13379613332352, --0.237911892334965, -0.311678168858149, -0.572442593908615, -0.0512336370308222, -0.523540853325813, 0.81752651972207, --1.39048888436405, -0.724731029686498, 0.982423271710257, 0.815098151908465, 1.6122824981209, -1.67886199463522, -1.28747231390801, -0.365915872703457, 2.2055277523943, -0.697173341814307, -0.889760340344018, -1.08386483552127, -0.431744288073442, -0.583069397107438, -0.369560179785526, -0.648239025635442, 0.70222691296944, -2.30866020763787, -0.407852667323362, -0.160851855260237, 2.10072418515972, -0.541972766389671, -0.57065817736795, -1.67789465360522, -0.970330052482172, 0.541295854675902, -0.883827176927362, -0.17970728434159, 1.59275231249526, -0.725217399645063, -0.377481614009765, -0.907664873986295, 0.415131096391543, -0.177559612941962, -0.255651336419039, -0.312629462332473, -0.328082630552146, 1.46213248259212, 0.553512490267574, -0.270437145921856, 0.516250944409965, -0.61209698441589, -1.44819905364613, -0.708150193935993, -0.766508545718192, -0.53972096488992, 0.0690655123876552, -0.510037742417739, --0.341236259670566, 0.248177997181912, -0.603825589839314, 0.819602730287243, 1.99223076954596, 1.4700726044014, --1.01234842509858, -0.568224392473773, 0.690968237327693, 0.717289365998395, 0.989351140725797, -1.11214201350499, -0.0232308201420258, -1.89523654048839, 1.70122294376486, 0.662067717573535, 2.14670784094714, 0.691742786303653, --1.26719502164384, -0.981664054585384, -1.15805166228521, 0.407531773062609, 1.1086515728783, -0.683474450712688, -1.02726127473626, -0.0587614128143404, 0.697641983212409, -0.142464285887121, 1.75747496603335, 1.14338343434381, --1.23735708273969, 0.782842968196887, 1.56825736518984, 1.1472355283525, 0.755848105390344, -0.56604175541074, --0.0314221120556773, -1.44700670796213, -1.64931993063618, 0.316830563596552, 0.251462049442568, 1.96142664934932, -1.33165525381989, -1.06511025738801, 0.416511906504452, -0.205911968752298, 0.890515093922139, 0.420994275890952, -1.82874542721073, -0.679785807217032, -0.800207190855285, 0.451425623241913, -0.611912602733629, -0.712236356498569, -0.195321497445668, -0.415619035398341, -2.51715055168043, -0.11211837920953, 1.19680949473656, -1.07033631854822, -0.192604834131031, 0.222774729530555, 0.172538897025755, -0.805974033676877, 2.68412340803426, 0.5155673678897, --0.400132870020175, 0.887775187771138, 1.14207447316021, -0.163631255640282, -1.22812811572387, -0.830847712256365, -1.25462496636799, 0.286760441700895, 0.992210636532292, -2.05623831741523, -0.889869155617186, 1.26611313871398, -0.483007634037241, -0.588253961568752, -0.693701718890236, 1.29641531041484, 0.765995044535265, -0.808728919529191, -0.480834975982949, -0.274055899013688, 0.467776021428551, 0.0409701859048461, -0.0060631978909716, -0.366648205145586, --0.16417760245555, -0.967773297976527, 0.0952155345676486, -0.0917909515199596, -1.64447213408179, 0.283956333598541, --0.889370258917861, 2.28749029000318, 0.748384086064163, -1.19715928805848, 1.48475607128895, -0.376223815865573, -0.442167562939677, -0.889843458547836, 1.63365420980008, -1.13760340524326, 0.740777614490013, -0.822191260277078, -0.517848569290268, 0.729762134943307, -1.87960755944116, 2.48754355706337, -0.9568549085966, 1.00181126414544, --0.668519929681562, -0.94888777901137, -1.75721213350624, 0.613374132087577, 0.596279044435183, -0.551182776078409, -1.85438485062213, -0.00194658730895008, -0.549879052193606, -0.960120550873671, -1.35724894407236, 0.942121620610034, --1.54789569816883, 0.810896917054045, 0.858987266154885, 0.257758186332539, 2.04120968067592, -0.291515270179969, -0.587871531383856, 0.514271319953652, 0.379226076409892, -0.469310043511313, 0.508737223759185, -1.51274654664315, --1.92355120341778, 0.988050060143154, -1.94807002456822, 0.684238534199976, 0.715792102103477, 0.101959762724287, -2.62895089810358, 1.40892761447978, 1.79797147549428, 0.240322644556822, 0.00610196321655062, 1.2402471819716, --1.97273642693885, 0.937958748732884, 0.0803970160265047, 0.628518103538578, 0.0316240393601563, -0.0136645756932857, -1.58865413993551, -0.293172791258265, 1.35074991301108, -2.62116582748105, -0.135695238680869, -0.571950548585533, -1.1456778845716, -0.941209652455872, -1.4682973499958, 0.219387474661183, -1.16152958103388, -1.78116792846122, --0.0510564590049327, -1.79341288668835, 0.50322980861241, 0.166454091362902, 1.46354747124367, -1.81537565015529, -0.775745774348439, -0.472800449432039, 0.972461434160787, -0.57485706429117, 0.27438105775233, -1.5093621331089, -0.598666031616524, 0.0970588706177941, -1.26284777734833, -1.68099365647767, 0.621612429982096, -0.672267093409725, -0.264059689263433, -0.729572082152867, -0.298161246268666, 0.915267137524719, -0.0857294035578394, 0.52843101194191, --0.496246872943112, -1.03919518047538, -1.07370947353943, -0.35295447988867, 1.17463068341786, -0.66303384946715, -0.55645354515825, -0.924530203959699, 1.54695105041365, 0.256825770809754, -0.26486209460595, 0.868490772893955, -0.716518973047981, -0.522032558977908, -0.7229950579699, -1.46363660382631, -1.43928233008145, -0.141263504505877, -2.77504204808304, 0.135221727762208, -2.01315647715382, 0.714580574672896, -2.19334203024195, 0.153711442982765, --1.28337850685866, -1.42060521435367, -0.429866776973892, 0.151632210421636, -0.978849480158906, -0.113952298253069, -0.464584747152612, 1.66502902718576, 0.286826424044771, 0.09044602574326, 0.644443091889847, 1.34824727850234, 1.2159401545672, -0.531528446409825, -2.71894582323862, 0.920903240462244, -0.375752361435048, 1.256996705409, -1.38182073579023, --0.380356446992104, -0.0733951651847866, 1.65811902528854, 0.569391868218375, 0.672618162453037, -0.468324511642346, --0.680308569947706, -0.241803319644442, -0.598986521377352, 0.342453418096899, 0.107682798852502, -1.64364978178195, -0.0765618152196486, -0.24169305225153, -0.747265167355167, 0.966311936552576, 0.170635342271952, 1.91554288731158, -1.23189972546309, -0.644690591653339, 0.953556646246524, -0.777575246192657, -1.72084827711434, 0.571783272274315, --0.795802108331396, -0.0120255224142838, -0.2469161185982, -0.206586675557259, -0.0501455762686665, -0.764816886145953, --0.514141939723548, -1.32125612257955, -0.977780382597772, 1.68680108500494, 1.02805908679615, -0.409151927019047, -0.67685379813526, 0.743990812147724, 1.7674310128251, -0.59019513124562, -0.527811644713049, -0.319789676174357, -0.521765543527145, -1.0107674719929, -0.403886591083717, 0.570581104233738, 0.350599099329699, 2.12212097574024, -0.148567114225578, 0.94893056188445, -0.980547548647494, -0.484124417911811, -0.354233928182578, -0.404742194357761, -1.76442496619485, -1.9135435866869, 0.0407948967178303, 1.80448851765838, 0.343487499465309, -0.43230752627621, --0.143857573301971, -0.0354909707257405, -0.393072727832571, -0.212276096457984, 1.55325945177481, 0.781226955816447, -0.852248613663193, -1.5878262610955, 1.37500983478325, 0.598506983023174, -1.11714469523171, -0.28348244558427, --1.51067254623782, 0.740878009328286, 2.37997252698705, 0.700214588666805, -0.475446302266885, 1.19452601603751, -1.10656850290674, -0.756898298646424, -1.86080736646707, -1.23106423015103, 0.485035802137943, 0.417294249933314, -1.54469926636855, -0.483798685236757, -0.444260882500074, 0.148816097851577, 0.81215650653759, -0.543419602984662, --2.46440325057419, -0.161943696652471, -0.288869612116867, -1.82719919503966, 0.499097835922718, -1.64048841611544, -0.365092670692328, -0.0482953008117277, 0.332910180753588, -2.12488327223911, 1.78923042047874, 0.564847928897108, -0.264532257925981, -2.15716409288451, 0.536267297754094, -0.521628896595477, 0.385139221713466, 0.428129869836065, -0.952790955649346, 0.622232845694646, 0.812905417612602, -1.55156976262908, 1.45941116261756, -1.12142728303574, -1.98236998741081, 1.05647856630986, 1.15427056272041, -0.456463716857643, -0.310680754982007, 0.713779511633934, -0.806668260231873, 0.624500986021615, -0.160323023499503, -0.133546532204286, 2.26353226177428, -0.821752294932066, -1.43920849414539, -1.12338235774491, 1.51582124065232, 0.218244159814809, 2.3527128634448, 0.666975851869164, 0.865007544577325, -0.0698060337792027, -0.143906031094288, -0.0262717301774481, 2.60433715193697, -0.942878745833981, 0.167086604414437, --0.605151427486501, 1.36554622440972, 0.133158970079849, -1.69239809392892, -0.0141088568849556, 0.0744035233622339, --1.06678014441491, -1.68081464486961, 1.1580058975542, -0.900889813875264, 0.67665595794075, 0.411578215195482, -0.406227939985066, 1.35172976517458, -0.502498843356354, -0.314581722012328, 0.315812469604364, -0.661328587383674, --1.43481313449684, -1.77599446874538, 1.14187359433568, -0.767625449011857, -0.828370245252457, -0.459948520007328, --0.171017301728553, -1.050185220663, 1.21725014823572, -0.381991818696135, -0.23387863466219, -0.722420727213951, -0.59611518594049, -1.53572863600178, -2.37771925680456, 0.713469515203709, -0.708900682565628, 0.61778361063197, --0.217830823477313, 0.164394369359529, 0.805329716782811, 0.843214951023417, -0.0584390627103578, -0.245127787991798, -0.616841552020974, 0.467490582823462, -2.54983490195833, 0.201293069421885, 0.248147850257091, 0.198815245074323, --1.29743849016853, -2.3417393309884, 1.0197320515215, 1.13407899590244, -0.464997807203204, 1.19290899675812, -1.13614513759469, -1.86427520848918, -0.191653851468716, 1.29128399234814, 2.87096614185381, -0.320990902564877, -2.12701602379938, --1.10378566313726, 0.481289566404423, -0.528624352525776, -1.01967833635134, -0.489251540397885, -1.78874135753623, --0.332889882509632, -0.566120777028772, -0.436043280666804, 0.0650029095532707, 0.884741210717425, -0.321784918253669, --0.211160998051443, -0.0764096535277925, 1.48319367121349, 1.6218949572797, 1.17420279918975, 0.0254496777389245, --1.63980009206546, -0.475987173874241, -0.0592629069713339, -1.24726783229865, 2.19467221585882, -0.247183989394959, --0.836394523523, 0.804354713307547, -0.807684236513168, -0.312849314485208, -0.508035670059948, -1.40878945453479, --0.686088676454434, 0.827226136122227, 0.275701904924379, 1.45155259936681, 0.52601585528563, 0.547513736564626, --1.50315824071416, 0.164242948212186, -0.284291222301163, 1.90701102046008, -0.273564914794088, -2.57992053659945, --2.05396139181038, -0.976693306002103, -0.910152102202919, -1.50002629218541, 0.612260287314928, -2.69518028428924, --1.03277932986144, 0.959951922454304, -1.01631806070198, 1.36969458231297, 0.89584029635625, -0.571161678471943, --0.496296963191757, 0.299911723541155, 0.352460762060121, 0.185757075975934, 0.709193739975018, -1.07125482915467, -0.816688794176959, 1.04932957324504, -1.04773757011261, 0.247695564039123, -0.869870168854633, 0.957566464114137, --0.527126293387255, 0.0920702318592229, 0.723340560718285, 1.03174160696768, -2.38417305259269, 2.06112663387637, --0.205772331113164, -1.35029094273777, -0.499532639084693, 0.747066101875046, -1.91638811230058, -0.0190822551834551, --1.25528514808118, -1.43022552615535, -0.51936098531052, 0.188810052597694, 0.67850902312913, -1.97577643364774, --0.596648811802557, -0.215383554182898, -1.69737945350187, -1.22502172675789, -0.465543792362148, -0.852651303290659, --0.9183452788072, -1.22440561266809, 0.288529601487771, -0.846679016389511, -0.496635091930882, -0.545798132770565, -0.373670140953444, -0.812452496273925, -1.67862166937165, -1.76323178257074, 0.845480617604847, 0.552607314450809, --0.293911768199735, -0.0892124128123422, -0.804193563178625, -1.31575040284551, 1.04834066623385, -0.153560397798923, --1.38920749833016, -1.20003365360654, -1.07913435180631, 1.6131768887277, -0.440403720988574, -2.23522966347822, --0.770329641446587, -0.693139699374613, -0.926578547062929, 2.78877371127964, -1.57229633661381, 1.35991089799489, -0.993109859742207, -0.152607873794248, 1.19496139202419, 1.05180350591216, -0.627379024758073, 0.282746805996862, -1.00363926345986, 0.807227549514798, 0.138099854911412, -0.656020593988042, 0.190750382197178, -1.36929658917828, -0.232374879857364, 0.628530785704648, 1.14521377468456, 0.702504939691768, 0.79243887514541, 0.0134035962113768, --0.484973929036698, 0.149330070923553, -0.899143986960883, 1.21565075095349, -1.92037705349426, -0.280189031368568, --0.621620678610039, 0.456138259658328, -0.628632551793186, 0.434944840859048, -0.498851913851343, -1.19600614888885, -0.55811485286945, -0.220580627335192, -0.546549600630472, -0.808575965351009, -0.367446979038474, -0.451809427141984, -0.122232084896743, 0.510154433276157, 0.898822932231222, 1.43183770259654, -1.02923330513778, -1.7331511921826, -0.302106714999539, 3.34160734019168, -0.582815549181832, -1.13755982016669, 0.396806125673774, 1.25671418134062, --0.873788832000539, -0.15608391512382, 0.898171993704376, 2.1277962087715, -0.565113135598704, 0.0518766225828113, -0.846597797081643, -0.0559050260929806, 1.73911594578422, -1.45339063217297, 1.17795218039085, 0.0927730172848886, -0.305140319211898, -0.613887506579876, 0.395395091130808, 2.02370055421134, -1.32268601426551, -0.735087336258719, --1.54138435408431, -1.28415145626235, -1.45922311464831, -0.387222720585608, -1.95984512578994, -2.46536518338137, -2.0549026519043, -0.0395976355313846, 0.517399897361191, -0.0340938095438564, -0.218104529830904, 0.933125989210505, --1.21702447187305, 0.146008657187143, 1.03603969280365, -1.46064760836582, 0.0338646862856918, -0.143600444555635, --1.34287087228951, 0.610296286219611, -0.92856114868454, -0.594517787303084, -1.02771070604333, -1.52895958478343, --0.0168603973939362, 1.08810656385936, -1.42772796590904, -0.758071444127186, -0.132444108887521, -0.143148051546841, --0.733216383884854, -0.646705377382288, -0.55834572584707, 0.236910580185063, 2.35459699847585, -1.47575223411093, --0.985130082566135, 0.0413966661594576, -0.55649894168992, 0.704629702758714, -1.75392676587738, 0.123776953175059, -2.49254360211232, -0.0308909487453421, -0.0557761202238091, -0.164692014729068, -0.549528051762933, -0.186099815307821, --1.86456391554589, -2.38207068403887, 1.40845594116073, -0.0781803098304435, 0.229621528170035, -0.335597155985677, -0.089845698269664, 0.193367236115379, -0.0961899111606634, 0.456944574907783, -1.72821682060622, 0.887412240569152, -1.18516116932296, 0.56162789387847, 0.178402172952873, -0.562170309322481, 1.75286069205727, 0.925483411049971, -0.659926995871293, -0.815968150678489, -0.849396116047665, -0.496828992165187, -0.761332483528042, -1.4472950041729, -0.248975745535103, -1.98151714463848, -0.842669901572429, 0.204809206204757, 0.441319457587365, -1.20634591757115, -0.569726307778434, -0.239305504470565, -0.527166621703221, -1.82093365760571, 0.654399066660411, 1.14236116403711, --1.61231965758284, -1.42188272326911, 0.959138010581611, -0.401147536036791, -0.222204303509291, -0.984951147170198, -0.978448488176009, 0.868881874001793, 1.17692634459943, -1.62259295122172, 0.755084424037482, -1.0353240456222, --0.0324137472435223, -0.363618246085454, -1.67876588673134, -0.0555273810237348, 0.824867460723047, -0.0706347349020776, --1.03967855375826, -0.157797505828849, 1.87147066459787, 0.259135217729439, 2.84289857512969, 0.206900329786045, -1.55016100411606, 0.43800243553174, 0.563920455016133, 0.655376278445036, -0.816578058373199, 1.21170004724944, -0.342693841705835, -0.523536047981546, 0.754836994417102, -1.1010878589523, -0.0979512116213791, -0.935953492394091, -0.728246494249862, -0.469233496049283, -0.52327024369874, 0.689140862015759, -0.596031902902881, 0.350671297103011, -0.428235131169425, -1.11984859296039, 2.04116812594582, 1.44059611287159, -0.907468590189759, 0.308900172526718, -0.33491422935102, -0.976438594409382, 0.356967848853635, -0.497931200333788, 0.697601685459937, 0.458148497486208, --0.416983124475231, 0.559067165676593, 0.500326315262138, -1.04782597833845, -0.477967503819758, -0.425815125506469, --0.564981275805185, -0.258237798236837, -0.925684381407387, 0.385247532871386, -0.915902067262808, -1.92811485557358, --1.42384939684524, -0.28074019857578, -0.914152880472116, -0.748824463999266, 0.279276473991937, 0.917569923839261, -0.710824505304443, -0.0994030048550701, 2.68007504934181, -0.798839535560725, 0.829506541977715, -0.828394930006822, --0.615526905640981, -1.11265043336698, 0.322709452042122, 0.358936059534929, -1.97532291125064, -0.813015777234598, -0.113638234839059, -1.44581424435112, 2.23509517073581, 0.422451411232682, 1.68184670181085, 0.0557360140930626, --0.983223992774248, 0.65520767802938, -0.456436242405338, -2.36746462783778, 1.12035482400427, -0.578759187200501, -0.0542281531352336, 0.242516097320593, 0.537413789019561, -0.613667190615615, -1.18924540812774, -0.638301728369757, --0.351887451680825, -0.471214740135664, 1.58043433218719, 0.229150142036099, -0.811835434717467, -0.317917074876231, --1.04107403326728, -0.618576188443752, -0.11319681874557, -0.856297044805529, 0.928813403368859, 0.654660695485085, --1.17987120335512, 1.78733218621184, -2.08543406425162, -0.00782702609534947, -0.217459303685775, -0.97405908112749, -0.440658848267394, -0.012146388651437, 0.408185589812503, 1.18302096792579, -0.967155383790024, 0.237057906272325, -0.947094937954299, 1.96910111587653, 2.68393333023546, 1.83352563218835, -0.919623540841984, -0.545335949723981, --0.584952944493149, 0.418852471588828, -0.869889571661325, -0.595517847735373, -0.784629885670898, -0.647401764562499, -1.06081865623363, 0.142986010091037, 0.695057898821119, -1.51164684388944, 0.501833600900325, -0.137858501435844, --0.700025818559562, 1.14008353621747, -0.568614881039728, -0.26396284421311, 0.864040248833986, -0.997943728350579, --0.0568652379246772, 0.447276089580835, -1.7259102490608, -0.311506223983151, 0.0833879110484236, -0.310895066825478, -1.01235105260707, -0.410930204894731, -1.80467913764886, -0.069485092124749, -0.080234038404257, -0.281216484260168, --0.161710884406909, -0.115188817862232, 0.66234577679725, -1.28093263407105, -0.653280429426707, 1.35749968717877, --1.26595050953846, -1.43782057053716, 0.873496669860394, -1.2306869760387, 0.303029216218348, -0.875851167755925, -0.878976730048932, -0.139249566340442, 0.0643972683898384, -1.77558697649888, 2.24445129297411, 0.49111071906716, --1.03065425864437, -1.97224016315708, -0.483185531724843, -0.321083888614285, -1.3810573174432, 1.12109575258713, --0.358952907937116, -0.860114282920454, -1.13819742282518, -0.174577217351264, -1.18258510677952, -0.897266414370421, -0.318083299158824, -0.688188961926042, 0.557301414620498, -0.455353460986509, -0.317094441470603, 1.99451264883095, --0.296564517022351, 0.632060706725625, 0.459926500054871, -0.301162580838831, -0.307467097547214, 0.45082316348614, -0.829012869225731, 0.751099352159805, 0.247625625809749, -1.10099448723159, 1.32057754462925, 0.389305251044338, -0.300968566205431, -1.98309345574208, -0.207644634262759, 1.65523340937328, -0.444092600029321, 1.42669021051476, -1.33926769300776, -0.364328011591163, -0.696236610193154, -0.2455736775518, 0.423751105420566, 0.660982623394149, -0.322412970684488, -0.879006260299429, -0.344756947698911, -0.698790802938073, 2.01301641578018, 0.389610740677217, --0.153416053618259, 1.34571913112435, 0.0928221819826228, 0.413265623397563, 0.917373487728238, -0.674219498972939, --3.13840932128337, -1.65919090472707, -0.343105439412146, 1.03843145339976, -0.166684742322438, -0.757338324150254, --0.519985724573071, -0.0533108796359583, -0.923828699055915, 0.0549993582618317, -1.69760686470557, 2.86743562614969, --0.52060155931869, 0.302469014646316, -0.771455319783641, -0.100868328417863, -0.304927830900123, 0.897575373454703, --0.0166188104915912, -0.848180446126733, -0.202893215456775, -0.311863139082538, 0.656723504008724, -1.06658716296151, --1.16691679951044, -0.855670497141331, 0.183880700658541, 0.92520745606878, -1.23964437190752, -1.57700437876381, --0.934343463723923, 0.636381585367081, 1.62298284557284, -1.9505812486882, 1.86089124931659, -0.0802357640306753, --1.8067196254632, -2.59080923243975, -0.0811830755645316, -1.61519745421633, -1.84458637910624, 1.15879294556737, --0.273851606257593, -0.894376492458382, 1.50652716411878, 0.686348854756788, 0.439858672779523, 0.365184078267454, -0.0189248778066819, 0.550385558038093, -0.965841022913396, 1.55446936499195, -1.11731035580462, 0.165140292780664, -0.724457512980305, 1.30890273017244, -1.86251594590771, -0.430915207649933, -0.447224491297859, 0.620346469834937, --0.167186044665083, 0.894857007932241, 0.647627616198274, -0.546307340447099, -0.678854910733455, 0.265727223352538, --0.437205131577499, -0.0242425272391981, -0.446583372905872, -0.1362176280311, 0.0399359281547487, 0.539421415253902, --2.1613779630881, 1.04040089498828, 0.980835255499087, 0.602097856955606, -0.0393696031318426, 1.30679570446241, -1.15713036929534, -0.224556152277395, 0.175889028044767, 0.0663544393273074, 1.43796451749051, 0.898559303074782, --0.904749066989008, 0.673759051981924, -0.888708562685066, -2.59021740272475, -1.01374363630891, -2.01220846889239, -0.0363797242188741, 0.233069713358913, -1.34159473979426, 0.306885220482159, -0.238596476070984, 0.335547618632154, --0.0751018139278303, -2.11991798353376, -0.408580577926551, 0.395145755377153, 0.437170703174118, 0.324282530478496, --0.226414301772486, 1.76343257143693, -0.245814617037542, 1.01092763033562, -0.0572968761137578, 0.190772710521098, -0.605705789750557, 0.130632161210927, 0.0275869723485229, -0.498620730215513, 1.07719797613661, 0.827665135396787, --1.21922342453499, 0.239423570898547, 1.32303548160389, 0.599243144624066, 0.215333368793776, -0.0439294523573796, --0.149517167362454, -0.908540752552747, -0.514593291687584, 1.32751169574348, -0.0911419088371737, 1.54204781627178, --0.325929964199562, -1.82065021951179, -0.40096812238335, -0.0011562563940528, 0.487205248509283, 2.25407832930624, -0.207810772688773, 0.373229881061553, -0.149643393959621, -0.119680967518621, 0.55492330832661, -1.27792797300294, --0.940238256918133, -0.848769448108308, 1.39523158667062, 0.921701288424559, -0.429338538579854, -0.551081633769794, -0.657291335378983, -0.998682217302671, -2.06527428568914, 0.423679574280894, -0.410092318338398, 0.48071160978552, --0.610266525367618, 1.79912938862039, -0.909395102405144, 1.18113812368496, -1.99868648339074, -0.39454384494719, -0.600467686882565, -0.329970640293165, -0.242395673454647, 0.864439430769144, -0.440336371970917, 0.056552882422574, --0.179471445818501, 0.0522872085341636, 1.0904695412962, 0.601670404988591, 0.955664192701838, 2.47504017111549, -0.327934293507011, -0.330117809190618, 1.40179363341398, 1.02658709451155, -0.573528952781581, -0.393293020949979, -0.900034875939114, -0.707406454941224, -0.904531361040988, 0.0573238984581883, -0.800665191384769, 1.41257335049455, --0.558759064868013, -0.653027072400744, -0.450668479203183, -2.14421558176928, -1.35846818299597, -0.278401807345882, --2.57407003005511, 0.567077869784179, -0.0632793298300179, 0.107783411432639, 1.80253709259706, -0.89911739062064, -0.0459840499197001, 1.01066600370425, 1.25455970473878, 1.50438530780908, 0.675073229127145, 0.866626149150834, -0.247605334150661, -0.534604672824115, 0.0869339551599248, 2.12484001577215, 0.50630640532784, -0.1234007887208, --0.866504758886484, 0.246635016990878, 0.505326275137555, 1.43286532671207, 0.318250940665266, 0.328900872951949, -1.43883801892207, 0.481518513666634, 0.48390906603131, 0.303017668613347, -1.07859398397255, 0.768624468150867, -0.277182562065255, -0.639261163987518, 0.00700454394515889, -1.17118115655857, 1.92279851867119, 0.0328109709017855, -0.876675351358971, 1.40331030453752, 1.00210319043007, 1.35427295011501, 0.880877217196471, 0.803069176408877, -0.861019726376257, -0.0546970781984859, -0.552709390445587, -0.17740882138797, -1.07882425058864, -0.549279036389525, -0.422577634710149, 1.82806081751052, -1.88213865864953, -1.11065117741818, -0.654815978619544, -0.282010367384648, --2.94904805559389, 0.139915251028122, 0.0411008984867159, 0.589947800791587, 1.52076290264619, -1.50272313248964, -0.31853967114495, -1.62116014350604, 1.46277477057757, 0.21527503818707, -1.00232850446533, 0.032740487255343, --1.40138343732831, 0.711045393613253, -0.0979143510097028, -0.845949264358296, -0.481079993165615, 0.649342612154301, -0.432478820210411, 0.474851789124736, 0.862033561143024, -0.467878526673708, 1.24273381233752, 1.1524722978629, -0.198130515444871, 0.897879224375347, 1.00277136299224, -0.627828784977337, 0.43582274328015, 0.249321436836448, --0.0314577495958992, 1.91202993387047, 0.800197273525826, 2.09622912949861, -0.988368726100309, -0.440247538360666, -0.906513669483508, -0.668121545144994, -0.256713311289211, 1.36376735876531, 2.01229651778721, -0.190071746954425, -0.453672945501367, 0.392064466919276, -0.273962820895623, 0.400444723278323, 0.339176214437717, 1.58911841708283, --0.898201718762857, 0.272576249756683, 0.31566451420133, 0.0318290595932627, 2.72198738812226, 0.556593428779292, --0.134372246513105, 1.02524050324274, -0.185158546079743, -0.649731365808609, 0.502336513007171, -1.21732612367998, -1.52440425985107, 0.190509546547256, -0.766483419669001, -0.555481621807881, -0.203913985988754, -0.2133263217612, -0.872765460307764, 0.28562817227756, -0.16693307855747, 0.467249629325915, 0.111897385664523, -1.72253614015346, --0.148997726334263, -1.38787695358081, 0.828702981538326, 1.74734607762278, 1.62129441471141, -0.661382125949389, -0.27039958475166, 0.108124889176259, -2.09538159712419, 0.620417291354621, 0.0731712041906239, 0.276945668677016, -1.46448782252139, -0.942266366525149, -0.200032993774054, 0.515046254270886, 0.998751236931609, -1.16025599519749, --0.276263145235709, -0.181100210318422, 1.39313271743638, -1.28070276614504, 1.79992109939687, 0.22910964717263, -0.323973683570686, 0.562225897157337, -1.28636487876491, 0.450764025501052, -1.63545581687134, -1.71890783172828, -0.30843604578871, -1.13215606852922, 1.0358987954885, -0.180990083905967, 2.09212766370721, 0.17456746572837, --0.0848204749925486, 0.0474693249988838, 0.252761280790926, -0.346864928536096, 1.15146583199349, 0.88432780149452, -0.0820259584791699, 0.117779204010625, -0.576420338537078, 0.125808032341019, -0.0898862280212711, 1.72787721011054, --0.958920172020181, 0.445006218698207, -0.821751114330957, 0.459802961916617, -0.958156410383941, -1.40628899328932, --0.397904104388898, 1.35519609406191, 0.110095512009497, 0.302765903664726, 1.37277241807481, -0.120541944195616, --0.0712976166959252, 0.924055507636994, 0.778301812887012, -1.09145993469773, -1.6767676512812, -1.08575915263318, -0.232092297164981, -1.08712267911235, -0.0513421650659602, -1.92444136206161, -0.72643334167115, 0.622187917233729, --0.910687187936334, 0.32326426876636, 0.90069552957397, 0.192812188545261, -1.60764230030814, -1.29990838874504, -0.136135425989383, -0.154047646078173, -0.274928541602624, -0.546246812321747, -0.279600489660015, -2.42103695992918, -0.671001727309641, 0.580419245824563, -1.4870963116061, 1.07510450789322, -1.70721910279573, 1.00974494861067, --1.98169842260235, 1.50668767325782, 0.0742805354202493, -0.361880909803655, -1.32377491934055, 0.795952763328828, --0.987737586718704, -0.806053590769675, -0.980735920044222, 0.0334148149699282, -0.0570891215865447, -1.25491395846211, -0.593181436442382, 0.696921506956212, -0.234391446064817, -0.377013916499454, 0.0109549747532987, 0.352407655492641, -0.46865701526869, 0.917716745868669, -0.998126536149861, 0.847132843942018, 0.567108400127566, -2.80224513870103, --1.61945352167926, 0.601503937872325, -0.626104790934115, -2.01334104020476, 0.723664235890511, -0.33161345894965, -0.124720915266154, -0.870390535571797, 0.253576781881867, -0.191379424748427, 0.253756531655632, -1.86540248795539, -0.319435797013365, -0.636001323775759, 0.234460982630718, 1.08757992195886, 0.120146252820042, 0.413232405464369, -1.87696257041505, -0.580903144861048, 0.654789394334846, 0.381087647622936, 1.40678241030011, 1.0988246627219, --1.47659963849998, -0.373895245913244, -0.082899297281792, 1.76513731466257, -0.477041778997472, 0.110630740327481, --0.450161317941843, -0.223432400986492, 0.332782482373811, -0.666817090861302, -0.987800166791882, -0.537599762251994, -0.227094311247514, 0.216596829083149, -0.287089750412938, 0.640041427333835, 0.621017745382566, -1.2784210994373, -0.660086318324393, 1.21546509263907, -0.13100224898712, -0.523957320383286, -1.54459859333001, 0.223989222658028, --1.53473791934165, -0.20625495488444, 1.53485192378254, -0.671126783325916, -0.305195940538755, -1.23442672303406, --0.939117554422038, -0.104922854554195, 0.991901715706679, -0.403326392150297, 0.340527743361751, 0.444637377981295, -0.195830451171811, -1.43912880962432, -0.461917019025158, 0.69663857437907, 1.12218192299585, 0.28820741304267, --1.52259399204841, -0.0714703095244478, 0.149995058314686, 2.77943456520427, 1.51520319237236, -0.686214034396081, -1.72287820305407, -2.26715127541055, -0.222653251865155, -0.119643160535878, 0.62454016695226, 0.407734735803156, --1.25380172151891, 0.829269227458319, 1.38101569724025, -0.223388945723857, -0.809714687329235, 0.37935217803655, --1.22817835844102, -1.13069873006699, -1.0880936875658, -0.469409522866103, -0.340135763559857, 0.943435733978744, --1.06657630642472, -0.538166566558447, 0.999316461276556, -0.62932672188297, 0.194637324108652, -0.400883357402223, -0.429479339990139, -0.670698053151844, -1.27329276825437, 0.51391728546177, -0.187104728184787, -0.178590632305172, --0.860447960563241, 1.13326654737844, -0.530581146696677, 1.82091199569421, -0.325803102449182, 0.0984670075139643, -2.22539440335406, -1.02624796834125, 1.15340038093581, 0.786600781621229, -1.16561089301257, -0.828071635825385, --1.69736461416671, 0.145637228777992, 0.755237745249886, 2.04079035460696, -0.0768873723182157, -0.468800594616697, --1.7045018807128, -0.383738762173667, -0.83571003256846, 1.02267968064537, -0.0139579884256869, 0.0180633419742752, -0.179085427682023, -0.256829181252199, -1.73452994831749, -1.37563973269068, -1.22559895327529, -0.671493958344884, -0.277157227283436, 0.61437660075193, 0.29467576690091, 0.965519355858158, -1.38970675802541, -2.34196115216459, --0.294863011424322, 0.385952927122258, 0.163622649054332, -0.521941617560976, -1.76298600962779, 1.48683968680547, --0.956097464201634, -0.424055507033292, 0.33670675795055, 1.6521054504399, -1.04269124566539, 0.103599540260578, --0.322331108037565, -0.903434235239068, -1.92074582498623, -0.451981272231006, -1.08129256140794, -0.285082219458578, --0.669281960444829, -0.581535922015286, 0.483777577030973, 0.557777243053528, 1.57501653535234, 1.05047728480972, -0.103952744713107, -0.207842804209699, 0.801480860592421, 0.567318873845062, -1.07857587429454, 1.31069870949775, --0.798703447589804, 0.689137172600469, 0.566707936546124, 0.858115065028994, -0.516786253794319, -1.31703813001913, -1.02296734266523, -0.470903135795837, -1.4889754755409, 0.913740648581082, 0.432205755381309, 0.697090051912819, --0.134408782955928, -0.666600843496887, 0.633641298883567, 0.363381887067787, 0.513099892921283, -1.27235575592656, -0.203056093641429, -1.33920128328688, 0.73249693250139, 0.453149260247115, -0.148329019122537, -2.86800789423106, --0.605526232937972, -0.5440518566759, -1.02901026547136, 0.795804716355574, 0.333087440528244, -0.138917077417483, -0.595968465902925, -0.664488816879329, -0.397389797098205, -0.71885298396826, -0.0820535115840487, 0.496541095397115, --0.393079868612541, 1.88656541972218, 0.889105553409918, -0.778665294227413, -0.918865848551081, -2.07541432749546, -0.735847982135803, 0.347069041966522, -0.902411302269605, 0.920568360649819, 0.187655641347489, 1.10981010332323, -1.38400768143752, -0.706316725154041, 1.26138819738804, 0.813123354728397, 0.225661386178982, 0.714981552152322, -1.74894286307297, -0.660804614997089, 1.92327230533934, -0.22988976464445, -0.89471201093395, 2.35837407127842, -0.0223790928784626, -0.60724908081984, -2.09141592611969, 0.30530788655771, 1.45061625865796, -1.19631332323127, -0.945642057274835, -1.27738008827149, 0.107539507657667, -0.937490316188199, 2.00681866946488, -1.28947045006441, --1.98893610468643, -0.905281153372346, 0.974329558113752, -0.690816175389624, 0.925926466058193, 1.16316701558083, --0.389238532124597, -2.21639215252083, -0.126340799295317, 1.12002480799642, 1.03669691689603, 0.167222774780912, --1.91882341642413, 0.350782721613817, -2.81063497763818, -0.312659554823228, -0.57726287005712, -0.0175802386460826, -0.453664395088845, -0.455811935673592, 0.0738957419764213, -0.577702921734056, 0.24133708051267, 0.797526167352045, -0.552226522439122, 0.493431557872049, -0.325902200305618, 1.1250970942098, -1.36961292811124, -1.45109878160849, --0.272404208559634, -0.18345113231261, 0.25189587357326, -1.2578836083237, -1.47281586856516, -0.789009462010011, -0.411746869888999, 1.43421648528324, -0.390970201260035, 2.19979538192441, 0.137252142898195, -1.54773897887291, -1.03577631522482, 0.382168510711771, 0.230113075749107, 1.78143929573811, -1.10139012146376, -2.45620620600946, --1.98399857237221, -0.603127509482901, 0.162153683749416, 2.10279619334456, 1.12860188842525, -0.71341002347458, -0.24045628960756, -1.18510291681408, -0.12249581328638, 0.0268033611850573, 0.849111887899131, -1.01155057884416, -0.960503389772437, 0.538044488193148, -2.2005515869226, 1.21789284260968, 0.412144969037524, 0.907768682668461, --1.00150034715685, -1.44701301769083, 1.52242742102005, -0.529675260535542, -1.11142889421025, 0.872170979248411, --0.0578873725796981, -1.79057076995939, 0.951108678546551, -0.94121375685713, 0.457875344987795, -0.287908163993919, -0.160408579560428, 0.110046913537653, -0.740478797589836, -0.715489977716727, -0.830848352459334, 2.59630188927445, --1.09828374187205, -0.270222160351816, -0.1690573766018, -1.46425681127945, -0.544346991145025, 2.8659346378293, -2.03461804060391, -1.1397995486031, -1.5661201959439, 0.632379629186987, 1.53345781348947, 1.60232999184305, -1.47086679580775, --0.944526709266186, 0.884490971437846, 0.844039660823165, 0.857834984315971, -2.32725007023504, 0.474673095425563, -0.194947155990763, -0.771136320335612, 0.0481648602104978, -0.756155952233491, 1.03858012765702, 1.12972327739435, -0.494349169932684, -0.62590162174732, 1.4321887697909, -0.89058287070396, 0.938525423252158, 2.00640066899992, -0.683555937111704, -0.312968611090789, 1.9508563302117, 0.203019653555256, 0.846079005377579, -1.8579214282012, --0.968368080837318, 0.50258981527136, -1.5345680931005, -0.46465698619469, -1.95033923412021, 1.25589481057616, -0.981139121485621, 0.114788613827408, -0.637363508051072, -0.0366044988213966, 0.258534213318956, -0.171087446685834, --0.238033996274539, -0.892768707558892, 0.535560149809635, 2.29439606511354, -0.846653187894572, 1.91174966238399, -0.0687639877026392, 0.242372579474224, -0.181538901759006, 0.62734545975207, 0.0365144096546745, 0.0526455576536915, --0.747849609930291, 0.64790998768915, 0.425982694853377, 1.63205982364468, -0.357170233940283, -0.179476641253346, -0.674992799249991, -0.163445579897387, -0.226016659731752, 1.09466691926546, -0.789478755573294, 0.284281969496085, --0.88282236494625, 0.782574870499588, 0.74679101787883, 0.621302586050491, -0.405709058619045, 1.21399228685774, --0.0288093548845736, -0.152460725726083, -0.267202637703728, -0.282563154002272, -3.58678764630256, -0.45357357127761, --0.416360858153374, 1.40075574574508, -0.680206337331559, -0.638994170756367, 0.874199152440343, -1.99924542782051, -0.651094614485002, -2.03560011148951, -0.119353887874965, -0.322183317124305, -0.0719744381965454, 0.0171251074159944, -0.0465790576967302, 1.01792593685522, -0.201777401289998, -0.404701168701688, -0.578979814739461, 0.819150938914746, --1.58008985219217, -0.272477941579482, -0.694094160749451, -0.135642032046116, -0.265903205944276, -2.76245531318974, -0.388804642426665, 0.147601278966897, 2.31796886473066, 0.351898117837113, -0.747960775531096, -1.0843463269688, --2.71342360926218, -0.945668148546235, 0.625962883039503, -0.889499316877211, 1.14430313239831, 0.24791111301008, --1.03931590663338, 1.54270086350527, 0.141598328187472, 2.04642545460285, 0.716221338931235, -0.245313541029803, --1.42638791478657, -0.989592392524173, -2.82435497872498, 0.653960766655766, 0.314657206563843, 0.477963176249077, -0.327856948262149, -2.28997960515424, 0.797494311299211, 0.696803830153856, 0.182687929908949, -1.31126122081049, --1.31765179630779, -0.503309128406384, -0.397239690762349, -1.83431022807416, 1.86252145515374, 1.47922264390411, --0.654522598357909, 0.647449540339151, 1.5350632047385, 1.80951671246126, 0.564809857527433, 1.54040910424837, --0.331180222826164, 1.79955857493149, -0.999602231807392, -0.309592090181644, 0.572651817224986, 0.318801085440688, -0.58404306122472, -2.68035627848593, 0.250691925653325, 0.968979383528687, 0.110329826578829, 0.713633328257861, -0.71163453511164, -0.00287202155510049, -0.404125734656677, -1.81005250016828, 0.545437465210102, -1.90277741575258, --0.54312891965799, -1.29955373083875, -1.72545867301376, 0.939127978448164, 0.338075425091513, 0.28699573339434, --1.39297421855739, -0.260510606862866, -0.567935481770612, 0.202996568832368, -0.802577516017288, -1.61043025423711, --1.18489085868202, 2.57535233311721, -0.309650958041886, 1.08771665289026, 1.52867153902079, -0.234417714655415, -0.525485078794058, 0.181152307440479, -0.940575206374134, -1.63095786244771, -1.95180461744305, 1.54780187694155, -0.65617865929671, -0.135384250311657, 1.15219091149264, 0.640076761378968, -0.725177681130407, -2.4151271017768, --0.138030243787176, -1.65170676794894, -0.808525193732856, -1.80544756392329, 0.411265796784594, 1.12808678368209, --0.768351819989798, -1.03583909157281, -0.215689681153979, 0.325391264210738, 1.30560199894231, -1.79031222155281, --0.422126241116351, -0.0164953502729357, 0.347204088977815, -0.307493096106462, -0.0677377497484995, 0.339278758673755, --0.442917518263775, 0.20539656461459, 0.564803716245414, 0.179802670833624, 1.85694322353502, -0.589665184867979, --0.656810167181819, 2.54147936506557, -0.662217995324057, -1.21245145098402, 0.46698069004037, 1.4148668182853, --0.398821491377337, 1.46626658497585, -0.309846810058974, 0.707586679882621, -0.901126784532247, -0.0591255526896916, --0.159553733104869, -0.65731174501164, 1.12989543929625, 0.653405067098311, -1.40236232700849, 0.646043525890951, -0.31437334160691, 0.253482295759529, -0.433039810869697, 1.13941460780379, -1.23068934593283, -0.3159020943463, -0.903715419833814, -0.432622588479053, -1.38481505662384, -0.783896768126824, -1.02724038090613, -0.374763236509984, --1.20580395717152, -0.855020292453886, -0.0605086114267447, -1.37226220679433, -2.44500197758358, 1.37921188137432, -1.76539268769825, -0.665529070529627, 1.46186434898063, 0.458391663113698, 1.70279861250848, 1.05138895711989, -0.454839263567001, -1.22948616406979, -0.742916391383227, -1.34074167150536, 0.423381555393864, -0.277104379421773, -0.317224945782615, -0.499248058753436, 1.14580151164114, 1.71489052915813, -0.0598918324478254, -1.11837174621111, --0.608871255255275, 0.128209065844127, 0.100258352251323, 0.0919006855061881, 0.165390765116054, -0.895821098533779, -0.319703431469498, -0.671643454918016, 0.277842873366708, -0.489553687733284, 1.51267148282876, 0.362169737863775, --1.0050583991328, 1.70761200676068, 0.291810280117282, 0.333551189240453, 0.428093964699987, 0.0688521793089391, --1.79002534495956, -0.296404530503252, -1.44764164468356, -0.218894830574129, 0.17904568306053, 0.590208360044471, -0.386906430867153, 0.448897977374213, 0.330190220358494, 0.642221435899548, -1.04163468919724, 1.27807949305851, --0.441360469036284, -0.374346151345123, 0.590269411523247, -1.10556254090377, 0.775689459980058, 0.824839460629916, --0.355852618759634, 1.09639264332386, 0.0826359982112498, 0.420037605093624, -0.665661109887421, -0.173771825572818, -1.40231102240312, -2.01490609127668, 0.698304085901596, -0.176878996448008, -0.831240607846634, 0.263960164422617, -0.0279152421968999, -0.813130790107685, 0.604956231884126, -0.721269663678447, 0.105062710690334, -0.382336202450131, --0.436663409895623, -0.40078418678409, 0.0536043362856301, -0.335928108153616, 1.25098816408897, -0.907194112288071, -2.61038078476183, -1.32741858565753, -2.33408381941292, 0.358482862995611, -0.739530703794736, -0.678201918207699, --0.412782276766588, 1.16876515073237, 0.70390666399325, -0.592411318838365, 0.882622236892356, -0.348815863991371, -2.23549965845505, -0.0130782234401407, 0.58352221949341, -0.322387396865368, -0.509670140982833, -2.10554949813191, -1.5193297689942, -0.235427681411323, 1.08027296143088, -0.495267193232288, -1.16129265848742, -0.179963563951892, -1.25067764657238, 0.889574753751807, 0.489708937513227, 0.0865409666133056, -0.644399186140423, -0.0304166406722172, --0.251839757926003, -0.875013250269436, 0.455335668248792, 1.44011408993319, 0.569735822567425, 0.209637051890878, --0.0246710329055809, 1.7454435456204, 1.88168251807946, -1.18593310641456, -0.0265262096663069, -0.884016808297759, -0.26215171386988, -0.129348792353689, 0.0661225471044981, -0.826352501093119, 0.548838741176556, -1.07237877139355, -0.1985847289463, 1.4485921859224, 0.911284706435413, 0.716355515742879, -0.384699276612641, -1.42282425176969, -0.0679639328045536, 1.28516622223467, -2.11160478048831, -0.396477888314508, 1.33064597634342, -0.17539033139971, -0.963965226825427, 0.296337461536494, 0.957753841522002, -0.000538842463663965, 0.767302206719783, -1.36183370875405, --1.07176869906021, -1.17207493148745, -0.960944036367432, 1.83667750156253, 0.0539693497196037, 1.05504839670166, -0.717491894731404, 0.228531777253271, -1.18928331932298, -0.00879923122832079, 1.01000803462485, 2.45564412874137, -0.0726217447239304, 0.2536170495815, 1.43422487970913, 0.146984803349642, -1.60888830367192, -0.0246859623963219, -1.49846205030159, 0.377194247984726, -1.27103104674642, 0.268377283269092, 1.2915858866389, -0.320990129271257, -0.927689163171698, 0.769425845920566, 0.234875854601442, 0.277995829782663, -1.71619889044698, -0.394274246927275, -1.14930673056819, -0.838468641754201, -0.181354614689848, 0.690941048281888, 0.278849724797425, -0.767220120984099, --1.65643544598563, -1.5810296378059, -2.11641165837812, -0.669714005224312, -0.248504218307454, -0.656593878326367, --0.515951032633784, -0.590392040827541, -2.13267779840244, -0.28987579904394, -0.180908693762724, -1.53387493592535, -0.900696230356575, 0.278114175661727, 0.585197872403682, -0.484369931572446, -0.194071565628893, 1.42166899062104, --0.467150994432995, -0.38904905033251, 1.32298493766039, 0.118146960825703, -0.389599780370049, -0.182590082497235, --0.888630318555725, 1.13530060987694, -0.631055831865533, 0.544684836425911, -2.65488714753906, -0.285395634953533, --1.83241271252968, -0.95980904862453, 1.27413324137329, 0.710435267260032, -0.252908074438334, 0.576680955998236, -1.75616219535329, 0.446894222351973, 0.136571592717523, 1.04094164901684, -1.38616765558347, -1.16314362598656, --0.814707649391813, 1.03005629584204, 0.168691583173403, 0.352880643073182, -0.915394054756934, 0.874474194652299, --0.765375770858138, 0.189460760765806, 0.241491094337411, 1.06023455625373, -1.41804325110715, -1.70314978465665, --1.0376822258896, -0.041319960067525, -1.41878346042969, 1.33378263749207, -0.890333845406499, 1.56359451289866, -0.820127894949376, 0.571478953563373, 0.933685225297847, 1.60660688890009, 1.73235322704933, 1.74678261886411, 0.66584374194394, --0.506627836751778, 1.06976976798137, 3.15203080551527, 1.16826403547642, -0.434276627901782, -0.542993295885999, --0.876595065386039, -0.977707944033048, 1.54429657382919, 0.915827313322226, -0.2951244101129, 0.273802235753789, --2.05614067908221, 0.233868463802707, 0.836604259187211, -0.898278566277592, 0.686369645588779, 0.756535391002675, -1.52185691905952, -1.01485582940652, -0.814113635090238, -0.19740263470647, -0.677274468461777, 1.57581174671005, --1.06096132450761, -0.191619390815769, -0.405869469103223, 0.535639916832442, -0.451866419853021, 0.0543968057064761, -1.09872796536713, -1.90339575164727, 1.37269830297864, -0.271589658930314, 0.677776772871578, -0.0569336320055906, -0.887390214963039, -0.453556584081672, 0.27126753889399, 0.468737352706947, -1.4421654466985, 1.74636571332661, -0.102874233485685, -0.199194339361665, 0.876409301204613, -1.32736364030243, -1.11913829100626, 0.559785405117975, -0.412118834215127, -0.246404968766841, -1.03039308684089, -0.205730603692799, -0.211508166639824, 1.22302714286035, --0.75315959858378, 0.244104659798786, -1.08125300670451, 1.74206172590985, 1.02741059746509, 1.8154344033563, 0.262310374527895, --0.314481533724166, 0.689047769956382, 1.11648241939299, 0.306501183167383, -0.767035205436497, -0.906390863640459, -3.76683783661023, 1.37717978896611, -0.155837872004312, -0.261643453047429, -0.279031227887638, -1.06325397357267, --0.102948194726815, 0.756890926873673, 1.1650976799338, 0.272741948417495, -0.584279934208001, -2.13122737917497, -0.42503725534912, -1.47400173749994, 1.32374511351428, 1.32250377881837, -1.34075308807251, -1.63549482887888, -0.662373521212944, 1.59934928353781, 0.860379034588195, -0.443581919527645, 0.145832806469424, 2.70902237412288, -0.39809650275025, -1.13947517234818, -0.028680207782241, 0.570890757328519, 0.439405765900811, 0.719374034235675, --1.08123553013731, 0.400331464998524, 0.542087458010464, -1.76826040539647, 1.27462517274748, 1.27322943292786, -1.19178160448095, -0.0278217335758768, -0.0195309708585952, -0.408194697057998, 0.142280502095197, 0.26225376507243, -0.963500525457448, 0.154865368519507, 0.616465223501112, -2.27241764195967, 0.955371394268988, -0.719822643706078, --1.35202441022451, -1.71937625020417, -0.959255388009448, 0.45091263880082, -0.217463460484097, -0.512658420222597, --0.359505594124389, -0.122445877488031, -0.935128676898526, -0.654777688747882, -1.45245128269144, 1.81692695846028, --0.19262146706526, 0.85097790100397, -0.525858965893421, 0.767150051588503, -1.55698173201525, -0.069279319787863, -0.736806785222241, 0.354242258583472, -0.020636846534007, -1.3465135614205, -0.0612866973126842, -1.24255598797839, --0.96462230549068, 0.14313375003619, 0.00567544527420362, 1.09195069332922, -0.0359765200490877, 2.02858475825376, --1.95251039798103, -1.03840845171239, -0.687745560460575, -0.269383522226547, 0.38087373741803, -1.02118377324787, --0.244344739654594, -0.697200111603315, -0.520584651145865, -0.337861254516622, -0.191148114560214, -0.858057274730452, --1.26972436266824, -1.87976933899255, -0.469842320235251, 1.45447278972444, -1.17254672822684, -0.290608379839403, --0.81147334971557, -0.070388784208239, 1.69295311649722, -0.357801828752788, 2.18798054124402, -2.19958564055227, -0.42155909684194, -0.874637604040173, 1.03939659456227, 0.0842575627978632, -2.12563703295746, -1.97866513062987, -0.435779766450829, 0.713112083875499, -0.620161973757575, 0.775575175568743, 0.868613894551357, -0.476195382708534, --0.439905195130924, 0.482074996574907, 0.138955717584803, 0.0434301869921273, -1.35857496060756, 0.0546145009332622, --1.319020206703, 0.291409685265036, -0.207596338164436, 1.62217198479116, 0.506890749401015, -0.108797516753788, --0.571030901668533, 1.33302043651666, 0.160803578975602, 1.73444672600091, -0.453344830573113, -1.53707257308025, -1.48601795346475, -1.19854175830036, 1.10367663411227, 1.02894592152868, 0.23770289794082, -0.461114654863055, --0.286231132641942, -0.0621415653129085, -0.368254207129528, 0.29513390486406, -1.48076202479036, -0.696830819245768, -0.588573223840135, -1.37656690584127, -1.27307932715763, 0.818133844069992, -0.391469896153971, -2.04233887545252, -1.24000004086919, 1.00399515614831, 0.690621755293172, 0.702654464471531, 0.940589192948221, -0.0406261517052395, --0.0511921171005367, 1.73862540810683, -1.1317296125924, -0.0472899164668941, 1.22535920600272, 1.2379619257833, --0.6844607539187, 0.973049485335157, -0.273231620280989, 0.212259573769609, 0.675553315072377, -1.45835113567018, -0.0960481072690844, -0.928217477758954, -0.611047917920607, 0.638045481681441, 0.160337739949286, 0.931085790451567, --0.80548896562862, 0.805706246793545, -0.811062244609748, -0.037051767711466, 0.134281247799707, 1.77851937499347, -0.427727619647357, 2.54031234575986, 1.54453429025266, -0.40853233643174, -1.59267222987308, -0.735519287565154, -1.47226313148417, 0.367370026678223, -1.08491024891135, 0.463440472431992, 0.460799129541933, 0.800727691602666, --0.120598481322707, -0.776951063674173, 2.73097874677206, -1.23345605310138, 0.505963628271601, -0.395963648828319, -0.927705814187161, -0.391446207648859, -0.596014276101209, -0.477214149085477, 2.0928843554653, -0.274736953226119, -1.74357623888311, 0.201595446315715, -1.58513804764309, 0.491678021637239, 0.0949460068454649, -0.0149488604519868, -1.01077908156315, 1.05766437808942, -2.23225254454794, -0.662510951231492, -0.382597588385306, 0.887436739246628, -0.786722918372509, 0.0168381332293539, -0.38780932485058, -1.7316057327744, -0.58538600152188, 0.335719216604547, -1.53511436661316, -0.52605870822936, 2.72375225926553, -0.505739757850597, -0.692392434974627, -0.00986833830111339, -0.199920318113077, -0.26336783734503, -1.07054460100307, 0.930178500987317, -0.414075280700661, 1.22113402855638, --0.190144634457918, -1.63551929879303, -1.10452835561185, 0.0392653014728478, -0.68086298283592, 0.273310187527429, --1.09652908776948, 0.997062238977786, 0.41788856195864, -1.85567499562601, 0.530483350981484, 1.38437437614822, --0.647555780561362, -0.0192313439366694, -1.32181251613875, -0.237646898703646, -0.0425123751037809, 0.114483334733482, -1.49604926093278, 0.130077496525524, -0.331666821044718, 0.380285338100793, -0.000520638221373701, -2.00868401564289, --0.982305612588023, 0.102501751255315, -0.786404166856133, -1.039802488171, 1.07066191707765, 0.700325798112976, --0.124419916628858, -1.36391995558355, 0.448773198595595, -0.988651736840586, -1.46364739551649, -0.735298416198561, --0.394350270178757, 0.244972197618228, 1.38391673107448, -0.521863158391593, 0.49068622560257, -1.31462859648147, --0.0502818876282042, 0.505567821189513, 1.91638760701559, -0.618515382249266, -0.168720575879912, -0.418841085575602, -1.67779111560424, 1.66476250270218, 0.949114965344561, 1.04532692970569, -1.00808525213347, 1.76258822533861, --0.444948841313385, 1.07717353913569, 0.680305026000066, -1.4782240937189, -0.476058721102856, 0.25631922452191, -0.195197936310572, 0.0897225219235091, -1.19868958002379, 2.16142358709174, -1.47960275463848, 0.973297684335984, -1.24651146199437, -0.641963929543071, 0.247434860430283, 0.454921760992058, -0.0528171384600678, 0.731382925497137, -1.71341676557656, 2.18892829049599, 2.79353282993424, -0.708079735381304, -1.24366525700261, 0.294732702068848, -0.834810147440775, 0.196315457713507, -0.899496477660834, 2.08202063189272, 0.21304917685251, 1.18249974278489, -0.648643532237228, 0.830872204261401, 0.230821252388848, 0.0815797200037048, 0.304589359719039, -0.423846652220264, --0.504287402020326, 0.602870822257414, -0.382275955150207, 0.859368992200834, 0.202999730123133, -2.31349760920967, -0.802670916046709, 1.13418686365258, 0.957468856243571, -0.845712167394389, -1.22134143810793, 1.17563900996469, --0.896974039141064, 0.0478703924638481, 0.542440173549328, -0.361475536171272, -0.442354162244736, 2.26671594665371, -0.383852155432115, -0.433386697254247, -1.02614406081552, 1.20917422579235, 0.77105721017684, -0.287678178374954, --0.13579343091496, -1.16099485184624, 2.07736279503333, -1.46886113883301, -1.61006681612026, -0.618267065002142, --0.199942632137576, -0.176438902458016, 0.777062007322461, -0.665208551853826, 0.773044068673035, 0.615067753081521, --0.500982555777752, -0.000774560026260527, -0.0767103318088046, -1.05231621875005, -0.0222647657875196, -0.146615971134924, -0.88934538720947, 0.549873852793186, 0.220432264341539, 1.10618970026825, -0.568316887708695, -0.727032330291391, -0.368823556787573, -1.71510211435525, -0.65574576566265, -0.525446109752696, -1.19233871755161, -0.529497729638595, -1.66242700921713, -0.252472012228203, -0.686583625655448, -1.04203948981921, -1.83817175803726, 0.474167844435158, --2.30963395619624, 0.524847195292576, -0.478681944626079, 1.32214320067918, 1.99925290787052, -2.55014923535022, -1.47336566721657, -0.547549817291385, 0.171874439212098, 0.602048370702865, 0.124792865013968, -0.828330448002847, --2.08594884372789, 0.427528722423596, -1.27193329578638, -0.374275194440024, 0.0829618367722746, -0.245443376083751, -0.438627357093882, 0.515645873243813, -0.489368419164902, 0.34630904515848, -0.0101141854246441, 0.918643074519654, -0.220773684213449, -0.499217514235159, 0.950921304447677, -0.0239742097372436, 1.11542448209141, 0.350442158432265, -0.848930455154403, 0.137515411574061, 1.2274174992014, 0.219301789942065, 0.536033067428275, 2.48540778247381, --0.362122257333837, 0.480052033257436, 0.110904324806323, 0.212292691054205, -0.632871583093108, -0.333916886184622, -0.980976871254983, 0.196943466516354, 0.996805376784773, -0.0784052742157901, 1.37447470070573, 0.279838049704097, --1.36529895595389, 0.520512553302464, 0.850150831889668, -0.956905273651984, -0.0247274479162886, -0.793178530978424, -2.49268041136001, 0.778716566208253, 0.942904157024646, 0.416347184456762, -0.415847002469499, 0.445227068795132, -0.82348776977623, 0.080685797741146, -0.783465909215618, 3.22715592580013, -0.326090840426158, -1.31203619528645, --1.0865411157567, 0.822382181848402, -1.49098564421543, -0.393386260517711, -0.406469893374497, 0.650168713280261, -0.910300383766338, 1.169791332205, -2.24981826854837, -0.776170176166498, -0.440425036313027, -0.514991146306159, -0.185263209998666, -0.796597014581156, -0.369186757994165, 0.824936063933908, 1.02294622021292, -0.7523684447575, --2.019590395125, -1.19210100915996, -1.65028133977956, -0.748701109502043, -0.858164391078125, -0.078117658296963, -0.900838121110923, -1.27947180164293, 0.545729655323476, -0.214483695059888, 0.466423080671046, 3.13919168971737, -0.823447656838946, -1.21386487456368, 2.09327307414766, 1.13713711485185, 0.674051405305029, -0.184686698345745, -1.64111329450899, 0.114974402891788, 0.886914632951823, 0.105416236440144, 1.17173524471514, 0.0246199819065983, --0.0603640439815867, 0.876233920654766, 1.81495751345737, 0.825011646825204, -1.10171895259106, 0.900701576219562, --1.19863137019053, -0.46327650607889, 0.357087854013488, 0.0406236871148842, 0.503470623778733, -2.06183278748823, -0.847503186727759, -1.56875694287556, 0.887400931360903, -0.589116793120388, -0.271143266637012, 0.289072683765821, --0.31325888956198, -0.473971368603756, -1.31269176438519, -1.59182347459779, 0.396213085598731, -1.05601342317088, --1.92090362170251, -0.553503872617805, 0.637173917785244, 0.483942169930861, -0.112904109786546, -1.15949038956261, --0.405299604818953, 0.578519585388543, -0.287467158156901, -0.475216533761514, 2.13906312928648, -1.61586765297041, -0.354430906540344, -0.274441431661437, -1.13095067454424, 0.0981210203403761, -1.49057831276565, -0.877792268724293, --1.50522395807214, -0.196700901751441, -0.497010735566395, 0.52180026430156, -1.11192632823163, -0.499217853280515, -0.74520669083741, 1.60743995632495, 1.13441565662034, 0.0813230491105811, -0.421945902630606, 0.940458345878486, -0.0200690124894736, 0.91585316322828, 0.870836109864894, 1.3493270239375, -0.661754723244057, 0.215605725800261, -0.257890722488491, -0.887338729543834, -0.00917194447363946, -1.1217406415169, 1.70618320531815, -0.810791345739404, -0.38309928020323, 0.448553989941731, -1.10475454521168, 0.0612717212092909, -0.449299251230894, -0.306495136425724, --0.350546022858716, -0.333337291031812, -2.42062711046428, -0.731042775931164, -0.252069540205202, 0.443386467947925, --0.28316220493031, -1.61374259008602, -0.140658550468521, 0.388256301116247, -0.657433678820824, 0.753427848642451, -1.04002457631025, 0.399078787530769, 0.246217790723561, -0.0599619876785327, -0.492243488008049, -0.0171310488842654, -3.22447923366572, -0.804876879394368, 0.322120438341655, 1.75946081283874, 0.841998817353972, -1.17081842360728, -0.0363277895218632, 2.22536778088311, 0.397891321706723, 0.164124590780595, -1.4937199581207, -1.18090924705171, -0.383854552440351, -1.19047987677596, 0.556835257592055, -2.14993697305066, 0.54526580650647, 0.0287616741219916, -0.798593799608687, -1.35173357164528, -1.26695719989819, 0.527474760764209, 2.66492350070306, -0.803425357746854, -0.152450694974188, 1.29181625984123, -1.02906991266384, 0.939698373378991, 0.7776155452888, -0.86895224674067, -0.478809623133283, 0.133987358216669, -2.34660468146642, 0.166766913207752, 1.69599604366505, 1.1465410544649, -0.187616010105279, -2.14983602777617, 1.21011622864479, -1.9189142637888, 0.255560637891562, -0.0639571262828175, --0.354950529671107, -0.994366791673954, -2.60358493632124, 0.240391978262506, -0.52527052316367, -0.958169960751303, -0.722519147602856, 1.93104613558702, 1.37774701702233, 0.123793941868018, -0.267899683547104, -1.48745656893874, -0.642803134949899, -0.0701735750155117, 0.710036216588474, 1.31745954091969, 0.264928952310476, -1.11833770772655, -1.47465633899462, -1.00790626265857, 0.557614966327324, -0.727886532093677, 1.65302203087012, 0.239572942375077, --0.540450227625393, -0.312824230055853, 0.74701338238783, -1.85750687687797, -0.359904884571949, 0.567076804468009, -0.0235887288621311, -0.966304317478704, -0.22147937623987, -1.37508803918859, 0.56538704393435, 2.33988259025513, -0.107065682492102, -0.864245359008627, -0.209433025486547, -0.511379124122074, -0.200848868592599, 1.02583840179062, --0.412050045738494, 0.0568730523603233, 1.33177739426791, -0.351972891316956, 0.90733793092142, -0.324240738373258, -0.39309131713129, 0.247415085044322, 2.06650594578707, 0.284662226139789, -0.693136483713115, -0.833445989249887, -0.681262398918784, 1.03023465320332, 0.731499997907573, -0.331555602813729, -1.10011331763199, -0.638598258934938, -1.19338525538027, -0.845408014240439, 0.319124087088491, 0.49170281027742, 0.0803437265977739, 0.766627897903658, --2.31678427595799, 0.694654024902981, 0.281942108875862, -1.21441175843125, -0.814917532614751, -0.581686924691082, --0.379449993531234, 1.30434288443977, -0.361504293450591, 1.28241543737285, -0.208554064635252, -0.83553464950798, -0.180170730326257, 0.512885189315319, 0.577826215733377, -0.363211266141713, 1.2029022067826, -0.334749196787956, -1.25942224210197, -0.50016408694099, -0.191100256479763, -1.58499481296224, 1.01035719252356, 1.30110174404215, --0.485443044219321, 0.441521791685085, 0.125084201731331, 0.435673365928597, 0.0675235177226824, -1.41835534343045, --1.33127039537081, -1.57997562471892, 1.73854505940488, 0.131624503559886, -0.265229392077413, -0.713474065047417, --0.198382304487168, -1.18755109221121, -0.250147472896154, -0.716968970164428, -1.148809251639, -1.42122523773506, --1.45664583494124, 0.0208842856557998, -0.217241276375894, 1.40643388570903, 1.55763563602833, -0.648685581299723, --0.195971177260196, 1.49884282371987, -0.857762337199353, 1.39291937697283, -0.395793868517914, -0.651878600368414, --0.0622312132670148, -0.152622786612664, 1.24316673653787, 0.0942068811966433, 1.61122043588052, -0.147523537812676, -0.0729458313817156, -0.603019202333611, -0.073861156050804, -0.594916798965121, -1.54752585905179, 0.686851484753666, -0.382153089408943, -0.643434019817887, -1.20398161186663, 0.692492739510137, 0.842233242391281, -0.021920564543543, --0.375695042840962, 0.711828474511327, -0.39233994498129, -0.681008267906583, -0.639402644595167, -2.39220181307776, --1.63961344899258, 0.457133809251128, 0.318629168517501, -1.08601322865289, 0.173745803153996, -0.729979822669873, -0.834088450723099, -2.12817350185483, 0.407921714592737, 0.207730006306799, -2.68706644685499, -0.910436826819747, --0.745449377659998, 1.23299932442097, -0.479171409437998, 0.867136043182857, -0.602309850761325, -1.17927411591461, -1.73585993123616, 0.6889154607863, -1.21529756716038, 0.0926264976901534, -0.341405101711432, -1.32891382281543, --0.00818908863580715, -0.829144743811355, -0.183678362703344, 0.923196996206639, 0.358928975009762, -1.92095298302295, --0.468092416680777, -0.475358459370414, -2.04593246556492, -0.150145335852918, 1.24406605919476, 0.571160567645386, -0.431164210156002, 0.327993611205178, -1.70953446832215, 0.408095329142076, -0.58980247182501, -0.814280183445037, --1.0291131384592, -0.921816981108236, -0.337283230794931, 0.722612612775153, -1.09063543065816, 0.596748544091265, --0.601252717073779, 0.0855526756412077, -0.462479060882368, -0.269608435596995, 0.891898484013042, -2.83281304460574, -0.184035094996983, 0.00205857772971073, 0.0508716617129507, -0.461662675405653, -0.355553930625955, -0.171250102097201, -1.61168255815993, -1.01626425727115, 0.110180304258382, -0.0191299134061181, -0.660592685461671, -0.837893241309614, -0.455925088229863, -0.30058092973999, 1.49498111033782, 1.73924259912529, 0.295259265153872, 0.542348164772087, --0.741661171346238, 0.893414392495088, -1.01658003994309, 0.739151426349952, -0.705953806910887, 0.285947338584182, --0.173175536799315, 0.155115081293236, 0.10523105266159, 1.81049695293777, -0.328198580985188, -2.31113317821335, --0.115731235856713, -0.548384051086303, 0.232651986150872, -1.06495858152433, -0.0259187981799517, 1.0792377976084, -0.511668354807287, -1.2638389739733, -0.754395086740637, -1.00280218506219, 0.124399624882751, -1.32632056922945, -0.692980132917634, 0.156849997223761, 2.05743123626016, -0.218166063502434, 0.749242800501542, 0.0533161969038064, -1.28671759236825, 1.50259017147162, 0.602255068915151, 0.846394323917256, -0.801177589931868, -0.35897971134869, -0.023173780465707, 1.12174970266825, -1.18883185310149, -0.576663083452696, 0.399608648534713, 0.411319284944424, --0.354673634453167, -0.391806909356344, -1.01085093683899, -0.593266038334749, 0.619573103104917, 0.562753911524473, -0.659248427765443, -2.78475441968216, -0.126377875856993, 0.608723104004398, -0.0713773079751286, -1.6476702485555, --0.68349508324214, 0.372927964766524, -0.219211476394169, 1.55274457359156, -0.704727765971994, -0.976936106197883, --1.36306143148086, -1.45715833847194, -0.595539793577838, 1.54825704043651, -0.142063207186533, -2.23408737278877, --0.685496916917647, 1.06124422051942, 0.878339197637764, -0.70883716792792, -0.572310889297068, -0.690627956187673, --2.20020909117194, 0.018592728811664, -1.03917742032228, -0.460569730393702, 2.44920470272351, 0.802812095429966, -0.512442438617665, 1.17957498833314, -0.118443923349902, 1.11109335729486, -0.702570395328921, -1.6735889814506, -1.07596057195898, 0.23617635314156, -0.919902652247638, -0.784809152321071, 0.496730860702687, -0.888555938480899, --0.62105607190373, -1.11045323243442, -0.588661094120453, -0.417273002903193, 0.87606624748776, 0.35969196479303, -0.0215974330825434, 0.293138635854736, 0.161893184520072, -0.626544217552067, -0.574352339017486, -0.517974703819111, -0.727321052454984, 0.356894942655391, -1.49567315016453, -0.117051221746883, -1.01227371830613, 0.695580092874502, --0.0844099684651905, 1.02424717322075, -0.150528307610411, 0.210563006071437, -0.574953394198525, -0.106939409163518, -0.828946986956277, -0.682025673165675, 1.13547348215951, -0.191775660482237, 0.622532985651407, 1.4324970367065, -0.673337086795998, -0.468942518618007, 0.310493065447535, 1.8764689738608, -0.590141201071132, -0.708762856989728, -0.39871563710763, -0.520878213454716, 0.0694919121773398, -1.58623275689996, -0.555848644240998, 0.426017055352023, --0.666755270042311, -1.39539843279569, -2.01184789231196, -0.496705818397604, -0.406361752524518, -0.940682495086673, --0.47391464520416, 0.657180607793011, -0.0543616042187232, -1.36854815066048, -2.0735703273294, -0.667629055883582, -1.9665853904812, 2.04847342714151, -0.161395152226328, 0.395377247392817, -1.24551825872196, 0.157925335011826, --0.282444964122379, -0.849782343081013, 0.47865575187699, -0.193069794501618, 0.861483803664676, -0.412192764207107, -0.622456156890488, -0.628682643111582, 0.522194367487827, 0.0947242875430555, 0.0464722968505564, 1.11750995391606, -2.1789086321588, -0.845324742838876, -0.789091296502301, 0.162613042843295, -0.818548758580025, -0.631858721850001, -0.201768193856993, 0.0735225204064982, -2.28875716227135, -0.925482946920926, 0.121599925359124, -0.227312024512738, -1.08447561899816, 0.74350856721378, -0.544682085181789, 2.09647576068325, 1.3053776193511, 0.692964932925383, --0.0146856428702302, -0.60494369165062, 0.33121101663841, -0.559612685487852, -0.356528452391949, -0.451925042319914, --0.0471597184912381, 0.699656898825309, 1.12588345325173, 0.329873845885088, -2.79650943924649, -1.43723682136143, -0.387398237245481, -0.539510954490176, 0.701534647610463, 0.830948273117063, 1.62713838123293, 2.04936900444558, -0.156148581458487, 0.0859450608507081, -1.26622082137222, 1.86632892288209, 0.0710278939821467, 0.308993919484177, --0.257200693393904, -0.500261253741122, 0.351197255638354, -0.808196100861813, 0.915960776950478, 0.382770829635983, --0.430326670874091, 2.10539582969095, -0.033497884311001, -1.09945967361461, 1.41887171682044, -1.40426658296917, --0.150496970168789, 1.48334110714222, 1.6530418053314, -1.62959859361654, 0.391055612342051, -0.700701354243743, --0.0158390943151547, 0.333366901718695, -0.826491435143758, -0.256932098964906, -0.314639245439301, -0.0655832089215406, -1.01132277255796, -0.510776894049764, 2.09351039069661, -0.144441655842482, 0.106813566310274, 0.970471804471967, -2.37019427258203, 1.73163020100362, -0.506321057914971, 1.45337091256432, -0.488487697448664, -0.701038098979985, -0.712550757623262, 0.114076269518271, -1.58580087943766, 0.242381082950347, -0.47470433017502, 1.57854967040026, --3.32229823848405, -0.204945592833509, -0.596048481716935, -0.500730608948299, -0.250537589476814, 0.593905528985014, --1.60576420172396, -0.382464084118365, 1.64045401445936, -0.86132449013351, 1.04963791827866, -1.17481467662311, --0.169205684130108, -2.04381394969287, 0.565441520928664, 0.849396769111592, 0.531644671037366, 0.528043710318909, --0.707257868555438, -1.507027911566, -0.160949703746541, 0.13519801435806, -1.00410363678253, -0.773214477302505, --0.77855274501213, -0.57089609288433, 0.622853337514122, 0.583855864294478, -0.620737171828313, 0.204827266838959, --0.819199993348606, 0.51833499421371, 0.759693784209863, -1.71288278830896, 0.883807896124122, 1.25618636697351, -0.0485176855229995, 1.3415248920555, -0.757419172965304, -1.75993327635787, 0.428627833633813, 0.247498469229836, --0.0565566662782431, -0.96568299386911, -0.304942175282622, -2.39656381785892, -0.703987917166608, 0.996718523912795, -1.01572595810203, -1.56904278603934, 1.48909145777163, -1.12339062605195, -0.163113084460674, 0.918713142723964, -0.19344912834166, -1.15987463256453, 0.747935893046444, -0.201562637399061, -0.432199397627923, 0.0764818371109086, --1.71978332360393, -1.17131439604597, 0.113911284815932, -0.711086394054577, 0.862930929568103, -0.912496267807739, -0.41442995498814, 0.61483901008584, -0.00621246849817066, -0.692269867069709, 1.04669047032259, -0.460124993753049, -0.586045738116509, 0.83180171952573, -1.09958158917106, -0.738827869407309, -0.459321928623381, -1.85700613321966, -0.558009785788527, -0.681951377337604, -2.14701737990137, -1.13713584264224, -0.776969198211304, 1.79482996729549, --0.473838388782687, 0.18814191808019, -0.827514492625635, -0.068596124852665, -0.595783557678687, 0.0893185039767077, --0.791649460514419, -1.05405812709871, -0.819584627193412, -0.742261157614926, 0.187775813153406, -1.22548859695757, -0.396693775209534, 0.052014744306235, -0.466127092359588, -0.0689782335554491, 0.114550240435086, 0.839959857144331, -0.375180162523903, -2.27349017104779, -0.631143371559063, 0.469852465976199, 1.68100270759105, -0.0577924883747859, --0.5720429725788, -0.652722562372924, -0.371178790994959, -0.436776988022211, 0.208265600407137, 1.02252901533876, -3.56847606563487, -0.307081094654161, -1.0968561691217, 0.869547978907917, 0.19026472560284, -1.66561618987774, --0.181703365205395, -0.742425420815559, -1.12957064520389, -0.106640399151261, 0.510295858413093, 0.676091787359058, --0.88954634970437, 1.82225603211192, -1.17257857005109, 0.836156776093343, -0.965025241536412, 0.723793825004305, --0.636817461064606, -0.40485849375974, -1.03156185149468, -0.488143127276609, 0.969147182150957, 1.12519344082294, -1.14978044090751, 0.243963318207817, 0.96046443459479, 0.172382250258435, -0.722075108316328, -0.0741910100873159, --0.00085190504056063, 1.0085344877979, -1.06299314050896, 0.971243138295901, -0.836443956155266, 1.07841074095538, --0.95463968259426, 0.234741413348922, -0.00186900143795351, 1.27853110304772, 0.840524020933195, 0.203339476456731, --0.391346527844205, 0.376369994892814, -1.23363395744787, 0.207452288724735, -0.722992649729013, 0.307729468432459, -1.81082428053763, -0.30062473427092, 1.43506648827295, -0.676604286068911, -0.189906613958794, 1.32125861624476, -1.54168751420796, 0.305673445478397, 0.710868743609061, -0.121539453312946, 0.302100684314833, -0.312799580467484, --0.649210693060789, -0.609180347851937, -1.94388546003341, 0.986146537024, 0.452391760854133, 0.597877741038092, -2.64386541867346, -0.772590911626522, -0.524576172751084, 0.44834467419732, -0.350002288598073, 0.565438271812682, --1.43434295311345, -0.0352418504699756, 1.25633317811449, -0.782351288352408, -0.697708861186578, 0.97732288161076, --1.46420837705561, -0.335719724604514, 1.58482745965435, 1.59026340506319, 0.59700448434685, -0.0799810813299777, --0.460114748492355, 1.67740215914818, -0.590922267724176, -1.40793859116576, -0.0339539116109284, 2.44067366668154, --1.14281647437275, -0.390809582665315, 0.671645806738015, -0.743075440135777, 0.10427744780302, -1.78776732284328, --0.772439987929651, 0.371285963645804, -0.318308260419441, 0.421376886004508, 0.044364719683661, 0.0844165475074308, -1.07377984749817, -0.118856178877065, 0.803449801556336, -0.464655091831111, -0.430542203787237, -0.624911449158424, --0.38422531426713, -1.24251553448876, 2.43289216717579, -0.346038028811356, 1.83133260854566, 0.705805622413765, --1.34981916253167, 0.316496281206442, 0.0975031188366082, 0.130374968277663, -1.16208945608109, -1.61898111342846, --0.740250824716068, -1.31648355258849, 0.694151502372948, -0.287820752898905, 1.41346848323664, 2.46438904151208, --0.0456694673642582, 1.44018041247758, 1.603432828664, -0.225654583870506, 0.905085684764403, -1.13273229309886, -0.0832876118374528, -0.612156644456585, 0.0123482668886766, -0.315009542643236, -0.194228915390395, -0.731186429396767, --0.00499592585924682, 0.456451128284726, 0.916709166742136, 0.677305376073443, 0.570217498944252, 0.597320782449998, --1.32754029289562, 0.498370955618571, -1.2982473772681, 3.23773967235261, 0.912404904295226, 0.636142292566659, --1.34120862455013, 0.464265589031404, -1.38233348326388, 0.364344279098753, -1.38706570242462, 0.364400013760918, --0.181608393380417, 0.75780196753076, 1.65279515466709, 0.96194981390408, -0.0196285930215416, -0.62094200347614, -0.0388534801185718, -2.36554997737282, 0.550709219884992, -0.927939696738509, 1.08382681737521, -1.064960550709, --2.23178329558458, 0.0394753781878992, 1.6286070016511, 0.121010284099998, -0.772806526150449, -0.972084072806234, --0.472635896255303, -0.45690416288331, 0.686465263048238, -0.818938725687016, -0.204135429679284, -2.35794520203861, -0.500771499803663, -1.56580182655378, -0.967476598982091, -0.623903295248768, 1.31376605423861, -0.831297356208247, --0.13937037721013, 1.64059054758308, -0.278952181420543, -0.132225410749194, 0.715259057467307, 1.88329036156203, --1.22193144815368, 0.308963145901669, -0.211733356327027, -0.552074113967627, -0.614803174536129, 0.218983677669444, -0.782027353949028, 0.10750268729999, -0.477303421165284, 0.797009035004475, 1.07198709877451, 0.0284409688305677, -2.94005845678994, 0.256941392029027, 0.287902579333811, 1.72561598110298, 0.395074952032179, 0.330236960400765, -0.356323888214201, -0.103816468025217, -1.2110585383857, 0.586868161704689, -1.44431126291913, 0.93909296785206, --0.546595557849043, -0.660447648683617, -0.195333527623677, -0.678579683380112, 0.799182900567525, 1.64096658457427, --0.02242117297554, 0.435944093293608, 0.42294529556028, -0.301657933055046, -0.669332162989219, -0.571672161972581, -0.682699420378375, -0.856349620634821, 0.683684738619613, -0.71051405282944, -1.57707269647076, 2.03248488645326, --0.170975950605695, 0.297493996728774, 0.999014527062821, 0.743454205462374, -0.357631647967409, 0.242084273767459, -0.112668506915432, 0.342027988357843, 0.976490258823861, -0.0225181190035251, -0.345656164370492, 0.177087380693318, --1.18217932732495, -0.739736283283325, -1.26804802584581, 0.181192813457647, -0.653156658860525, -0.844442799241131, --0.401168274687026, 0.241633168962232, 0.519225736486193, -1.44799649375489, -0.0648827631180964, 1.25217465744077, --0.0500199883398958, 0.847693582628415, 0.787114108473497, -0.165517564706603, 1.03870189435856, 1.50606928429865, --0.498168432233681, -0.418714124876545, -1.54582086512618, -1.06760457011093, -0.0709667344401404, -0.862328799383351, --0.0689325203811454, -0.570082729081103, -0.316077906577837, 1.66952445790411, 0.12103085566028, 0.724134549590439, -0.0455353994851407, 0.0502622269242079, -0.917533742474637, -1.24095766398073, 0.585147820588634, -0.637222767873192, -1.79274468062622, 0.667002511700976, -0.29450930898595, -1.87422383882066, -1.00952842248749, -0.537876882364985, --0.90354802854534, -1.15755775505305, 0.994508883029376, -0.495273859103067, -1.01491705315377, 0.974672233001141, --1.50692008848337, 0.982921902454441, -0.34220263361418, 0.90064047519107, 0.433533776960179, 0.468539612755871, -0.768301370161523, -1.05722862287679, 0.235890455075616, -1.56850970161419, 0.833839037027777, -1.6677086495439, -0.523683580142997, 0.994408627697874, 0.275685958527233, -0.950794618677126, 0.837498804740339, -0.549258241191782, -1.59400172777006, -0.317872488469472, 0.643119496138598, 0.113203005726767, 0.215157022498076, -0.126433912295922, -0.721039508013921, 0.313984750101641, -0.0337823755148467, 0.357946514229743, 0.250734197784217, -1.1718496825412, -0.143818287775655, -0.327341960396753, 0.337472223423486, 0.925071346873267, 0.492269978746187, 0.953657505275894, --0.0932494132850098, -1.00547233753041, -0.888731725963046, 0.223302585532699, 0.700136859504097, 0.472149798772864, --1.636625469928, 1.18381510500034, 1.32323828038912, -0.90882038947235, -2.10388404312569, -0.146956503133385, 2.0317159476772, -0.274760881641961, 0.899833658226889, 1.44591408324494, -0.178923635875843, 0.43617778173223, -0.130558600854887, --0.254110832858324, -2.44540042391227, 0.0528988343824327, -0.220467237232147, 1.10755599237824, -1.32574091187817, --1.06119509983336, 1.05460767881413, -1.83746062363099, -0.737445882997075, -0.687813788719305, 0.0268632518985445, --0.218773009381229, 0.591908903838664, -0.0876555534307165, -0.0135024427043949, -1.22515749547251, 0.203998851206652, --1.26072884627769, 0.136946003415807, 1.63656240030638, -0.162206907683976, -0.0406404458548001, -0.211987191384205, --0.393676580863947, -1.15662467154047, -0.224442648253871, -0.812291970963785, -1.02620918611329, -0.0636293338517649, --0.614368111228167, -0.532857985544458, 0.181587816323057, 0.333852497884341, 0.58182557682755, -1.11747769183997, -1.03182762302896, -0.6662583865445, -1.452608867173, -1.1729192707661, -0.836083304872897, -0.588363746985412, -0.253671923170551, 0.0958444460902049, 1.24774192611588, 0.512436401855791, -1.14604069366921, 0.881959403912999, --0.315196483831985, 2.6317507283403, -1.19874472419959, -0.0353556380740484, -1.63571099254065, -0.739439741068132, --0.919515034829325, -1.04573480303206, 0.165338923238257, -1.31173818376962, 2.24710723045475, 2.03462615320116, --0.0853963610753332, -0.418033030310625, -2.22700924885962, -0.616939188708184, 0.0653078939841593, 0.361416987346173, --0.175172025798929, 0.348678446238639, -0.380513264993386, 0.3733837620499, 1.67722445612266, 0.803011065987501, -0.405128126794107, 0.676870592868587, -0.0435270334275078, -1.09856039980897, 1.8530246910501, -0.0405968898012778, -0.573741414132854, 0.55025481309742, 0.536936172925721, -1.35153164088025, 1.87401724514262, 0.982327474937643, -0.0491557879465959, 0.134536075720652, 0.719417877608776, 0.488922327451108, -0.12332841580315, 0.0735176535308767, --0.847316661609821, 1.68429240251624, 0.085861226092997, -0.26414854651367, 0.387595185541997, -1.5419595148326, --1.87606390106174, -0.0600679582204403, -0.550276418618738, 1.80077680879864, 0.449589248022093, 0.0306257763390939, -0.171372464609088, 0.357671081166065, 0.585158154413417, 0.504577323308169, 0.486684251327053, -0.789100843862339, --0.248921010414257, 0.542217915528488, -0.788649900724165, 0.170873543995771, 0.509459337523056, 0.301930253477867, -0.184239454786575, -0.29341167400345, 0.162636916908402, 0.354533373669608, -0.277963346125747, 1.31288849702843, -1.21242706061066, -1.12896503983154, 0.927161755765431, 0.881619093157614, 2.83676428129674, -0.0904991194442989, --0.652520227993617, 0.564345959629042, 0.305562632094674, 2.64330659744123, -1.37438149000371, 0.711217137971917, --0.622084053647095, -0.537774144270132, -0.902660336174718, -0.0930055087601342, -0.327513800471698, -0.292554947866469, --0.380952437619937, -1.08654925541244, -0.18603835307064, -0.504832217447495, -1.25739140098319, -0.242585783165969, -0.356608465492102, -1.67514372620534, -0.40673746022146, 0.561563669135244, -1.53719513472568, 1.54773494947555, --1.70510009464515, 2.71453564346424, 1.21624689641211, 1.07567207362478, 1.42609845362828, -1.34861656051479, -1.58757717271111, -0.776210969297849, -0.324845330382352, -0.464588675831031, 1.19752506115094, -1.40386396174594, -1.91976276222937, -0.637253016289396, -0.186721847967028, -0.93857064595718, 0.379463293016508, -1.59004515402881, 1.1098722300488, -0.303110276619267, 1.33568416935654, -0.0411714489062496, -0.525909404948635, 0.0192763053142469, -0.308370183385204, --0.749091465527286, 0.181060741414565, -0.835406979306407, 0.0553015859918287, 0.10494239325998, -1.55551671223087, -0.991440224331468, -0.337163478148234, 1.11960881671513, -0.967553287955973, 0.568830621097512, 0.00396811889236021, -0.0512552138962078, -0.651832080685342, 0.93624000501752, 1.58430567362831, -0.526768671899652, 1.34908034429438, -0.888625164329524, 0.743794939946617, -0.336214103458952, 1.07746487247325, -0.394575406780636, -0.102389792358481, -0.658800485095574, 0.665954387295975, 0.47507778751106, -1.58379881495432, 0.170378689619987, -0.789887895887962, -0.302535902222984, -1.65138016004422, -1.22517991745554, 2.00870986065808, 0.740930763361864, -0.798008900567931, -1.22210779701609, -0.705468250992219, -0.223297602598856, 0.00466421974643661, 1.34789021478449, -0.768210387055366, -0.109046676927305, 2.36816834451168, 0.487619052762103, -2.2641763242146, -1.34081884014424, -0.70623843000754, -0.590160535328142, 0.655924848192296, 0.111704804379263, 0.907218845946617, 0.408284188103623, -0.84395335970777, -1.3972070395104, -0.0008247094561625, 0.597221715403932, -0.147196738852832, -0.141800593850717, 1.5358576153415, --0.59890418824874, -0.879023747377212, -1.30682168717905, -0.624606816929714, -0.781750558849035, 0.14472072823686, -0.444198250586928, -1.7195240218047, 0.423153617383867, 0.248822986747802, -0.21392582273683, 0.561301406175048, -1.60570216304396, -0.849323646110693, 0.411212639515081, 1.45683774154108, -0.445309556402265, -1.24833764953502, --0.908509146952982, -1.67514197499712, 0.285379423298436, -0.360940467038774, -0.0234578454826057, -0.933366007630125, --0.251177472832379, -0.752041174804001, -0.0547037113286027, 0.127944425205534, 0.245613078985839, -1.02151781164219, --1.15054916208521, -2.09756773603652, -0.687790812142181, -0.462752884195375, 0.581198377389343, -0.0301720996225784, -0.963903811605354, 0.123955101696373, 0.308237591942875, 1.24623496449018, -0.413569654506342, -0.846485416634452, -0.323061943287442, -0.0252107548983457, 0.111060893324587, -0.523737789237296, -0.3975949775656, -2.07531596802062, --0.312641084752504, -0.562915861405385, -0.526127824780207, 0.440028398785041, -1.4980959027073, 0.970552718808444, -0.377585834956468, 0.398978361482786, -0.060454402886166, -0.690964556549048, 0.0917285661468366, -2.17694004440896, --0.349419735948686, -0.0583617826361126, -0.945628423280178, -0.501148410033724, -0.338575875987258, -0.166388564261645, -1.23502681137548, 1.62695300575575, -0.0555255398066202, -0.478176406482808, -1.29238050362319, -1.36573433889388, --0.629714270382745, 0.692459436538853, -1.9114225862503, 0.684925139791708, 0.904937254155084, -1.62624696601384, --0.145128162485109, 1.29877671651163, 1.24052152009969, 1.3108213598416, -0.314393819462537, 0.413846795604404, -0.267979078583382, 0.31667759282488, -0.225191008659782, 0.158694861839583, 0.970854895867708, -0.391389380665577, --0.323187268590194, -0.613816642096993, -0.862058430377786, -0.89458347847626, -0.786058600863711, 0.0349756793665593, -1.45736658082888, 1.04628129590686, 1.52214140663299, 0.36099894485661, 0.591860506220764, -1.4359333091901, 0.982718894542313, --0.750890212875129, 0.563591084032468, 0.0963118078399033, -0.024328157338997, 1.33503971855392, -1.18396798534241, -0.965232153915219, -0.366467597119963, 0.252988489815166, -0.163167876056863, 0.0881081861121518, 0.965811605115934, -1.69165510087229, 0.472502502876197, 0.914743439286609, 0.579494854199228, -2.36573824705096, -1.33671295188081, -1.12289990984163, -0.276046160589429, 0.404684662640455, 1.81649587821063, -0.281625715460359, -0.2574958540193, --0.660402486567588, 0.378560784547543, 0.308176689510192, 0.633966616925427, 1.26033296492696, -0.924407276698663, -0.832371561387768, -0.165614502539187, 2.30935014842449, -0.165740611639757, 0.616014910915142, 0.416664741836105, -0.462658685455797, -0.833689357046117, 1.07669722607958, 0.39121977083187, 1.85237917568027, 1.57872806557405, --2.78016354263892, 1.21097348893872, 0.34244171449759, -0.179361846300747, -0.660715029035978, 0.127290762740227, --0.499502270863531, 0.0779248418791297, 0.833779930718778, -0.17221271057451, -0.12755016133995, 0.879725316212386, -0.496715246942674, 0.804193800661593, -0.45789539728583, -0.246699670371196, -0.600472575996218, 1.0288607644986, --1.4289458101882, -1.47002452734476, 1.49246130865092, -1.82520600165965, -1.34869663971019, -0.196969391930501, -0.263890977327658, -2.2587268646638, 0.883491957444909, -0.283271085627698, 0.115483395393188, -0.191758786038382, --0.626564496196397, -1.26542945310403, -0.911441746618673, 0.399912558461291, -0.736463961545151, -0.690396580127968, -0.496873569284866, -1.6663764571892, -1.43494770238387, -0.53096442234051, 0.67658090189962, -0.953633188989408, -1.15609284222199, 0.995526601304838, 0.425869664218449, -1.08489316755775, 0.113028121215589, -0.598242996028607, -1.6097490133133, 0.711753345165799, 1.21531305912402, 0.443635642240998, -0.280731520165963, -1.56120957190041, -0.776995244148751, -0.353528536344804, -1.48137477352282, -0.951073839258129, 0.74694574524485, -0.528547085387285, -0.414629810504057, -0.733645607984922, 0.431047020456991, -2.4081021821515, 0.282939810653244, -1.61784430522606, -0.0692588793817178, -0.747561937136548, 0.928966506152104, 0.0715777491516724, -1.79807819145039, -0.659573168877761, --0.484522395619548, 1.4841318223697, 0.629316311363965, 0.110910723348847, 0.589243559263246, -0.560597141519463, -0.869532058524541, -0.24523980458466, 0.973747650589645, -0.279821791090805, 0.379822986502657, 0.298599967409182, --0.987194185353188, -0.902299212629249, 1.14068497279824, 0.380927501873903, -0.376121180211975, -0.1107534640938, --0.116015032205686, 0.395004271182429, 0.219524824412668, -0.0474101479286584, -1.25521937307576, -1.3084439265845, --2.63203265551759, 0.699488411153503, 0.725568463913338, 1.04436353568734, 0.724287492189727, 0.545414741998261, --0.684898849254376, -0.265157227559123, 0.986970158504672, -0.896701981197914, 0.41926110012804, -1.29685083980452, -1.30231506931153, 0.978974027519225, -0.388925761455732, -1.09371737265062, -1.45690006955063, -1.05927088784524, --1.48516753691005, -0.639775104543056, -1.06977385949416, 0.207398888480484, -2.66145719926469, 2.47980663446347, --0.393200318098256, -0.405572827550732, 1.44209892010515, -1.57234842102446, -1.03087923555062, -0.0443153310730792, -0.833713835221313, 0.576701107190937, -1.58078407148771, 0.0824972107393558, 0.702918327857619, 2.26053700327521, --0.21947123926447, -0.099966195817108, 1.36685939017581, 0.735498290973859, -1.28574369630975, 0.0625866392511628, -1.75874116106832, 1.67764586249732, 0.3778738912798, -0.662458123156363, -0.136902157585384, 1.90348364256823, --0.366656341778997, -0.54016852222394, -1.96739447958227, 0.464000203195537, -0.405842665240158, 1.0789067431515, --0.32350453999269, -0.122672190456648, 1.13873519635254, -1.8491736834396, -0.670710281907806, -1.83000460244099, --0.751942692177748, 0.875681105304793, 0.793817710029995, 0.000621833734250599, -0.442280980273464, 0.89256366368206, --0.133110057564675, 0.431855054381289, 0.133758225174594, 0.629314659286904, 0.608465377666553, 0.688415536521462, --0.0986026590350449, -0.401921005098147, 0.760282508777861, 0.0881299003421901, -0.578634465379996, 0.468065369071145, --0.618766964369664, -0.467701864139595, 1.20259697036487, -0.0905176870087339, -1.94666357168829, 0.459640443988441, -0.427164288578095, 1.23951047676553, 0.0161043446565073, -0.891285157632313, -0.425304329366678, -0.2406868810551, -0.731707461243785, -0.0273233189264359, -0.57602224850055, -1.27330758189896, -0.293715674734236, -0.467230803181799, --1.62878193298991, -0.0347453018966035, -1.68183913564969, -1.34286971938041, 1.12594227833945, 0.595928533918912, -2.53700951770085, 1.56679792775765, 0.146829181036967, -1.42818568377477, -0.374465859357499, 0.731834239034983, -1.38905102053743, -1.86565446337076, -0.680891295078138, -1.99221396211652, 0.453107850409498, -1.23569332175946, -0.889976227873894, -0.762398870267526, 0.582133031207123, -0.109756684758275, -1.03385804753502, 0.602922236198473, -1.58861815020288, 0.529772163380163, -0.800030202025625, 1.64898900166657, -1.07011520758916, -0.123580225664475, -0.679636598404604, 0.0417517435539689, -1.07954430656288, 1.50481614234719, -0.511524435338263, 0.417915975472128, -0.245053051987822, -1.40889838133062, -1.55125951690818, -0.785986333673574, 0.116555484912866, 0.982881644177769, -1.1104667395999, -0.0550467072140707, 1.20418398171173, 0.334248868253063, 0.299168971617654, 0.194145097656192, --1.15331974092592, 0.517951763673742, 0.329824435767072, 0.0459423067196847, 1.76837869072528, 1.04852705065518, --0.435859584167511, -0.598449478264999, 2.20736466075074, -0.339172771655677, -1.35535387822393, -1.18863180973023, -0.265758316265701, -0.21178244429008, 1.67408015511177, -0.853523224341387, 0.486535423510717, 0.285236854734642, -0.477385825733026, 0.693293851737723, 1.43591416644487, -1.21594558290392, -1.64890901128456, 2.02035447149722, --0.640656436162457, 2.27915117265134, -0.167309517250478, 0.723717987446273, -0.503350866878087, -0.397626480148203, -0.474513234876484, -0.946500511064273, -0.841625141695981, 0.313068236591942, -0.589943536814262, -2.85528098480971, --0.182212338414034, -1.50708096742534, 1.37781171010072, -0.994291315581909, 0.253795711955703, -0.927372508398258, --0.111644781704119, -0.176364420243371, -0.941867459227821, -2.79511945036296, 0.631183341605207, -0.52308725001227, -0.828942601669975, -2.4512036368799, 1.07596269575706, -0.953769415211646, 1.3710551382022, -0.917665616503862, -0.889020712568659, 1.13676001299209, -0.101440696092124, 0.93599040893087, -1.06549843745363, 0.152694918005669, --1.38221362177255, 0.388727596184938, -1.3085411385862, -0.600965374577419, 1.77375610749002, -1.14202251763252, -1.0629026486881, 1.90415704586488, 0.449577215261396, -1.64019135387709, 1.12111207754535, 0.69464254603016, 0.913406172747082, -0.325482921383168, 1.20014030496699, -2.12413593983465, -0.900875929673285, 0.0989206253474581, -0.86175437899211, --1.44089585432497, -0.654427265234725, -0.129152119949425, 1.47660405859485, -0.99577856216259, 0.33020278008457, -0.977007752342418, -1.47387632364572, -0.106661087286241, 1.3949172034533, 0.38584956267504, 0.0282500210298032, -0.142866091623348, 1.79720927816926, 0.350322608596886, -0.0324685577375869, 1.70037104682143, -0.146184387824018, -0.347717428382328, 0.843075147240895, 0.682811438703223, -0.0320065569339952, -0.147710963225657, 1.07004829646261, --0.681591744425217, 1.21723753433609, -1.08394214331163, -0.0751938305277475, 0.809575794650913, -2.69710941656951, --0.328624495922365, 0.935220240389761, 0.666433087393254, -0.892026975918603, -0.951569411430587, -0.618481175502723, -0.255628907620881, -1.81734672851518, 0.327137152438439, -2.0581997054488, 0.967296845771487, -1.60331575667358, -1.66135005931254, -0.345063999450877, -0.309744070697975, 1.28242489272975, -0.0667807249955761, 0.0199376631927537, --1.0664038153298, 0.43485590472481, 0.224777717103535, 0.695226115335051, 0.599505754545234, -0.880970994455812, -1.07760607251858, 0.892972439802905, 0.498435346221877, -1.0377840066361, -0.85625873668188, 0.878800053617333, --0.959236345555138, -1.22831374318464, -0.0486579036372694, 1.248462556694, 1.40254294078841, -0.276317726165391, --1.64327771273405, 0.729610484338194, 0.0517041279722333, 1.05699830277881, 1.26586739325758, 1.40178969104581, -0.520231887261624, 1.05816833899637, 0.00238564535379812, 0.733359214472224, -0.376348464657088, 1.0646700380934, --0.192772339624473, 0.544641284316936, 0.182424120448128, 0.795092126376269, -0.597946218285922, 0.573129757897414, --1.26551381039529, -0.738794483753798, 1.67677072388478, -0.572297455808556, 0.641724473857056, -1.20309244388168, -1.6424089484088, -0.198266348426584, 0.770600576887311, -1.40748219695482, -0.266767511003119, -1.14028222294793, -1.23647049487707, 0.23269362283012, 0.610581692727387, -0.270731217154301, -0.657907530897962, 0.236090161329277, --1.15870123669584, -1.01033156493266, -0.338338918934775, -0.707848857378142, 1.63942203987847, 0.27940615825937, -0.014561412359992, -0.76760623496715, 0.624107253565637, -2.52075015572572, 1.64096467851254, -0.311061601495515, --0.787220364306332, -1.02354123333421, 0.597567732930274, 2.29622438147511, 0.704477302105185, 0.175570222440476, --0.386312065993498, -0.578555941254447, -1.93065448928503, -2.1761040529277, 0.38291799751054, -1.02234184624694, --0.594437696497556, -0.0301961224687449, 0.920286340743266, 0.573350793217428, -0.640438495375736, -1.38439126167927, -0.0956135741252584, 1.9158425652754, -2.58365369312613, -0.075683687832483, 0.529130021633338, -0.380596280238711, -0.220392122538556, -0.259774534570483, 1.38490928089516, -1.24373266203062, -1.24353753698955, 1.63923449245983, -0.684330934226727, -0.832033584755364, -0.526827575290857, 1.22230726080128, -1.60509315802455, -0.202400856241345, --1.08303383635362, 0.693137510720056, -0.743245502236021, 1.07244707090428, -0.508023435648915, -0.752754779834567, -0.0226077492523848, 1.59489448766936, 0.423523561807365, 0.872745196149392, -0.124177992141408, -0.333123018637778, -0.525035154980534, 0.791756310485054, -1.08970727172669, 1.33434974684754, 0.00230470755111487, -0.899631340423635, -0.544449307633114, -1.41021479210341, 0.425779920363531, 1.73606429670914, -0.726358705210292, 0.121954240661179, -1.18212374865311, 1.69881374833858, -1.04528129539821, -0.296451660472061, 2.94897402035653, 0.91438760901092, 1.4544822435512, --0.766817530837525, -1.69044246058871, -0.00991696385953746, 0.921368672465716, -0.631485234727323, -1.31327484912063, -0.698736430407407, 0.0850557610650685, 2.26829047187506, 0.473643139199869, 0.514971278502636, 0.312947076729682, --1.40046031742514, 0.511374245836498, -0.294504153319015, 1.3648828025616, -0.267810249346071, -1.1083407573879, --0.582740894161464, 1.34181580179101, -1.28461197013151, 0.701426526065345, -0.892114106302114, 0.423892280814351, -0.00814763079558249, -1.33078884809764, 0.973470224249753, 1.04895737984211, 1.4260198447164, 1.75943904348659, --0.456920006091392, -0.588927176825234, 0.793723057697471, 0.673476888225434, -0.3434820053278, -1.45014060337283, -0.638261382910877, 1.65010368245267, 0.498610625499936, -2.43425380247978, 1.31872041765833, -0.229474900433214, -0.515057360889761, 0.182029869705288, 0.723763728858098, 0.381835673379189, 2.58721588221255, 0.441873071309338, -0.889331254400561, 1.4805556932255, 1.18490144066161, 1.70456190994388, 0.0299556367176063, -0.975963847411034, --0.31120238093692, 0.800487158985778, -0.442576768534201, 0.43861183270776, -0.111741814633581, 0.576178066449203, --2.20130762681667, -1.69717879936681, 1.86916147366576, -1.07219348886206, -0.660471969809648, -1.45980433227089, -1.68296766849351, 0.185642023763586, 2.28197464039606, 0.87161085189323, 0.576388451128863, 0.570539270064666, --0.314698724610892, 1.25116422398207, -0.535963713687306, 0.836348743427673, -0.998376668244914, 1.50464647125648, -2.20008550491801, -0.458609476139157, -1.32398008548689, -0.0552660238448123, 1.39273623656492, -1.59655085718847, -0.929178653997823, -0.599391029923711, -0.748158936107459, -1.85111565113008, -0.370903725843119, -0.588556501307395, --1.21980114050115, -1.1689870821572, -1.21898196688185, 0.868288889582462, -0.67207408136713, 0.402219610036391, -0.368435278807195, -0.398524824087356, -0.384319384020586, -0.339214900805459, 0.549204873030162, 0.122101240830238, -1.15824770955235, -0.536834438041304, 0.445299553449546, -0.980451634767027, 2.23295528476116, -0.192358312978261, -1.8099024692853, -1.45421911695902, 0.469210035397747, 0.947320646848656, 1.54426774289966, -1.10441821541153, 2.14992183947432, -0.346058946375109, 1.30837931297352, 0.710608843897285, 0.786342422307969, 0.551970138830988, 0.517121608117039, --1.77728394656258, -2.64829448169278, 1.60355434433328, 0.581268896451293, 0.0275961632111428, -0.423718267637576, --0.948987385692382, 0.659842244805828, -0.443312431052535, 0.301319412183364, -0.452870902878695, 1.0768921971892, -1.77581057473302, 0.760412388643141, -1.1770410211378, 1.31029536503708, 1.09660442001905, 1.81118613112651, 2.1356440181301, -0.506282325748138, -0.678996728819359, 2.16056188485364, 0.19325528946149, 0.435133134204735, -0.557985736839756, --0.157588062390795, 0.192118648435509, -0.535518109751532, 2.06418969105854, -0.42816552315934, -1.68596888961453, --0.60638244793067, 0.582535588996556, -0.604087470582959, -0.402954328034977, 1.67228103123825, -0.348760188918695, --0.228305760185157, -0.56297032692283, -0.743728522228103, 0.696728296917494, 0.765503672886429, 0.437201337205729, --0.504085660142004, 1.70219597021568, 0.715861840634415, -2.52574253247915, 0.00650679298573333, 0.619940449336006, --0.0321561683085462, -0.116772314242056, 0.350148242046677, -0.275350806026759, 0.00686125589718564, -0.0390341086518227, --0.240252852025948, 0.313781814534614, 0.673072977808258, -0.1651311274179, -0.990431977550741, 0.0692743082147678, --1.23885372394113, 0.336273508337398, -0.485596674160935, 0.977864045697066, 0.207075668758844, -0.839405990295658, -0.847212130006117, 0.0420268885705361, -2.65229075368073, 0.579911615240658, -0.329778483314296, 0.383435948788959, --0.140051160109896, -0.0256784716800073, 0.627921581099538, 0.53066246962698, -1.35576519570101, 0.673590101289364, --1.89035800373654, -2.66402391805389, 0.374316376086241, -0.43995813651039, -1.55931882233887, 0.478496527700643, -0.86841243069838, 0.542383273453465, 0.154821965217319, -0.0454807718775599, 0.899647964490352, 0.593898502844098, -0.780000693696758, -0.626657646254962, -0.0861367515411179, 0.115018689998037, -1.2009176739008, -0.174387511036781, --0.501836883029371, 0.455071050758042, 0.110246961580608, 0.0855815784390118, 1.66306913853622, 0.960296089910201, --1.97408692635168, 2.04069200380351, -0.116478510751334, 0.332819590133985, -1.30072476526283, 1.67143814459294, -0.136253049979204, 0.456251567659782, -2.17943065864109, 1.38682685891512, -1.83696689422304, 0.247826654733975, -0.586960355538872, 1.21469603706077, 2.1055867323049, -0.442147337787532, 0.110850446687368, -1.67571272585076, -0.291155354617829, -0.0827222598618963, -0.11068808194393, 1.30663819768793, -3.3523787879692, -0.753116866475535, -1.92889309513464, 0.424045021233715, 0.175992113916487, -1.80667966798524, 0.634565744807361, -0.799512231646917, --1.49478403068052, -1.00025929265731, 2.46055382538848, 1.45871145582883, -0.165828138237811, -0.468523809286446, -0.0615188649053259, 1.33408537397886, 0.256168324134188, 1.249733276818, 1.78701014749603, 0.731760429151042, -1.6457298727351, --0.567573901924166, -0.437783673699505, 0.43429831168519, 1.36229058111949, 2.53596215300568, 0.289387992426018, -0.763791286743009, -0.47673713094056, -1.34433624601916, 0.119638069318829, -0.0319472682110684, 0.356176356347489, -0.719105596023884, -0.208730063378244, -0.397988681457209, 0.545430613035819, 1.08750070180708, -0.985169676952754, -0.0613058414469995, 0.721521959315662, 0.125153814741461, -0.192263719658434, 0.122349139494617, -0.958288676150145, -1.2781167292325, 0.52485117192671, -0.833951374405899, 0.667396460525877, 0.166383053942407, 1.34558521760926, -0.317627393123512, -0.210286747997254, -1.35403592970574, 0.941238321778295, 0.91282921967257, 0.365813218075333, -1.68273910464464, -0.575864029465655, 1.3248589497091, 0.35890750038754, -1.12812112584259, -0.149973265176038, --0.791610857660875, 0.735220822232393, -1.40592126060639, -0.687582291142753, 1.00966690535976, 0.526574941383995, -0.80990704726371, -1.38589528506692, 0.629504007502754, -0.445328387073121, 0.534239156907802, 0.0167989365028945, -0.252706399746674, -0.702993634361998, 2.01308302757364, -0.989952000524165, 1.43121121096538, 0.492170018268772, -0.691754075726225, 0.256918180506941, 0.0112536614407309, -1.00320525650958, -0.814195769242161, 0.536189814633443, --1.37371450696495, 0.657975588603074, -0.815170904572862, 1.20718330797207, -0.418596602083343, -0.928534158615621, -0.134147842771844, 0.772048996363028, -0.658347228499231, 0.209413204474829, -1.50755023947039, -1.89654675072656, -1.01173824553788, 1.06946637700931, -1.35283596235281, 1.3980861752687, 0.363626752897855, -1.14536902018138, 0.627128966161307, -0.153287859941715, -1.26009360464599, -0.288222649285574, 1.8371794661745, 2.85621812015739, -0.299530023180281, -0.692373668247422, -1.29675529503271, 0.378590556908429, -0.883396914013108, 1.13064659514944, -0.780131904911149, --0.0633209667617982, -0.748666186956258, -1.25346181746125, 1.40565299933258, 0.389114021352288, -1.46961874043417, --0.254124160573491, -0.0694877208593518, 0.601445542038601, 0.674833818306598, -0.570682276506979, 0.822429871058678, -1.39719386297545, -1.16478094124291, -0.664692347132072, 0.670408652687654, -0.00341753280133889, -0.683092031984829, --0.981393736787242, -0.0433342215718889, 1.2960732366412, 0.806934497606882, -0.0408065843596712, 2.15008974117524, --1.39224595217121, 0.0779443818163703, -0.125236505756301, -0.104261548523916, -0.0419328521191234, 1.03017766923131, --1.63701194689681, 0.0629121051145115, -0.62451524769124, 0.293381373713047, -0.144244781412932, -0.183832036373413, --0.704091310846957, 0.742350557776122, -0.284988030604385, -2.25050587456732, -0.207296724597669, 0.776704078388239, -1.61571152275413, 0.684523670027266, -2.05583516627477, 2.14088122927082, 0.925581941759343, 0.293876686198214, -0.0751206975677812, 1.58389992604468, -0.241024553355952, 1.2782412600009, 0.0867956396783288, -0.585750975068353, -1.5328879362889, -0.709823066409239, -0.76249872792218, -1.52333738661881, -0.526611841359244, -1.02064400391399, -0.762634541658062, 1.62416378162886, 1.06358032694042, 2.3441590614016, 0.742259242589148, 0.00157990248152745, -0.236551954897244, -0.422023148182772, 0.634123656265244, -1.24491462934616, -0.194196158575596, 0.200596773185481, --0.31206021253344, 0.454143567239426, -1.25250224947517, -0.0818903032479049, -0.319804977872007, 1.70597494242801, --0.0521645849160099, -1.67965311060499, 1.45679246067176, -0.395038796005974, -1.37674349517358, -1.49842707724422, -0.610379614032476, -0.667831287406335, 1.74337762696003, -2.35835750701815, -0.11519551808872, 1.49234496048391, --0.269045434076751, -1.0030315691026, 0.820265327960226, 1.98641711445974, 0.139760310424622, 0.766268853436976, --0.464864947050157, -1.1891925296587, 0.224976339460304, -0.0216954434228376, -0.617939953371919, 0.501738217860019, -0.102420513311498, -0.0969326710182819, 0.903137651424365, -0.400217955151061, 1.18892494972254, 0.611842281060211, -0.288475075232921, 0.346695163649478, 0.105597940144416, 0.0735507163980747, 0.533606228291093, 0.608166284655446, --0.0700344591895162, 1.85086737381139, -1.05349719547836, 0.348885012949355, 1.44867301013145, 0.323960708377747, -0.166598413735103, -0.24859379889461, -0.513557579931325, -0.350674787106557, 0.392649053193144, 1.24537724373912, -0.428268799325799, -0.363287190016048, -0.335359127958408, 1.19496181554101, -0.723018173695604, 1.25174054937387, --0.530976440798554, 0.129644664365642, 0.63969243515588, -0.946908745193517, -0.2073062777785, -1.50127841885374, --0.542671661415404, 0.161787965988824, 0.0427238544911788, 0.097953310784994, 0.320321756994427, -0.0631220707190558, --1.02007175503705, -0.289634394152223, 0.276663688971228, -1.76686429942477, 1.21786961099216, -0.431328616532779, -0.362534652038161, 0.40823121649984, 1.88482264765409, 1.98254592914111, 1.57363764905983, -0.709323579655947, 1.05740666512665, -1.5298567109228, -1.80863210510098, 1.02762783428771, 1.10935763104792, 1.12216099991388, 0.252015249009575, 0.404849488296634, --2.06169569189927, 0.389979350286401, 1.28061368170023, 1.31052109590213, 0.475636827162595, 0.817678824150408, --0.290572187004267, -0.788149850676385, -0.815934415580342, -1.40152641682139, 1.03972317041678, -0.280356924188976, -1.32434019161863, 1.55035173655565, 0.46082375583525, -1.41679796049884, 1.74169824831762, 0.306464254633609, 0.763925186895009, --1.72127398648413, -0.731810922849892, -1.48187392590955, 0.838785971684692, 0.383072026850309, -0.186619011534884, --1.72884950851227, 0.158348743266462, -0.249350048996352, 2.16874207069329, -0.310409359186035, -0.247608511046905, -0.50992342130122, 0.616772787706402, 0.428844855567643, 0.986029355646165, 0.727267787468591, 0.85466486256344, -0.567220190065427, 1.55576589473237, 0.450543366282361, -0.382390180555212, 0.532136236871951, 0.933339842874311, --0.949731625540001, 0.640558874176027, -0.0171581325483124, -1.25189851061368, 1.30464849182181, 0.966103753648006, -0.800156148052956, -0.117181396156333, -0.651461063875899, 0.250441121089548, -1.21838812785696, -0.929841407801498, -0.219611026467441, -0.331588830644665, -1.74291443537743, -0.697093096739778, 0.905790388054334, -1.3154099447611, --0.841404952192307, -1.71547496713246, 0.353406309835762, 0.249960918119848, 0.129671129087755, -0.911017391592441, -0.234299188450297, 0.162189360203769, -0.985816321567063, 1.74528266623044, 1.68427791254086, -1.24056089316678, -0.670228655525306, -0.320560485471391, -0.529634512200022, -0.205933714046934, -1.47550288318277, -1.0865830056606, --1.19885027124928, 0.495903574243625, 0.922637594347313, 1.29953153409842, -0.0608758596877733, 1.70049926959592, -0.786483945213418, 0.705460984674231, -1.28005501106743, -2.26882231541562, 1.22056568937605, 0.254399581201766, -1.58916278523592, 0.42246721025276, 1.23980999373827, 1.01044122325223, 0.309656769877627, -1.60055828394562, --0.0387664437738049, -0.922449889621165, -1.63927852050612, -0.875375372826907, 1.17078031155763, -0.78257203420773, --2.11696074641255, 1.35003488981972, -0.114425644056625, -1.65602767201104, 2.37244341000946, -0.321194737257784, -0.267295431280839, 0.790160981406994, 0.222774356794749, 0.0226221236781524, -0.410632723352756, -1.83211338428854, -0.659069093733877, 0.519486052204863, 0.102379252723917, -0.432372747790473, 0.387325943957626, -0.474676202817946, --1.13375921786613, -0.344393684106312, -2.01800784294148, 0.175787298014354, -0.0368653171045809, 0.874852950685367, --0.34510888054001, -0.928030003383022, 0.0896492539981053, 0.947701022757334, -0.633342546264859, 2.03820261743234, --1.29090135840006, -1.09730496971702, -0.745323449309192, 0.540977884799584, 1.49688122241572, -0.433769610163767, --1.65490477866845, 2.24831663679895, -0.303537874463176, -1.7308813776707, -1.25814772560749, 2.02438176328728, -1.26909468520339, 0.835101918794091, 1.23875872163599, 1.15756033043794, -2.31122690205417, 0.200398355766041, --1.00544398156861, 1.55629958291575, 0.707481392105406, 0.249577445616701, -1.31349813963379, 1.98122885514984, -0.638393060193248, -0.905241268928739, 1.18243000276934, -0.606851380136231, 0.956679324918143, 2.58314894845514, -1.14118794999958, 1.0208441106877, 1.15511638603769, 1.67961407459033, -1.46191455333362, -0.867722835950832, --0.370634788683754, 0.170706961272353, 2.11246546548773, 0.655115490589358, -1.06139331486836, -1.30250232953634, -0.522860350261824, 0.548650283494988, 0.0207014843087262, 0.205730940653197, -0.0593673119844797, -0.530763642271724, --0.122322231843846, 0.482390240988345, -0.558210862234167, 0.665918093524252, -0.357082040571839, 0.605936852251101, -1.36263061382431, -0.919522055450223, 0.370376642525397, 1.45889567452108, 1.07917308361474, -1.18016899079902, --1.24383482061862, 1.33717584024097, 1.13328840690882, -0.413970886362568, 1.23851564717577, 1.16709736724813, -0.283995366085992, -0.587244365759604, -0.462850165806106, 0.195181687233495, 0.0617870720544463, -0.597012335187599, --0.146047992138424, -1.17570408204485, 1.04954911015383, 0.755539756203567, 0.203008565309617, 1.27125665224214, --0.159547815127675, 2.28591647628702, -0.6569994415801, -1.17308246808383, -0.571139853698046, 0.160436530256384, --0.815896287621704, -0.14040553610411, 0.978023328676823, -1.13240291618144, -0.172124223488631, -0.371642080295613, -2.06812428557852, -0.193726858375285, 1.30646030805848, -1.21764695174204, -0.579925386311085, 0.589045801213121, --3.34373509668384, -0.12690914752403, 1.19210218294901, -0.318877133128047, -0.555867239593768, -2.40596476172007, --0.578237998524464, -0.695790008089025, 0.411704982040741, 1.33849463691345, -0.694681410813496, -0.787358115784358, -1.12970011549693, -0.412905808611299, 0.326845524962082, 0.128900690789104, -1.92512891492102, 0.272007086498286, --0.4094701891391, 0.825756869632284, 0.649847948791142, -0.154183688133973, -0.286492796717613, 1.09522272672201, --1.28962962043268, -0.326408610971635, 0.63112436751973, 1.40068147773773, 0.968726797510346, -1.37933657554225, -1.61413979018636, -1.13658245778852, 0.50374557808368, -0.0567379367269394, -0.260014507871939, -3.17225262550871, --2.36035219584752, 1.2838216581984, 0.718177339873487, -1.3732479435466, 1.0179962824666, 0.839649096172183, 1.3607436581033, --1.47436788432667, -0.396441074697858, -2.12178557515354, -0.138848590687675, 1.73707996946653, 0.88732025177792, -1.05955041654766, -0.280711088654415, -2.58324714028662, -1.86026080985501, -1.1823804181316, 0.174042894276151, -1.09428878137039, 0.156402861234468, -0.43245637164264, -0.555114822185623, -2.13842393274926, -0.74770686221651, -1.31567508848023, -0.166214374740241, 0.220778709291706, 1.17759242802321, 0.593720151847573, 0.0305070563630406, --1.08773938266005, 0.076611083730309, -0.734567947314207, -1.36822383736335, 3.08510772474731, -1.56051713819413, --0.339755317897778, 0.349170905464469, -0.809342265414473, 0.468396969702839, 0.494027033144783, 0.474064516843388, -0.532090179357878, 0.621971725294388, 1.95806403016482, -1.11349912717921, 1.81761923479623, 1.49771191732441, --1.22230653645261, 0.397890127253734, -0.32936530641219, 0.322393348868044, 0.223968629746723, 0.497621443176942, --0.316512007272234, -0.862566596516405, -0.193588416459311, -0.422507875871517, -0.523577703274795, 0.800652397911676, --1.35874660392282, -0.0188183555991879, -0.187673464083556, -0.46769345708665, 0.21429110392518, 1.28870343924475, -0.315838423061126, -1.36265174594731, -2.21499705891138, 1.34255193724942, -0.223402575615484, 0.0537735675915431, -1.92259933786919, 1.64555262673021, 1.28704748342434, 0.07411914615848, -0.312518986642327, -0.895908602036703, -1.02337616100156, -1.74631348300413, -0.779949853448901, -1.19767297252187, -0.15958793867975, -0.427487026179164, --0.741871120724238, -0.806005389380259, 0.555197680640974, 1.11503313370286, -0.178987243979632, 0.293024025286693, --0.398633313646583, -1.53363234270604, -0.106086307460351, -0.956270364706651, 0.168681763887885, -0.624202222284865, -1.20177030851267, -0.0945860476951988, 2.11761358728568, -1.59340062449878, -1.62679111768041, 1.45310080532318, -0.826279654076524, -0.324013951423782, -0.220272849958851, -0.622459994829158, -0.620714595772236, -0.183369866995237, -0.263721095189969, -0.564990200359133, -1.8749610552365, 0.374610541203345, 1.04442684176385, 1.50922865114049, --0.5467899627775, -0.894631416788035, -0.983224307781455, -0.159421273500565, 0.266466239095495, 0.844789781790879, -0.570849974159177, -0.973317527772434, -1.05857422374901, 2.0271567752779, -0.150676407303212, -0.646608381251682, --0.463881118587503, -0.126957519198276, 0.424366392189742, 0.635645449155566, 0.607938410268689, 1.09537661988274, -0.329481815461854, -1.09663008976444, 0.0172993544815618, -0.196188388316416, -0.263890952921012, 0.739371475393016, --1.08937318822631, -0.8849001045221, 1.50326815628941, 0.068254764093787, 0.433085933415842, -0.0260081272480801, --0.311767450314788, 0.573741477456285, -0.256249456510563, 0.191682322235539, -0.522530718170957, -1.244648242658, --1.27265673111536, 0.6328874827765, 0.26005486153721, -0.250350157147814, -0.0450034826927655, -1.47427176020948, --0.738596737600396, -2.15168644449118, 1.15367792808306, 0.227020229238462, -0.4560612130498, 0.90905270267388, -1.04173294562086, -1.78238584149372, 0.205592107076446, -1.23551480551315, 1.72763937871811, -1.20153606351338, -0.00706824997835443, 1.70639653229489, 0.125615633153013, 0.162163328146441, 0.269409628958681, -0.790034793437689, --1.07103502335068, -0.5219233380217, -2.18365306486129, -1.41382601445066, -1.06371050364483, -0.726817140348491, --0.649811623897301, -2.32555935449813, 1.11183118707867, 1.02720624976928, -0.312694543161493, 3.24601714158512, --0.00170750803366535, 0.273460610819431, 0.133573003991229, -1.25411997811945, 0.709003824452432, 0.865867252188614, --0.309461751225066, 0.105410159259285, 0.24617718419932, 0.980474956872901, -1.61771298365054, -0.260672324130321, --1.0167327369881, 1.16826747655896, 0.476213514440597, 0.221638242190219, -1.07434493913792, -1.04780254147023, --0.601520166106309, 1.130203330037, -0.0828018865338251, 0.759040756570153, -1.58939308050516, 0.401766028608011, --0.176997941972574, -0.466110773492883, 1.18374906424681, -0.484786850780192, 0.363144488670742, 0.557938953957409, -1.1285394265258, -0.273711298033997, -1.2970799358992, -0.706369695898239, 1.09716038450574, 0.180772964716309, --0.21360757044435, 0.76118041946013, 2.17723127435654, 2.19655768617644, 0.130438522026806, 0.0627093785477363, -0.694025530225122, 0.267673960242941, -0.95439505107095, -0.0724550776852916, 1.08224891309192, -1.80866163222847, -1.67913201391032, -0.450967538985541, 1.00593373456827, -2.28202779284827, -1.35871437998648, -1.92263527964746, --0.781931431384465, 1.40272849027913, 2.39044569889268, -0.112988328488485, 1.36695638655072, 0.272459527879712, --0.399668713555741, 0.386295620472691, 0.260178666063364, -2.1858703892752, -0.101378566890294, 1.03300610415662, -3.52134306327679, 1.15483963261245, 0.0219329811104366, 0.0876667685222666, -2.48194601311653, -0.353685189695708, -0.276549314096306, -0.200264081034414, 0.81224134235999, 0.55995775768088, -1.82863843775713, 1.85968175971395, -1.19143894152539, -0.676739004557098, 0.110082246997069, 0.542302244520894, -2.00958490148494, -0.199147444006664, --0.503874578533648, 1.10981854673361, -1.25790417311316, -0.126430453596455, 0.428982336882183, 1.62320484415592, -1.26502140254913, 1.85384997649097, 0.0427315758770518, -1.71546548194245, -2.21949091334208, -0.574073578495905, --0.391765593869678, 0.0624784026993555, 0.185497879474842, 0.784154429621669, -1.51101510864519, 0.107499185914193, --1.28647327272777, -1.13128643587495, -0.10168730891636, -3.65625264259728, 1.4628781169551, 0.435177620180074, -0.594418103014648, 0.716930420290922, 0.521548591017593, -1.87257917146343, -0.662909249540784, 0.125336777145292, --0.892979766294943, 0.458285826966394, 1.03723113764993, 0.610636051787549, -0.184014069320629, -0.406859208776758, --0.704627017411942, -0.498418856572715, -0.280588525117744, -0.498571827513467, 2.0472741439503, -1.19409158411281, -0.320657009665221, -0.0945312845027071, -0.247886372193008, 0.506365792982917, 1.00246798659974, -0.696545475405605, -0.0304635394904542, -1.4819769506272, -0.961045778564539, 0.687262139846784, 0.945158880155451, -0.300904412938463, --1.05755216901119, 1.07925048005279, 0.0133247720960696, -0.374893406645097, 0.58309891584189, -1.46041694611907, --0.373710937148468, -0.425438982749146, 1.20407235327, -0.0877639126025485, -0.285184238708183, 1.28770016356459, --0.94027108089762, 0.224465431873216, -1.33643135810773, 1.24608362105108, 1.96726241491042, 0.0613183256130318, -0.53030833775722, 0.987522855951923, -2.43709484075492, -0.198306172879468, -0.956062669630399, 0.15937060641301, --0.312074243358391, 1.9190947879751, 0.791337188930279, 0.10354206790919, -0.400820205804823, -1.07594867532778, --0.294338353857227, -0.344467374164048, -1.64283461537992, 0.755226241446279, -0.433169409989086, 0.953513289552836, -0.852681227133739, 1.1953620166454, 0.486550788763992, 0.0805109377124734, 0.443053475452258, 0.176703786935232, -2.48419095817803, 0.476686116952602, -0.28503247399422, -0.685803763971035, -0.908959222748959, 0.904407208227866, --1.02134548877843, 1.00529312417147, 0.42783095843384, -0.646508656802486, -1.20310804733612, -0.248920397146577, -0.590665697148707, -0.220825096465138, 0.635080028803414, -0.593119183043464, 0.57989660359237, 0.599789844261486, --0.663616810038196, 0.422719643843103, -2.14313142575209, -0.0921082204211667, 2.84420184029906, -1.41526995606404, --1.24348199429053, 0.0615372829814131, 0.185170130434711, 0.800698801142218, 2.03644794153848, -0.399481711562374, --0.0219829954831739, 0.579178835715027, 0.799060034047627, 0.298362852783885, -2.12583967056185, 0.480113773246912, --0.40640344872254, 1.38804880351644, -1.4932411542078, -1.75443259785618, 0.627254520953039, 2.31594648093662, --0.0749692753104362, -0.330260490745583, 1.47341434945273, 0.115322127323802, 0.970209363551914, -1.62230949561934, -0.393947997647065, 1.21996794026987, 0.275333997421087, 0.445689381075852, 1.03310075215914, -0.0432637915355266, -1.22909238085146, -0.737096811923035, 1.42117509203531, 1.79951667898792, 0.39629430822464, -0.500378528638686, -1.82351794411176, -0.632949014788661, 0.808609289239728, 0.0594405976685199, -1.53637981554011, 0.51224167014675, -0.2042869992961, -1.26539214963233, -0.378160667945904, -1.58092897951251, -0.455782967555404, 1.24486495191921, --1.68831340570111, 1.51353385185827, 0.649839374185789, -0.0739642398796154, -1.02642556863575, -0.85796682107812, -0.000356026247163571, 0.922027377589658, 2.29313309532255, -0.619452958926713, -2.00882995516827, -0.484799605788969, -0.721637335037768, -0.103700263996474, -0.367888353130122, -0.684034164124921, -0.064719706885086, -0.715634129540286, --1.15480248921667, -0.977391184228396, -2.14465714412653, 1.43244417140098, -1.15080050084248, -1.37091967484703, -0.26820408570001, 0.298855943052998, -0.945028403180406, 0.583048469981379, 1.14174898169816, 0.026271993100938, --0.882952711082612, 0.358072675679331, -0.641868361113198, 0.301539259677518, 1.39776966720375, 0.320306944383342, --0.838597455828329, 1.67400945494858, -2.64173851391924, -2.44179154566203, -0.125513646258585, 0.285301372979319, --0.926844018627319, 0.445933636069723, -0.301050002474611, -0.949691045699477, 0.806055566068221, -0.829493775251677, -0.0842989540354514, 0.935007577162168, -0.36342044928044, -0.800018105854152, 1.67635523931807, -0.210713362131902, --1.70528321526329, 0.0857655955180478, -0.0958716067999993, -0.88465944715105, -0.00666813729509956, -1.15746196748581, -0.203020836742145, -0.891692944826536, 0.0685286480013507, -0.799915077378888, -1.2333758434492, -1.12619015506589, -0.55143139022252, -0.6864070885241, 0.588661253034898, 1.03532383944017, 1.26505361074255, -0.934025077665727, --2.54747074393897, -0.13327892841878, 0.715462533950831, -0.689749524143636, -0.85874501684113, 0.0140007963844446, --0.435193298095985, 0.140726615907902, -2.25988515759247, 0.0124951328851664, 2.10642634105022, -0.882856275091842, -1.11758777392677, 0.355478004278143, -0.514652398362636, 0.377977299122191, 1.29400730400034, 1.11083175536758, -0.59537195382537, -1.10411398534537, 0.0998763504224844, -0.896715461465025, -0.596849450514289, 0.425643269608143, --2.36262305597524, 1.3985811609064, -1.23626769416572, 1.11630447951609, -0.276648618977016, 0.245503235586709, --2.71131089488369, -0.204304415019444, 0.254121146193514, -0.929357579406989, -1.34070206904713, 2.08872489262045, --0.742662068619056, -0.311381157211186, 0.000718980974820996, -1.0215983422305, -0.386367229536947, -0.393291679084293, -1.73991143155535, 0.167181776798374, 0.656306091020027, 0.834579029396935, -0.415039303951965, 0.248303912380544, -1.08862045729878, -0.876663861113166, -0.55378892413261, -0.418274457995483, -1.42508799557892, 0.295512337319828, -0.56339090338052, -0.942918938100083, 0.222495133213569, 1.12223178807264, 1.4919446940026, -0.872214420893613, --1.12469595243983, 1.87897862468052, -0.0375637692066811, -0.904345523546809, 0.84798113758633, -1.48347539004031, -0.0660848591005551, -3.08601697327639, 1.28360988668305, -0.353065726112611, 1.91019592901482, 0.282552290158411, -1.3213995423476, 0.619136301149652, -1.73100899266394, 0.57799168890036, -0.375539210169388), -.Dim = c(1000, 11)) -y <- -c(0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, -0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, -0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, -0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, -1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, -0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, -0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, -1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, -0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, -0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, -1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, -1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, -1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, -0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, -0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, -1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, -0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, -0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, -1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, -0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, -1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, -0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1) -N <- 1000 diff --git a/src/test/test-models/good/variational/hier_logistic.data.json b/src/test/test-models/good/variational/hier_logistic.data.json new file mode 100644 index 0000000000..1680ebb451 --- /dev/null +++ b/src/test/test-models/good/variational/hier_logistic.data.json @@ -0,0 +1,1007 @@ +{ + "X": [ + [1, 2.57917716199775, -0.0348321257238794, -0.722119837886351, 0.816216268076882, 1.25462496636799, 0.373229881061553, 0.548838741176556, -1.0291131384592, -0.0547037113286027, -0.683092031984829], + [1, -2.38744893329618, 0.951360498262548, -0.254502175102988, -0.939535806437119, 0.286760441700895, -0.149643393959621, -1.07237877139355, -0.921816981108236, 0.127944425205534, -0.981393736787242], + [1, -0.749536484986239, -1.31979618091471, 1.60535491277753, 1.16901552216559, 0.992210636532292, -0.119680967518621, 0.1985847289463, -0.337283230794931, 0.245613078985839, -0.0433342215718889], + [1, -1.11672385999519, -1.08763505619974, 1.37500101626621, 0.325221424167738, -2.05623831741523, 0.55492330832661, 1.4485921859224, 0.722612612775153, -1.02151781164219, 1.2960732366412], + [1, -0.619933558578326, 0.786884226812518, 0.180855488757987, 2.26432999445083, -0.889869155617186, -1.27792797300294, 0.911284706435413, -1.09063543065816, -1.15054916208521, 0.806934497606882], + [1, 0.015368117156971, -0.516776310120882, -1.19047181963855, -0.617900528823766, 1.26611313871398, -0.940238256918133, 0.716355515742879, 0.596748544091265, -2.09756773603652, -0.0408065843596712], + [1, -0.851727066684374, -1.72389173782849, -1.46132594627286, 1.11750103595582, 0.483007634037241, -0.848769448108308, -0.384699276612641, -0.601252717073779, -0.687790812142181, 2.15008974117524], + [1, -0.666147957941832, -0.504332493803526, 0.0330102370824705, -0.460581374832559, -0.588253961568752, 1.39523158667062, -1.42282425176969, 0.0855526756412077, -0.462752884195375, -1.39224595217121], + [1, -0.361482321664015, -1.142981668459, 0.571930085158133, 0.393365573930767, -0.693701718890236, 0.921701288424559, 0.0679639328045536, -0.462479060882368, 0.581198377389343, 0.0779443818163703], + [1, 1.11524383605807, 0.869637479071448, -1.19883056427719, 1.07476705018218, 1.29641531041484, -0.429338538579854, 1.28516622223467, -0.269608435596995, -0.0301720996225784, -0.125236505756301], + [1, 0.496373931775554, -1.34622852486657, 1.06314033099996, -0.958007540029886, 0.765995044535265, -0.551081633769794, -2.11160478048831, 0.891898484013042, 0.963903811605354, -0.104261548523916], + [1, -0.840281282726482, 1.08908132877102, -0.420118351798116, 0.36973280859453, -0.808728919529191, 0.657291335378983, -0.396477888314508, -2.83281304460574, 0.123955101696373, -0.0419328521191234], + [1, -0.325804797259299, 0.863677553722814, -0.617375030104416, -0.456537386374151, 0.480834975982949, -0.998682217302671, 1.33064597634342, 0.184035094996983, 0.308237591942875, 1.03017766923131], + [1, 0.604651280746919, -1.45611671157852, 0.4391698741018, -1.03306033098588, -0.274055899013688, -2.06527428568914, -0.17539033139971, 0.00205857772971073, 1.24623496449018, -1.63701194689681], + [1, 1.70449767691726, 0.522968748129384, -0.0457834091012115, 0.581069423688402, 0.467776021428551, 0.423679574280894, 0.963965226825427, 0.0508716617129507, -0.413569654506342, 0.0629121051145115], + [1, -0.114335498600736, -1.37625209248846, -0.0287118233368874, -2.11842049929415, 0.0409701859048461, -0.410092318338398, 0.296337461536494, -0.461662675405653, -0.846485416634452, -0.62451524769124], + [1, -0.631518751815811, 1.62241682518376, 1.17662070429722, -1.3278643957806, -0.0060631978909716, 0.48071160978552, 0.957753841522002, -0.355553930625955, 0.323061943287442, 0.293381373713047], + [1, 0.0107337799941104, -0.760248971555083, -0.97935624471049, -1.51398007166845, -0.366648205145586, -0.610266525367618, -0.000538842463663965, -0.171250102097201, -0.0252107548983457, -0.144244781412932], + [1, -0.861221921347218, -0.0692477905852415, -1.89285104597983, -0.34565371319696, -0.16417760245555, 1.79912938862039, 0.767302206719783, 1.61168255815993, 0.111060893324587, -0.183832036373413], + [1, -1.32221082826268, 0.932255985999559, 1.07978345003726, -1.59725285037877, -0.967773297976527, -0.909395102405144, -1.36183370875405, -1.01626425727115, -0.523737789237296, -0.704091310846957], + [1, 0.821959021860556, 0.828708915295613, -0.262089403932588, -0.59212673536256, 0.0952155345676486, 1.18113812368496, -1.07176869906021, 0.110180304258382, -0.3975949775656, 0.742350557776122], + [1, 1.55006007804385, 0.701197064553088, -1.43677207392493, 0.0311890653814737, -0.0917909515199596, -1.99868648339074, -1.17207493148745, -0.0191299134061181, -2.07531596802062, -0.284988030604385], + [1, 0.744476299020508, -0.555455346328636, -1.23884158783146, 0.392302908971647, -1.64447213408179, -0.39454384494719, -0.960944036367432, -0.660592685461671, -0.312641084752504, -2.25050587456732], + [1, -0.195245168143584, -0.199562351104511, -1.00073108280695, -1.57890778212524, 0.283956333598541, 0.600467686882565, 1.83667750156253, -0.837893241309614, -0.562915861405385, -0.207296724597669], + [1, 1.85542714805721, -0.98606305432237, -0.555235486522018, 0.179509585737979, -0.889370258917861, -0.329970640293165, 0.0539693497196037, 0.455925088229863, -0.526127824780207, 0.776704078388239], + [1, 0.0802060884833868, -1.11649656959053, 0.879935761493538, 0.289586980063629, 2.28749029000318, -0.242395673454647, 1.05504839670166, -0.30058092973999, 0.440028398785041, 1.61571152275413], + [1, -0.612168718386911, 0.217837287925338, 1.26174877061941, 0.807644981255497, 0.748384086064163, 0.864439430769144, 0.717491894731404, 1.49498111033782, -1.4980959027073, 0.684523670027266], + [1, -0.607737013410983, -0.0478754321134561, 0.731524752422609, 0.151100622646287, -1.19715928805848, -0.440336371970917, 0.228531777253271, 1.73924259912529, 0.970552718808444, -2.05583516627477], + [1, -0.979373909961232, 2.24639009029605, 0.775118212051823, 0.303614044825513, 1.48475607128895, 0.056552882422574, -1.18928331932298, 0.295259265153872, 0.377585834956468, 2.14088122927082], + [1, 0.652603040183717, 0.407495387022595, -0.604001102696297, 0.872169730850451, -0.376223815865573, -0.179471445818501, -0.00879923122832079, 0.542348164772087, 0.398978361482786, 0.925581941759343], + [1, 1.09669973329903, 1.14736002457732, 0.224452048854299, 0.58693819689413, 0.442167562939677, 0.0522872085341636, 1.01000803462485, -0.741661171346238, -0.060454402886166, 0.293876686198214], + [1, 0.424317060681982, 1.55757287011763, 0.304171769065205, 0.156771157774847, -0.889843458547836, 1.0904695412962, 2.45564412874137, 0.893414392495088, -0.690964556549048, 0.0751206975677812], + [1, -0.800164697318374, -0.134385216440685, -0.102244042164429, -1.07492592307486, 1.63365420980008, 0.601670404988591, 0.0726217447239304, -1.01658003994309, 0.0917285661468366, 1.58389992604468], + [1, -0.212406972339471, -0.175215195387592, -0.99328395796649, -0.895372640866238, -1.13760340524326, 0.955664192701838, 0.2536170495815, 0.739151426349952, -2.17694004440896, -0.241024553355952], + [1, 0.36885397480859, -0.797483030733454, -1.31409748343542, 0.212162912904251, 0.740777614490013, 2.47504017111549, 1.43422487970913, -0.705953806910887, -0.349419735948686, 1.2782412600009], + [1, 0.760742055593667, 0.656875414326964, -0.889251570748722, -0.0961102710661513, -0.822191260277078, 0.327934293507011, 0.146984803349642, 0.285947338584182, -0.0583617826361126, 0.0867956396783288], + [1, 0.30928693128092, -0.580708200824838, -1.12212807264228, -0.194469276422664, 0.517848569290268, -0.330117809190618, -1.60888830367192, -0.173175536799315, -0.945628423280178, -0.585750975068353], + [1, 0.559264817847443, 1.06964998010558, -0.522273216385187, -0.42539961028174, 0.729762134943307, 1.40179363341398, -0.0246859623963219, 0.155115081293236, -0.501148410033724, 1.5328879362889], + [1, -0.620323590398783, 0.0545566889605223, -1.30370653052614, -1.47765051313287, -1.87960755944116, 1.02658709451155, 1.49846205030159, 0.10523105266159, -0.338575875987258, -0.709823066409239], + [1, 0.793357261643947, 0.840166482575712, 0.61843773319556, 1.15516986229365, 2.48754355706337, -0.573528952781581, 0.377194247984726, 1.81049695293777, -0.166388564261645, -0.76249872792218], + [1, -0.149931356597717, -0.989792233321963, 1.62524410443268, 0.777983256465292, -0.9568549085966, -0.393293020949979, -1.27103104674642, -0.328198580985188, 1.23502681137548, -1.52333738661881], + [1, 0.185785774021925, -0.7841286709649, -0.929906310428374, -0.670241105230494, 1.00181126414544, 0.900034875939114, 0.268377283269092, -2.31113317821335, 1.62695300575575, -0.526611841359244], + [1, 0.740859262317599, 2.11248020134409, -2.09638243369458, -0.47063813718095, -0.668519929681562, -0.707406454941224, 1.2915858866389, -0.115731235856713, -0.0555255398066202, -1.02064400391399], + [1, -0.100345505384714, 1.02702222196354, -0.507248121227788, -0.59483342983408, -0.94888777901137, -0.904531361040988, -0.320990129271257, -0.548384051086303, -0.478176406482808, 0.762634541658062], + [1, 1.38805075639723, -0.192016780150674, -0.474958008165473, -0.224786057504133, -1.75721213350624, 0.0573238984581883, 0.927689163171698, 0.232651986150872, -1.29238050362319, 1.62416378162886], + [1, -0.538744853336703, -0.0131057436245737, 1.59188009555742, -0.18638446736537, 0.613374132087577, -0.800665191384769, 0.769425845920566, -1.06495858152433, -1.36573433889388, 1.06358032694042], + [1, -0.427377223197364, -1.52785245327333, 0.928124922312575, -1.14434567001474, 0.596279044435183, 1.41257335049455, 0.234875854601442, -0.0259187981799517, -0.629714270382745, 2.3441590614016], + [1, -0.295084350190647, -2.24475360672899, 0.287195896223284, 0.629065377689324, -0.551182776078409, -0.558759064868013, 0.277995829782663, 1.0792377976084, 0.692459436538853, 0.742259242589148], + [1, -1.72630734966235, -0.0459092281378865, -0.195457419454389, 0.98271633100275, 1.85438485062213, -0.653027072400744, -1.71619889044698, 0.511668354807287, -1.9114225862503, 0.00157990248152745], + [1, -0.520706040294143, 0.136751741473048, 0.353010691748332, 0.67098091573378, -0.00194658730895008, -0.450668479203183, -0.394274246927275, -1.2638389739733, 0.684925139791708, 0.236551954897244], + [1, -1.55416016672806, 0.439120160331514, -0.586688611426205, 0.100774958058887, -0.549879052193606, -2.14421558176928, 1.14930673056819, -0.754395086740637, 0.904937254155084, -0.422023148182772], + [1, 0.4914493190968, -0.346416691593661, -0.910540281288637, -0.618144776903803, -0.960120550873671, -1.35846818299597, -0.838468641754201, -1.00280218506219, -1.62624696601384, 0.634123656265244], + [1, -1.28440190821979, -0.595605220112669, -0.662211989276492, 0.726721769051415, -1.35724894407236, -0.278401807345882, -0.181354614689848, 0.124399624882751, -0.145128162485109, -1.24491462934616], + [1, -0.670098871322636, -0.937164517029391, -0.491604396262942, -0.0579028506453517, 0.942121620610034, -2.57407003005511, 0.690941048281888, -1.32632056922945, 1.29877671651163, -0.194196158575596], + [1, 0.099676024127, -1.24233729850698, 0.586189367376227, 1.9583723839426, -1.54789569816883, 0.567077869784179, 0.278849724797425, 0.692980132917634, 1.24052152009969, 0.200596773185481], + [1, 2.05678131414237, 0.105420205078933, 1.30776228071731, -0.27961440807859, 0.810896917054045, -0.0632793298300179, -0.767220120984099, 0.156849997223761, 1.3108213598416, -0.31206021253344], + [1, 0.819772349832892, 0.862388312936453, 0.75972986554818, 0.207844803682323, 0.858987266154885, 0.107783411432639, -1.65643544598563, 2.05743123626016, -0.314393819462537, 0.454143567239426], + [1, -0.114034723822362, 0.706285359402943, -0.878136811260066, 0.297558323997326, 0.257758186332539, 1.80253709259706, -1.5810296378059, -0.218166063502434, 0.413846795604404, -1.25250224947517], + [1, -0.322306156520015, 1.25429071612454, 0.107795770322281, -0.953987829242271, 2.04120968067592, -0.89911739062064, -2.11641165837812, 0.749242800501542, 0.267979078583382, -0.0818903032479049], + [1, 0.112530185817529, -0.640140630721747, 1.12902567233128, 0.0358641494569674, -0.291515270179969, 0.0459840499197001, -0.669714005224312, 0.0533161969038064, 0.31667759282488, -0.319804977872007], + [1, 0.0805965979255399, -0.203365255676363, 0.447293566060931, 0.635835548146137, 0.587871531383856, 1.01066600370425, -0.248504218307454, 1.28671759236825, -0.225191008659782, 1.70597494242801], + [1, 0.664508505655029, 0.275638521812389, -1.17711631416495, -0.129577652812665, 0.514271319953652, 1.25455970473878, -0.656593878326367, 1.50259017147162, 0.158694861839583, -0.0521645849160099], + [1, -0.697620129214756, -1.94611127858211, -0.973944387140202, -1.95367672545353, 0.379226076409892, 1.50438530780908, -0.515951032633784, 0.602255068915151, 0.970854895867708, -1.67965311060499], + [1, 0.230787518959929, -2.28659325519973, 0.225833977346034, -0.224729570684868, -0.469310043511313, 0.675073229127145, -0.590392040827541, 0.846394323917256, -0.391389380665577, 1.45679246067176], + [1, 0.443242476569146, 0.884333335898872, -2.40050433588545, 0.23745454648151, 0.508737223759185, 0.866626149150834, -2.13267779840244, -0.801177589931868, -0.323187268590194, -0.395038796005974], + [1, 0.408469484798353, -0.0450273887296529, -1.51953230903702, -0.296205867344559, -1.51274654664315, 0.247605334150661, -0.28987579904394, -0.35897971134869, -0.613816642096993, -1.37674349517358], + [1, -0.598882792879348, 0.544552476683243, 0.980223653027183, 0.187067413998713, -1.92355120341778, -0.534604672824115, -0.180908693762724, 0.023173780465707, -0.862058430377786, -1.49842707724422], + [1, -0.268835216517759, 1.67748501030115, -0.170450038822228, 0.774339453889433, 0.988050060143154, 0.0869339551599248, -1.53387493592535, 1.12174970266825, -0.89458347847626, 0.610379614032476], + [1, 1.179292747124, -1.16611591126963, 1.08644134775569, 0.239273142363148, -1.94807002456822, 2.12484001577215, 0.900696230356575, -1.18883185310149, -0.786058600863711, -0.667831287406335], + [1, -1.06542562632417, 0.138119560375408, 0.787302270533097, -1.35353225918912, 0.684238534199976, 0.50630640532784, 0.278114175661727, -0.576663083452696, 0.0349756793665593, 1.74337762696003], + [1, -1.45411054672898, -0.758099603174791, -0.0910547150953861, 0.41179935803692, 0.715792102103477, -0.1234007887208, 0.585197872403682, 0.399608648534713, 1.45736658082888, -2.35835750701815], + [1, -1.30081085904273, 1.22575492492934, -0.309313690683166, -1.34220484779532, 0.101959762724287, -0.866504758886484, -0.484369931572446, 0.411319284944424, 1.04628129590686, -0.11519551808872], + [1, -1.27486791769539, 1.15804927622785, 0.0172073229263382, -0.09410347388729, 2.62895089810358, 0.246635016990878, -0.194071565628893, -0.354673634453167, 1.52214140663299, 1.49234496048391], + [1, -0.492268806181647, -0.174622564734439, -0.801279589214151, -0.752907222493914, 1.40892761447978, 0.505326275137555, 1.42166899062104, -0.391806909356344, 0.36099894485661, -0.269045434076751], + [1, -0.401524174728404, -1.79686193306009, -1.18857609013151, 0.312095553657885, 1.79797147549428, 1.43286532671207, -0.467150994432995, -1.01085093683899, 0.591860506220764, -1.0030315691026], + [1, 1.20490230170249, -2.78070492850344, 0.512941168787184, 0.107175722776883, 0.240322644556822, 0.318250940665266, -0.38904905033251, -0.593266038334749, -1.4359333091901, 0.820265327960226], + [1, -1.61902655341544, 1.85906490777249, 1.03861577494425, -2.09340595480844, 0.00610196321655062, 0.328900872951949, 1.32298493766039, 0.619573103104917, 0.982718894542313, 1.98641711445974], + [1, 0.87395240882498, 0.0592597014068605, 0.213181512758313, 2.63943637594235, 1.2402471819716, 1.43883801892207, 0.118146960825703, 0.562753911524473, -0.750890212875129, 0.139760310424622], + [1, 0.264829055514425, 2.07800430565351, -1.14427579122844, 0.745576263800836, -1.97273642693885, 0.481518513666634, -0.389599780370049, 0.659248427765443, 0.563591084032468, 0.766268853436976], + [1, 1.01838583491309, 0.28480087019264, -0.694854080349734, -1.72519675264434, 0.937958748732884, 0.48390906603131, -0.182590082497235, -2.78475441968216, 0.0963118078399033, -0.464864947050157], + [1, 0.0452486294860993, 1.12865058079281, -0.393441810496811, 1.48228324988244, 0.0803970160265047, 0.303017668613347, -0.888630318555725, -0.126377875856993, -0.024328157338997, -1.1891925296587], + [1, 0.140893873378869, 1.21784891873184, -0.488612937244456, 0.435076100450997, 0.628518103538578, -1.07859398397255, 1.13530060987694, 0.608723104004398, 1.33503971855392, 0.224976339460304], + [1, 0.472636297749296, 2.69255607747957, -1.23633831963208, -1.02138844953709, 0.0316240393601563, 0.768624468150867, -0.631055831865533, -0.0713773079751286, -1.18396798534241, -0.0216954434228376], + [1, 0.453988993374329, -1.80322091781934, -1.59540062383997, 1.07537249207568, -0.0136645756932857, 0.277182562065255, 0.544684836425911, -1.6476702485555, 0.965232153915219, -0.617939953371919], + [1, 0.221824847190939, -0.0147596502042235, -0.892228183164052, 0.425227459457305, 1.58865413993551, -0.639261163987518, -2.65488714753906, -0.68349508324214, -0.366467597119963, 0.501738217860019], + [1, -0.49121900845089, 0.539242292756731, 0.925677058749021, 1.64902445269646, -0.293172791258265, 0.00700454394515889, -0.285395634953533, 0.372927964766524, 0.252988489815166, 0.102420513311498], + [1, -0.338728889096545, -1.07080564940211, -0.220666887224635, -0.262818729311129, 1.35074991301108, -1.17118115655857, -1.83241271252968, -0.219211476394169, -0.163167876056863, -0.0969326710182819], + [1, -1.12451364512268, -0.0881517772961169, 0.0052686269285507, -0.829269263200198, -2.62116582748105, 1.92279851867119, -0.95980904862453, 1.55274457359156, 0.0881081861121518, 0.903137651424365], + [1, -0.054676023791613, 1.13219603404546, -0.501252686666203, -0.0702233081930539, -0.135695238680869, 0.0328109709017855, 1.27413324137329, -0.704727765971994, 0.965811605115934, -0.400217955151061], + [1, -0.789137291581214, 0.0324891571816732, 1.71000516857035, -0.563294921423415, -0.571950548585533, 0.876675351358971, 0.710435267260032, -0.976936106197883, 1.69165510087229, 1.18892494972254], + [1, 1.12360991099833, 1.04502439488494, 0.507114952858729, -0.822023971696543, 1.1456778845716, 1.40331030453752, -0.252908074438334, -1.36306143148086, 0.472502502876197, 0.611842281060211], + [1, 0.16532665354239, 0.539432011007613, 0.388402660198106, 0.350795987922701, -0.941209652455872, 1.00210319043007, 0.576680955998236, -1.45715833847194, 0.914743439286609, 0.288475075232921], + [1, -0.332213691397305, 1.40214980543282, 1.46782542271278, 1.04833340826122, -1.4682973499958, 1.35427295011501, 1.75616219535329, -0.595539793577838, 0.579494854199228, 0.346695163649478], + [1, 1.58098999053467, -0.494615537807563, -0.319241545825161, -0.242197295254762, 0.219387474661183, 0.880877217196471, 0.446894222351973, 1.54825704043651, -2.36573824705096, 0.105597940144416], + [1, 0.269202140822671, -2.24427200661453, -0.811174021898494, 0.791932684525532, -1.16152958103388, 0.803069176408877, 0.136571592717523, -0.142063207186533, -1.33671295188081, 0.0735507163980747], + [1, 0.862308220499829, 0.0729926336328388, -0.365739750568774, -1.54302750059725, -1.78116792846122, 0.861019726376257, 1.04094164901684, -2.23408737278877, 1.12289990984163, 0.533606228291093], + [1, 0.871606440022216, 0.0460588985717286, 1.06991485483143, 0.356649397138778, -0.0510564590049327, -0.0546970781984859, -1.38616765558347, -0.685496916917647, -0.276046160589429, 0.608166284655446], + [1, 0.912365770221251, -0.736286518421324, 0.847526496960662, -0.21303792156479, -1.79341288668835, -0.552709390445587, -1.16314362598656, 1.06124422051942, 0.404684662640455, -0.0700344591895162], + [1, -0.0922804005073777, 1.06225451504473, 1.49388122592419, -0.436523744712912, 0.50322980861241, -0.17740882138797, -0.814707649391813, 0.878339197637764, 1.81649587821063, 1.85086737381139], + [1, -0.436043055655883, 0.0563408951560306, -0.592260966722841, -0.319846254353622, 0.166454091362902, -1.07882425058864, 1.03005629584204, -0.70883716792792, -0.281625715460359, -1.05349719547836], + [1, -1.50785281398054, -0.661117832684992, -0.490493432254849, 0.431970988307004, 1.46354747124367, -0.549279036389525, 0.168691583173403, -0.572310889297068, -0.2574958540193, 0.348885012949355], + [1, 0.866897603703387, -0.620241463130989, -1.27261930261387, 1.46512536643139, -1.81537565015529, 0.422577634710149, 0.352880643073182, -0.690627956187673, -0.660402486567588, 1.44867301013145], + [1, -0.117033262541989, -1.35764031062474, 0.481219111694695, -1.0166269191291, 0.775745774348439, 1.82806081751052, -0.915394054756934, -2.20020909117194, 0.378560784547543, 0.323960708377747], + [1, 1.02669096232982, -1.26868782208513, 1.04242898064809, -0.443062206973839, -0.472800449432039, -1.88213865864953, 0.874474194652299, 0.018592728811664, 0.308176689510192, 0.166598413735103], + [1, 1.11996718932965, 2.05687964618772, -0.730257796708091, 0.871832323584903, 0.972461434160787, -1.11065117741818, -0.765375770858138, -1.03917742032228, 0.633966616925427, -0.24859379889461], + [1, 1.08003509403607, -0.787553914918604, 0.0910932455067344, -0.172683912343996, -0.57485706429117, -0.654815978619544, 0.189460760765806, -0.460569730393702, 1.26033296492696, -0.513557579931325], + [1, -1.44294959844884, 0.864845998162136, 0.328271752837879, 2.11317872981407, 0.27438105775233, -0.282010367384648, 0.241491094337411, 2.44920470272351, -0.924407276698663, -0.350674787106557], + [1, 0.246455745609291, -0.0455694434488654, 0.0239566411411615, 1.08822925616407, -1.5093621331089, -2.94904805559389, 1.06023455625373, 0.802812095429966, 0.832371561387768, 0.392649053193144], + [1, -0.659558493039642, 1.5163806536136, 0.76959341200323, 1.84185234700568, 0.598666031616524, 0.139915251028122, -1.41804325110715, 0.512442438617665, -0.165614502539187, 1.24537724373912], + [1, -0.138238210064953, -0.37077127658939, -0.943058164197848, 0.915223052496004, 0.0970588706177941, 0.0411008984867159, -1.70314978465665, 1.17957498833314, 2.30935014842449, 0.428268799325799], + [1, 2.21149540624235, -0.881965958753822, 0.0180394139518344, 0.738842249678943, -1.26284777734833, 0.589947800791587, -1.0376822258896, -0.118443923349902, -0.165740611639757, -0.363287190016048], + [1, -1.04405897002309, 2.51164426391649, -0.115362883202373, -1.3248002350905, -1.68099365647767, 1.52076290264619, -0.041319960067525, 1.11109335729486, 0.616014910915142, -0.335359127958408], + [1, -0.0322558648852745, 0.692036388043303, 1.1936322016132, 0.704434261709433, 0.621612429982096, -1.50272313248964, -1.41878346042969, -0.702570395328921, 0.416664741836105, 1.19496181554101], + [1, -1.02005214027875, -1.19309837971574, -0.0818655576015089, -0.0963474637563128, -0.672267093409725, 0.31853967114495, 1.33378263749207, -1.6735889814506, 0.462658685455797, -0.723018173695604], + [1, 2.04899661787197, 1.10107742027424, 0.414503018783339, 0.473135039100486, 0.264059689263433, -1.62116014350604, -0.890333845406499, 1.07596057195898, -0.833689357046117, 1.25174054937387], + [1, -0.0537844269138957, -2.52911634122704, -0.75457904065538, 0.276157232412421, -0.729572082152867, 1.46277477057757, 1.56359451289866, 0.23617635314156, 1.07669722607958, -0.530976440798554], + [1, -1.1218869376864, -0.505641317730878, -1.28642868412683, -0.697399663856365, -0.298161246268666, 0.21527503818707, 0.820127894949376, -0.919902652247638, 0.39121977083187, 0.129644664365642], + [1, 0.345378336561381, 1.78058664544542, 1.20965674526623, -0.0226145592132506, 0.915267137524719, -1.00232850446533, 0.571478953563373, -0.784809152321071, 1.85237917568027, 0.63969243515588], + [1, 0.88532502913169, -0.261586931607344, -0.752013357315815, 0.240581019613406, -0.0857294035578394, 0.032740487255343, 0.933685225297847, 0.496730860702687, 1.57872806557405, -0.946908745193517], + [1, 0.74158287878403, 0.71518388492669, 0.682718912812363, -2.3926791916351, 0.52843101194191, -1.40138343732831, 1.60660688890009, -0.888555938480899, -2.78016354263892, -0.2073062777785], + [1, 1.66741364922882, -1.5578263052916, -1.19305981606806, 0.87210649709499, -0.496246872943112, 0.711045393613253, 1.73235322704933, -0.62105607190373, 1.21097348893872, -1.50127841885374], + [1, 0.79733208396446, -0.467878529774703, 0.152410120453575, -0.398867027451092, -1.03919518047538, -0.0979143510097028, 1.74678261886411, -1.11045323243442, 0.34244171449759, -0.542671661415404], + [1, -0.347066108274102, -0.500013222683255, -0.224728374961496, -2.69115425085837, -1.07370947353943, -0.845949264358296, 0.66584374194394, -0.588661094120453, -0.179361846300747, 0.161787965988824], + [1, -1.08303350242797, -0.208772720782439, 1.08877022320099, 0.189039161871914, -0.35295447988867, -0.481079993165615, -0.506627836751778, -0.417273002903193, -0.660715029035978, 0.0427238544911788], + [1, -1.60426917218837, -0.656711668164851, 0.436943394823431, -0.969721655789241, 1.17463068341786, 0.649342612154301, 1.06976976798137, 0.87606624748776, 0.127290762740227, 0.097953310784994], + [1, 1.72435940011563, -0.649028492587928, -0.189026755269878, 0.141191051077223, -0.66303384946715, 0.432478820210411, 3.15203080551527, 0.35969196479303, -0.499502270863531, 0.320321756994427], + [1, -0.369218344467639, -0.592453757488815, -0.634279674538215, -0.570297036056226, 0.55645354515825, 0.474851789124736, 1.16826403547642, 0.0215974330825434, 0.0779248418791297, -0.0631220707190558], + [1, 0.659210152441182, -0.862940032251989, 0.823119726646554, -1.69595237293123, -0.924530203959699, 0.862033561143024, -0.434276627901782, 0.293138635854736, 0.833779930718778, -1.02007175503705], + [1, 0.175984069665674, -0.583477322951094, 0.880172134686172, 0.336205709519303, 1.54695105041365, -0.467878526673708, -0.542993295885999, 0.161893184520072, -0.17221271057451, -0.289634394152223], + [1, 0.33936365060071, -0.344674112197226, -0.0447156930486705, 1.19254324218825, 0.256825770809754, 1.24273381233752, -0.876595065386039, -0.626544217552067, -0.12755016133995, 0.276663688971228], + [1, 0.915183168611525, -0.860393480788985, -0.963801612188454, 0.821122680705742, -0.26486209460595, 1.1524722978629, -0.977707944033048, -0.574352339017486, 0.879725316212386, -1.76686429942477], + [1, 0.110439562647599, -1.73433859563284, -0.416791424720539, 2.3151185052982, 0.868490772893955, 0.198130515444871, 1.54429657382919, -0.517974703819111, 0.496715246942674, 1.21786961099216], + [1, -1.54284997459478, -0.0634467228815642, -1.69160737668884, -1.93477607212062, 0.716518973047981, 0.897879224375347, 0.915827313322226, 0.727321052454984, 0.804193800661593, -0.431328616532779], + [1, -0.197439405023526, 1.23498569925455, 1.39855152605617, 1.40944180858748, -0.522032558977908, 1.00277136299224, -0.2951244101129, 0.356894942655391, -0.45789539728583, 0.362534652038161], + [1, -0.217114404815543, -1.62844635715085, -0.725808341462432, 1.16873689571824, -0.7229950579699, -0.627828784977337, 0.273802235753789, -1.49567315016453, -0.246699670371196, 0.40823121649984], + [1, 0.75349987354686, 0.947997658934685, 0.416194708395776, 0.738239321986172, -1.46363660382631, 0.43582274328015, -2.05614067908221, -0.117051221746883, -0.600472575996218, 1.88482264765409], + [1, -0.636275400966915, -0.857321092860208, 0.670447396679833, 1.40250110065242, -1.43928233008145, 0.249321436836448, 0.233868463802707, -1.01227371830613, 1.0288607644986, 1.98254592914111], + [1, 1.18407479487827, -0.737604629308954, -0.965178737620457, 0.442314207689339, -0.141263504505877, -0.0314577495958992, 0.836604259187211, 0.695580092874502, -1.4289458101882, 1.57363764905983], + [1, -0.0465755243960001, -0.731563306012409, 0.147570332832117, 0.53968982917529, 2.77504204808304, 1.91202993387047, -0.898278566277592, -0.0844099684651905, -1.47002452734476, -0.709323579655947], + [1, 0.856353426458313, -1.58269423741672, 1.50208650968351, 1.76827453144644, 0.135221727762208, 0.800197273525826, 0.686369645588779, 1.02424717322075, 1.49246130865092, 1.05740666512665], + [1, 0.289415833666859, -1.34002599971376, -2.10325090788906, -0.222024473998492, -2.01315647715382, 2.09622912949861, 0.756535391002675, -0.150528307610411, -1.82520600165965, 1.5298567109228], + [1, -1.31478014653586, -1.61830070306391, 0.51489111179983, -0.271112703609234, 0.714580574672896, -0.988368726100309, 1.52185691905952, 0.210563006071437, -1.34869663971019, -1.80863210510098], + [1, -0.381550000684025, -0.378584103172379, -0.489473860260901, -3.05515412142685, -2.19334203024195, -0.440247538360666, -1.01485582940652, -0.574953394198525, -0.196969391930501, 1.02762783428771], + [1, -0.726943754683938, 1.40939537031487, -0.846035087909233, -0.993072231649324, 0.153711442982765, 0.906513669483508, -0.814113635090238, -0.106939409163518, 0.263890977327658, 1.10935763104792], + [1, -1.53108034454659, 0.699820812010614, -0.606456345093166, 0.132907847613425, -1.28337850685866, -0.668121545144994, -0.19740263470647, 0.828946986956277, -2.2587268646638, 1.12216099991388], + [1, 1.15182810627127, 1.17124296030972, -2.29037933795033, 1.05933602881877, -1.42060521435367, -0.256713311289211, -0.677274468461777, -0.682025673165675, 0.883491957444909, 0.252015249009575], + [1, -0.768073129962994, -0.316000315465388, -0.858798944599084, 1.90816027356437, -0.429866776973892, 1.36376735876531, 1.57581174671005, 1.13547348215951, -0.283271085627698, 0.404849488296634], + [1, 2.57593504313787, -0.0416890758117048, 0.386800650765045, -1.18094237393181, 0.151632210421636, 2.01229651778721, -1.06096132450761, -0.191775660482237, 0.115483395393188, -2.06169569189927], + [1, 0.395255485561876, -0.206288596466174, 0.163983278715495, 0.897185067116582, -0.978849480158906, -0.190071746954425, -0.191619390815769, 0.622532985651407, -0.191758786038382, 0.389979350286401], + [1, -0.622760022269917, -0.354551680859143, 0.89020622646001, -1.93028128666534, -0.113952298253069, 0.453672945501367, -0.405869469103223, 1.4324970367065, -0.626564496196397, 1.28061368170023], + [1, 0.412783931497303, -0.691746980231792, -0.534592078562149, -0.129367993528905, 0.464584747152612, 0.392064466919276, 0.535639916832442, 0.673337086795998, -1.26542945310403, 1.31052109590213], + [1, -0.0150470730489512, 0.565160833061701, -0.113524651167587, 0.294037728125743, 1.66502902718576, -0.273962820895623, -0.451866419853021, -0.468942518618007, -0.911441746618673, 0.475636827162595], + [1, 1.13036354583681, 1.04545375731684, 1.50211826053142, -0.0484409066053376, 0.286826424044771, 0.400444723278323, 0.0543968057064761, 0.310493065447535, 0.399912558461291, 0.817678824150408], + [1, 0.346447734694128, 0.775923572393234, -0.879280199890418, 0.402034316566401, 0.09044602574326, 0.339176214437717, 1.09872796536713, 1.8764689738608, -0.736463961545151, -0.290572187004267], + [1, -1.56303765999488, -0.542442043732349, 0.198155402696382, 0.0587419151353402, 0.644443091889847, 1.58911841708283, -1.90339575164727, -0.590141201071132, -0.690396580127968, -0.788149850676385], + [1, 1.45459502624196, 0.0480104898330525, -0.333357638782843, 0.223883145026718, 1.34824727850234, -0.898201718762857, 1.37269830297864, -0.708762856989728, 0.496873569284866, -0.815934415580342], + [1, 0.0257877712917972, -0.370251206938078, 1.19535304249807, -0.198715973211082, 1.2159401545672, 0.272576249756683, -0.271589658930314, 0.39871563710763, -1.6663764571892, -1.40152641682139], + [1, 0.213755858982387, -0.0147038209271157, 0.0849840756155935, -0.512632878169763, 0.531528446409825, 0.31566451420133, 0.677776772871578, -0.520878213454716, -1.43494770238387, 1.03972317041678], + [1, 1.12070735038337, -0.502493998429975, 0.314253119488943, 1.12771337769273, -2.71894582323862, 0.0318290595932627, -0.0569336320055906, 0.0694919121773398, -0.53096442234051, -0.280356924188976], + [1, -1.27849826380686, 1.22534286236477, 1.48517850966252, 1.7634937489595, 0.920903240462244, 2.72198738812226, 0.887390214963039, -1.58623275689996, 0.67658090189962, 1.32434019161863], + [1, 0.0541718224545231, 0.718876854377301, 0.256782508543902, 0.515022250623139, -0.375752361435048, 0.556593428779292, -0.453556584081672, -0.555848644240998, -0.953633188989408, 1.55035173655565], + [1, -1.23352752082946, -1.80585978899202, 0.296046429821462, -0.888977471957812, 1.256996705409, -0.134372246513105, 0.27126753889399, 0.426017055352023, 1.15609284222199, 0.46082375583525], + [1, -0.86457484200129, 1.01325905218663, -2.07984479549609, 1.69103245110447, -1.38182073579023, 1.02524050324274, 0.468737352706947, -0.666755270042311, 0.995526601304838, -1.41679796049884], + [1, -1.87975828872711, -0.290572267344484, -0.361596459442319, 0.320855259660323, -0.380356446992104, -0.185158546079743, -1.4421654466985, -1.39539843279569, 0.425869664218449, 1.74169824831762], + [1, -0.399545610032572, 1.03307147293035, -1.5947729688399, -0.605603980110899, -0.0733951651847866, -0.649731365808609, 1.74636571332661, -2.01184789231196, -1.08489316755775, 0.306464254633609], + [1, -0.661886963333136, -1.16037316445312, 0.300524462143029, -1.38540047096603, 1.65811902528854, 0.502336513007171, 0.102874233485685, -0.496705818397604, 0.113028121215589, 0.763925186895009], + [1, 0.237522440965149, 1.99665730075496, 0.014095977907088, 1.02482850569836, 0.569391868218375, -1.21732612367998, -0.199194339361665, -0.406361752524518, -0.598242996028607, -1.72127398648413], + [1, 0.79225390242904, 0.834934343558725, 1.90173424334073, 1.91922392968882, 0.672618162453037, 1.52440425985107, 0.876409301204613, -0.940682495086673, 1.6097490133133, -0.731810922849892], + [1, -0.227520656260621, -0.375634198574288, -0.506415407701605, 0.957935266476087, -0.468324511642346, 0.190509546547256, -1.32736364030243, -0.47391464520416, 0.711753345165799, -1.48187392590955], + [1, -0.640972930241129, 2.32488685446622, 0.749415081634598, 0.451282052378319, -0.680308569947706, -0.766483419669001, -1.11913829100626, 0.657180607793011, 1.21531305912402, 0.838785971684692], + [1, -0.517273361439859, -1.78263470067673, -1.55769537440991, 0.0508775751501725, -0.241803319644442, -0.555481621807881, 0.559785405117975, -0.0543616042187232, 0.443635642240998, 0.383072026850309], + [1, -2.6847436536213, 0.433050620880986, -0.587861842660947, -0.65572082813317, -0.598986521377352, -0.203913985988754, 0.412118834215127, -1.36854815066048, -0.280731520165963, -0.186619011534884], + [1, -0.115217693774055, 0.317928036081373, -0.476142557788917, -0.69721562055968, 0.342453418096899, -0.2133263217612, -0.246404968766841, -2.0735703273294, -1.56120957190041, -1.72884950851227], + [1, 0.250684068331081, -0.718790094333811, -0.288813280102892, -0.0186199240270164, 0.107682798852502, 0.872765460307764, -1.03039308684089, -0.667629055883582, 0.776995244148751, 0.158348743266462], + [1, 1.24855635305514, -0.663519175341733, -0.7608141850186, 0.314152765837001, -1.64364978178195, 0.28562817227756, -0.205730603692799, 1.9665853904812, -0.353528536344804, -0.249350048996352], + [1, 0.14936080019548, 0.616980465918783, 0.239267155861965, 0.495564212029439, 0.0765618152196486, -0.16693307855747, -0.211508166639824, 2.04847342714151, -1.48137477352282, 2.16874207069329], + [1, 1.03898637582768, -0.660875577818193, -1.55632418841623, 0.198299403379932, -0.24169305225153, 0.467249629325915, 1.22302714286035, -0.161395152226328, -0.951073839258129, -0.310409359186035], + [1, 1.47866452056941, -1.38115585616826, 1.12563501687176, -0.0825036348131544, -0.747265167355167, 0.111897385664523, -0.75315959858378, 0.395377247392817, 0.74694574524485, -0.247608511046905], + [1, -0.28635713774773, 0.100738151564935, 1.8124188084714, 0.277251375386147, 0.966311936552576, -1.72253614015346, 0.244104659798786, -1.24551825872196, -0.528547085387285, 0.50992342130122], + [1, 1.96368966225037, 1.81160018122651, 0.336732462460169, -0.339434831608078, 0.170635342271952, -0.148997726334263, -1.08125300670451, 0.157925335011826, 0.414629810504057, 0.616772787706402], + [1, -0.125211498170713, 1.69649021409983, 0.315308354887601, 0.296405832672205, 1.91554288731158, -1.38787695358081, 1.74206172590985, -0.282444964122379, -0.733645607984922, 0.428844855567643], + [1, 2.27961195497506, -0.121099383211787, -2.67072142783041, 1.29022896186729, 1.23189972546309, 0.828702981538326, 1.02741059746509, -0.849782343081013, 0.431047020456991, 0.986029355646165], + [1, 0.374247627182289, -1.62350288863857, 0.536785534595554, -1.11338828625918, -0.644690591653339, 1.74734607762278, 1.8154344033563, 0.47865575187699, -2.4081021821515, 0.727267787468591], + [1, 1.24992816698627, -0.494615915300045, -1.37227132708417, 0.210715573445627, 0.953556646246524, 1.62129441471141, 0.262310374527895, -0.193069794501618, 0.282939810653244, 0.85466486256344], + [1, 0.749729049744348, -0.965911803606376, -0.416161389284952, 0.612578053274798, -0.777575246192657, -0.661382125949389, -0.314481533724166, 0.861483803664676, -1.61784430522606, 0.567220190065427], + [1, 1.48082635267505, -0.11409868874502, 0.641173778547103, -0.11859335349638, -1.72084827711434, 0.27039958475166, 0.689047769956382, -0.412192764207107, 0.0692588793817178, 1.55576589473237], + [1, 0.719525591713462, 1.01980326060581, 1.17446050599937, -2.59019571460861, 0.571783272274315, 0.108124889176259, 1.11648241939299, 0.622456156890488, -0.747561937136548, 0.450543366282361], + [1, -0.175792984174014, 0.988838767085715, 0.505607683603784, 1.43565730910564, -0.795802108331396, -2.09538159712419, 0.306501183167383, -0.628682643111582, 0.928966506152104, -0.382390180555212], + [1, 1.11259465684422, -0.69983817188553, -0.459995866605658, -1.58968729660999, -0.0120255224142838, 0.620417291354621, -0.767035205436497, 0.522194367487827, 0.0715777491516724, 0.532136236871951], + [1, 1.35789616188178, 0.294171006484038, 0.84311521767527, -1.2541974980453, -0.2469161185982, 0.0731712041906239, -0.906390863640459, 0.0947242875430555, -1.79807819145039, 0.933339842874311], + [1, -1.1327803569429, 0.578032532424658, 1.11849937424014, 0.0822872658666755, -0.206586675557259, 0.276945668677016, 3.76683783661023, 0.0464722968505564, -0.659573168877761, -0.949731625540001], + [1, -0.474070837728571, -0.219883182167584, -0.0197533136649941, 0.379016760803531, -0.0501455762686665, 1.46448782252139, 1.37717978896611, 1.11750995391606, -0.484522395619548, 0.640558874176027], + [1, -1.07891904000059, -0.117384671268236, 0.0746435156734318, -1.60755566592272, -0.764816886145953, -0.942266366525149, -0.155837872004312, 2.1789086321588, 1.4841318223697, -0.0171581325483124], + [1, 0.877057615032182, 0.600552483103985, 0.995137765783989, 1.02263975828624, -0.514141939723548, -0.200032993774054, -0.261643453047429, -0.845324742838876, 0.629316311363965, -1.25189851061368], + [1, -1.74014315158575, -1.28554934378014, -3.33776970825525, 0.981030565394271, -1.32125612257955, 0.515046254270886, -0.279031227887638, -0.789091296502301, 0.110910723348847, 1.30464849182181], + [1, -0.757708103632285, 0.125914559480549, -0.313900137029393, 0.497702802712945, -0.977780382597772, 0.998751236931609, -1.06325397357267, 0.162613042843295, 0.589243559263246, 0.966103753648006], + [1, 1.06020844322666, -0.805712629927298, -0.613677430364697, -0.345689394585296, 1.68680108500494, -1.16025599519749, -0.102948194726815, -0.818548758580025, -0.560597141519463, 0.800156148052956], + [1, -0.224649219213155, -0.23658827353597, -0.408775764633731, -1.65044715322888, 1.02805908679615, -0.276263145235709, 0.756890926873673, -0.631858721850001, 0.869532058524541, -0.117181396156333], + [1, -2.11285011236415, 0.160230164873416, -0.240694874017913, 0.702210561047191, -0.409151927019047, -0.181100210318422, 1.1650976799338, 0.201768193856993, -0.24523980458466, -0.651461063875899], + [1, 0.991844463245075, -1.13818705629596, -1.70184108207645, 1.51922015054356, 0.67685379813526, 1.39313271743638, 0.272741948417495, 0.0735225204064982, 0.973747650589645, 0.250441121089548], + [1, 0.711082346798216, 0.117450594096964, -0.0430527468534835, 1.27340812654402, 0.743990812147724, -1.28070276614504, -0.584279934208001, -2.28875716227135, -0.279821791090805, -1.21838812785696], + [1, 0.07309438564432, -0.655924820602222, -1.44061237209769, 1.87276772067901, 1.7674310128251, 1.79992109939687, -2.13122737917497, -0.925482946920926, 0.379822986502657, -0.929841407801498], + [1, -1.87468709867654, -1.66283089379801, -0.833977953827917, 0.701181623250603, -0.59019513124562, 0.22910964717263, 0.42503725534912, 0.121599925359124, 0.298599967409182, 0.219611026467441], + [1, -1.0841873078096, -2.33927436590022, 0.314875907598394, -0.746234014540964, -0.527811644713049, 0.323973683570686, -1.47400173749994, -0.227312024512738, -0.987194185353188, -0.331588830644665], + [1, 0.00511042335489403, 0.412913052075734, 0.401023573210229, -0.749484864611746, -0.319789676174357, 0.562225897157337, 1.32374511351428, 1.08447561899816, -0.902299212629249, -1.74291443537743], + [1, -0.68800424685653, 0.385196229619431, 0.103876482427885, 0.837394669719113, 0.521765543527145, -1.28636487876491, 1.32250377881837, 0.74350856721378, 1.14068497279824, -0.697093096739778], + [1, -1.67779814201743, 0.408968199540759, -0.950495505236488, 0.972521692657187, -1.0107674719929, 0.450764025501052, -1.34075308807251, -0.544682085181789, 0.380927501873903, 0.905790388054334], + [1, -0.978168859279978, 0.450236249431465, -1.01645713680908, -1.20388770155128, -0.403886591083717, -1.63545581687134, -1.63549482887888, 2.09647576068325, -0.376121180211975, -1.3154099447611], + [1, 0.71338184625673, -0.181999811662092, -0.452513136280408, -1.23474322795458, 0.570581104233738, -1.71890783172828, 0.662373521212944, 1.3053776193511, -0.1107534640938, -0.841404952192307], + [1, 3.31096178995616, -1.36776841081285, 0.158689784326942, -1.4379608804842, 0.350599099329699, 0.30843604578871, 1.59934928353781, 0.692964932925383, -0.116015032205686, -1.71547496713246], + [1, 0.788055650246968, -0.886918846472489, 0.864968645395036, -0.6771949185621, 2.12212097574024, -1.13215606852922, 0.860379034588195, -0.0146856428702302, 0.395004271182429, 0.353406309835762], + [1, 1.0626400408268, 1.99288443865408, 0.224666266363358, -1.10108333231247, 0.148567114225578, 1.0358987954885, -0.443581919527645, -0.60494369165062, 0.219524824412668, 0.249960918119848], + [1, -0.237356816200989, -0.0127190700911846, -0.23654092498969, -1.32615254430061, 0.94893056188445, -0.180990083905967, 0.145832806469424, 0.33121101663841, -0.0474101479286584, 0.129671129087755], + [1, 0.194809861374024, 0.789736740972101, -0.982245474091511, 1.06486529531715, -0.980547548647494, 2.09212766370721, 2.70902237412288, -0.559612685487852, -1.25521937307576, -0.911017391592441], + [1, 1.3154804386651, 0.72610701693439, -0.305013002781893, 0.83335365697047, -0.484124417911811, 0.17456746572837, 0.39809650275025, -0.356528452391949, -1.3084439265845, 0.234299188450297], + [1, -1.00261834888739, 1.20213928938457, 0.577534394195128, -0.155056349438279, -0.354233928182578, -0.0848204749925486, -1.13947517234818, -0.451925042319914, -2.63203265551759, 0.162189360203769], + [1, 0.715292694074492, -1.07631310447848, 0.394106636890583, -0.899425226474062, -0.404742194357761, 0.0474693249988838, -0.028680207782241, -0.0471597184912381, 0.699488411153503, -0.985816321567063], + [1, 0.832496764909325, -0.845777828726429, -0.0876924188597212, 0.157654936114623, 1.76442496619485, 0.252761280790926, 0.570890757328519, 0.699656898825309, 0.725568463913338, 1.74528266623044], + [1, 0.983638125896721, -0.511133232278131, -1.27480289176902, -2.18220607868867, -1.9135435866869, -0.346864928536096, 0.439405765900811, 1.12588345325173, 1.04436353568734, 1.68427791254086], + [1, 0.690050300390903, 0.183511344018215, -0.488873621741308, -0.372482710122811, 0.0407948967178303, 1.15146583199349, 0.719374034235675, 0.329873845885088, 0.724287492189727, -1.24056089316678], + [1, -1.67345463704483, -0.0581494576625651, -0.744021306384625, -1.00661401267864, 1.80448851765838, 0.88432780149452, -1.08123553013731, -2.79650943924649, 0.545414741998261, 0.670228655525306], + [1, -0.463320192480573, 1.7475261187211, 0.00588777425268877, -0.160347598058086, 0.343487499465309, 0.0820259584791699, 0.400331464998524, -1.43723682136143, -0.684898849254376, -0.320560485471391], + [1, -1.01882892827265, 0.12680991325714, -0.126199225957729, -0.495112145581025, -0.43230752627621, 0.117779204010625, 0.542087458010464, 0.387398237245481, -0.265157227559123, -0.529634512200022], + [1, 0.760449503075122, 0.346577549747043, 0.377331200402941, -0.762432116101992, -0.143857573301971, -0.576420338537078, -1.76826040539647, -0.539510954490176, 0.986970158504672, -0.205933714046934], + [1, 0.631462346962772, -0.347658768853803, -0.217040234639827, 0.230226903514656, -0.0354909707257405, 0.125808032341019, 1.27462517274748, 0.701534647610463, -0.896701981197914, -1.47550288318277], + [1, 0.152089528341247, 0.102907617348921, 0.114116683614131, 0.0796916197855206, -0.393072727832571, -0.0898862280212711, 1.27322943292786, 0.830948273117063, 0.41926110012804, -1.0865830056606], + [1, 0.0438057736109355, 1.83947777098775, 1.40187278441875, -1.76659885049259, -0.212276096457984, 1.72787721011054, 1.19178160448095, 1.62713838123293, -1.29685083980452, -1.19885027124928], + [1, -1.5946309751888, -2.02064920302065, 0.22884571084671, 1.94402451889293, 1.55325945177481, -0.958920172020181, -0.0278217335758768, 2.04936900444558, 1.30231506931153, 0.495903574243625], + [1, 0.0688272186262918, 0.836017201666817, 0.0523774007161087, 0.821898527898587, 0.781226955816447, 0.445006218698207, -0.0195309708585952, 0.156148581458487, 0.978974027519225, 0.922637594347313], + [1, -0.0614758604269467, 1.76704132543546, 2.40043019266197, -1.04928958118244, 0.852248613663193, -0.821751114330957, -0.408194697057998, 0.0859450608507081, -0.388925761455732, 1.29953153409842], + [1, -0.915260907426811, -0.233990797262648, 0.414921912787461, -0.590735778696244, -1.5878262610955, 0.459802961916617, 0.142280502095197, -1.26622082137222, -1.09371737265062, -0.0608758596877733], + [1, -1.12500234930438, -0.540709319301531, 0.269671156522759, 0.0743791471207893, 1.37500983478325, -0.958156410383941, 0.26225376507243, 1.86632892288209, -1.45690006955063, 1.70049926959592], + [1, 0.815842751470703, 0.902340754964724, -0.592868126515396, 0.00442790945887391, 0.598506983023174, -1.40628899328932, 0.963500525457448, 0.0710278939821467, -1.05927088784524, 0.786483945213418], + [1, -1.643761247516, 1.43413421686782, 1.22487280967423, 0.846425759692521, -1.11714469523171, -0.397904104388898, 0.154865368519507, 0.308993919484177, -1.48516753691005, 0.705460984674231], + [1, 0.960590659020648, -1.26940807455248, 0.724088640741634, 1.22167516526069, -0.28348244558427, 1.35519609406191, 0.616465223501112, -0.257200693393904, -0.639775104543056, -1.28005501106743], + [1, 0.154563407957009, -0.718502824990578, -0.46506034545425, -0.484151335970577, -1.51067254623782, 0.110095512009497, -2.27241764195967, -0.500261253741122, -1.06977385949416, -2.26882231541562], + [1, 1.20414288452861, -0.791028745288815, 0.155556315101235, 1.73514467061434, 0.740878009328286, 0.302765903664726, 0.955371394268988, 0.351197255638354, 0.207398888480484, 1.22056568937605], + [1, 1.52714308875996, -1.07296554654045, 0.179973371918225, -0.436229730433633, 2.37997252698705, 1.37277241807481, -0.719822643706078, -0.808196100861813, -2.66145719926469, 0.254399581201766], + [1, -0.0978163502789948, 0.57064300415661, 0.497459009961722, 1.57453926652303, 0.700214588666805, -0.120541944195616, -1.35202441022451, 0.915960776950478, 2.47980663446347, 1.58916278523592], + [1, -1.17211790254478, -0.908685108559307, -0.175275313377792, 0.216493792806901, -0.475446302266885, -0.0712976166959252, -1.71937625020417, 0.382770829635983, -0.393200318098256, 0.42246721025276], + [1, -0.526342263192258, 0.504619491982736, -1.90347358622619, 0.642897124257289, 1.19452601603751, 0.924055507636994, -0.959255388009448, -0.430326670874091, -0.405572827550732, 1.23980999373827], + [1, 0.270258988553755, 0.0114885880754705, 0.0627286855722903, -1.05419173373894, 1.10656850290674, 0.778301812887012, 0.45091263880082, 2.10539582969095, 1.44209892010515, 1.01044122325223], + [1, 2.46432777655785, -0.591023644715147, 0.676022760430271, 0.558048695602108, -0.756898298646424, -1.09145993469773, -0.217463460484097, -0.033497884311001, -1.57234842102446, 0.309656769877627], + [1, 0.635408332426448, 0.821907462153012, 0.00543396862788553, 0.124218225302014, -1.86080736646707, -1.6767676512812, -0.512658420222597, -1.09945967361461, -1.03087923555062, -1.60055828394562], + [1, -1.34492765902435, -0.313599080980229, -0.368507407908448, -0.00786512525292688, -1.23106423015103, -1.08575915263318, -0.359505594124389, 1.41887171682044, -0.0443153310730792, -0.0387664437738049], + [1, -0.103796799131733, 0.984697726152067, -2.18261913314613, 1.48467131744997, 0.485035802137943, 0.232092297164981, -0.122445877488031, -1.40426658296917, 0.833713835221313, -0.922449889621165], + [1, -0.624816762682257, 1.6042331932178, 0.492184880704127, -0.336965814252221, 0.417294249933314, -1.08712267911235, -0.935128676898526, -0.150496970168789, 0.576701107190937, -1.63927852050612], + [1, -0.175182134696764, -1.9067165430729, 0.249945506386625, 0.300176128354916, 1.54469926636855, -0.0513421650659602, -0.654777688747882, 1.48334110714222, -1.58078407148771, -0.875375372826907], + [1, 0.903559057855837, -1.66242996068999, 1.11026879129376, 2.0025944888563, -0.483798685236757, -1.92444136206161, -1.45245128269144, 1.6530418053314, 0.0824972107393558, 1.17078031155763], + [1, -0.322619977552535, 1.07991449794185, 0.96663021871109, 0.578631103004985, -0.444260882500074, -0.72643334167115, 1.81692695846028, -1.62959859361654, 0.702918327857619, -0.78257203420773], + [1, -0.0519921846873054, -0.289572992978744, 1.15765975857363, 1.23696871108957, 0.148816097851577, 0.622187917233729, -0.19262146706526, 0.391055612342051, 2.26053700327521, -2.11696074641255], + [1, 0.402801835219623, 0.244404706687852, 0.449229569983505, -1.48296741325882, 0.81215650653759, -0.910687187936334, 0.85097790100397, -0.700701354243743, -0.21947123926447, 1.35003488981972], + [1, 0.356277834225734, 0.114683491912248, 0.157538798309015, -0.924204094708291, -0.543419602984662, 0.32326426876636, -0.525858965893421, -0.0158390943151547, -0.099966195817108, -0.114425644056625], + [1, 0.233775712259531, 0.859154015140903, -2.89243338667229, -0.833252576393751, -2.46440325057419, 0.90069552957397, 0.767150051588503, 0.333366901718695, 1.36685939017581, -1.65602767201104], + [1, -1.07859223276538, 1.62073348679355, 1.64833340915353, 0.925827671797588, -0.161943696652471, 0.192812188545261, -1.55698173201525, -0.826491435143758, 0.735498290973859, 2.37244341000946], + [1, 0.852757050409697, 0.908097519584182, 0.793659947082685, 1.21121688293563, -0.288869612116867, -1.60764230030814, -0.069279319787863, -0.256932098964906, -1.28574369630975, -0.321194737257784], + [1, -2.05115274904634, -0.0635107229443917, 0.459068312862946, 0.604249438578625, -1.82719919503966, -1.29990838874504, 0.736806785222241, -0.314639245439301, 0.0625866392511628, 0.267295431280839], + [1, -0.250767159079008, 0.845735298658901, -0.39360310992306, -1.40513509223086, 0.499097835922718, 0.136135425989383, 0.354242258583472, -0.0655832089215406, 1.75874116106832, 0.790160981406994], + [1, 0.816003428407337, 0.159779037909362, -0.625984289008391, -1.74378018843892, -1.64048841611544, -0.154047646078173, -0.020636846534007, 1.01132277255796, 1.67764586249732, 0.222774356794749], + [1, 0.412918776293678, -2.01168711302063, -0.895066504319677, 0.132849833491562, 0.365092670692328, -0.274928541602624, -1.3465135614205, -0.510776894049764, 0.3778738912798, 0.0226221236781524], + [1, -0.629332144273191, 0.56134978128214, -1.14548259964535, -0.29264638793793, -0.0482953008117277, -0.546246812321747, -0.0612866973126842, 2.09351039069661, -0.662458123156363, -0.410632723352756], + [1, 0.0255794374900549, -2.13715349991833, -1.00104763621386, -0.705506297202938, 0.332910180753588, -0.279600489660015, -1.24255598797839, -0.144441655842482, -0.136902157585384, -1.83211338428854], + [1, 0.480792413133131, -0.492575414524149, 0.144695922002916, 0.137373565655511, -2.12488327223911, -2.42103695992918, -0.96462230549068, 0.106813566310274, 1.90348364256823, 0.659069093733877], + [1, 0.426344298457363, -0.499557153958622, 0.547872574522133, -0.309448228690439, 1.78923042047874, 0.671001727309641, 0.14313375003619, 0.970471804471967, -0.366656341778997, 0.519486052204863], + [1, 1.13975802762172, -0.974485133790933, 1.62436592160338, -0.539030297769144, 0.564847928897108, 0.580419245824563, 0.00567544527420362, 2.37019427258203, -0.54016852222394, 0.102379252723917], + [1, 1.44007289549687, 0.182283890814196, -0.709827060773357, 1.2087996322619, 0.264532257925981, -1.4870963116061, 1.09195069332922, 1.73163020100362, -1.96739447958227, -0.432372747790473], + [1, -0.686914095583759, -0.636207904794637, 0.0149829239774565, -1.04689912194355, -2.15716409288451, 1.07510450789322, -0.0359765200490877, -0.506321057914971, 0.464000203195537, 0.387325943957626], + [1, 0.682698020349823, 0.190764154069807, -0.274627219067887, 0.353710258525669, 0.536267297754094, -1.70721910279573, 2.02858475825376, 1.45337091256432, -0.405842665240158, -0.474676202817946], + [1, 0.282995495994091, -0.513681839577887, 0.868934571361812, 0.110354954004858, -0.521628896595477, 1.00974494861067, -1.95251039798103, -0.488487697448664, 1.0789067431515, -1.13375921786613], + [1, 0.847375365627917, 1.07655929301921, 0.437572859749185, 0.181249621979462, 0.385139221713466, -1.98169842260235, -1.03840845171239, -0.701038098979985, -0.32350453999269, -0.344393684106312], + [1, -0.557388070865319, -0.555467244486122, 1.71152144434291, 1.18551624270153, 0.428129869836065, 1.50668767325782, -0.687745560460575, 0.712550757623262, -0.122672190456648, -2.01800784294148], + [1, -0.486467233939374, 1.48810548314868, -0.147316532136273, -0.9489689028392, 0.952790955649346, 0.0742805354202493, -0.269383522226547, 0.114076269518271, 1.13873519635254, 0.175787298014354], + [1, 0.491533174286661, 0.719964268444804, 1.11546279396419, -0.67659076447159, 0.622232845694646, -0.361880909803655, 0.38087373741803, -1.58580087943766, -1.8491736834396, -0.0368653171045809], + [1, 0.516823271697658, 2.00371480288332, 1.03421227139897, 1.95165647167184, 0.812905417612602, -1.32377491934055, -1.02118377324787, 0.242381082950347, -0.670710281907806, 0.874852950685367], + [1, -0.153522576018854, -1.25903889665307, -0.524846139039139, -0.256172664794566, -1.55156976262908, 0.795952763328828, -0.244344739654594, -0.47470433017502, -1.83000460244099, -0.34510888054001], + [1, 0.0121833020918519, 1.44594857347247, -0.0948251105713194, 0.123018818364011, 1.45941116261756, -0.987737586718704, -0.697200111603315, 1.57854967040026, -0.751942692177748, -0.928030003383022], + [1, 0.326671752510455, -1.85098542088696, 0.0291608590904736, 0.257841380014095, -1.12142728303574, -0.806053590769675, -0.520584651145865, -3.32229823848405, 0.875681105304793, 0.0896492539981053], + [1, 0.655232067649395, -0.242709663226575, -0.825758981485767, 0.856166261426656, 1.98236998741081, -0.980735920044222, -0.337861254516622, -0.204945592833509, 0.793817710029995, 0.947701022757334], + [1, -0.155410338508849, -1.83837577965203, -0.549308321431302, -1.16644593807385, 1.05647856630986, 0.0334148149699282, -0.191148114560214, -0.596048481716935, 0.000621833734250599, -0.633342546264859], + [1, 0.223980809881515, 0.355868992170541, -1.1649342990865, 0.0134614956989079, 1.15427056272041, -0.0570891215865447, -0.858057274730452, -0.500730608948299, -0.442280980273464, 2.03820261743234], + [1, -1.12805287923897, -0.459356823810236, -0.371289723932661, -1.10863092120993, -0.456463716857643, -1.25491395846211, -1.26972436266824, -0.250537589476814, 0.89256366368206, -1.29090135840006], + [1, 0.213294532612493, -0.358217393101149, 0.515335208641767, 0.303537692709154, -0.310680754982007, 0.593181436442382, -1.87976933899255, 0.593905528985014, -0.133110057564675, -1.09730496971702], + [1, 0.334375616025451, 0.66249422296794, -0.702965393225223, -1.41773944725836, 0.713779511633934, 0.696921506956212, -0.469842320235251, -1.60576420172396, 0.431855054381289, -0.745323449309192], + [1, -0.548248314315769, 1.23156928861004, 1.6837547703668, -0.900609825117432, 0.806668260231873, -0.234391446064817, 1.45447278972444, -0.382464084118365, 0.133758225174594, 0.540977884799584], + [1, -0.963246041437229, 0.771000707966811, -0.50983562655377, -0.322804208837855, 0.624500986021615, -0.377013916499454, -1.17254672822684, 1.64045401445936, 0.629314659286904, 1.49688122241572], + [1, 0.110892588299581, -3.01655720566266, -0.461380502006488, -0.604927497184723, -0.160323023499503, 0.0109549747532987, -0.290608379839403, -0.86132449013351, 0.608465377666553, -0.433769610163767], + [1, -0.263721387781111, -0.92888168582889, -1.5185997847507, 0.0874221717585555, -0.133546532204286, 0.352407655492641, -0.81147334971557, 1.04963791827866, 0.688415536521462, -1.65490477866845], + [1, -0.00452382218149236, -1.05478709324795, -1.17940431505679, 1.63165254297711, 2.26353226177428, 0.46865701526869, -0.070388784208239, -1.17481467662311, -0.0986026590350449, 2.24831663679895], + [1, -0.0980963153850163, 1.01643525439374, 0.0105785987842987, -1.33737594250694, -0.821752294932066, 0.917716745868669, 1.69295311649722, -0.169205684130108, -0.401921005098147, -0.303537874463176], + [1, 0.0129580648206859, 0.839953163471089, -1.05321829732528, -1.50521592853662, 1.43920849414539, -0.998126536149861, -0.357801828752788, -2.04381394969287, 0.760282508777861, -1.7308813776707], + [1, 1.8086281642806, -0.477912123158324, 1.61307843557808, 1.75446485075999, -1.12338235774491, 0.847132843942018, 2.18798054124402, 0.565441520928664, 0.0881299003421901, -1.25814772560749], + [1, -0.861778946566748, -0.70978564289933, -0.819071845993046, 1.24194066850016, 1.51582124065232, 0.567108400127566, -2.19958564055227, 0.849396769111592, -0.578634465379996, 2.02438176328728], + [1, 1.08184798693107, 0.480296393904533, 0.117275550915765, 0.109373070565896, 0.218244159814809, -2.80224513870103, 0.42155909684194, 0.531644671037366, 0.468065369071145, 1.26909468520339], + [1, 1.41142123851869, -1.24637417477841, 0.303389880903329, -0.314305738551574, 2.3527128634448, -1.61945352167926, -0.874637604040173, 0.528043710318909, -0.618766964369664, 0.835101918794091], + [1, -0.0788739528842272, -0.21735443381969, -0.57372712136489, 0.119097935978052, 0.666975851869164, 0.601503937872325, 1.03939659456227, -0.707257868555438, -0.467701864139595, 1.23875872163599], + [1, 1.14690931585666, 0.185139635390681, 0.411406113879405, 1.12110781985266, 0.865007544577325, -0.626104790934115, 0.0842575627978632, -1.507027911566, 1.20259697036487, 1.15756033043794], + [1, -0.149357567661004, 1.2486509186276, -1.11248359096276, -0.521919628780204, 0.0698060337792027, -2.01334104020476, -2.12563703295746, -0.160949703746541, -0.0905176870087339, -2.31122690205417], + [1, 1.13997463759644, -0.877213132365973, -0.804776191458503, 1.40676994458224, -0.143906031094288, 0.723664235890511, -1.97866513062987, 0.13519801435806, -1.94666357168829, 0.200398355766041], + [1, 0.656907120662454, 0.521109296803826, -0.131377648688595, -0.481338181472851, -0.0262717301774481, -0.33161345894965, 0.435779766450829, -1.00410363678253, 0.459640443988441, -1.00544398156861], + [1, 0.677804190987119, 1.25661517398149, -0.190569678138867, 0.123775647067427, 2.60433715193697, 0.124720915266154, 0.713112083875499, -0.773214477302505, 0.427164288578095, 1.55629958291575], + [1, -0.752804055778311, -0.80037137555918, -0.954889529412167, -1.8308515309642, -0.942878745833981, -0.870390535571797, -0.620161973757575, -0.77855274501213, 1.23951047676553, 0.707481392105406], + [1, -0.415686642936759, 0.0160246670907747, 1.45673425493669, -0.0369239044009395, 0.167086604414437, 0.253576781881867, 0.775575175568743, -0.57089609288433, 0.0161043446565073, 0.249577445616701], + [1, 0.0588178752614041, 1.74265546551436, -0.0234525773266622, 0.996418086585829, -0.605151427486501, -0.191379424748427, 0.868613894551357, 0.622853337514122, -0.891285157632313, -1.31349813963379], + [1, -0.189756414780667, 0.00821764886844355, 0.77449988898121, -0.257599421935913, 1.36554622440972, 0.253756531655632, -0.476195382708534, 0.583855864294478, -0.425304329366678, 1.98122885514984], + [1, 1.40705924255622, 0.479810507118277, 0.490784957446195, -1.33569923521143, 0.133158970079849, -1.86540248795539, -0.439905195130924, -0.620737171828313, -0.2406868810551, 0.638393060193248], + [1, -0.199095830154534, -1.66764641296175, 1.54659220575458, 0.0576481361832372, -1.69239809392892, 0.319435797013365, 0.482074996574907, 0.204827266838959, 0.731707461243785, -0.905241268928739], + [1, -1.21408224917478, 0.0843861670411541, 0.0265403322222445, 0.138412554859758, -0.0141088568849556, -0.636001323775759, 0.138955717584803, -0.819199993348606, -0.0273233189264359, 1.18243000276934], + [1, -0.75945563147921, -0.524527637551885, -1.20942285041198, -0.934932016640056, 0.0744035233622339, 0.234460982630718, 0.0434301869921273, 0.51833499421371, -0.57602224850055, -0.606851380136231], + [1, 0.953046805353977, 0.954827057439205, -1.63429089692243, -0.179599249442556, -1.06678014441491, 1.08757992195886, -1.35857496060756, 0.759693784209863, -1.27330758189896, 0.956679324918143], + [1, -0.279798406582525, 1.544747812829, -0.0748703161911561, 1.29446754569069, -1.68081464486961, 0.120146252820042, 0.0546145009332622, -1.71288278830896, -0.293715674734236, 2.58314894845514], + [1, -1.61625045994981, -1.73492087988394, 2.6059284370775, -0.974359069504124, 1.1580058975542, 0.413232405464369, -1.319020206703, 0.883807896124122, -0.467230803181799, 1.14118794999958], + [1, -1.50371211769016, -2.27936826166698, -1.53572110336136, -0.515305114232146, -0.900889813875264, 1.87696257041505, 0.291409685265036, 1.25618636697351, -1.62878193298991, 1.0208441106877], + [1, 0.755819950692786, 0.346645640245259, -0.983368283397652, 1.24789536214026, 0.67665595794075, -0.580903144861048, -0.207596338164436, 0.0485176855229995, -0.0347453018966035, 1.15511638603769], + [1, -0.418939928855064, 2.12382778023308, -0.264904112353301, 0.554000467451896, 0.411578215195482, 0.654789394334846, 1.62217198479116, 1.3415248920555, -1.68183913564969, 1.67961407459033], + [1, -0.587469129841068, 1.10356640946751, 0.417621321628038, 2.10312230775837, 0.406227939985066, 0.381087647622936, 0.506890749401015, -0.757419172965304, -1.34286971938041, -1.46191455333362], + [1, -0.741212328608131, 1.14294628641766, -0.0623869660753054, 0.979034097202763, 1.35172976517458, 1.40678241030011, -0.108797516753788, -1.75993327635787, 1.12594227833945, -0.867722835950832], + [1, 0.481149155127202, 0.135173793440227, 1.48259161353872, -0.194977669023146, -0.502498843356354, 1.0988246627219, -0.571030901668533, 0.428627833633813, 0.595928533918912, -0.370634788683754], + [1, -0.705612032275991, -0.374153633218723, 1.00037282371051, -0.851703603404847, -0.314581722012328, -1.47659963849998, 1.33302043651666, 0.247498469229836, 2.53700951770085, 0.170706961272353], + [1, 0.183788276104339, 0.990346929530961, -1.30295516388447, -0.606553774274131, 0.315812469604364, -0.373895245913244, 0.160803578975602, -0.0565566662782431, 1.56679792775765, 2.11246546548773], + [1, 0.600656225105272, 0.201501003990921, 0.0306395888084127, -0.0423268169584658, -0.661328587383674, -0.082899297281792, 1.73444672600091, -0.96568299386911, 0.146829181036967, 0.655115490589358], + [1, 0.617525568011613, 1.23032936363403, -0.38174945348081, -1.20744519243785, -1.43481313449684, 1.76513731466257, -0.453344830573113, -0.304942175282622, -1.42818568377477, -1.06139331486836], + [1, 1.74718856977734, -1.03752214521355, 0.682724530374844, -0.69686103939525, -1.77599446874538, -0.477041778997472, -1.53707257308025, -2.39656381785892, -0.374465859357499, -1.30250232953634], + [1, -1.05789599097706, 0.259077979883814, -0.928378497169629, 0.68625132659975, 1.14187359433568, 0.110630740327481, 1.48601795346475, -0.703987917166608, 0.731834239034983, 0.522860350261824], + [1, -0.0128845025688867, -0.65168161308097, -0.591634896802373, 0.197871953240167, -0.767625449011857, -0.450161317941843, -1.19854175830036, 0.996718523912795, 1.38905102053743, 0.548650283494988], + [1, 0.148896539698808, 0.0624989870560525, 0.537821925645159, -0.86441842648903, -0.828370245252457, -0.223432400986492, 1.10367663411227, 1.01572595810203, -1.86565446337076, 0.0207014843087262], + [1, 0.138436603499358, -1.93025514512641, 0.122926679774786, -0.271887520501576, -0.459948520007328, 0.332782482373811, 1.02894592152868, -1.56904278603934, -0.680891295078138, 0.205730940653197], + [1, 0.878713171604731, 0.131308665064303, -0.569700534422496, -1.58070292649677, -0.171017301728553, -0.666817090861302, 0.23770289794082, 1.48909145777163, -1.99221396211652, -0.0593673119844797], + [1, 0.746752366174888, -0.0497701858539252, 1.0720010480951, 0.500298593487968, -1.050185220663, -0.987800166791882, -0.461114654863055, -1.12339062605195, 0.453107850409498, -0.530763642271724], + [1, 1.98261039647957, 0.896610800952206, 0.478321387201596, 0.45177913969389, 1.21725014823572, -0.537599762251994, -0.286231132641942, -0.163113084460674, -1.23569332175946, -0.122322231843846], + [1, -0.321473636714235, -0.922626359484469, 0.335098045087374, 0.551302478941007, -0.381991818696135, 0.227094311247514, -0.0621415653129085, 0.918713142723964, 0.889976227873894, 0.482390240988345], + [1, -0.3962069865309, -0.969691303587961, -1.13239435900684, -0.940006871145194, -0.23387863466219, 0.216596829083149, -0.368254207129528, 0.19344912834166, -0.762398870267526, -0.558210862234167], + [1, -2.0091598177349, 0.776810241617836, -0.590779119692552, 0.408861214317684, -0.722420727213951, -0.287089750412938, 0.29513390486406, -1.15987463256453, 0.582133031207123, 0.665918093524252], + [1, -0.385700778790221, -0.776340794466553, -0.563362252250031, 1.37086352052492, 0.59611518594049, 0.640041427333835, -1.48076202479036, 0.747935893046444, -0.109756684758275, -0.357082040571839], + [1, -0.571001919956464, -0.535975020837464, 0.681672936328145, 0.664246924979728, -1.53572863600178, 0.621017745382566, -0.696830819245768, -0.201562637399061, -1.03385804753502, 0.605936852251101], + [1, -0.101540418363153, -1.66024209030759, 0.659251235999499, -1.57762830805247, -2.37771925680456, -1.2784210994373, 0.588573223840135, -0.432199397627923, 0.602922236198473, 1.36263061382431], + [1, 0.537041055364273, -0.415496639376537, -2.11639181429213, -0.502516474610773, 0.713469515203709, 0.660086318324393, -1.37656690584127, 0.0764818371109086, 1.58861815020288, -0.919522055450223], + [1, -0.700222795680817, -0.0313489539587311, 0.19695973175728, -0.889216222709527, -0.708900682565628, 1.21546509263907, -1.27307932715763, -1.71978332360393, 0.529772163380163, 0.370376642525397], + [1, -0.398843711336123, 0.117353347861516, -0.0557209813842546, -0.174733028215441, 0.61778361063197, -0.13100224898712, 0.818133844069992, -1.17131439604597, -0.800030202025625, 1.45889567452108], + [1, -0.414980863070009, -1.63010394740844, 0.526003514414002, -0.406481284273447, -0.217830823477313, -0.523957320383286, -0.391469896153971, 0.113911284815932, 1.64898900166657, 1.07917308361474], + [1, 3.03861709779262, -0.805294178720336, 1.49446229819161, 0.0909549551812133, 0.164394369359529, -1.54459859333001, -2.04233887545252, -0.711086394054577, -1.07011520758916, -1.18016899079902], + [1, -0.056490358667454, -0.408543779952842, -0.296284413249257, 0.692121845785003, 0.805329716782811, 0.223989222658028, 1.24000004086919, 0.862930929568103, -0.123580225664475, -1.24383482061862], + [1, -0.293958455340442, -0.257062454417471, -0.285522473142868, -0.354754986667173, 0.843214951023417, -1.53473791934165, 1.00399515614831, -0.912496267807739, 0.679636598404604, 1.33717584024097], + [1, 0.930666390217005, 0.343084484433762, 0.521988172958165, -0.782196206230475, -0.0584390627103578, -0.20625495488444, 0.690621755293172, 0.41442995498814, 0.0417517435539689, 1.13328840690882], + [1, 0.98314836246845, -1.08041676726552, -1.81514459455943, 0.159772159628149, -0.245127787991798, 1.53485192378254, 0.702654464471531, 0.61483901008584, -1.07954430656288, -0.413970886362568], + [1, -0.030118238061042, -1.38968067566983, 1.07026673738878, 0.046994414325189, 0.616841552020974, -0.671126783325916, 0.940589192948221, -0.00621246849817066, 1.50481614234719, 1.23851564717577], + [1, 0.0329989842570078, -0.0711531574784798, -0.394494238015966, -1.63548949952878, 0.467490582823462, -0.305195940538755, -0.0406261517052395, -0.692269867069709, -0.511524435338263, 1.16709736724813], + [1, 0.423908366430969, 1.63995167739707, -0.403713675972838, -1.38046825452181, -2.54983490195833, -1.23442672303406, -0.0511921171005367, 1.04669047032259, 0.417915975472128, 0.283995366085992], + [1, -0.538336146291458, -1.94725304084738, -0.563012645367835, -0.893448588533602, 0.201293069421885, -0.939117554422038, 1.73862540810683, -0.460124993753049, 0.245053051987822, -0.587244365759604], + [1, 1.18241051526938, 0.813737727266945, 1.19582586153523, 1.20705914698526, 0.248147850257091, -0.104922854554195, -1.1317296125924, 0.586045738116509, -1.40889838133062, -0.462850165806106], + [1, 0.340622980829039, 0.17472204277198, -1.19958788708462, -0.291143552722926, 0.198815245074323, 0.991901715706679, -0.0472899164668941, 0.83180171952573, -1.55125951690818, 0.195181687233495], + [1, 1.58993228126739, -0.416294873434723, -0.0891645549135418, -0.168327749410092, -1.29743849016853, -0.403326392150297, 1.22535920600272, -1.09958158917106, -0.785986333673574, 0.0617870720544463], + [1, 0.969362053925189, 0.477169932952988, 0.998270305644457, 2.00402113497221, -2.3417393309884, 0.340527743361751, 1.2379619257833, -0.738827869407309, 0.116555484912866, -0.597012335187599], + [1, 0.0204059826918115, 0.839338936680759, -1.56163352136722, 0.762171608332494, 1.0197320515215, 0.444637377981295, -0.6844607539187, -0.459321928623381, 0.982881644177769, -0.146047992138424], + [1, 1.01075151248235, -0.277437903589826, -0.923449834232745, -0.0873564007187299, 1.13407899590244, 0.195830451171811, 0.973049485335157, -1.85700613321966, 1.1104667395999, -1.17570408204485], + [1, -1.03409499976402, -0.0573092136502171, 0.708973876474614, 1.42019390864229, -0.464997807203204, -1.43912880962432, -0.273231620280989, 0.558009785788527, -0.0550467072140707, 1.04954911015383], + [1, -0.258269962287116, -0.185796315700205, 0.105017778274589, -0.782991272297674, 1.19290899675812, -0.461917019025158, 0.212259573769609, -0.681951377337604, 1.20418398171173, 0.755539756203567], + [1, -0.597843421623756, -1.34158582700499, 1.16261013821389, 0.430702390955035, -1.13614513759469, 0.69663857437907, 0.675553315072377, -2.14701737990137, 0.334248868253063, 0.203008565309617], + [1, -0.551093145521334, 0.627713882914884, -2.18220817609864, -0.54386248205833, 1.86427520848918, 1.12218192299585, -1.45835113567018, -1.13713584264224, 0.299168971617654, 1.27125665224214], + [1, 0.344006044284329, -0.298212183756091, 0.781924262630188, 0.548191671949958, -0.191653851468716, 0.28820741304267, 0.0960481072690844, -0.776969198211304, 0.194145097656192, -0.159547815127675], + [1, -0.048935019594509, -0.723869861105233, -1.27371338299456, -1.61201835788169, 1.29128399234814, -1.52259399204841, -0.928217477758954, 1.79482996729549, -1.15331974092592, 2.28591647628702], + [1, -2.11590806150954, -1.05661680335153, 0.960366571678854, 1.39963796048482, 2.87096614185381, -0.0714703095244478, -0.611047917920607, -0.473838388782687, 0.517951763673742, -0.6569994415801], + [1, 0.811239549280564, 0.394326544434367, 0.497996279679021, 1.1914195129182, -0.320990902564877, 0.149995058314686, 0.638045481681441, 0.18814191808019, 0.329824435767072, -1.17308246808383], + [1, -0.0188357874175357, 1.1258755605712, -0.353939394511852, -0.350549641312007, -2.12701602379938, 2.77943456520427, 0.160337739949286, -0.827514492625635, 0.0459423067196847, -0.571139853698046], + [1, -0.467033235491769, -0.0737996923888308, 1.10767484324117, 0.25119493982508, -1.10378566313726, 1.51520319237236, 0.931085790451567, -0.068596124852665, 1.76837869072528, 0.160436530256384], + [1, -0.0337804793665571, 1.12034899718234, 1.36868039311475, -0.889583750132093, 0.481289566404423, -0.686214034396081, -0.80548896562862, -0.595783557678687, 1.04852705065518, -0.815896287621704], + [1, 0.535291347278067, 1.51671207277987, -0.716847669708878, 0.214080955710834, -0.528624352525776, 1.72287820305407, 0.805706246793545, 0.0893185039767077, -0.435859584167511, -0.14040553610411], + [1, -1.24899291424908, 0.304866197234222, -3.40627913884099, 0.570329598202603, -1.01967833635134, -2.26715127541055, -0.811062244609748, -0.791649460514419, -0.598449478264999, 0.978023328676823], + [1, -2.02185551351332, 1.39897674226074, -0.405516772524844, -0.29419355027643, -0.489251540397885, -0.222653251865155, -0.037051767711466, -1.05405812709871, 2.20736466075074, -1.13240291618144], + [1, -1.10640729715445, -0.668667615083039, -1.76510573216848, 0.504139415892461, -1.78874135753623, -0.119643160535878, 0.134281247799707, -0.819584627193412, -0.339172771655677, -0.172124223488631], + [1, 1.35187428550271, 2.42737871894465, 0.835272508094015, -1.24682350573416, -0.332889882509632, 0.62454016695226, 1.77851937499347, -0.742261157614926, -1.35535387822393, -0.371642080295613], + [1, 0.65841299887006, 0.868898366229165, 0.304826966539743, 0.700161538704354, -0.566120777028772, 0.407734735803156, 0.427727619647357, 0.187775813153406, -1.18863180973023, 2.06812428557852], + [1, 0.198726791336318, -2.43084541089623, 1.40967159692527, 0.101671614077478, -0.436043280666804, -1.25380172151891, 2.54031234575986, -1.22548859695757, 0.265758316265701, -0.193726858375285], + [1, -1.48437266386136, 0.932645982179598, 1.70046028985901, 0.30492713080189, 0.0650029095532707, 0.829269227458319, 1.54453429025266, 0.396693775209534, -0.21178244429008, 1.30646030805848], + [1, -1.34918627967778, -0.584174850069564, 1.37444848134925, 0.584789003456315, 0.884741210717425, 1.38101569724025, -0.40853233643174, 0.052014744306235, 1.67408015511177, -1.21764695174204], + [1, -0.849754405932367, -0.0195173205954154, 0.162060759202135, -0.240395634147833, -0.321784918253669, -0.223388945723857, -1.59267222987308, -0.466127092359588, -0.853523224341387, -0.579925386311085], + [1, 0.46123691965914, 1.49368446928118, -0.324707220944139, 1.44388725726878, -0.211160998051443, -0.809714687329235, -0.735519287565154, -0.0689782335554491, 0.486535423510717, 0.589045801213121], + [1, 0.114762062961294, -0.0584060326017302, -1.04233651943355, 0.286943886528225, -0.0764096535277925, 0.37935217803655, 1.47226313148417, 0.114550240435086, 0.285236854734642, -3.34373509668384], + [1, -2.01546718177331, 0.334729429412629, -0.841208425957212, -0.93766093553712, 1.48319367121349, -1.22817835844102, 0.367370026678223, 0.839959857144331, 0.477385825733026, -0.12690914752403], + [1, -0.0233249432038224, 2.07661544820275, -0.0914796408711367, 0.103599507862508, 1.6218949572797, -1.13069873006699, -1.08491024891135, 0.375180162523903, 0.693293851737723, 1.19210218294901], + [1, -0.214911016680328, 1.19563949306412, 1.20964154234929, -1.27130722074533, 1.17420279918975, -1.0880936875658, 0.463440472431992, -2.27349017104779, 1.43591416644487, -0.318877133128047], + [1, -0.122516232985227, -0.289075471220607, -1.44041485633938, 0.0690374842312148, 0.0254496777389245, -0.469409522866103, 0.460799129541933, -0.631143371559063, -1.21594558290392, -0.555867239593768], + [1, 1.89940192598234, 0.657061212760735, -1.74653163500763, -0.230200885251949, -1.63980009206546, -0.340135763559857, 0.800727691602666, 0.469852465976199, -1.64890901128456, -2.40596476172007], + [1, -0.611773145502149, -0.437019821341279, -1.61904028940651, -1.10957637773732, -0.475987173874241, 0.943435733978744, -0.120598481322707, 1.68100270759105, 2.02035447149722, -0.578237998524464], + [1, -1.66841612272989, 0.974108221814754, 0.765826829148783, -0.757787933605034, -0.0592629069713339, -1.06657630642472, -0.776951063674173, -0.0577924883747859, -0.640656436162457, -0.695790008089025], + [1, -1.32702672106747, -0.189111955516497, -0.858767027950641, 1.39487501545148, -1.24726783229865, -0.538166566558447, 2.73097874677206, -0.5720429725788, 2.27915117265134, 0.411704982040741], + [1, 1.19185715359804, -0.57068685996425, -0.217489443913257, 1.57501577357582, 2.19467221585882, 0.999316461276556, -1.23345605310138, -0.652722562372924, -0.167309517250478, 1.33849463691345], + [1, 1.26974845763713, -1.17909519155749, 1.27857618497344, -1.62629615590982, -0.247183989394959, -0.62932672188297, 0.505963628271601, -0.371178790994959, 0.723717987446273, -0.694681410813496], + [1, -0.663550953231539, 0.0749738674290073, 0.166742634435604, 1.49313384666499, -0.836394523523, 0.194637324108652, -0.395963648828319, -0.436776988022211, -0.503350866878087, -0.787358115784358], + [1, -1.19289770334523, -0.56340267526492, -0.28657589411211, -0.896068813708575, 0.804354713307547, -0.400883357402223, 0.927705814187161, 0.208265600407137, -0.397626480148203, 1.12970011549693], + [1, -0.521383523016945, -1.20280547629251, -1.55022392425857, 0.236357946167678, -0.807684236513168, 0.429479339990139, -0.391446207648859, 1.02252901533876, 0.474513234876484, -0.412905808611299], + [1, 0.803444031203972, -0.521512213856057, 1.18522329881917, -0.626199250306484, -0.312849314485208, -0.670698053151844, -0.596014276101209, 3.56847606563487, -0.946500511064273, 0.326845524962082], + [1, -0.475342970177399, 0.381065882170825, 1.61249207098121, 1.77660973658305, -0.508035670059948, -1.27329276825437, -0.477214149085477, -0.307081094654161, -0.841625141695981, 0.128900690789104], + [1, 0.000117638153677518, 0.238264380160856, -0.881790104988677, -0.174297956075482, -1.40878945453479, 0.51391728546177, 2.0928843554653, -1.0968561691217, 0.313068236591942, -1.92512891492102], + [1, 0.752827675431345, -0.189918375475086, 1.09130872917435, -2.30754783841637, -0.686088676454434, -0.187104728184787, -0.274736953226119, 0.869547978907917, -0.589943536814262, 0.272007086498286], + [1, -0.976785607710908, -0.962297157618472, 1.99128099512706, -0.336965510913843, 0.827226136122227, -0.178590632305172, 1.74357623888311, 0.19026472560284, -2.85528098480971, -0.4094701891391], + [1, -0.531377560605919, -0.738741284077295, -2.02851363650594, 0.68954076485346, 0.275701904924379, -0.860447960563241, 0.201595446315715, -1.66561618987774, -0.182212338414034, 0.825756869632284], + [1, 0.507620923278945, 1.89899642237899, 0.699204806773316, -0.0255193383934405, 1.45155259936681, 1.13326654737844, -1.58513804764309, -0.181703365205395, -1.50708096742534, 0.649847948791142], + [1, 0.690307063959115, 0.200422289868486, -0.212088081594598, -1.0580439841949, 0.52601585528563, -0.530581146696677, 0.491678021637239, -0.742425420815559, 1.37781171010072, -0.154183688133973], + [1, -0.837290711509647, -1.04813470864603, 0.701917048236424, 0.763345732227247, 0.547513736564626, 1.82091199569421, 0.0949460068454649, -1.12957064520389, -0.994291315581909, -0.286492796717613], + [1, 0.611857204249062, -0.291812038697694, 1.95835643819231, -0.995987900736007, -1.50315824071416, -0.325803102449182, -0.0149488604519868, -0.106640399151261, 0.253795711955703, 1.09522272672201], + [1, 1.91363224208618, 1.05634676828442, 0.248634838552023, -1.13919133909446, 0.164242948212186, 0.0984670075139643, 1.01077908156315, 0.510295858413093, -0.927372508398258, -1.28962962043268], + [1, -0.551818973156168, -0.879399082754231, -0.833520936433902, 1.31557874476469, -0.284291222301163, 2.22539440335406, 1.05766437808942, 0.676091787359058, -0.111644781704119, -0.326408610971635], + [1, -2.25712849958209, 0.572318632040802, 0.907890615500798, -0.0378913360995319, 1.90701102046008, -1.02624796834125, -2.23225254454794, -0.88954634970437, -0.176364420243371, 0.63112436751973], + [1, -0.720011799916443, 0.179825985573935, 1.15068178291335, 0.139364729852477, -0.273564914794088, 1.15340038093581, -0.662510951231492, 1.82225603211192, -0.941867459227821, 1.40068147773773], + [1, -0.172063508085432, 1.58628907419342, 0.126223445401361, 0.993833294083229, -2.57992053659945, 0.786600781621229, -0.382597588385306, -1.17257857005109, -2.79511945036296, 0.968726797510346], + [1, -0.764934470720001, 0.599053103026693, 0.877657970418475, -0.876484661106202, -2.05396139181038, -1.16561089301257, 0.887436739246628, 0.836156776093343, 0.631183341605207, -1.37933657554225], + [1, -0.721802833617963, -0.389874695400191, -0.926837421130733, -1.01975296940074, -0.976693306002103, -0.828071635825385, 0.786722918372509, -0.965025241536412, -0.52308725001227, 1.61413979018636], + [1, -1.29591944415496, 0.432481632489265, -0.249071689929248, 0.268576352447383, -0.910152102202919, -1.69736461416671, 0.0168381332293539, 0.723793825004305, 0.828942601669975, -1.13658245778852], + [1, -0.581680141178465, -0.217029802244256, 0.440747378730898, 0.775710948097738, -1.50002629218541, 0.145637228777992, -0.38780932485058, -0.636817461064606, -2.4512036368799, 0.50374557808368], + [1, -0.577326428032413, -1.92331907527144, -0.619171955452592, 0.892735202328985, 0.612260287314928, 0.755237745249886, -1.7316057327744, -0.40485849375974, 1.07596269575706, -0.0567379367269394], + [1, 0.700195430025435, -0.164390840982567, -0.277642384257391, 1.06938435430041, -2.69518028428924, 2.04079035460696, -0.58538600152188, -1.03156185149468, -0.953769415211646, -0.260014507871939], + [1, 0.955333008728362, 2.04115886546677, -0.42649918721058, -0.562357434150252, -1.03277932986144, -0.0768873723182157, 0.335719216604547, -0.488143127276609, 1.3710551382022, -3.17225262550871], + [1, -0.584236726116399, 0.60678484555203, 0.323203816634237, 1.03835046654676, 0.959951922454304, -0.468800594616697, 1.53511436661316, 0.969147182150957, -0.917665616503862, -2.36035219584752], + [1, 0.46806718020092, 0.802596865931211, 0.586141210566742, -1.71901396214009, -1.01631806070198, -1.7045018807128, -0.52605870822936, 1.12519344082294, 0.889020712568659, 1.2838216581984], + [1, 0.71414906734371, -0.332600706357878, 1.77592996472685, -0.226256496528986, 1.36969458231297, -0.383738762173667, 2.72375225926553, 1.14978044090751, 1.13676001299209, 0.718177339873487], + [1, 0.0612188593514147, -0.713002833509426, 0.869605346756887, -0.875876322139106, 0.89584029635625, -0.83571003256846, -0.505739757850597, 0.243963318207817, -0.101440696092124, -1.3732479435466], + [1, -1.19122023435804, -0.36257737450554, 0.859012713707563, 0.13155033837648, -0.571161678471943, 1.02267968064537, -0.692392434974627, 0.96046443459479, 0.93599040893087, 1.0179962824666], + [1, 1.31740478045852, 0.185020148129782, 1.7446217606337, -0.800737724285143, -0.496296963191757, -0.0139579884256869, -0.00986833830111339, 0.172382250258435, -1.06549843745363, 0.839649096172183], + [1, -1.23785919263601, 1.60690513887937, -1.30247407875009, 2.89578558709366, 0.299911723541155, 0.0180633419742752, 0.199920318113077, -0.722075108316328, 0.152694918005669, 1.3607436581033], + [1, -1.21823821851261, -0.225815763643355, -0.404598634750408, -1.16793801624369, 0.352460762060121, 0.179085427682023, -0.26336783734503, -0.0741910100873159, -1.38221362177255, -1.47436788432667], + [1, 0.534003480397082, -0.144255044451259, -0.600952775182009, -1.26170047383967, 0.185757075975934, -0.256829181252199, -1.07054460100307, -0.00085190504056063, 0.388727596184938, -0.396441074697858], + [1, -0.511970003692923, 1.239624001106, 0.339938717984097, 1.28475315431468, 0.709193739975018, -1.73452994831749, 0.930178500987317, 1.0085344877979, -1.3085411385862, -2.12178557515354], + [1, -1.39214838239579, -1.45686634404976, 0.803008308406856, -0.608133465116403, -1.07125482915467, -1.37563973269068, -0.414075280700661, -1.06299314050896, -0.600965374577419, -0.138848590687675], + [1, 0.169179541560513, 0.691935886148055, 0.242401030991514, 1.01456404983023, 0.816688794176959, -1.22559895327529, 1.22113402855638, 0.971243138295901, 1.77375610749002, 1.73707996946653], + [1, -2.50862142104189, -0.555386106623758, -0.238496392943892, 0.354313848955494, 1.04932957324504, -0.671493958344884, -0.190144634457918, -0.836443956155266, -1.14202251763252, 0.88732025177792], + [1, -0.000336821596343713, -0.165947311017069, 0.532285239284656, 0.33176145121122, -1.04773757011261, 0.277157227283436, -1.63551929879303, 1.07841074095538, 1.0629026486881, 1.05955041654766], + [1, 1.13087812520896, -0.668598616837216, 0.915520573469877, 0.0470586856421805, 0.247695564039123, 0.61437660075193, -1.10452835561185, -0.95463968259426, 1.90415704586488, -0.280711088654415], + [1, -1.18532722224868, 0.723232301147594, -0.663570284719937, -0.237349622607488, -0.869870168854633, 0.29467576690091, 0.0392653014728478, 0.234741413348922, 0.449577215261396, -2.58324714028662], + [1, -0.32474656237854, 1.04548062662312, -0.252636923845207, -0.252203318621072, 0.957566464114137, 0.965519355858158, -0.68086298283592, -0.00186900143795351, -1.64019135387709, -1.86026080985501], + [1, 0.726944070300359, 1.00402962062361, 0.365932270534091, 1.2722612301617, -0.527126293387255, -1.38970675802541, 0.273310187527429, 1.27853110304772, 1.12111207754535, -1.1823804181316], + [1, 1.09096602919821, -1.80657936886579, -1.67935972680056, 1.42407816555254, 0.0920702318592229, -2.34196115216459, -1.09652908776948, 0.840524020933195, 0.69464254603016, 0.174042894276151], + [1, -0.28002546743048, -0.803315224239672, -0.471359403914049, 0.303826429886823, 0.723340560718285, -0.294863011424322, 0.997062238977786, 0.203339476456731, 0.913406172747082, 1.09428878137039], + [1, -1.09097588737979, -0.814755156906396, -0.909450027773377, 0.804119804327232, 1.03174160696768, 0.385952927122258, 0.41788856195864, -0.391346527844205, 0.325482921383168, 0.156402861234468], + [1, 0.106049617720956, 1.72505066170158, 0.0924919007767871, 0.235547153623332, -2.38417305259269, 0.163622649054332, -1.85567499562601, 0.376369994892814, 1.20014030496699, -0.43245637164264], + [1, 0.289042825511518, 0.510768618175269, -0.676038204466263, -1.42084648035413, 2.06112663387637, -0.521941617560976, 0.530483350981484, -1.23363395744787, -2.12413593983465, -0.555114822185623], + [1, -0.269143411352672, 0.432359878578433, -1.48261949943218, 0.312914696099519, -0.205772331113164, -1.76298600962779, 1.38437437614822, 0.207452288724735, -0.900875929673285, -2.13842393274926], + [1, -0.292576361171863, -0.634988908073769, -0.14872628412988, -0.525232490435175, -1.35029094273777, 1.48683968680547, -0.647555780561362, -0.722992649729013, 0.0989206253474581, -0.74770686221651], + [1, 0.0852221416849093, 0.508412891454818, 1.49263667566715, -0.896416140513023, -0.499532639084693, -0.956097464201634, -0.0192313439366694, 0.307729468432459, -0.86175437899211, 1.31567508848023], + [1, -0.559769477660722, -0.480373776379203, 1.08806098269958, 1.17450541829195, 0.747066101875046, -0.424055507033292, -1.32181251613875, 1.81082428053763, -1.44089585432497, -0.166214374740241], + [1, 0.349077728482034, -0.607702057713757, 0.350521514128544, -0.344150457141036, -1.91638811230058, 0.33670675795055, -0.237646898703646, -0.30062473427092, -0.654427265234725, 0.220778709291706], + [1, -0.632992765227897, 0.975327170338433, -2.6384853573851, -0.918264816931044, -0.0190822551834551, 1.6521054504399, -0.0425123751037809, 1.43506648827295, -0.129152119949425, 1.17759242802321], + [1, 0.723627230906733, -0.859213291672511, -1.62044245567207, -0.421143338876507, -1.25528514808118, -1.04269124566539, 0.114483334733482, -0.676604286068911, 1.47660405859485, 0.593720151847573], + [1, 2.51082888411618, 0.623263965649302, 0.528643078925186, -0.201902734244314, -1.43022552615535, 0.103599540260578, 1.49604926093278, -0.189906613958794, -0.99577856216259, 0.0305070563630406], + [1, -0.930710969061106, -0.0789792238324504, 0.490376796389848, -1.11427960317842, -0.51936098531052, -0.322331108037565, 0.130077496525524, 1.32125861624476, 0.33020278008457, -1.08773938266005], + [1, -0.427628408332228, -0.782871562620874, 1.21748071563102, 1.93474582806447, 0.188810052597694, -0.903434235239068, -0.331666821044718, 1.54168751420796, 0.977007752342418, 0.076611083730309], + [1, -0.00342249547406149, -0.849571667202668, -0.868242925804245, 1.36808792925526, 0.67850902312913, -1.92074582498623, 0.380285338100793, 0.305673445478397, -1.47387632364572, -0.734567947314207], + [1, 0.658905981348834, -0.729443192881121, 0.851523107052554, -1.52772708262267, -1.97577643364774, -0.451981272231006, -0.000520638221373701, 0.710868743609061, -0.106661087286241, -1.36822383736335], + [1, 1.86188954317038, 0.353603412130606, -0.451502820781498, 1.0565287777658, -0.596648811802557, -1.08129256140794, -2.00868401564289, -0.121539453312946, 1.3949172034533, 3.08510772474731], + [1, -0.105303830039517, -0.649903921859555, 0.387504592102721, -0.172613458099997, -0.215383554182898, -0.285082219458578, -0.982305612588023, 0.302100684314833, 0.38584956267504, -1.56051713819413], + [1, 2.4160200520961, -0.326054549883573, 1.6249181154754, 0.637228500851453, -1.69737945350187, -0.669281960444829, 0.102501751255315, -0.312799580467484, 0.0282500210298032, -0.339755317897778], + [1, -0.1056459448476, 0.726001953146045, -0.515603366099278, -1.2819430967692, -1.22502172675789, -0.581535922015286, -0.786404166856133, -0.649210693060789, 0.142866091623348, 0.349170905464469], + [1, -0.330308726644029, -1.29783953088857, 1.19804856977725, 0.119774834216218, -0.465543792362148, 0.483777577030973, -1.039802488171, -0.609180347851937, 1.79720927816926, -0.809342265414473], + [1, -0.434757521717994, 0.630020608996262, 0.407842641195093, -0.348693776139167, -0.852651303290659, 0.557777243053528, 1.07066191707765, -1.94388546003341, 0.350322608596886, 0.468396969702839], + [1, -1.33112438605445, -0.175255554720604, 0.693510955933961, 1.46543941542893, -0.9183452788072, 1.57501653535234, 0.700325798112976, 0.986146537024, -0.0324685577375869, 0.494027033144783], + [1, -0.0917220977598405, 0.415794414809314, 1.57785503832991, -2.22558710131327, -1.22440561266809, 1.05047728480972, -0.124419916628858, 0.452391760854133, 1.70037104682143, 0.474064516843388], + [1, 0.465753378784445, 0.224943011363629, -0.35198448572148, 0.484220279285974, 0.288529601487771, 0.103952744713107, -1.36391995558355, 0.597877741038092, -0.146184387824018, 0.532090179357878], + [1, 0.390063992831445, 1.31183106899197, -0.777965738404467, 0.833644210834157, -0.846679016389511, -0.207842804209699, 0.448773198595595, 2.64386541867346, 0.347717428382328, 0.621971725294388], + [1, -1.34991646335485, -0.0359574021071124, 1.14817881491364, 0.827577869933721, -0.496635091930882, 0.801480860592421, -0.988651736840586, -0.772590911626522, 0.843075147240895, 1.95806403016482], + [1, -1.34660262542311, 0.542537600583883, 0.825121143883656, 1.26089051682425, -0.545798132770565, 0.567318873845062, -1.46364739551649, -0.524576172751084, 0.682811438703223, -1.11349912717921], + [1, 1.0624781741676, -1.57964748706995, -0.623624087432592, -0.293365153483549, 0.373670140953444, -1.07857587429454, -0.735298416198561, 0.44834467419732, -0.0320065569339952, 1.81761923479623], + [1, -0.910491385466653, -2.51073309975745, 0.641906331687957, 0.45028241347697, -0.812452496273925, 1.31069870949775, -0.394350270178757, -0.350002288598073, -0.147710963225657, 1.49771191732441], + [1, 0.641785024341111, 1.22622723871508, -0.775389381104951, 1.08766113543765, -1.67862166937165, -0.798703447589804, 0.244972197618228, 0.565438271812682, 1.07004829646261, -1.22230653645261], + [1, 0.729421269968578, -0.971783267524907, 1.11829735912651, 1.69637741409593, -1.76323178257074, 0.689137172600469, 1.38391673107448, -1.43434295311345, -0.681591744425217, 0.397890127253734], + [1, -0.116226157933932, 0.335788072104965, 0.508221360322064, -1.27794079618106, 0.845480617604847, 0.566707936546124, -0.521863158391593, -0.0352418504699756, 1.21723753433609, -0.32936530641219], + [1, -2.27175744759152, 0.477179771060133, -0.246938828617406, 0.78840457103186, 0.552607314450809, 0.858115065028994, 0.49068622560257, 1.25633317811449, -1.08394214331163, 0.322393348868044], + [1, 0.0495506001849403, 0.783516474825178, -0.644933906590653, 0.682361044374798, -0.293911768199735, -0.516786253794319, -1.31462859648147, -0.782351288352408, -0.0751938305277475, 0.223968629746723], + [1, 1.16071630009677, 2.663006849943, 1.85680105328145, -0.606860696755704, -0.0892124128123422, -1.31703813001913, -0.0502818876282042, -0.697708861186578, 0.809575794650913, 0.497621443176942], + [1, -0.214861134267734, 1.37460225992546, 0.710070266262205, -0.00436318543357702, -0.804193563178625, 1.02296734266523, 0.505567821189513, 0.97732288161076, -2.69710941656951, -0.316512007272234], + [1, 0.91327474971498, -1.13799021133302, -1.36813238687702, -0.60984578188298, -1.31575040284551, -0.470903135795837, 1.91638760701559, -1.46420837705561, -0.328624495922365, -0.862566596516405], + [1, 0.232494023800816, -0.19114804251339, -1.53214656614242, -0.207169124363607, 1.04834066623385, -1.4889754755409, -0.618515382249266, -0.335719724604514, 0.935220240389761, -0.193588416459311], + [1, 0.909122184680017, 1.50493644184031, -0.195840329981101, -2.22353641846619, -0.153560397798923, 0.913740648581082, -0.168720575879912, 1.58482745965435, 0.666433087393254, -0.422507875871517], + [1, -0.0113839791785105, -0.683272174801773, -1.16938515552777, 0.262146344873866, -1.38920749833016, 0.432205755381309, -0.418841085575602, 1.59026340506319, -0.892026975918603, -0.523577703274795], + [1, 1.13871624335478, -1.18024424737692, 0.772334901513589, 0.951405052699036, -1.20003365360654, 0.697090051912819, 1.67779111560424, 0.59700448434685, -0.951569411430587, 0.800652397911676], + [1, 1.63672355910765, -0.715893645127731, 2.0274162852817, 0.389770424115866, -1.07913435180631, -0.134408782955928, 1.66476250270218, -0.0799810813299777, -0.618481175502723, -1.35874660392282], + [1, -0.206250751364165, 0.0640464866401612, 0.912814298164919, -2.84384857640525, 1.6131768887277, -0.666600843496887, 0.949114965344561, -0.460114748492355, 0.255628907620881, -0.0188183555991879], + [1, -1.56402499242079, 2.19497594911539, -1.44817001404664, 0.351657119029045, -0.440403720988574, 0.633641298883567, 1.04532692970569, 1.67740215914818, -1.81734672851518, -0.187673464083556], + [1, 1.11224073360735, 1.19648004900645, -0.794249844022514, -1.2855414864291, -2.23522966347822, 0.363381887067787, -1.00808525213347, -0.590922267724176, 0.327137152438439, -0.46769345708665], + [1, 1.6552560484182, -0.392352530552162, 0.423826419529836, 0.166627575606811, -0.770329641446587, 0.513099892921283, 1.76258822533861, -1.40793859116576, -2.0581997054488, 0.21429110392518], + [1, -0.310441913708745, -0.0254598942305087, 0.573649459803515, 0.245147250904305, -0.693139699374613, -1.27235575592656, -0.444948841313385, -0.0339539116109284, 0.967296845771487, 1.28870343924475], + [1, -1.5846196281031, 0.36865496501937, 0.303242842240415, -1.3058587900246, -0.926578547062929, 0.203056093641429, 1.07717353913569, 2.44067366668154, -1.60331575667358, 0.315838423061126], + [1, -0.791647133153011, -0.149784994784462, -0.210877173862807, -0.67919717425948, 2.78877371127964, -1.33920128328688, 0.680305026000066, -1.14281647437275, 1.66135005931254, -1.36265174594731], + [1, -1.41093526106575, -0.644735846494903, -0.604678034489242, -0.96356090993076, -1.57229633661381, 0.73249693250139, -1.4782240937189, -0.390809582665315, -0.345063999450877, -2.21499705891138], + [1, -0.142454210782027, 0.338570172027913, 0.28948815947047, 0.903652551776629, 1.35991089799489, 0.453149260247115, -0.476058721102856, 0.671645806738015, -0.309744070697975, 1.34255193724942], + [1, -1.19850693644167, -0.71057549759177, 0.00517172508007832, 0.277482355391705, 0.993109859742207, -0.148329019122537, 0.25631922452191, -0.743075440135777, 1.28242489272975, -0.223402575615484], + [1, -1.21253836098383, -1.69610221467636, 0.0177858009795179, 1.26177016548608, -0.152607873794248, -2.86800789423106, 0.195197936310572, 0.10427744780302, -0.0667807249955761, 0.0537735675915431], + [1, -0.781677405826666, -0.6575382747393, -0.626193982885731, -1.81194755647493, 1.19496139202419, -0.605526232937972, 0.0897225219235091, -1.78776732284328, 0.0199376631927537, 1.92259933786919], + [1, 0.222029827141011, 1.1024994860412, -0.23554944343405, 1.4883327383365, 1.05180350591216, -0.5440518566759, -1.19868958002379, -0.772439987929651, -1.0664038153298, 1.64555262673021], + [1, -0.0626785281196579, -0.61098952387198, -1.28480929882158, -0.435808446030869, -0.627379024758073, -1.02901026547136, 2.16142358709174, 0.371285963645804, 0.43485590472481, 1.28704748342434], + [1, -0.229790477919473, 0.166236728521037, -0.0840503186333428, -0.677027617995138, 0.282746805996862, 0.795804716355574, -1.47960275463848, -0.318308260419441, 0.224777717103535, 0.07411914615848], + [1, 1.06352818439189, -0.15813820702465, 1.73424439138206, 1.26791788100561, 1.00363926345986, 0.333087440528244, 0.973297684335984, 0.421376886004508, 0.695226115335051, -0.312518986642327], + [1, -0.00339490942752137, -1.34295888796672, 0.598055983626345, 0.0493563918584629, 0.807227549514798, -0.138917077417483, 1.24651146199437, 0.044364719683661, 0.599505754545234, -0.895908602036703], + [1, -0.519842424639104, 0.0748030560005267, -3.27412074156162, 0.00817565248775007, 0.138099854911412, 0.595968465902925, -0.641963929543071, 0.0844165475074308, -0.880970994455812, 1.02337616100156], + [1, -0.108419289559285, -0.0945468121464586, 0.136777373656113, 1.25500645200982, -0.656020593988042, -0.664488816879329, 0.247434860430283, 1.07377984749817, 1.07760607251858, -1.74631348300413], + [1, -1.48832846498391, -0.567976071872457, -0.474495069767028, 0.0802292823464393, 0.190750382197178, -0.397389797098205, 0.454921760992058, -0.118856178877065, 0.892972439802905, -0.779949853448901], + [1, -0.00795016526783572, -0.10230742132952, -1.90173109253391, 0.0553439499631001, -1.36929658917828, -0.71885298396826, -0.0528171384600678, 0.803449801556336, 0.498435346221877, -1.19767297252187], + [1, -2.00354675638069, -0.410561754072878, 0.453438623267501, 0.86700364471867, 0.232374879857364, -0.0820535115840487, 0.731382925497137, -0.464655091831111, -1.0377840066361, -0.15958793867975], + [1, 0.928083607088763, 0.189024365514865, 0.20446897854053, -1.37590695520108, 0.628530785704648, 0.496541095397115, 1.71341676557656, -0.430542203787237, -0.85625873668188, -0.427487026179164], + [1, -0.338967536683273, 0.623682217096984, 0.487343105007377, 1.46395102154634, 1.14521377468456, -0.393079868612541, 2.18892829049599, -0.624911449158424, 0.878800053617333, -0.741871120724238], + [1, 0.550358447495185, -1.11798724685448, -0.170595805805571, 0.322862148469757, 0.702504939691768, 1.88656541972218, 2.79353282993424, -0.38422531426713, -0.959236345555138, -0.806005389380259], + [1, 0.477304291289361, 2.57110368437613, -0.565956995194415, -1.03659319666315, 0.79243887514541, 0.889105553409918, -0.708079735381304, -1.24251553448876, -1.22831374318464, 0.555197680640974], + [1, -0.848224958949812, -1.80941023919421, 0.287411615760936, 1.91296226318399, 0.0134035962113768, -0.778665294227413, -1.24366525700261, 2.43289216717579, -0.0486579036372694, 1.11503313370286], + [1, -0.915487502616714, -1.2232523449647, 0.431339910829127, -2.62309071269567, -0.484973929036698, -0.918865848551081, 0.294732702068848, -0.346038028811356, 1.248462556694, -0.178987243979632], + [1, -0.886427687067517, -0.484241724369674, 1.72232181166321, -0.515197788110447, 0.149330070923553, -2.07541432749546, 0.834810147440775, 1.83133260854566, 1.40254294078841, 0.293024025286693], + [1, 0.7905350364555, -1.27744463406295, 0.213578163320812, 1.68985819383873, -0.899143986960883, 0.735847982135803, 0.196315457713507, 0.705805622413765, -0.276317726165391, -0.398633313646583], + [1, -2.88534434494891, 0.915957268870147, 2.15400663923342, 0.909697759163242, 1.21565075095349, 0.347069041966522, -0.899496477660834, -1.34981916253167, -1.64327771273405, -1.53363234270604], + [1, 0.422683219350245, -0.240337980767307, -0.386428911556757, -0.944350086517898, -1.92037705349426, -0.902411302269605, 2.08202063189272, 0.316496281206442, 0.729610484338194, -0.106086307460351], + [1, 0.216596086568832, -0.152174877634385, -0.0810307643185016, 1.00355028431501, -0.280189031368568, 0.920568360649819, 0.21304917685251, 0.0975031188366082, 0.0517041279722333, -0.956270364706651], + [1, -0.393133370940212, 1.18149237154364, 0.0481346241779248, 2.18266799283546, -0.621620678610039, 0.187655641347489, 1.18249974278489, 0.130374968277663, 1.05699830277881, 0.168681763887885], + [1, 0.928347599401518, 1.20235445231339, 0.425959810332466, 2.43498743968898, 0.456138259658328, 1.10981010332323, 0.648643532237228, -1.16208945608109, 1.26586739325758, -0.624202222284865], + [1, 0.38047017997063, -1.24420140617395, -2.35603802066369, 0.476304289465285, -0.628632551793186, 1.38400768143752, 0.830872204261401, -1.61898111342846, 1.40178969104581, 1.20177030851267], + [1, 1.54744345795672, 1.90130643742841, 0.664642528566765, -0.238464264021377, 0.434944840859048, -0.706316725154041, 0.230821252388848, -0.740250824716068, 0.520231887261624, -0.0945860476951988], + [1, 1.5308688314644, 0.356124444409775, -0.221355366635686, 1.97183378895148, -0.498851913851343, 1.26138819738804, 0.0815797200037048, -1.31648355258849, 1.05816833899637, 2.11761358728568], + [1, -0.491061289196447, 0.0814739317142539, -0.906265688039477, -1.11236036871691, -1.19600614888885, 0.813123354728397, 0.304589359719039, 0.694151502372948, 0.00238564535379812, -1.59340062449878], + [1, -0.411487389481661, 0.445741514570346, -0.550931090091875, -1.00025281378292, 0.55811485286945, 0.225661386178982, -0.423846652220264, -0.287820752898905, 0.733359214472224, -1.62679111768041], + [1, 0.285415700684578, 0.632830064334205, -0.106789179767064, -1.11737021602315, -0.220580627335192, 0.714981552152322, -0.504287402020326, 1.41346848323664, -0.376348464657088, 1.45310080532318], + [1, -1.01609319446697, 0.736613560851102, 0.227543015040075, -0.44927165644793, -0.546549600630472, 1.74894286307297, 0.602870822257414, 2.46438904151208, 1.0646700380934, 0.826279654076524], + [1, 1.80116689820191, 0.915394602018423, -1.59526397489797, 0.102712154355515, -0.808575965351009, -0.660804614997089, -0.382275955150207, -0.0456694673642582, -0.192772339624473, -0.324013951423782], + [1, 1.15478762326293, -1.78967122933774, -0.663889799576384, 0.864442619381631, -0.367446979038474, 1.92327230533934, 0.859368992200834, 1.44018041247758, 0.544641284316936, -0.220272849958851], + [1, 1.5184667892194, -0.965526190679311, 0.382118866166986, -0.632793002553936, -0.451809427141984, -0.22988976464445, 0.202999730123133, 1.603432828664, 0.182424120448128, -0.622459994829158], + [1, 2.09286672948644, 1.30574607493287, 0.560801041701771, -0.0654828936059277, 0.122232084896743, -0.89471201093395, -2.31349760920967, -0.225654583870506, 0.795092126376269, -0.620714595772236], + [1, -0.951319979780386, -1.11062367139948, -0.370513295692473, -2.40703938978762, 0.510154433276157, 2.35837407127842, 0.802670916046709, 0.905085684764403, -0.597946218285922, -0.183369866995237], + [1, -0.954863435515016, -0.898400497495654, 1.05971999294685, -0.733191641293416, 0.898822932231222, 0.0223790928784626, 1.13418686365258, -1.13273229309886, 0.573129757897414, 0.263721095189969], + [1, -0.724100276354502, 0.807118294050927, 0.0328297006852786, -2.16633578608707, 1.43183770259654, -0.60724908081984, 0.957468856243571, 0.0832876118374528, -1.26551381039529, -0.564990200359133], + [1, -0.155692220952375, 0.137315605863546, -1.22579558674634, -0.184422385693049, -1.02923330513778, -2.09141592611969, -0.845712167394389, -0.612156644456585, -0.738794483753798, -1.8749610552365], + [1, -0.118643469710392, 1.57066544702808, -1.74082067941716, 1.07408867996093, -1.7331511921826, 0.30530788655771, -1.22134143810793, 0.0123482668886766, 1.67677072388478, 0.374610541203345], + [1, -0.328092323902875, -1.12108918694198, 0.0160998795496592, 1.09718588867218, 0.302106714999539, 1.45061625865796, 1.17563900996469, -0.315009542643236, -0.572297455808556, 1.04442684176385], + [1, -0.352792589758423, 4.50259235846073e-05, -0.157882798408332, 0.709004343495026, 3.34160734019168, -1.19631332323127, -0.896974039141064, -0.194228915390395, 0.641724473857056, 1.50922865114049], + [1, -0.0415648767059906, -1.46093259376602, 0.597795893613907, -1.15492237016496, -0.582815549181832, 0.945642057274835, 0.0478703924638481, -0.731186429396767, -1.20309244388168, -0.5467899627775], + [1, 0.386827838668361, -0.868063129524065, 0.913659327637649, 1.6177509428739, -1.13755982016669, -1.27738008827149, 0.542440173549328, -0.00499592585924682, 1.6424089484088, -0.894631416788035], + [1, -0.455449089542254, -2.26138591680919, -0.5895634414763, -0.229676477068295, 0.396806125673774, 0.107539507657667, -0.361475536171272, 0.456451128284726, -0.198266348426584, -0.983224307781455], + [1, 1.12943555829996, 1.17801989521958, -1.90714191933219, -2.03149931183714, 1.25671418134062, -0.937490316188199, -0.442354162244736, 0.916709166742136, 0.770600576887311, -0.159421273500565], + [1, -2.28034034403401, -0.586673038641123, 1.89297387574516, -0.336106521119026, -0.873788832000539, 2.00681866946488, 2.26671594665371, 0.677305376073443, -1.40748219695482, 0.266466239095495], + [1, -0.0749869556970217, 0.720145402547367, -0.0116879431856029, -0.419607758827468, -0.15608391512382, -1.28947045006441, 0.383852155432115, 0.570217498944252, -0.266767511003119, 0.844789781790879], + [1, 0.390956069262321, -1.07865636661019, -1.15764754429027, -0.0429901759034176, 0.898171993704376, -1.98893610468643, -0.433386697254247, 0.597320782449998, -1.14028222294793, 0.570849974159177], + [1, 1.39725943986245, 1.10046791652892, -0.112947373027393, 0.505667757861679, 2.1277962087715, -0.905281153372346, -1.02614406081552, -1.32754029289562, 1.23647049487707, -0.973317527772434], + [1, 0.358457970625527, 0.294019371644099, -0.589062847477925, -0.148235171406011, -0.565113135598704, 0.974329558113752, 1.20917422579235, 0.498370955618571, 0.23269362283012, -1.05857422374901], + [1, -0.954270800466769, -0.369329929683335, 1.46748201638156, 0.97816067051406, 0.0518766225828113, -0.690816175389624, 0.77105721017684, -1.2982473772681, 0.610581692727387, 2.0271567752779], + [1, -0.760782092995879, 2.52093421442711, 0.0417301600825901, 0.0951142673509497, 0.846597797081643, 0.925926466058193, -0.287678178374954, 3.23773967235261, -0.270731217154301, -0.150676407303212], + [1, -1.0704862723226, -0.412395922106032, 0.889054085970965, -0.0998795801828412, -0.0559050260929806, 1.16316701558083, -0.13579343091496, 0.912404904295226, -0.657907530897962, -0.646608381251682], + [1, 0.789659158481062, 0.443162777267726, -0.0862262716049879, 0.586127263749583, 1.73911594578422, -0.389238532124597, -1.16099485184624, 0.636142292566659, 0.236090161329277, -0.463881118587503], + [1, 0.753382064646552, -1.31942309820401, 0.230588289131395, 0.613861939974541, -1.45339063217297, -2.21639215252083, 2.07736279503333, -1.34120862455013, -1.15870123669584, -0.126957519198276], + [1, 0.937808412365745, 1.9346460767674, -0.720872490787245, -0.37914557485189, 1.17795218039085, -0.126340799295317, -1.46886113883301, 0.464265589031404, -1.01033156493266, 0.424366392189742], + [1, -0.816975318891458, 0.184716695867874, 0.117501896336234, 1.64519810763259, 0.0927730172848886, 1.12002480799642, -1.61006681612026, -1.38233348326388, -0.338338918934775, 0.635645449155566], + [1, -1.5570425060218, -1.47419956268031, 0.776108328680504, 0.0433899037002999, 0.305140319211898, 1.03669691689603, -0.618267065002142, 0.364344279098753, -0.707848857378142, 0.607938410268689], + [1, 1.15618268542984, -1.06782097443231, 0.639261239347282, -0.0408689131809471, -0.613887506579876, 0.167222774780912, -0.199942632137576, -1.38706570242462, 1.63942203987847, 1.09537661988274], + [1, -0.0946026465394819, 1.83568047303722, -1.4110601951825, -0.636591180394804, 0.395395091130808, -1.91882341642413, -0.176438902458016, 0.364400013760918, 0.27940615825937, 0.329481815461854], + [1, -0.485475412541147, 0.922696771681339, -1.73098380534289, -1.28138961305125, 2.02370055421134, 0.350782721613817, 0.777062007322461, -0.181608393380417, 0.014561412359992, -1.09663008976444], + [1, -0.186726849384212, 0.615503632558611, -1.83136409088455, 0.549354348392737, -1.32268601426551, -2.81063497763818, -0.665208551853826, 0.75780196753076, -0.76760623496715, 0.0172993544815618], + [1, -0.181037583483198, -0.00359746099843569, -0.166672195735054, -0.486268229526772, -0.735087336258719, -0.312659554823228, 0.773044068673035, 1.65279515466709, 0.624107253565637, -0.196188388316416], + [1, 2.3634869038246, -0.538068451910469, 1.12840739099333, -1.10977483119691, -1.54138435408431, -0.57726287005712, 0.615067753081521, 0.96194981390408, -2.52075015572572, -0.263890952921012], + [1, 0.643875923247045, 0.850476695028726, -0.564256238257891, -1.40495394217203, -1.28415145626235, -0.0175802386460826, -0.500982555777752, -0.0196285930215416, 1.64096467851254, 0.739371475393016], + [1, 0.246906426977911, -2.58055365898789, 0.0827029968161687, 0.91145485421702, -1.45922311464831, 0.453664395088845, -0.000774560026260527, -0.62094200347614, -0.311061601495515, -1.08937318822631], + [1, 0.145126546830667, 0.00583058808778218, -1.44298380220381, 1.1093388254999, -0.387222720585608, -0.455811935673592, -0.0767103318088046, 0.0388534801185718, -0.787220364306332, -0.8849001045221], + [1, -1.43704294915033, 1.13190603209645, 1.14144446759051, -0.879598584767838, -1.95984512578994, 0.0738957419764213, -1.05231621875005, -2.36554997737282, -1.02354123333421, 1.50326815628941], + [1, -0.738750376267537, 0.123192252091845, -1.3279351404928, -0.0275251434866269, -2.46536518338137, -0.577702921734056, -0.0222647657875196, 0.550709219884992, 0.597567732930274, 0.068254764093787], + [1, -0.923686766256931, -0.65960854077897, -0.948762208138735, 0.240395651247659, 2.0549026519043, 0.24133708051267, -0.146615971134924, -0.927939696738509, 2.29622438147511, 0.433085933415842], + [1, -0.321075867554797, 0.643674916018188, -0.606518243611425, 0.386488672060183, -0.0395976355313846, 0.797526167352045, 0.88934538720947, 1.08382681737521, 0.704477302105185, -0.0260081272480801], + [1, -0.990269919403795, 0.0181305003417085, -0.575583636723711, -1.91854184851584, 0.517399897361191, 0.552226522439122, 0.549873852793186, -1.064960550709, 0.175570222440476, -0.311767450314788], + [1, -0.870327221186581, -0.164224136834759, 0.170889526608319, 0.531316390848958, -0.0340938095438564, 0.493431557872049, 0.220432264341539, -2.23178329558458, -0.386312065993498, 0.573741477456285], + [1, 0.843880198731204, 0.171611683184534, 0.810070310972348, 0.184434742776452, -0.218104529830904, -0.325902200305618, 1.10618970026825, 0.0394753781878992, -0.578555941254447, -0.256249456510563], + [1, -0.624446813211324, -1.36054836383117, 0.683547666852017, -1.39604204009279, 0.933125989210505, 1.1250970942098, -0.568316887708695, 1.6286070016511, -1.93065448928503, 0.191682322235539], + [1, 0.2922812166109, -0.909788505065595, 0.620520614916275, 1.63622675773227, -1.21702447187305, -1.36961292811124, -0.727032330291391, 0.121010284099998, -2.1761040529277, -0.522530718170957], + [1, -0.375917801707658, -1.31559271567382, 2.6376159003694, 0.468720775583983, 0.146008657187143, -1.45109878160849, 0.368823556787573, -0.772806526150449, 0.38291799751054, -1.244648242658], + [1, 0.507843093577615, -0.331543562607949, -1.00446322858682, 0.837071055097299, 1.03603969280365, -0.272404208559634, -1.71510211435525, -0.972084072806234, -1.02234184624694, -1.27265673111536], + [1, -1.00765426349502, -1.37901963669782, 1.32983503260022, 1.14124935504545, -1.46064760836582, -0.18345113231261, -0.65574576566265, -0.472635896255303, -0.594437696497556, 0.6328874827765], + [1, 0.550730220847561, 1.14358017487288, -0.833612314218252, -1.83054543668092, 0.0338646862856918, 0.25189587357326, -0.525446109752696, -0.45690416288331, -0.0301961224687449, 0.26005486153721], + [1, 0.898314284509625, 0.332863564160723, 1.16470956284931, -0.170200664031269, -0.143600444555635, -1.2578836083237, -1.19233871755161, 0.686465263048238, 0.920286340743266, -0.250350157147814], + [1, -0.126323067746812, 0.352804342924601, -1.94645808503105, -0.812436869321195, -1.34287087228951, -1.47281586856516, -0.529497729638595, -0.818938725687016, 0.573350793217428, -0.0450034826927655], + [1, -0.659874962173825, -0.0255327470444975, 0.541370870321096, -1.7081194809523, 0.610296286219611, -0.789009462010011, 1.66242700921713, -0.204135429679284, -0.640438495375736, -1.47427176020948], + [1, 1.10373892117108, -0.861776561068059, -0.569259970433027, -0.580608704675407, -0.92856114868454, 0.411746869888999, -0.252472012228203, -2.35794520203861, -1.38439126167927, -0.738596737600396], + [1, -0.117269718629325, -0.972252519634583, 0.252306384755654, 0.933904018147296, -0.594517787303084, 1.43421648528324, -0.686583625655448, 0.500771499803663, 0.0956135741252584, -2.15168644449118], + [1, -0.279399277494002, 1.41096363386725, 0.912482912589704, 2.54182721875224, -1.02771070604333, -0.390970201260035, -1.04203948981921, -1.56580182655378, 1.9158425652754, 1.15367792808306], + [1, 0.020369372829298, 0.146124656369987, 0.368289791020854, -1.00993125797045, -1.52895958478343, 2.19979538192441, -1.83817175803726, -0.967476598982091, -2.58365369312613, 0.227020229238462], + [1, 1.27114209674145, 1.06950955947412, -1.66062915980244, 0.254457027303886, -0.0168603973939362, 0.137252142898195, 0.474167844435158, -0.623903295248768, -0.075683687832483, -0.4560612130498], + [1, -0.469440297170567, 1.24174484189162, 1.35860844861717, -0.127916504979554, 1.08810656385936, -1.54773897887291, -2.30963395619624, 1.31376605423861, 0.529130021633338, 0.90905270267388], + [1, 0.813625873176463, -0.430291430118163, 0.250589379113161, -1.00150717250635, -1.42772796590904, 1.03577631522482, 0.524847195292576, -0.831297356208247, -0.380596280238711, 1.04173294562086], + [1, -1.66967840586141, -0.137297596550127, 0.128328008732725, 0.358203738826477, -0.758071444127186, 0.382168510711771, -0.478681944626079, -0.13937037721013, 0.220392122538556, -1.78238584149372], + [1, 0.605736734010114, -1.31596778149785, -0.682164893777092, 0.179492667916384, -0.132444108887521, 0.230113075749107, 1.32214320067918, 1.64059054758308, -0.259774534570483, 0.205592107076446], + [1, 0.106758386278598, -0.188003535114191, -0.899430048457108, 0.736005049345153, -0.143148051546841, 1.78143929573811, 1.99925290787052, -0.278952181420543, 1.38490928089516, -1.23551480551315], + [1, 0.330929523866984, -0.458661887030219, 1.63906918925839, 0.143753278291343, -0.733216383884854, -1.10139012146376, -2.55014923535022, -0.132225410749194, -1.24373266203062, 1.72763937871811], + [1, -0.532791555974071, -0.280884806065698, 0.857011275445598, -2.47957613120261, -0.646705377382288, -2.45620620600946, 1.47336566721657, 0.715259057467307, -1.24353753698955, -1.20153606351338], + [1, -0.320279125057995, 0.255068050202249, -0.0199338050756313, 0.148055055451489, -0.55834572584707, -1.98399857237221, -0.547549817291385, 1.88329036156203, 1.63923449245983, 0.00706824997835443], + [1, 0.214743630543651, 0.562609512209848, -0.054712102853279, 0.656794674503689, 0.236910580185063, -0.603127509482901, 0.171874439212098, -1.22193144815368, 0.684330934226727, 1.70639653229489], + [1, 2.14717520125991, 0.694245437948715, -0.598028036898542, 0.932334623711114, 2.35459699847585, 0.162153683749416, 0.602048370702865, 0.308963145901669, -0.832033584755364, 0.125615633153013], + [1, 0.450432174460318, 1.37694846429711, 0.662775301077336, 0.311869981500672, -1.47575223411093, 2.10279619334456, 0.124792865013968, -0.211733356327027, -0.526827575290857, 0.162163328146441], + [1, -0.378278965722875, 0.507172241924487, 0.42189687858654, -0.0566412735638611, -0.985130082566135, 1.12860188842525, -0.828330448002847, -0.552074113967627, 1.22230726080128, 0.269409628958681], + [1, 0.0273645503404752, 0.244014174331882, -0.44455594234139, 2.68213304326753, 0.0413966661594576, -0.71341002347458, -2.08594884372789, -0.614803174536129, -1.60509315802455, -0.790034793437689], + [1, -0.101116334756211, -0.234760353777071, 1.50876776349078, -0.382727178798782, -0.55649894168992, 0.24045628960756, 0.427528722423596, 0.218983677669444, -0.202400856241345, -1.07103502335068], + [1, -1.01917946523513, 0.931528279818238, -0.992033536950185, -1.57546261461102, 0.704629702758714, -1.18510291681408, -1.27193329578638, 0.782027353949028, -1.08303383635362, -0.5219233380217], + [1, -2.38290970182575, 0.649081162227254, 1.74700516928621, -0.819325042774344, -1.75392676587738, -0.12249581328638, -0.374275194440024, 0.10750268729999, 0.693137510720056, -2.18365306486129], + [1, -1.40023306130291, -0.441617535538874, -0.868998307457853, 1.40934368599936, 0.123776953175059, 0.0268033611850573, 0.0829618367722746, -0.477303421165284, -0.743245502236021, -1.41382601445066], + [1, -0.0473147666374628, -0.13451224502778, -1.91426425286015, -1.11021649592335, 2.49254360211232, 0.849111887899131, -0.245443376083751, 0.797009035004475, 1.07244707090428, -1.06371050364483], + [1, -1.15373794330809, 1.49358625955126, 0.982483535784173, -1.75421415876346, -0.0308909487453421, -1.01155057884416, 0.438627357093882, 1.07198709877451, -0.508023435648915, -0.726817140348491], + [1, 0.22247482913915, -1.04008186036801, 1.23646490301956, -0.191529964530684, -0.0557761202238091, 0.960503389772437, 0.515645873243813, 0.0284409688305677, -0.752754779834567, -0.649811623897301], + [1, 0.551868272039797, -0.0880604520856529, 0.340648207100606, -0.161272641188106, -0.164692014729068, 0.538044488193148, -0.489368419164902, 2.94005845678994, 0.0226077492523848, -2.32555935449813], + [1, -0.47986472809419, 0.802178655259116, 0.417982005781174, -0.110524498446083, -0.549528051762933, -2.2005515869226, 0.34630904515848, 0.256941392029027, 1.59489448766936, 1.11183118707867], + [1, -0.552649136836953, 1.75856249829138, -0.706795289941678, 0.0740933439116165, -0.186099815307821, 1.21789284260968, -0.0101141854246441, 0.287902579333811, 0.423523561807365, 1.02720624976928], + [1, -0.703897469982243, 1.01041408226125, -0.736857921401918, -0.196633494176295, -1.86456391554589, 0.412144969037524, 0.918643074519654, 1.72561598110298, 0.872745196149392, -0.312694543161493], + [1, -0.0864374734000218, 0.252100889926526, -0.523952830132619, -0.220873554390657, -2.38207068403887, 0.907768682668461, 0.220773684213449, 0.395074952032179, -0.124177992141408, 3.24601714158512], + [1, 0.320852200291768, -1.2672912656672, -0.875962929781466, -0.160601738382447, 1.40845594116073, -1.00150034715685, -0.499217514235159, 0.330236960400765, -0.333123018637778, -0.00170750803366535], + [1, 0.509666619374225, -0.209408335516557, -1.8285380873783, 1.19665812724116, -0.0781803098304435, -1.44701301769083, 0.950921304447677, 0.356323888214201, 0.525035154980534, 0.273460610819431], + [1, 0.431095333213149, 0.278668474028459, 0.337169744489456, -1.06725277803968, 0.229621528170035, 1.52242742102005, -0.0239742097372436, -0.103816468025217, 0.791756310485054, 0.133573003991229], + [1, 0.472167689970559, 0.305652350900664, 0.360654343541392, 0.687123838496067, -0.335597155985677, -0.529675260535542, 1.11542448209141, -1.2110585383857, -1.08970727172669, -1.25411997811945], + [1, 0.293811773201704, -0.720061637452352, 0.478416979497256, 0.576893117514356, 0.089845698269664, -1.11142889421025, 0.350442158432265, 0.586868161704689, 1.33434974684754, 0.709003824452432], + [1, 0.295663139097878, -1.44342312163268, -0.732463449105832, -1.68124958518144, 0.193367236115379, 0.872170979248411, 0.848930455154403, -1.44431126291913, 0.00230470755111487, 0.865867252188614], + [1, -1.18117035103131, -0.159558448044733, -0.15785065480725, -0.242738199725905, -0.0961899111606634, -0.0578873725796981, 0.137515411574061, 0.93909296785206, -0.899631340423635, -0.309461751225066], + [1, 0.584172064285411, 1.03880092081564, 0.173773071706126, 1.24782779663469, 0.456944574907783, -1.79057076995939, 1.2274174992014, -0.546595557849043, 0.544449307633114, 0.105410159259285], + [1, 0.325331615104818, 1.35187498742933, -1.74489894185161, -1.20384573402576, -1.72821682060622, 0.951108678546551, 0.219301789942065, -0.660447648683617, -1.41021479210341, 0.24617718419932], + [1, 0.86797116533987, -0.513178988202847, -1.17383324464839, -0.0259519425423814, 0.887412240569152, -0.94121375685713, 0.536033067428275, -0.195333527623677, 0.425779920363531, 0.980474956872901], + [1, 0.101914633372752, -0.372890928515022, -0.230954005835891, -0.448593215001446, 1.18516116932296, 0.457875344987795, 2.48540778247381, -0.678579683380112, 1.73606429670914, -1.61771298365054], + [1, 0.361506777415872, -0.403785777273248, 0.960652716118998, 0.925331783596181, 0.56162789387847, -0.287908163993919, -0.362122257333837, 0.799182900567525, -0.726358705210292, -0.260672324130321], + [1, 0.995110105047131, -0.133038520381682, 0.60602420296439, -0.781302234572225, 0.178402172952873, 0.160408579560428, 0.480052033257436, 1.64096658457427, 0.121954240661179, -1.0167327369881], + [1, -0.748394121695574, -2.30801908027455, -1.98931860029417, -0.661809504317365, -0.562170309322481, 0.110046913537653, 0.110904324806323, -0.02242117297554, 1.18212374865311, 1.16826747655896], + [1, 1.23601185419553, 1.50789305857152, -1.08917161412584, 0.587385943446777, 1.75286069205727, -0.740478797589836, 0.212292691054205, 0.435944093293608, 1.69881374833858, 0.476213514440597], + [1, 2.2304687859627, -1.17528121042571, 0.454985701566058, -1.5252180533371, 0.925483411049971, -0.715489977716727, -0.632871583093108, 0.42294529556028, -1.04528129539821, 0.221638242190219], + [1, -1.83271010045781, -0.145020317627208, -0.531835258067243, 0.562769129453659, 0.659926995871293, -0.830848352459334, -0.333916886184622, -0.301657933055046, -0.296451660472061, -1.07434493913792], + [1, -0.489648426237403, -1.07036146549938, 0.764110605247308, 1.01034582882259, -0.815968150678489, 2.59630188927445, 0.980976871254983, -0.669332162989219, 2.94897402035653, -1.04780254147023], + [1, -0.890624504104954, -1.07512219898301, -0.0819686485133494, 1.85949305666629, -0.849396116047665, -1.09828374187205, 0.196943466516354, -0.571672161972581, 0.91438760901092, -0.601520166106309], + [1, -0.976021444206189, 0.0875356410546551, 0.277720209936118, 0.0552609795911957, -0.496828992165187, -0.270222160351816, 0.996805376784773, 0.682699420378375, 1.4544822435512, 1.130203330037], + [1, -1.94203329720926, 0.297501430206376, -1.06097510343744, -0.369984968247879, -0.761332483528042, -0.1690573766018, -0.0784052742157901, -0.856349620634821, -0.766817530837525, -0.0828018865338251], + [1, 0.357524775134926, 0.607124364142768, -1.33138250917244, 0.09337327781846, -1.4472950041729, -1.46425681127945, 1.37447470070573, 0.683684738619613, -1.69044246058871, 0.759040756570153], + [1, -0.600583918040074, -0.278049726685233, -0.323567421210413, 0.379505929956794, 0.248975745535103, -0.544346991145025, 0.279838049704097, -0.71051405282944, -0.00991696385953746, -1.58939308050516], + [1, -0.921535800496582, 0.815279754269731, 0.4787906109219, 1.00511508656422, -1.98151714463848, 2.8659346378293, -1.36529895595389, -1.57707269647076, 0.921368672465716, 0.401766028608011], + [1, -0.908961640328406, 0.0205913683678314, -0.612236700561976, -0.0557065226778126, -0.842669901572429, 2.03461804060391, 0.520512553302464, 2.03248488645326, -0.631485234727323, -0.176997941972574], + [1, -1.87308338771041, 0.588006567048692, 0.39387246291345, 1.0285394953111, 0.204809206204757, -1.1397995486031, 0.850150831889668, -0.170975950605695, -1.31327484912063, -0.466110773492883], + [1, -0.670578400342234, -0.219283627570602, -1.00077416483459, 2.02469425609347, 0.441319457587365, -1.5661201959439, -0.956905273651984, 0.297493996728774, 0.698736430407407, 1.18374906424681], + [1, 1.26174547044336, -1.02337835597087, -0.275512999935775, 1.62514962488503, -1.20634591757115, 0.632379629186987, -0.0247274479162886, 0.999014527062821, 0.0850557610650685, -0.484786850780192], + [1, -0.332122102811065, 0.107563449287424, -0.875217077728472, 0.196993094655876, 0.569726307778434, 1.53345781348947, -0.793178530978424, 0.743454205462374, 2.26829047187506, 0.363144488670742], + [1, -1.90683081664613, -0.124647381543562, 1.11056590905028, 0.714656902658499, -0.239305504470565, 1.60232999184305, 2.49268041136001, -0.357631647967409, 0.473643139199869, 0.557938953957409], + [1, 1.00720825662281, 0.840728249222776, -1.68157851704947, 1.09763800888472, -0.527166621703221, -1.47086679580775, 0.778716566208253, 0.242084273767459, 0.514971278502636, 1.1285394265258], + [1, 1.83080707732046, -1.26926830540385, 1.83482177306002, -0.187062029671667, -1.82093365760571, -0.944526709266186, 0.942904157024646, 0.112668506915432, 0.312947076729682, -0.273711298033997], + [1, 0.601204844011037, -0.164826587578063, 1.44487907217346, -0.493694891178948, 0.654399066660411, 0.884490971437846, 0.416347184456762, 0.342027988357843, -1.40046031742514, -1.2970799358992], + [1, 0.555141124825395, -0.0918900143098216, -0.428639628980824, -0.81533806545182, 1.14236116403711, 0.844039660823165, -0.415847002469499, 0.976490258823861, 0.511374245836498, -0.706369695898239], + [1, 1.00077993917208, -0.769088659032906, -0.77999738083666, -1.00214396593963, -1.61231965758284, 0.857834984315971, 0.445227068795132, -0.0225181190035251, -0.294504153319015, 1.09716038450574], + [1, 0.829878845045995, 1.44003439404655, -0.668549571380242, -0.924050644984103, -1.42188272326911, -2.32725007023504, 0.82348776977623, -0.345656164370492, 1.3648828025616, 0.180772964716309], + [1, -0.369152579051588, -1.36541666428274, -0.479929713300946, 1.5102159309635, 0.959138010581611, 0.474673095425563, 0.080685797741146, 0.177087380693318, -0.267810249346071, -0.21360757044435], + [1, 0.13818973162329, -0.380963052865275, 0.391004936544739, -0.267362163381074, -0.401147536036791, 0.194947155990763, -0.783465909215618, -1.18217932732495, -1.1083407573879, 0.76118041946013], + [1, 0.594273302862094, -0.19120765242749, -0.157148011931097, 0.427487219634776, -0.222204303509291, -0.771136320335612, 3.22715592580013, -0.739736283283325, -0.582740894161464, 2.17723127435654], + [1, 0.622873236159409, -1.11148702648575, 1.67481093731411, -0.759546219393167, -0.984951147170198, 0.0481648602104978, -0.326090840426158, -1.26804802584581, 1.34181580179101, 2.19655768617644], + [1, 0.53812065078791, 0.982359204815205, 1.00294473931934, 1.16788410188192, 0.978448488176009, -0.756155952233491, -1.31203619528645, 0.181192813457647, -1.28461197013151, 0.130438522026806], + [1, -0.918889724201684, -0.476480088037147, -1.2290889648819, 1.0010917332238, 0.868881874001793, 1.03858012765702, -1.0865411157567, -0.653156658860525, 0.701426526065345, 0.0627093785477363], + [1, -0.160936036101088, 0.366730365737216, 0.757890044599369, -0.712729710645177, 1.17692634459943, 1.12972327739435, 0.822382181848402, -0.844442799241131, -0.892114106302114, 0.694025530225122], + [1, -0.195063249025143, 0.730743572678458, -1.14638421664005, 0.552850995574003, -1.62259295122172, 0.494349169932684, -1.49098564421543, -0.401168274687026, 0.423892280814351, 0.267673960242941], + [1, -0.575568986620426, 1.19202534478195, -1.4994679230309, 0.0852176931780819, 0.755084424037482, -0.62590162174732, -0.393386260517711, 0.241633168962232, 0.00814763079558249, -0.95439505107095], + [1, 0.364624922887837, -0.242940224587045, -1.34185462569408, -1.12649065502172, -1.0353240456222, 1.4321887697909, -0.406469893374497, 0.519225736486193, -1.33078884809764, -0.0724550776852916], + [1, 1.04321632136462, -0.588174414424711, 0.98515272117472, 0.160488323139275, -0.0324137472435223, -0.89058287070396, 0.650168713280261, -1.44799649375489, 0.973470224249753, 1.08224891309192], + [1, -0.818334847783596, -1.31347862828171, 0.200285766083351, 0.0551342867089065, -0.363618246085454, 0.938525423252158, 0.910300383766338, -0.0648827631180964, 1.04895737984211, -1.80866163222847], + [1, 0.849074825056222, -0.811623356923857, 0.0854951565731757, -1.39505182382638, -1.67876588673134, 2.00640066899992, 1.169791332205, 1.25217465744077, 1.4260198447164, 1.67913201391032], + [1, 2.59381382510354, 0.045772383538682, -0.189575844287034, -1.93591730555222, -0.0555273810237348, 0.683555937111704, -2.24981826854837, -0.0500199883398958, 1.75943904348659, -0.450967538985541], + [1, -0.199905216355677, 1.42561769701154, 0.157483650075946, 0.115472893085158, 0.824867460723047, -0.312968611090789, -0.776170176166498, 0.847693582628415, -0.456920006091392, 1.00593373456827], + [1, -2.07571515085809, 2.52204242175825, 2.4289026152442, 0.348915755029709, -0.0706347349020776, 1.9508563302117, -0.440425036313027, 0.787114108473497, -0.588927176825234, -2.28202779284827], + [1, 1.46725189898227, -1.39194208532878, -0.825020344549312, -0.336593347182585, -1.03967855375826, 0.203019653555256, -0.514991146306159, -0.165517564706603, 0.793723057697471, -1.35871437998648], + [1, 1.22132596341281, 1.01862701748242, -0.436113277165971, -1.14385433821768, -0.157797505828849, 0.846079005377579, 0.185263209998666, 1.03870189435856, 0.673476888225434, -1.92263527964746], + [1, 0.218302883960088, 1.62530847636836, -0.337630893245779, 1.1084097861228, 1.87147066459787, -1.8579214282012, -0.796597014581156, 1.50606928429865, -0.3434820053278, -0.781931431384465], + [1, -1.09547801726531, -1.16273714316427, 0.815432583577486, 0.886788286720468, 0.259135217729439, -0.968368080837318, -0.369186757994165, -0.498168432233681, -1.45014060337283, 1.40272849027913], + [1, -1.18162872612409, 0.743988851685655, -0.884249528045601, -0.597287789399437, 2.84289857512969, 0.50258981527136, 0.824936063933908, -0.418714124876545, 0.638261382910877, 2.39044569889268], + [1, 1.16971105370125, -0.250510178033325, 2.17853399590229, 0.355457653267887, 0.206900329786045, -1.5345680931005, 1.02294622021292, -1.54582086512618, 1.65010368245267, -0.112988328488485], + [1, 0.146587349822864, -1.48132678802693, -1.20460781691575, 1.28442070645025, 1.55016100411606, -0.46465698619469, -0.7523684447575, -1.06760457011093, 0.498610625499936, 1.36695638655072], + [1, 1.19244405209895, 0.37707661560334, -0.377235781824331, -0.220914566488925, 0.43800243553174, -1.95033923412021, -2.019590395125, -0.0709667344401404, -2.43425380247978, 0.272459527879712], + [1, -0.692179191012648, 0.554455672074975, 1.10373225739648, 0.458065485540469, 0.563920455016133, 1.25589481057616, -1.19210100915996, -0.862328799383351, 1.31872041765833, -0.399668713555741], + [1, 0.394973774219342, 0.599152081906622, -1.17458720571168, -0.019073555964426, 0.655376278445036, 0.981139121485621, -1.65028133977956, -0.0689325203811454, -0.229474900433214, 0.386295620472691], + [1, -0.65281364662526, 0.775131325803916, -1.12958169690289, 0.191359960383421, -0.816578058373199, 0.114788613827408, -0.748701109502043, -0.570082729081103, 0.515057360889761, 0.260178666063364], + [1, 0.619250552917653, -0.941839605421087, 1.54708261575313, 0.447796644014051, 1.21170004724944, -0.637363508051072, -0.858164391078125, -0.316077906577837, 0.182029869705288, -2.1858703892752], + [1, 0.704079996986889, -1.13030924482278, 0.199839272159252, 1.75668275806111, 0.342693841705835, -0.0366044988213966, -0.078117658296963, 1.66952445790411, 0.723763728858098, -0.101378566890294], + [1, -1.40628388132932, 0.593516313286061, 0.831298761776383, -0.307050554160319, -0.523536047981546, 0.258534213318956, 0.900838121110923, 0.12103085566028, 0.381835673379189, 1.03300610415662], + [1, 0.754849812013316, -0.666089092793221, -1.10332592488133, 0.574052800712522, 0.754836994417102, -0.171087446685834, -1.27947180164293, 0.724134549590439, 2.58721588221255, 3.52134306327679], + [1, -0.603076633703155, -0.627378988455333, -0.5549231826542, -1.77557365993746, -1.1010878589523, -0.238033996274539, 0.545729655323476, 0.0455353994851407, 0.441873071309338, 1.15483963261245], + [1, 0.68897580064517, 0.277796454102244, 0.378387087138659, -0.108006005586717, -0.0979512116213791, -0.892768707558892, -0.214483695059888, 0.0502622269242079, 0.889331254400561, 0.0219329811104366], + [1, -0.778664551223035, -1.77836647279706, 0.372494566978646, -0.935452516336098, -0.935953492394091, 0.535560149809635, 0.466423080671046, -0.917533742474637, 1.4805556932255, 0.0876667685222666], + [1, -0.907389205002648, -1.39015756627873, -0.449607036876476, 0.0750706106322691, 0.728246494249862, 2.29439606511354, 3.13919168971737, -1.24095766398073, 1.18490144066161, -2.48194601311653], + [1, 0.00828644881989187, 0.522054401801662, 0.437486497926686, 0.134797494791568, -0.469233496049283, -0.846653187894572, 0.823447656838946, 0.585147820588634, 1.70456190994388, -0.353685189695708], + [1, 0.212009380254421, -1.1000471266371, -0.982955023022519, 0.188604739753813, -0.52327024369874, 1.91174966238399, -1.21386487456368, -0.637222767873192, 0.0299556367176063, 0.276549314096306], + [1, -0.515675789902043, -0.24885801295955, 0.452602622651348, -0.278658980160581, 0.689140862015759, 0.0687639877026392, 2.09327307414766, 1.79274468062622, -0.975963847411034, -0.200264081034414], + [1, -1.17549838615693, 0.556587271051903, 0.0825521595494212, -0.378685334337458, -0.596031902902881, 0.242372579474224, 1.13713711485185, 0.667002511700976, -0.31120238093692, 0.81224134235999], + [1, 0.00643806602904379, -0.462028098012777, -0.326812062686985, -0.612567362985868, 0.350671297103011, -0.181538901759006, 0.674051405305029, -0.29450930898595, 0.800487158985778, 0.55995775768088], + [1, 1.064360067316, 0.421075065824309, 0.832643558840222, -0.0112311178141201, 0.428235131169425, 0.62734545975207, -0.184686698345745, -1.87422383882066, -0.442576768534201, -1.82863843775713], + [1, 0.554314534894229, 0.260841633965526, -0.708151574955301, -0.124829077189526, -1.11984859296039, 0.0365144096546745, 1.64111329450899, -1.00952842248749, 0.43861183270776, 1.85968175971395], + [1, 1.77123992047204, 0.180937467617942, 0.805902160781741, -1.60451221467736, 2.04116812594582, 0.0526455576536915, 0.114974402891788, -0.537876882364985, -0.111741814633581, 1.19143894152539], + [1, -0.581885263739233, -2.01990880050548, 0.539068051094765, 0.431607784013478, 1.44059611287159, -0.747849609930291, 0.886914632951823, -0.90354802854534, 0.576178066449203, -0.676739004557098], + [1, -0.256795174324747, -0.642068944977364, -1.15458424494409, 0.807760739424685, -0.907468590189759, 0.64790998768915, 0.105416236440144, -1.15755775505305, -2.20130762681667, 0.110082246997069], + [1, 0.518644594060234, -0.196817565304383, 0.410367824080005, -0.741841157079197, 0.308900172526718, 0.425982694853377, 1.17173524471514, 0.994508883029376, -1.69717879936681, 0.542302244520894], + [1, 0.976505061874071, -1.22600034424079, 1.2021594118627, 0.478803418600539, 0.33491422935102, 1.63205982364468, 0.0246199819065983, -0.495273859103067, 1.86916147366576, -2.00958490148494], + [1, -0.263816528301179, 1.99983948934109, 0.239427824025259, 1.64139428340992, -0.976438594409382, -0.357170233940283, -0.0603640439815867, -1.01491705315377, -1.07219348886206, -0.199147444006664], + [1, 1.69995165801473, 0.31516581216697, -0.090005841044823, -0.456223260834848, 0.356967848853635, -0.179476641253346, 0.876233920654766, 0.974672233001141, -0.660471969809648, -0.503874578533648], + [1, 1.54486854089795, 0.0871636491999297, -1.15328725214624, -2.76574277405701, -0.497931200333788, 0.674992799249991, 1.81495751345737, -1.50692008848337, -1.45980433227089, 1.10981854673361], + [1, -1.13294859512257, -0.886211128168438, 0.197847462351308, -1.30836479675401, 0.697601685459937, -0.163445579897387, 0.825011646825204, 0.982921902454441, 1.68296766849351, -1.25790417311316], + [1, -1.12492419414656, -1.81516217305346, 0.94488832718051, -0.482326905027926, 0.458148497486208, -0.226016659731752, -1.10171895259106, -0.34220263361418, 0.185642023763586, -0.126430453596455], + [1, 0.107023282720214, 0.679094181222204, 0.504243586150205, -1.11789053682684, -0.416983124475231, 1.09466691926546, 0.900701576219562, 0.90064047519107, 2.28197464039606, 0.428982336882183], + [1, 0.201213574915957, 1.46726686202777, -1.50766920201619, -0.380684205553192, 0.559067165676593, -0.789478755573294, -1.19863137019053, 0.433533776960179, 0.87161085189323, 1.62320484415592], + [1, 2.35054447599264, 1.03021725265732, -1.09871002770372, 0.651645073947711, 0.500326315262138, 0.284281969496085, -0.46327650607889, 0.468539612755871, 0.576388451128863, 1.26502140254913], + [1, -0.0746650294027303, 0.556050884828039, -1.6078782528487, 1.33376948327055, -1.04782597833845, -0.88282236494625, 0.357087854013488, 0.768301370161523, 0.570539270064666, 1.85384997649097], + [1, 0.933784602748028, 0.838083397690029, -1.30776646597021, 0.774887616239558, -0.477967503819758, 0.782574870499588, 0.0406236871148842, -1.05722862287679, -0.314698724610892, 0.0427315758770518], + [1, 1.5836453198821, 0.61162558505053, -0.0589736824602939, -0.422235871892712, -0.425815125506469, 0.74679101787883, 0.503470623778733, 0.235890455075616, 1.25116422398207, -1.71546548194245], + [1, -0.306942599460782, -0.283548657532079, -1.48705153076799, 0.508882480445295, -0.564981275805185, 0.621302586050491, -2.06183278748823, -1.56850970161419, -0.535963713687306, -2.21949091334208], + [1, -0.603955750833064, 0.623646844857113, -0.136194006800959, 1.21487374471135, -0.258237798236837, -0.405709058619045, 0.847503186727759, 0.833839037027777, 0.836348743427673, -0.574073578495905], + [1, -0.784022930254033, 0.180299072687556, -0.402504507706494, -1.60602464330085, -0.925684381407387, 1.21399228685774, -1.56875694287556, -1.6677086495439, -0.998376668244914, -0.391765593869678], + [1, -0.680297144289173, 0.989283090631373, 1.22859875446381, 0.834036553471539, 0.385247532871386, -0.0288093548845736, 0.887400931360903, 0.523683580142997, 1.50464647125648, 0.0624784026993555], + [1, 1.9111725339816, 0.00860686135101289, 0.444136517536289, 0.335974506359503, -0.915902067262808, -0.152460725726083, -0.589116793120388, 0.994408627697874, 2.20008550491801, 0.185497879474842], + [1, -1.02418687243285, 0.674372945709632, -0.181845206793202, 2.20201227471925, -1.92811485557358, -0.267202637703728, -0.271143266637012, 0.275685958527233, -0.458609476139157, 0.784154429621669], + [1, -0.480460342631481, -0.913931081605209, 1.08859657181147, -0.842466992314895, -1.42384939684524, -0.282563154002272, 0.289072683765821, -0.950794618677126, -1.32398008548689, -1.51101510864519], + [1, -0.390382036995179, -1.601148306633, -0.336805957275501, 1.39313296196537, -0.28074019857578, -3.58678764630256, -0.31325888956198, 0.837498804740339, -0.0552660238448123, 0.107499185914193], + [1, 0.612727970868975, -2.44353986419761, -1.42694664405392, -1.17113112508245, -0.914152880472116, -0.45357357127761, -0.473971368603756, -0.549258241191782, 1.39273623656492, -1.28647327272777], + [1, 1.30957956511383, 1.09934832304785, -1.78684215072188, -1.53086302494053, -0.748824463999266, -0.416360858153374, -1.31269176438519, 1.59400172777006, -1.59655085718847, -1.13128643587495], + [1, -0.167173748569449, -0.593995940934495, 1.09892533461685, 0.790665867703108, 0.279276473991937, 1.40075574574508, -1.59182347459779, -0.317872488469472, 0.929178653997823, -0.10168730891636], + [1, -0.173045730316091, 0.354015887571534, -0.30579042616781, 0.0697042163721167, 0.917569923839261, -0.680206337331559, 0.396213085598731, 0.643119496138598, -0.599391029923711, -3.65625264259728], + [1, 0.454597661604916, 1.69452624756803, -0.566046312319842, 0.142455044421873, 0.710824505304443, -0.638994170756367, -1.05601342317088, 0.113203005726767, -0.748158936107459, 1.4628781169551], + [1, 1.65488463493057, 0.10062648647793, -1.71245268386562, 0.279165687489487, -0.0994030048550701, 0.874199152440343, -1.92090362170251, 0.215157022498076, -1.85111565113008, 0.435177620180074], + [1, 1.80473171774289, -0.749601967599805, -0.505318696137457, -1.04792308932046, 2.68007504934181, -1.99924542782051, -0.553503872617805, -0.126433912295922, -0.370903725843119, 0.594418103014648], + [1, 1.36757659233381, -0.207055308022061, -0.352146914640957, -0.0376376040008341, -0.798839535560725, 0.651094614485002, 0.637173917785244, 0.721039508013921, -0.588556501307395, 0.716930420290922], + [1, 0.382959595546615, 2.01259023319167, -0.632826715781648, -0.173511062570841, 0.829506541977715, -2.03560011148951, 0.483942169930861, 0.313984750101641, -1.21980114050115, 0.521548591017593], + [1, 0.879896334223858, -0.590521924509568, 1.50385767701593, 1.75921477287461, -0.828394930006822, -0.119353887874965, -0.112904109786546, -0.0337823755148467, -1.1689870821572, -1.87257917146343], + [1, 0.404800096082289, 2.03735472540559, -0.43918477668762, -1.58961900538076, -0.615526905640981, -0.322183317124305, -1.15949038956261, 0.357946514229743, -1.21898196688185, -0.662909249540784], + [1, 1.43140043703361, -0.980013443601623, 0.438704440878257, 0.746817332025977, -1.11265043336698, -0.0719744381965454, -0.405299604818953, 0.250734197784217, 0.868288889582462, 0.125336777145292], + [1, -0.210440890341642, 0.782081627856407, 1.48023587355193, -0.240451938617267, 0.322709452042122, 0.0171251074159944, 0.578519585388543, -1.1718496825412, -0.67207408136713, -0.892979766294943], + [1, -0.958072728182832, 0.438848731546319, 0.209943527278552, 1.07592727302523, 0.358936059534929, 0.0465790576967302, -0.287467158156901, 0.143818287775655, 0.402219610036391, 0.458285826966394], + [1, 1.94234177410803, -1.56461782853383, -1.84686672080471, 0.479585373800897, -1.97532291125064, 1.01792593685522, -0.475216533761514, -0.327341960396753, 0.368435278807195, 1.03723113764993], + [1, 1.06150241324185, -1.47321667460632, -1.37381910135801, -0.563095792316096, -0.813015777234598, -0.201777401289998, 2.13906312928648, 0.337472223423486, -0.398524824087356, 0.610636051787549], + [1, -1.04223710808924, 0.18374503923404, 0.0475157690963251, 0.791268892178889, 0.113638234839059, -0.404701168701688, -1.61586765297041, 0.925071346873267, -0.384319384020586, -0.184014069320629], + [1, -1.3754294499764, -1.693229661089, -0.78449435563021, -0.0694329935897259, -1.44581424435112, -0.578979814739461, 0.354430906540344, 0.492269978746187, -0.339214900805459, -0.406859208776758], + [1, 0.182933658605359, 1.33384447188907, -1.39325329793425, 0.420640203737072, 2.23509517073581, 0.819150938914746, -0.274441431661437, 0.953657505275894, 0.549204873030162, -0.704627017411942], + [1, -1.14648228657337, 0.525651052369496, -0.428343104759049, 0.636770967924288, 0.422451411232682, -1.58008985219217, -1.13095067454424, -0.0932494132850098, 0.122101240830238, -0.498418856572715], + [1, -0.320919776004399, -0.727940076574138, 1.78202593003416, -1.44877911971572, 1.68184670181085, -0.272477941579482, 0.0981210203403761, -1.00547233753041, 1.15824770955235, -0.280588525117744], + [1, 0.686151748383153, -0.411663853624183, -2.03254001335879, 0.283178709281529, 0.0557360140930626, -0.694094160749451, -1.49057831276565, -0.888731725963046, -0.536834438041304, -0.498571827513467], + [1, -0.430248751593959, -1.52159670573236, -0.156633483076023, 0.377255088555636, -0.983223992774248, -0.135642032046116, -0.877792268724293, 0.223302585532699, 0.445299553449546, 2.0472741439503], + [1, 1.01456784919804, -1.28450284945411, -0.309669205924216, -1.49049247041607, 0.65520767802938, -0.265903205944276, -1.50522395807214, 0.700136859504097, -0.980451634767027, -1.19409158411281], + [1, 1.17964274414655, 0.21126932308974, -1.01519301656018, -0.287869867466666, -0.456436242405338, -2.76245531318974, -0.196700901751441, 0.472149798772864, 2.23295528476116, 0.320657009665221], + [1, 0.587055224287241, 0.400658243417291, -0.0897286475752248, -0.227135923384063, -2.36746462783778, 0.388804642426665, -0.497010735566395, -1.636625469928, -0.192358312978261, -0.0945312845027071], + [1, 0.681810831241758, -1.58856017144616, -0.892594602000219, -0.763297629662477, 1.12035482400427, 0.147601278966897, 0.52180026430156, 1.18381510500034, 1.8099024692853, -0.247886372193008], + [1, 0.528398231706119, -0.561586158241826, 0.206973455176728, 0.295937478694729, -0.578759187200501, 2.31796886473066, -1.11192632823163, 1.32323828038912, -1.45421911695902, 0.506365792982917], + [1, 1.11415963623083, 1.31959043354246, -1.82623265165107, 0.986396618269161, 0.0542281531352336, 0.351898117837113, -0.499217853280515, -0.90882038947235, 0.469210035397747, 1.00246798659974], + [1, 0.856989773179712, -1.65073902720827, 1.03983321881693, 0.341368485709965, 0.242516097320593, -0.747960775531096, 0.74520669083741, -2.10388404312569, 0.947320646848656, -0.696545475405605], + [1, -1.55104128506571, -1.64697990423745, -1.34470465809401, 2.08159498095176, 0.537413789019561, -1.0843463269688, 1.60743995632495, -0.146956503133385, 1.54426774289966, 0.0304635394904542], + [1, -1.46880081200149, 0.497079851744304, 0.305873608357415, -2.16822974695062, -0.613667190615615, -2.71342360926218, 1.13441565662034, 2.0317159476772, -1.10441821541153, -1.4819769506272], + [1, -1.94397517196994, -1.41916639972418, 1.04626303730347, -1.20315284971228, -1.18924540812774, -0.945668148546235, 0.0813230491105811, 0.274760881641961, 2.14992183947432, -0.961045778564539], + [1, 0.445875245449484, 0.755117638238231, -0.955910870407996, -1.08412655808897, -0.638301728369757, 0.625962883039503, -0.421945902630606, 0.899833658226889, 0.346058946375109, 0.687262139846784], + [1, -1.37415982788588, 1.63588354360217, 0.957119513348806, -0.686451425631075, -0.351887451680825, -0.889499316877211, 0.940458345878486, 1.44591408324494, 1.30837931297352, 0.945158880155451], + [1, -0.483810900095382, -1.08871221411288, 0.925656637374024, -0.423801333138335, -0.471214740135664, 1.14430313239831, 0.0200690124894736, -0.178923635875843, 0.710608843897285, -0.300904412938463], + [1, -1.50646543603637, 0.34733989700057, -0.384438990534413, -2.70331783052825, 1.58043433218719, 0.24791111301008, 0.91585316322828, 0.43617778173223, 0.786342422307969, -1.05755216901119], + [1, 1.00589846256889, 0.262000146504765, -0.614131186439384, 0.480272267345097, 0.229150142036099, -1.03931590663338, 0.870836109864894, -0.130558600854887, 0.551970138830988, 1.07925048005279], + [1, -0.762001359204519, -0.0731264415284123, -0.0147761867015231, -0.275321596240357, -0.811835434717467, 1.54270086350527, 1.3493270239375, -0.254110832858324, 0.517121608117039, 0.0133247720960696], + [1, -0.139375687281065, -0.296043961327395, -0.778587742329379, -0.400137705957457, -0.317917074876231, 0.141598328187472, -0.661754723244057, -2.44540042391227, -1.77728394656258, -0.374893406645097], + [1, 0.155818340703159, -0.320236523983157, 1.47906440793067, 0.947570225072062, -1.04107403326728, 2.04642545460285, 0.215605725800261, 0.0528988343824327, -2.64829448169278, 0.58309891584189], + [1, 2.24459797772659, 0.3242596472957, 0.161900024162051, 0.93437645117632, -0.618576188443752, 0.716221338931235, 0.257890722488491, -0.220467237232147, 1.60355434433328, -1.46041694611907], + [1, 0.461569098967689, 1.23404859808586, -0.741616741010153, -0.0700907832518047, -0.11319681874557, -0.245313541029803, -0.887338729543834, 1.10755599237824, 0.581268896451293, -0.373710937148468], + [1, -0.801778939744131, 2.07868483143679, 0.444689460805033, -0.569063003564249, -0.856297044805529, -1.42638791478657, -0.00917194447363946, -1.32574091187817, 0.0275961632111428, -0.425438982749146], + [1, 0.559010895310733, 0.653020679833005, -0.175938991826459, -0.316644948546192, 0.928813403368859, -0.989592392524173, -1.1217406415169, -1.06119509983336, -0.423718267637576, 1.20407235327], + [1, 0.519817571633177, 0.283383887844783, 2.37472674551352, 0.841723750755311, 0.654660695485085, -2.82435497872498, 1.70618320531815, 1.05460767881413, -0.948987385692382, -0.0877639126025485], + [1, 0.287456147528234, 0.990838960656795, -0.0494419663886837, 0.562632353678782, -1.17987120335512, 0.653960766655766, -0.810791345739404, -1.83746062363099, 0.659842244805828, -0.285184238708183], + [1, 0.373424614332421, -0.681322221796344, 0.655127640518765, 0.352509365951723, 1.78733218621184, 0.314657206563843, 0.38309928020323, -0.737445882997075, -0.443312431052535, 1.28770016356459], + [1, 0.75159201964458, -0.27219738720089, -0.861371228247139, 0.727292001954686, -2.08543406425162, 0.477963176249077, 0.448553989941731, -0.687813788719305, 0.301319412183364, -0.94027108089762], + [1, 2.33419724242886, 0.7093720188081, -0.0282537201498121, 1.40156987675477, -0.00782702609534947, 0.327856948262149, -1.10475454521168, 0.0268632518985445, -0.452870902878695, 0.224465431873216], + [1, 1.47193198550903, 0.722715412884079, 1.03262868316592, 2.15342188694488, -0.217459303685775, -2.28997960515424, 0.0612717212092909, -0.218773009381229, 1.0768921971892, -1.33643135810773], + [1, 0.41336502740929, -2.5017310797349, -2.6063487422958, 0.922468518941349, -0.97405908112749, 0.797494311299211, -0.449299251230894, 0.591908903838664, 1.77581057473302, 1.24608362105108], + [1, -0.252820571099468, 0.0494379211904567, -0.693657282017213, 0.499833494152477, 0.440658848267394, 0.696803830153856, -0.306495136425724, -0.0876555534307165, 0.760412388643141, 1.96726241491042], + [1, -1.75989338399133, 1.14716840758524, 0.247854725645786, -0.971970409399283, -0.012146388651437, 0.182687929908949, -0.350546022858716, -0.0135024427043949, -1.1770410211378, 0.0613183256130318], + [1, 1.06983760787876, 0.48106878682512, -0.219570295232754, -2.2015083760078, 0.408185589812503, -1.31126122081049, -0.333337291031812, -1.22515749547251, 1.31029536503708, 0.53030833775722], + [1, -1.40946707959358, -0.0950581084269564, -0.503267908604094, 0.0696520153125382, 1.18302096792579, -1.31765179630779, -2.42062711046428, 0.203998851206652, 1.09660442001905, 0.987522855951923], + [1, -0.560096968671034, 1.83445763812645, 1.19168995114743, 1.09110047688203, -0.967155383790024, -0.503309128406384, -0.731042775931164, -1.26072884627769, 1.81118613112651, -2.43709484075492], + [1, 1.42265055391271, -1.85759767806398, -0.306876491345661, -0.0100730187033746, 0.237057906272325, -0.397239690762349, -0.252069540205202, 0.136946003415807, 2.1356440181301, -0.198306172879468], + [1, -0.651184175873325, 3.74420149290016, 0.350928991344612, -1.22377731836253, 0.947094937954299, -1.83431022807416, 0.443386467947925, 1.63656240030638, 0.506282325748138, -0.956062669630399], + [1, -1.36521412492034, -0.196714360673978, 0.991753218231546, 0.45454475742562, 1.96910111587653, 1.86252145515374, -0.28316220493031, -0.162206907683976, -0.678996728819359, 0.15937060641301], + [1, 0.158771425802283, -2.45128078132629, 0.596671489375331, 0.330469003720448, 2.68393333023546, 1.47922264390411, -1.61374259008602, -0.0406404458548001, 2.16056188485364, -0.312074243358391], + [1, -0.847582409842585, -0.405084691053262, 1.24893211125811, 0.928092323897434, 1.83352563218835, -0.654522598357909, -0.140658550468521, -0.211987191384205, 0.19325528946149, 1.9190947879751], + [1, -0.966562404119503, 0.745443532895389, 0.40032470157887, 0.629823199294849, -0.919623540841984, 0.647449540339151, 0.388256301116247, -0.393676580863947, 0.435133134204735, 0.791337188930279], + [1, 0.739587545269517, -0.217701938011781, 0.447118567870377, 0.375042170787476, -0.545335949723981, 1.5350632047385, -0.657433678820824, -1.15662467154047, -0.557985736839756, 0.10354206790919], + [1, -1.01902700090682, 0.0600139929289447, 0.243462783454202, 1.1498425860317, -0.584952944493149, 1.80951671246126, 0.753427848642451, -0.224442648253871, -0.157588062390795, -0.400820205804823], + [1, -0.783786904048515, 0.0644270138653453, 0.513902517668952, 1.55268317366673, 0.418852471588828, 0.564809857527433, 1.04002457631025, -0.812291970963785, 0.192118648435509, -1.07594867532778], + [1, 0.869853530033134, 0.828087477259995, 0.321676559197953, 1.25802727706073, -0.869889571661325, 1.54040910424837, 0.399078787530769, -1.02620918611329, -0.535518109751532, -0.294338353857227], + [1, 1.05854937961927, 2.41222095621059, -0.425923831600431, 0.487705109384675, -0.595517847735373, -0.331180222826164, 0.246217790723561, -0.0636293338517649, 2.06418969105854, -0.344467374164048], + [1, 0.303681579902868, -1.94726130347487, -0.198518188045413, 1.02962443779143, -0.784629885670898, 1.79955857493149, -0.0599619876785327, -0.614368111228167, -0.42816552315934, -1.64283461537992], + [1, -1.56749419611232, 0.675229643747019, -0.670235267701958, -2.28174240692111, -0.647401764562499, -0.999602231807392, -0.492243488008049, -0.532857985544458, -1.68596888961453, 0.755226241446279], + [1, 0.674539297275526, -0.645090070197937, -0.898463874786154, 1.06853001229338, 1.06081865623363, -0.309592090181644, -0.0171310488842654, 0.181587816323057, -0.60638244793067, -0.433169409989086], + [1, -0.91046409728286, -0.513543617797286, -1.21048545322765, -0.507406047630356, 0.142986010091037, 0.572651817224986, 3.22447923366572, 0.333852497884341, 0.582535588996556, 0.953513289552836], + [1, -0.784644774112209, -1.44063155508163, 0.83720076990269, 1.26797587652261, 0.695057898821119, 0.318801085440688, -0.804876879394368, 0.58182557682755, -0.604087470582959, 0.852681227133739], + [1, -1.41527534901989, 0.230014845675668, -1.06528274141401, 1.02511093680983, -1.51164684388944, 0.58404306122472, 0.322120438341655, -1.11747769183997, -0.402954328034977, 1.1953620166454], + [1, 0.58578312002541, -0.8599126006584, 0.53233896805553, -0.401302409001517, 0.501833600900325, -2.68035627848593, 1.75946081283874, 1.03182762302896, 1.67228103123825, 0.486550788763992], + [1, -1.15476980420679, 0.833462545262289, -0.0835787480130151, -1.7222460474859, -0.137858501435844, 0.250691925653325, 0.841998817353972, -0.6662583865445, -0.348760188918695, 0.0805109377124734], + [1, -0.703852741861704, 0.558117519494534, -0.113454839900376, 0.456760098915082, -0.700025818559562, 0.968979383528687, -1.17081842360728, -1.452608867173, -0.228305760185157, 0.443053475452258], + [1, 2.69682107753385, 0.986658617572268, 2.20812907775948, -0.790933910647696, 1.14008353621747, 0.110329826578829, 0.0363277895218632, -1.1729192707661, -0.56297032692283, 0.176703786935232], + [1, 0.279614613407993, 2.25562370740413, -1.09480453960499, -0.0603319580143669, -0.568614881039728, 0.713633328257861, 2.22536778088311, -0.836083304872897, -0.743728522228103, 2.48419095817803], + [1, -1.32109118030726, -0.631242577896926, -1.26863423695808, 1.19419180252922, -0.26396284421311, 0.71163453511164, 0.397891321706723, -0.588363746985412, 0.696728296917494, 0.476686116952602], + [1, 0.938279080561347, -1.3216984825145, 1.45535890375428, 2.58234908343897, 0.864040248833986, -0.00287202155510049, 0.164124590780595, 0.253671923170551, 0.765503672886429, -0.28503247399422], + [1, -2.27129114203649, 1.05613381338947, 0.840058975462831, 0.953837473519676, -0.997943728350579, -0.404125734656677, -1.4937199581207, 0.0958444460902049, 0.437201337205729, -0.685803763971035], + [1, 0.176965379609567, -0.529237989734255, -1.52695912468778, 0.0800665374363567, -0.0568652379246772, -1.81005250016828, -1.18090924705171, 1.24774192611588, -0.504085660142004, -0.908959222748959], + [1, 1.68409066079605, 0.503424043940422, 0.170365557554929, -1.68580471733473, 0.447276089580835, 0.545437465210102, 0.383854552440351, 0.512436401855791, 1.70219597021568, 0.904407208227866], + [1, 0.474154531041827, -0.758200376195171, -0.805982962356975, 2.54078400679656, -1.7259102490608, -1.90277741575258, -1.19047987677596, -1.14604069366921, 0.715861840634415, -1.02134548877843], + [1, 0.336626991694928, -0.147210782101746, 0.471892557626206, -0.393301962123334, -0.311506223983151, -0.54312891965799, 0.556835257592055, 0.881959403912999, -2.52574253247915, 1.00529312417147], + [1, 0.303081704383306, 1.81373643660559, 0.10869997696508, -1.31809606143902, 0.0833879110484236, -1.29955373083875, -2.14993697305066, -0.315196483831985, 0.00650679298573333, 0.42783095843384], + [1, -0.482261116411679, 0.685830862316194, 2.01455366037265, 0.807584368489897, -0.310895066825478, -1.72545867301376, 0.54526580650647, 2.6317507283403, 0.619940449336006, -0.646508656802486], + [1, -0.367884876746884, -0.437887235883775, -1.2699180426591, 1.38497141324027, 1.01235105260707, 0.939127978448164, 0.0287616741219916, -1.19874472419959, -0.0321561683085462, -1.20310804733612], + [1, -0.816009874326294, -2.1037007035352, -0.384155761755901, -2.06312597256211, -0.410930204894731, 0.338075425091513, 0.798593799608687, -0.0353556380740484, -0.116772314242056, -0.248920397146577], + [1, -0.919190375196461, -1.452998046444, -0.0235272347822185, -0.22549662511908, -1.80467913764886, 0.28699573339434, -1.35173357164528, -1.63571099254065, 0.350148242046677, 0.590665697148707], + [1, 0.951668100235934, 0.731969380400852, -1.17748756414784, 0.333530520591872, -0.069485092124749, -1.39297421855739, -1.26695719989819, -0.739439741068132, -0.275350806026759, -0.220825096465138], + [1, -1.23107513938234, 0.753180053075347, 0.305310055960868, -2.38398291714227, -0.080234038404257, -0.260510606862866, 0.527474760764209, -0.919515034829325, 0.00686125589718564, 0.635080028803414], + [1, -0.52201421260151, 0.00496399384847594, -0.625638772923144, -2.59885677183695, -0.281216484260168, -0.567935481770612, 2.66492350070306, -1.04573480303206, -0.0390341086518227, -0.593119183043464], + [1, 0.619208548812865, -0.763546243375559, -0.714962350566834, -0.0148067833559549, -0.161710884406909, 0.202996568832368, -0.803425357746854, 0.165338923238257, -0.240252852025948, 0.57989660359237], + [1, 1.94390857955151, 0.610238237054396, 0.549719517775185, 1.7250109663604, -0.115188817862232, -0.802577516017288, 0.152450694974188, -1.31173818376962, 0.313781814534614, 0.599789844261486], + [1, -0.878684520878814, -1.74092516483057, 0.344472247315064, -0.991218707243706, 0.66234577679725, -1.61043025423711, 1.29181625984123, 2.24710723045475, 0.673072977808258, -0.663616810038196], + [1, 1.32470431201012, 1.49613559272435, 0.540429278196908, -0.708235732322369, -1.28093263407105, -1.18489085868202, -1.02906991266384, 2.03462615320116, -0.1651311274179, 0.422719643843103], + [1, -0.534083620362317, -0.0281259724952576, 1.02079710213298, -1.29883676427852, -0.653280429426707, 2.57535233311721, 0.939698373378991, -0.0853963610753332, -0.990431977550741, -2.14313142575209], + [1, -0.468454796815347, -0.651259181214439, 0.119600845399067, -2.50487617387459, 1.35749968717877, -0.309650958041886, 0.7776155452888, -0.418033030310625, 0.0692743082147678, -0.0921082204211667], + [1, 0.325056952872152, -0.644763960879774, 0.100288125965191, -0.0903613710271801, -1.26595050953846, 1.08771665289026, -0.86895224674067, -2.22700924885962, -1.23885372394113, 2.84420184029906], + [1, -0.662577733842967, 0.385545913462656, -0.489039775130291, -0.575102997115776, -1.43782057053716, 1.52867153902079, 0.478809623133283, -0.616939188708184, 0.336273508337398, -1.41526995606404], + [1, 1.15315218835596, -0.424044450940692, -0.662846597613106, -1.46643309358774, 0.873496669860394, -0.234417714655415, 0.133987358216669, 0.0653078939841593, -0.485596674160935, -1.24348199429053], + [1, 0.245695228309862, 1.25610251016238, -1.13026250197095, -1.06973098875653, -1.2306869760387, 0.525485078794058, -2.34660468146642, 0.361416987346173, 0.977864045697066, 0.0615372829814131], + [1, 0.902096867570319, 0.376615171712147, 0.131479766263882, -0.0784360426701248, 0.303029216218348, 0.181152307440479, 0.166766913207752, -0.175172025798929, 0.207075668758844, 0.185170130434711], + [1, -0.533366865508062, 0.0833697032086776, -0.0125275225289782, 0.486936325426757, -0.875851167755925, -0.940575206374134, 1.69599604366505, 0.348678446238639, -0.839405990295658, 0.800698801142218], + [1, 0.820811728268122, 1.28145632706208, -0.0877757044870778, 0.126908353354954, 0.878976730048932, -1.63095786244771, 1.1465410544649, -0.380513264993386, 0.847212130006117, 2.03644794153848], + [1, -0.603166197365474, 0.322500810508579, -0.299487275755982, -0.259878754475587, -0.139249566340442, -1.95180461744305, 0.187616010105279, 0.3733837620499, 0.0420268885705361, -0.399481711562374], + [1, -0.00668196272593409, 0.606334032768206, 1.26854959458272, -0.516603653840304, 0.0643972683898384, 1.54780187694155, -2.14983602777617, 1.67722445612266, -2.65229075368073, -0.0219829954831739], + [1, 0.529134033235507, 0.360502724762235, 0.25705269105216, -0.790326421917779, -1.77558697649888, 0.65617865929671, 1.21011622864479, 0.803011065987501, 0.579911615240658, 0.579178835715027], + [1, -0.855072814307352, -0.868831549126975, 0.341089186718264, -0.335597548330373, 2.24445129297411, -0.135384250311657, -1.9189142637888, 0.405128126794107, -0.329778483314296, 0.799060034047627], + [1, -0.11211617743286, -0.463282053046925, 0.345099809636558, 0.619091564183552, 0.49111071906716, 1.15219091149264, 0.255560637891562, 0.676870592868587, 0.383435948788959, 0.298362852783885], + [1, -0.0318837626055996, -1.01722987512384, -0.970191146846263, -0.406011838880605, -1.03065425864437, 0.640076761378968, -0.0639571262828175, -0.0435270334275078, -0.140051160109896, -2.12583967056185], + [1, -0.378486602509987, -2.41268166296142, 1.8264930242581, 0.317066419386034, -1.97224016315708, -0.725177681130407, -0.354950529671107, -1.09856039980897, -0.0256784716800073, 0.480113773246912], + [1, -0.0578689008901032, -0.877645481069115, -1.24924286321739, -1.72913068198736, -0.483185531724843, -2.4151271017768, -0.994366791673954, 1.8530246910501, 0.627921581099538, -0.40640344872254], + [1, 0.53226539561296, 0.71490752392489, -0.0295240488800823, -1.67470766144596, -0.321083888614285, -0.138030243787176, -2.60358493632124, -0.0405968898012778, 0.53066246962698, 1.38804880351644], + [1, -1.3563175633858, 0.791067902527973, -1.62013972398385, -0.588393955212509, -1.3810573174432, -1.65170676794894, 0.240391978262506, 0.573741414132854, -1.35576519570101, -1.4932411542078], + [1, 0.15103696979777, 0.837259455312118, 0.114796928762367, -0.420914675630553, 1.12109575258713, -0.808525193732856, -0.52527052316367, 0.55025481309742, 0.673590101289364, -1.75443259785618], + [1, -2.87932683687846, 0.360748452858734, -0.420636323260762, 0.605703777797809, -0.358952907937116, -1.80544756392329, -0.958169960751303, 0.536936172925721, -1.89035800373654, 0.627254520953039], + [1, 0.520392750233268, -0.856061168035642, 0.20879524610279, -0.255817761167365, -0.860114282920454, 0.411265796784594, 0.722519147602856, -1.35153164088025, -2.66402391805389, 2.31594648093662], + [1, -0.934779351079078, 1.36550187092889, -1.18154312942209, -0.563099222378557, -1.13819742282518, 1.12808678368209, 1.93104613558702, 1.87401724514262, 0.374316376086241, -0.0749692753104362], + [1, -0.873391606663193, -1.15756445551869, 0.311423466451, -0.0307132326124902, -0.174577217351264, -0.768351819989798, 1.37774701702233, 0.982327474937643, -0.43995813651039, -0.330260490745583], + [1, -0.24949369253496, -0.150775259144802, 0.73536356324213, 0.654183377382184, -1.18258510677952, -1.03583909157281, 0.123793941868018, 0.0491557879465959, -1.55931882233887, 1.47341434945273], + [1, -0.251078739210541, -0.330864220346338, 0.419871712641118, -0.817267504366991, -0.897266414370421, -0.215689681153979, -0.267899683547104, 0.134536075720652, 0.478496527700643, 0.115322127323802], + [1, -0.767814074106437, 1.35675556563257, 0.793337700313134, -1.45730131377965, 0.318083299158824, 0.325391264210738, -1.48745656893874, 0.719417877608776, 0.86841243069838, 0.970209363551914], + [1, 0.477935435492444, -0.634658744071964, -0.767577172506193, -0.00838321778836851, -0.688188961926042, 1.30560199894231, 0.642803134949899, 0.488922327451108, 0.542383273453465, -1.62230949561934], + [1, -1.10740819499445, 0.752482217989334, 0.281388349603991, -0.185383952421179, 0.557301414620498, -1.79031222155281, -0.0701735750155117, -0.12332841580315, 0.154821965217319, 0.393947997647065], + [1, 0.307999572889197, 0.999324322795972, 1.72827140634102, -0.234014701778877, -0.455353460986509, -0.422126241116351, 0.710036216588474, 0.0735176535308767, -0.0454807718775599, 1.21996794026987], + [1, 0.0925354440541058, -0.306773224189931, -2.43031042206642, 1.0227112527571, -0.317094441470603, -0.0164953502729357, 1.31745954091969, -0.847316661609821, 0.899647964490352, 0.275333997421087], + [1, 0.429681313001613, -0.868006007760488, 0.48142625603874, -0.282847166290946, 1.99451264883095, 0.347204088977815, 0.264928952310476, 1.68429240251624, 0.593898502844098, 0.445689381075852], + [1, 0.862915991946444, -0.905779419615912, 1.42725771954708, -0.137199313281811, -0.296564517022351, -0.307493096106462, -1.11833770772655, 0.085861226092997, 0.780000693696758, 1.03310075215914], + [1, -1.69742805707435, -0.607250712328048, -1.08776446134425, -1.07927574352235, 0.632060706725625, -0.0677377497484995, 1.47465633899462, -0.26414854651367, -0.626657646254962, -0.0432637915355266], + [1, -0.0242836423889243, 0.487048136624791, 0.534412651191843, 1.65261008984341, 0.459926500054871, 0.339278758673755, -1.00790626265857, 0.387595185541997, -0.0861367515411179, 1.22909238085146], + [1, -1.60203448602209, -0.337183809106253, -1.31928939330644, -0.600033633902645, -0.301162580838831, -0.442917518263775, 0.557614966327324, -1.5419595148326, 0.115018689998037, -0.737096811923035], + [1, 2.15284023841208, 0.102951749353911, -1.4737007175126, -0.417168922303029, -0.307467097547214, 0.20539656461459, -0.727886532093677, -1.87606390106174, -1.2009176739008, 1.42117509203531], + [1, 1.59995247289608, 0.544501243559897, -0.0884746744264758, -2.31221222834467, 0.45082316348614, 0.564803716245414, 1.65302203087012, -0.0600679582204403, -0.174387511036781, 1.79951667898792], + [1, 0.375707424053679, -1.01699656882139, -0.282868603893982, -1.40191666923433, 0.829012869225731, 0.179802670833624, 0.239572942375077, -0.550276418618738, -0.501836883029371, 0.39629430822464], + [1, 1.48685515044136, -0.227055421977601, -1.51484340578365, 0.0544134574770299, 0.751099352159805, 1.85694322353502, -0.540450227625393, 1.80077680879864, 0.455071050758042, -0.500378528638686], + [1, -0.354890336641492, -0.349354959549795, -0.510328344208779, -0.327394292803723, 0.247625625809749, -0.589665184867979, -0.312824230055853, 0.449589248022093, 0.110246961580608, 1.82351794411176], + [1, -1.38663309123978, -0.772637718614898, 0.613353433506262, 0.872874493328989, -1.10099448723159, -0.656810167181819, 0.74701338238783, 0.0306257763390939, 0.0855815784390118, -0.632949014788661], + [1, 0.0202953933913542, -0.17798044742495, -0.623193280997066, -2.34831033603946, 1.32057754462925, 2.54147936506557, -1.85750687687797, 0.171372464609088, 1.66306913853622, 0.808609289239728], + [1, -2.2172347599894, 0.452392128946779, -0.308755246789904, 0.111878433088551, 0.389305251044338, -0.662217995324057, -0.359904884571949, 0.357671081166065, 0.960296089910201, 0.0594405976685199], + [1, 0.238348165521037, 0.840846223330017, 0.124056032149149, -0.734985063097244, 0.300968566205431, -1.21245145098402, 0.567076804468009, 0.585158154413417, -1.97408692635168, -1.53637981554011], + [1, 1.19385464125804, 0.0406622304815918, 2.07224306772823, 0.894189862435433, -1.98309345574208, 0.46698069004037, 0.0235887288621311, 0.504577323308169, 2.04069200380351, 0.51224167014675], + [1, -2.74815403789515, 0.547671155850216, 1.29935979241835, -0.227570002181527, -0.207644634262759, 1.4148668182853, -0.966304317478704, 0.486684251327053, -0.116478510751334, 0.2042869992961], + [1, 0.952510804358767, -1.6783644121941, 0.871769629942711, 0.76613426797407, 1.65523340937328, -0.398821491377337, -0.22147937623987, -0.789100843862339, 0.332819590133985, -1.26539214963233], + [1, 1.53914046903851, -0.701195220319686, 0.817185506116108, -0.260656000507174, -0.444092600029321, 1.46626658497585, -1.37508803918859, -0.248921010414257, -1.30072476526283, -0.378160667945904], + [1, 1.12417960209976, 0.305545922161997, 0.557018307304839, 0.19559907752954, 1.42669021051476, -0.309846810058974, 0.56538704393435, 0.542217915528488, 1.67143814459294, -1.58092897951251], + [1, -1.1712054287726, 1.00709593530296, 1.11561839064919, 2.11841882366024, 1.33926769300776, 0.707586679882621, 2.33988259025513, -0.788649900724165, 0.136253049979204, -0.455782967555404], + [1, -1.12161957658702, -1.37981014625554, 0.390915001711932, -0.894624934483288, -0.364328011591163, -0.901126784532247, 0.107065682492102, 0.170873543995771, 0.456251567659782, 1.24486495191921], + [1, 0.00950941526293878, 0.153828916628079, 0.189737262631524, -0.555994481778552, -0.696236610193154, -0.0591255526896916, -0.864245359008627, 0.509459337523056, -2.17943065864109, -1.68831340570111], + [1, 0.910618056470928, 0.925139256994705, -0.0828207333696314, 0.716590755910618, -0.2455736775518, -0.159553733104869, -0.209433025486547, 0.301930253477867, 1.38682685891512, 1.51353385185827], + [1, -0.73966871253334, -0.205753129963412, 0.706970887987222, -1.38567873948247, 0.423751105420566, -0.65731174501164, -0.511379124122074, 0.184239454786575, -1.83696689422304, 0.649839374185789], + [1, 0.0196348307389257, 0.301269526178115, -1.50221686788416, -0.598452996406576, 0.660982623394149, 1.12989543929625, -0.200848868592599, -0.29341167400345, 0.247826654733975, -0.0739642398796154], + [1, 1.0354262472925, 0.075920475425019, -1.31734579052602, -0.504839585891577, 0.322412970684488, 0.653405067098311, 1.02583840179062, 0.162636916908402, 0.586960355538872, -1.02642556863575], + [1, -0.502598929090275, 1.34960799681079, 0.210953061156245, -1.34591453892682, -0.879006260299429, -1.40236232700849, -0.412050045738494, 0.354533373669608, 1.21469603706077, -0.85796682107812], + [1, -0.240721120542849, 0.590412256899033, -0.531652302588179, 0.523476428579686, -0.344756947698911, 0.646043525890951, 0.0568730523603233, -0.277963346125747, 2.1055867323049, 0.000356026247163571], + [1, 0.328441046065344, 0.607655350631777, 0.872230653119666, -0.0743227705192407, -0.698790802938073, 0.31437334160691, 1.33177739426791, 1.31288849702843, -0.442147337787532, 0.922027377589658], + [1, -1.19467380214863, 0.132851123519871, -0.275349264392408, 0.729007009242066, 2.01301641578018, 0.253482295759529, -0.351972891316956, 1.21242706061066, 0.110850446687368, 2.29313309532255], + [1, 0.217399748342267, -0.144833362699161, 0.359268556808796, 0.344040453675485, 0.389610740677217, -0.433039810869697, 0.90733793092142, -1.12896503983154, -1.67571272585076, -0.619452958926713], + [1, 0.614459694171602, 0.494308942187153, -1.22925394273602, -0.0130192873748471, -0.153416053618259, 1.13941460780379, -0.324240738373258, 0.927161755765431, 0.291155354617829, -2.00882995516827], + [1, -0.23246500469148, -0.93574525812581, -0.764715176489264, -0.0109466836258253, 1.34571913112435, -1.23068934593283, 0.39309131713129, 0.881619093157614, -0.0827222598618963, -0.484799605788969], + [1, 0.430942513411393, -0.98609259355006, 0.346067871256298, 1.27816871458544, 0.0928221819826228, -0.3159020943463, 0.247415085044322, 2.83676428129674, -0.11068808194393, 0.721637335037768], + [1, 0.054215041198201, -2.0052624563358, 0.574345140441132, -0.065058469206371, 0.413265623397563, 0.903715419833814, 2.06650594578707, -0.0904991194442989, 1.30663819768793, -0.103700263996474], + [1, 0.174138502121905, 0.0390420165009069, 0.926319797114362, 0.897104241150634, 0.917373487728238, -0.432622588479053, 0.284662226139789, -0.652520227993617, -3.3523787879692, -0.367888353130122], + [1, 1.32125628001809, 0.670371730083108, -1.13534175710701, -0.0538691628426288, -0.674219498972939, -1.38481505662384, -0.693136483713115, 0.564345959629042, -0.753116866475535, -0.684034164124921], + [1, 0.279914331642124, -0.193482734163494, 0.180706618570202, -1.81054811851185, -3.13840932128337, -0.783896768126824, -0.833445989249887, 0.305562632094674, 1.92889309513464, -0.064719706885086], + [1, 1.40867936311928, 0.238429624279532, -0.0500635954619509, -0.905952192287389, -1.65919090472707, -1.02724038090613, 0.681262398918784, 2.64330659744123, 0.424045021233715, -0.715634129540286], + [1, 0.941406618746418, 1.51757217547735, 0.220223587452199, 0.374604550044607, -0.343105439412146, -0.374763236509984, 1.03023465320332, -1.37438149000371, 0.175992113916487, -1.15480248921667], + [1, -0.2763369594895, -1.24438060433033, 0.18263248328062, -0.46251388106218, 1.03843145339976, -1.20580395717152, 0.731499997907573, 0.711217137971917, -1.80667966798524, -0.977391184228396], + [1, 1.21551928349672, -0.609724613443666, -1.54850000136067, 0.149895999391666, -0.166684742322438, -0.855020292453886, -0.331555602813729, -0.622084053647095, 0.634565744807361, -2.14465714412653], + [1, 0.6661823868262, -1.69026590325673, -1.94062000800588, 0.0892666628693018, -0.757338324150254, -0.0605086114267447, -1.10011331763199, -0.537774144270132, -0.799512231646917, 1.43244417140098], + [1, -0.704053864802352, 0.685048105109371, 1.04685965876802, 1.13379613332352, -0.519985724573071, -1.37226220679433, -0.638598258934938, -0.902660336174718, -1.49478403068052, -1.15080050084248], + [1, 0.949167822077244, -0.0100556671957269, 0.13319399252132, -0.237911892334965, -0.0533108796359583, -2.44500197758358, 1.19338525538027, -0.0930055087601342, -1.00025929265731, -1.37091967484703], + [1, 0.539443032892569, 1.4013986365938, -0.205717574888209, -0.311678168858149, -0.923828699055915, 1.37921188137432, -0.845408014240439, -0.327513800471698, 2.46055382538848, 0.26820408570001], + [1, -0.071500034635824, 0.868601181246126, -1.12232982652721, -0.572442593908615, 0.0549993582618317, 1.76539268769825, 0.319124087088491, -0.292554947866469, 1.45871145582883, 0.298855943052998], + [1, 1.0192909222211, -1.19475339620928, -1.72478674249267, -0.0512336370308222, -1.69760686470557, -0.665529070529627, 0.49170281027742, -0.380952437619937, -0.165828138237811, -0.945028403180406], + [1, -0.772191349737247, -1.86953391451262, -2.35938121798099, -0.523540853325813, 2.86743562614969, 1.46186434898063, 0.0803437265977739, -1.08654925541244, -0.468523809286446, 0.583048469981379], + [1, 1.62572439027096, 0.920379129649868, 0.0991482360676786, 0.81752651972207, -0.52060155931869, 0.458391663113698, 0.766627897903658, -0.18603835307064, 0.0615188649053259, 1.14174898169816], + [1, 2.9735351660946, -1.18949970892545, -0.278182175235481, -1.39048888436405, 0.302469014646316, 1.70279861250848, -2.31678427595799, -0.504832217447495, 1.33408537397886, 0.026271993100938], + [1, 0.617985010131547, -0.958864034048322, 0.557572083802879, -0.724731029686498, -0.771455319783641, 1.05138895711989, 0.694654024902981, -1.25739140098319, 0.256168324134188, -0.882952711082612], + [1, -0.594433564656849, -2.7424150037536, 0.0157682729655227, 0.982423271710257, -0.100868328417863, 0.454839263567001, 0.281942108875862, -0.242585783165969, 1.249733276818, 0.358072675679331], + [1, -0.685016885203487, 2.2289310068978, -0.86185563492336, 0.815098151908465, -0.304927830900123, -1.22948616406979, -1.21441175843125, 0.356608465492102, 1.78701014749603, -0.641868361113198], + [1, -0.93174529581385, -0.513587099084902, -0.0269863749317823, 1.6122824981209, 0.897575373454703, -0.742916391383227, -0.814917532614751, -1.67514372620534, 0.731760429151042, 0.301539259677518], + [1, -1.06102319447077, 0.980868299478053, 0.797943767209136, -1.67886199463522, -0.0166188104915912, -1.34074167150536, -0.581686924691082, -0.40673746022146, -1.6457298727351, 1.39776966720375], + [1, -1.22681036872071, 0.874276850552634, -1.22344714914758, 1.28747231390801, -0.848180446126733, 0.423381555393864, -0.379449993531234, 0.561563669135244, -0.567573901924166, 0.320306944383342], + [1, 1.72384693161568, 1.71227567711734, 0.616488674464164, -0.365915872703457, -0.202893215456775, -0.277104379421773, 1.30434288443977, -1.53719513472568, -0.437783673699505, -0.838597455828329], + [1, 1.24857988814068, 1.28405798840044, 0.745597582744067, 2.2055277523943, -0.311863139082538, 0.317224945782615, -0.361504293450591, 1.54773494947555, 0.43429831168519, 1.67400945494858], + [1, 0.622991355894054, 2.18360979295492, -0.151868121842804, -0.697173341814307, 0.656723504008724, -0.499248058753436, 1.28241543737285, -1.70510009464515, 1.36229058111949, -2.64173851391924], + [1, 1.7440571243546, 1.09100828752394, -0.616171281175043, -0.889760340344018, -1.06658716296151, 1.14580151164114, -0.208554064635252, 2.71453564346424, 2.53596215300568, -2.44179154566203], + [1, 1.46562808581244, 0.527936688226681, -1.9342316735701, -1.08386483552127, -1.16691679951044, 1.71489052915813, -0.83553464950798, 1.21624689641211, 0.289387992426018, -0.125513646258585], + [1, 0.832307893932855, -1.54162336082202, 1.04719809159679, 0.431744288073442, -0.855670497141331, -0.0598918324478254, 0.180170730326257, 1.07567207362478, 0.763791286743009, 0.285301372979319], + [1, -0.254205271337925, 1.67087620045011, 0.126169297651628, -0.583069397107438, 0.183880700658541, -1.11837174621111, 0.512885189315319, 1.42609845362828, -0.47673713094056, -0.926844018627319], + [1, -0.851729472840558, -1.71463610343865, -0.435884209867197, -0.369560179785526, 0.92520745606878, -0.608871255255275, 0.577826215733377, -1.34861656051479, -1.34433624601916, 0.445933636069723], + [1, 1.06320768117474, -2.94476215882639, 1.24005465670033, -0.648239025635442, -1.23964437190752, 0.128209065844127, -0.363211266141713, -1.58757717271111, 0.119638069318829, -0.301050002474611], + [1, 0.910556112359681, -0.083554651920782, 0.324687367113607, 0.70222691296944, -1.57700437876381, 0.100258352251323, 1.2029022067826, 0.776210969297849, -0.0319472682110684, -0.949691045699477], + [1, 0.857602167480099, -0.465484792579747, -0.139757304919371, -2.30866020763787, -0.934343463723923, 0.0919006855061881, -0.334749196787956, -0.324845330382352, 0.356176356347489, 0.806055566068221], + [1, -1.95754335092832, -1.74752690589908, 1.2120567663575, 0.407852667323362, 0.636381585367081, 0.165390765116054, 1.25942224210197, -0.464588675831031, 0.719105596023884, -0.829493775251677], + [1, 0.946333755695818, 1.44829836755897, -0.519687796220638, -0.160851855260237, 1.62298284557284, -0.895821098533779, -0.50016408694099, 1.19752506115094, -0.208730063378244, 0.0842989540354514], + [1, 0.6323430988869, -0.139768114526439, 0.109862457836965, 2.10072418515972, -1.9505812486882, 0.319703431469498, -0.191100256479763, -1.40386396174594, -0.397988681457209, 0.935007577162168], + [1, 0.294156343846853, -0.154952908242528, -0.382704055872224, -0.541972766389671, 1.86089124931659, -0.671643454918016, -1.58499481296224, -1.91976276222937, 0.545430613035819, -0.36342044928044], + [1, -0.457188522402376, -0.911922082888691, -1.39889206519774, -0.57065817736795, -0.0802357640306753, 0.277842873366708, 1.01035719252356, 0.637253016289396, 1.08750070180708, -0.800018105854152], + [1, -1.18504080299351, 1.3922287321666, -1.40094819297178, -1.67789465360522, -1.8067196254632, -0.489553687733284, 1.30110174404215, -0.186721847967028, -0.985169676952754, 1.67635523931807], + [1, -0.239442798935616, -0.543628269402737, 0.543940233665197, 0.970330052482172, -2.59080923243975, 1.51267148282876, -0.485443044219321, -0.93857064595718, 0.0613058414469995, -0.210713362131902], + [1, 0.813435409004093, 0.114686282883398, -0.181744696145154, 0.541295854675902, -0.0811830755645316, 0.362169737863775, 0.441521791685085, 0.379463293016508, 0.721521959315662, -1.70528321526329], + [1, 1.16314864102657, -0.196662844326625, 1.50834412418208, -0.883827176927362, -1.61519745421633, -1.0050583991328, 0.125084201731331, -1.59004515402881, 0.125153814741461, 0.0857655955180478], + [1, 1.17763006382269, -1.41754321175357, 1.91551023733204, -0.17970728434159, -1.84458637910624, 1.70761200676068, 0.435673365928597, 1.1098722300488, -0.192263719658434, -0.0958716067999993], + [1, 0.964195485614609, -1.01350190242624, 0.866626770515173, 1.59275231249526, 1.15879294556737, 0.291810280117282, 0.0675235177226824, 0.303110276619267, 0.122349139494617, -0.88465944715105], + [1, 0.105492561582905, 0.287688804133854, -0.363256133364127, -0.725217399645063, -0.273851606257593, 0.333551189240453, -1.41835534343045, 1.33568416935654, -0.958288676150145, -0.00666813729509956], + [1, -0.00836699303779103, -0.832259436872436, 0.0526880100300545, 0.377481614009765, -0.894376492458382, 0.428093964699987, -1.33127039537081, -0.0411714489062496, 1.2781167292325, -1.15746196748581], + [1, 0.0329869313163281, 0.541410695450004, 0.927953633701019, -0.907664873986295, 1.50652716411878, 0.0688521793089391, -1.57997562471892, -0.525909404948635, 0.52485117192671, 0.203020836742145], + [1, -3.03320444561043, 0.695471439936616, -1.70940830089082, 0.415131096391543, 0.686348854756788, -1.79002534495956, 1.73854505940488, 0.0192763053142469, -0.833951374405899, -0.891692944826536], + [1, -0.364662925150715, -2.03601705455446, 0.933949123408569, -0.177559612941962, 0.439858672779523, -0.296404530503252, 0.131624503559886, -0.308370183385204, 0.667396460525877, 0.0685286480013507], + [1, 0.126557302179385, 0.79314716133689, -1.34832751297425, -0.255651336419039, 0.365184078267454, -1.44764164468356, -0.265229392077413, -0.749091465527286, 0.166383053942407, -0.799915077378888], + [1, 0.347065078637917, 0.933957393105774, 0.484079542067548, -0.312629462332473, 0.0189248778066819, -0.218894830574129, -0.713474065047417, 0.181060741414565, 1.34558521760926, -1.2333758434492], + [1, -0.974777523999182, -1.33809758476099, -0.0331825473012523, 0.328082630552146, 0.550385558038093, 0.17904568306053, -0.198382304487168, -0.835406979306407, 0.317627393123512, -1.12619015506589], + [1, -0.378299280031317, 0.119221928789072, 2.31424142675311, 1.46213248259212, -0.965841022913396, 0.590208360044471, -1.18755109221121, 0.0553015859918287, -0.210286747997254, 0.55143139022252], + [1, 0.494538743827999, 2.00148333756039, -1.05272331111529, 0.553512490267574, 1.55446936499195, 0.386906430867153, -0.250147472896154, 0.10494239325998, -1.35403592970574, -0.6864070885241], + [1, 0.282464832513637, -0.515949104689266, -1.07374425194689, -0.270437145921856, -1.11731035580462, 0.448897977374213, -0.716968970164428, -1.55551671223087, 0.941238321778295, 0.588661253034898], + [1, -0.29830470090347, 1.11654236235935, 0.605312058497415, 0.516250944409965, 0.165140292780664, 0.330190220358494, -1.148809251639, 0.991440224331468, 0.91282921967257, 1.03532383944017], + [1, 1.40342110110382, -1.38429359334867, 1.08030318654749, -0.61209698441589, 0.724457512980305, 0.642221435899548, -1.42122523773506, -0.337163478148234, 0.365813218075333, 1.26505361074255], + [1, 0.206276241528266, 1.03489877245873, 1.99231452603605, 1.44819905364613, 1.30890273017244, -1.04163468919724, -1.45664583494124, 1.11960881671513, 1.68273910464464, -0.934025077665727], + [1, 0.515438732339433, -0.0396837073251049, 0.00327832768646913, -0.708150193935993, -1.86251594590771, 1.27807949305851, 0.0208842856557998, -0.967553287955973, -0.575864029465655, -2.54747074393897], + [1, 1.11309751082698, 0.603101971599917, 0.890217719132376, -0.766508545718192, -0.430915207649933, -0.441360469036284, -0.217241276375894, 0.568830621097512, 1.3248589497091, -0.13327892841878], + [1, 0.497153660805445, -1.0140267523321, -0.456423863967802, -0.53972096488992, -0.447224491297859, -0.374346151345123, 1.40643388570903, 0.00396811889236021, 0.35890750038754, 0.715462533950831], + [1, -1.48956984711657, 0.220347322721702, -0.306252219093865, 0.0690655123876552, 0.620346469834937, 0.590269411523247, 1.55763563602833, 0.0512552138962078, -1.12812112584259, -0.689749524143636], + [1, -1.44520521164319, -0.059375742709994, 1.09131428858736, -0.510037742417739, -0.167186044665083, -1.10556254090377, -0.648685581299723, -0.651832080685342, -0.149973265176038, -0.85874501684113], + [1, 0.387334276976964, -0.249996003835183, 0.464457525993265, -0.341236259670566, 0.894857007932241, 0.775689459980058, -0.195971177260196, 0.93624000501752, -0.791610857660875, 0.0140007963844446], + [1, 0.164778582868795, -0.301179153313668, 1.31653584382377, 0.248177997181912, 0.647627616198274, 0.824839460629916, 1.49884282371987, 1.58430567362831, 0.735220822232393, -0.435193298095985], + [1, -0.128687355931227, -1.21650932149279, -1.30003258615527, -0.603825589839314, -0.546307340447099, -0.355852618759634, -0.857762337199353, -0.526768671899652, -1.40592126060639, 0.140726615907902], + [1, -0.544215526351516, -1.44423334127816, 1.20488217620105, 0.819602730287243, -0.678854910733455, 1.09639264332386, 1.39291937697283, 1.34908034429438, -0.687582291142753, -2.25988515759247], + [1, -0.458310387629439, 1.90437290722641, -1.13472941213657, 1.99223076954596, 0.265727223352538, 0.0826359982112498, -0.395793868517914, 0.888625164329524, 1.00966690535976, 0.0124951328851664], + [1, 1.97506488985878, 0.479702169042656, 1.3911551666834, 1.4700726044014, -0.437205131577499, 0.420037605093624, -0.651878600368414, 0.743794939946617, 0.526574941383995, 2.10642634105022], + [1, -0.969000022621263, -0.158146114789921, -0.257305865718615, -1.01234842509858, -0.0242425272391981, -0.665661109887421, -0.0622312132670148, -0.336214103458952, 0.80990704726371, -0.882856275091842], + [1, 0.807684515377059, -1.55577376419868, 0.515497060761168, -0.568224392473773, -0.446583372905872, -0.173771825572818, -0.152622786612664, 1.07746487247325, -1.38589528506692, 1.11758777392677], + [1, -0.129392414258196, -0.242376155505216, 0.571019065309533, 0.690968237327693, -0.1362176280311, 1.40231102240312, 1.24316673653787, -0.394575406780636, 0.629504007502754, 0.355478004278143], + [1, 1.60947373567375, -0.0187086036743671, -0.288577525573997, 0.717289365998395, 0.0399359281547487, -2.01490609127668, 0.0942068811966433, -0.102389792358481, -0.445328387073121, -0.514652398362636], + [1, 0.527121294603182, 0.121490391607575, 0.658570490458951, 0.989351140725797, 0.539421415253902, 0.698304085901596, 1.61122043588052, 0.658800485095574, 0.534239156907802, 0.377977299122191], + [1, 0.4452119985412, 0.529608155864286, 0.77281663602855, -1.11214201350499, -2.1613779630881, -0.176878996448008, -0.147523537812676, 0.665954387295975, 0.0167989365028945, 1.29400730400034], + [1, -1.02146962214456, -0.603217471993787, 0.918308702269429, 0.0232308201420258, 1.04040089498828, -0.831240607846634, 0.0729458313817156, 0.47507778751106, 0.252706399746674, 1.11083175536758], + [1, -0.0812096129614166, -0.674629338479653, -0.284374298054888, -1.89523654048839, 0.980835255499087, 0.263960164422617, -0.603019202333611, -1.58379881495432, -0.702993634361998, 0.59537195382537], + [1, 0.110376876864517, 2.41475820853492, 1.76874425153429, 1.70122294376486, 0.602097856955606, 0.0279152421968999, -0.073861156050804, 0.170378689619987, 2.01308302757364, -1.10411398534537], + [1, 0.448367511165614, -0.724159666623, 0.53990164548151, 0.662067717573535, -0.0393696031318426, -0.813130790107685, -0.594916798965121, -0.789887895887962, -0.989952000524165, 0.0998763504224844], + [1, 0.825121664103146, -0.517452277737852, 0.049606435750488, 2.14670784094714, 1.30679570446241, 0.604956231884126, -1.54752585905179, 0.302535902222984, 1.43121121096538, -0.896715461465025], + [1, -0.27825626754638, -0.533830927823549, 0.250794824924444, 0.691742786303653, 1.15713036929534, -0.721269663678447, 0.686851484753666, -1.65138016004422, 0.492170018268772, -0.596849450514289], + [1, 1.39688125527035, 0.528449234883961, -2.31722898370417, -1.26719502164384, -0.224556152277395, 0.105062710690334, 0.382153089408943, -1.22517991745554, 0.691754075726225, 0.425643269608143], + [1, -0.237351886771058, -1.85394831889267, 0.200358115900863, -0.981664054585384, 0.175889028044767, -0.382336202450131, -0.643434019817887, 2.00870986065808, 0.256918180506941, -2.36262305597524], + [1, -0.529318490219205, 0.438061964694434, -1.81734078518517, -1.15805166228521, 0.0663544393273074, -0.436663409895623, -1.20398161186663, 0.740930763361864, 0.0112536614407309, 1.3985811609064], + [1, 0.472671476495609, 1.30045867427045, -0.150041254747449, 0.407531773062609, 1.43796451749051, -0.40078418678409, 0.692492739510137, -0.798008900567931, -1.00320525650958, -1.23626769416572], + [1, 1.22049240663511, 1.20813404160755, -0.24622420989221, 1.1086515728783, 0.898559303074782, 0.0536043362856301, 0.842233242391281, 1.22210779701609, -0.814195769242161, 1.11630447951609], + [1, -0.965257445673168, -0.047481153869649, 1.57511830528178, -0.683474450712688, -0.904749066989008, -0.335928108153616, -0.021920564543543, -0.705468250992219, 0.536189814633443, -0.276648618977016], + [1, 0.718269290686733, -0.214902457716818, 1.27376337296086, 1.02726127473626, 0.673759051981924, 1.25098816408897, -0.375695042840962, -0.223297602598856, -1.37371450696495, 0.245503235586709], + [1, -0.209369945482088, -0.728824679142889, -0.782094969358559, -0.0587614128143404, -0.888708562685066, -0.907194112288071, 0.711828474511327, 0.00466421974643661, 0.657975588603074, -2.71131089488369], + [1, -1.68492229620007, 0.772455331035215, 0.867622819784422, 0.697641983212409, -2.59021740272475, 2.61038078476183, -0.39233994498129, 1.34789021478449, -0.815170904572862, -0.204304415019444], + [1, -0.0590078641386063, 2.48081817213988, 0.526271908487527, -0.142464285887121, -1.01374363630891, -1.32741858565753, -0.681008267906583, -0.768210387055366, 1.20718330797207, 0.254121146193514], + [1, 0.20376374138827, 0.825545064859602, -2.37014550962822, 1.75747496603335, -2.01220846889239, -2.33408381941292, -0.639402644595167, 0.109046676927305, -0.418596602083343, -0.929357579406989], + [1, -0.103298579714125, 1.17591197197134, -1.68701956951567, 1.14338343434381, 0.0363797242188741, 0.358482862995611, -2.39220181307776, 2.36816834451168, -0.928534158615621, -1.34070206904713], + [1, -0.213475991371015, -0.46437866877145, 0.206801988380831, -1.23735708273969, 0.233069713358913, -0.739530703794736, -1.63961344899258, 0.487619052762103, 0.134147842771844, 2.08872489262045], + [1, -0.237728329035281, -0.846357176246362, 0.642503569756369, 0.782842968196887, -1.34159473979426, -0.678201918207699, 0.457133809251128, -2.2641763242146, 0.772048996363028, -0.742662068619056], + [1, 0.412511898072628, 1.32366413553859, -0.11786573209627, 1.56825736518984, 0.306885220482159, -0.412782276766588, 0.318629168517501, -1.34081884014424, -0.658347228499231, -0.311381157211186], + [1, 0.26255110117525, -1.43726790421629, -0.979245349212138, 1.1472355283525, -0.238596476070984, 1.16876515073237, -1.08601322865289, -0.70623843000754, 0.209413204474829, 0.000718980974820996], + [1, -0.746353408990687, 0.583536381473618, -0.505384816782853, 0.755848105390344, 0.335547618632154, 0.70390666399325, 0.173745803153996, 0.590160535328142, -1.50755023947039, -1.0215983422305], + [1, -0.163344442761733, 0.117365091709443, 0.439932313623542, -0.56604175541074, -0.0751018139278303, -0.592411318838365, -0.729979822669873, 0.655924848192296, -1.89654675072656, -0.386367229536947], + [1, 2.38593905900221, -1.50041013435308, -0.637231325206092, -0.0314221120556773, -2.11991798353376, 0.882622236892356, 0.834088450723099, 0.111704804379263, 1.01173824553788, -0.393291679084293], + [1, -1.38778139798434, 1.11995596517927, 0.631586851978588, -1.44700670796213, -0.408580577926551, -0.348815863991371, -2.12817350185483, 0.907218845946617, 1.06946637700931, 1.73991143155535], + [1, 0.702301138898146, -0.391083916419514, -1.26648562195719, -1.64931993063618, 0.395145755377153, 2.23549965845505, 0.407921714592737, 0.408284188103623, -1.35283596235281, 0.167181776798374], + [1, 1.13081619830849, -1.2627187415195, -1.3520211221035, 0.316830563596552, 0.437170703174118, -0.0130782234401407, 0.207730006306799, -0.84395335970777, 1.3980861752687, 0.656306091020027], + [1, -0.778879506199033, -1.53184544124751, 0.914370722755252, 0.251462049442568, 0.324282530478496, 0.58352221949341, -2.68706644685499, 1.3972070395104, 0.363626752897855, 0.834579029396935], + [1, 1.21368830099368, -0.583681803498012, 0.171458298797048, 1.96142664934932, -0.226414301772486, -0.322387396865368, -0.910436826819747, -0.0008247094561625, -1.14536902018138, -0.415039303951965], + [1, 0.834063005583098, 0.902200926291631, -0.145654336480909, 1.33165525381989, 1.76343257143693, -0.509670140982833, -0.745449377659998, 0.597221715403932, 0.627128966161307, 0.248303912380544], + [1, 0.221315863080882, -0.922536172021043, 1.53198812011363, -1.06511025738801, -0.245814617037542, -2.10554949813191, 1.23299932442097, -0.147196738852832, 0.153287859941715, 1.08862045729878], + [1, -0.88998468855992, 0.645636841154643, 0.630306213180128, 0.416511906504452, 1.01092763033562, 1.5193297689942, -0.479171409437998, -0.141800593850717, -1.26009360464599, -0.876663861113166], + [1, 0.667190097153623, 0.54165037217532, 0.547278194170927, -0.205911968752298, -0.0572968761137578, -0.235427681411323, 0.867136043182857, 1.5358576153415, -0.288222649285574, -0.55378892413261], + [1, 0.516138071670446, -0.885240692159938, 0.170200730254245, 0.890515093922139, 0.190772710521098, 1.08027296143088, -0.602309850761325, -0.59890418824874, 1.8371794661745, -0.418274457995483], + [1, 0.648899605073196, 0.885466729031407, 0.0605384081510611, 0.420994275890952, 0.605705789750557, -0.495267193232288, -1.17927411591461, -0.879023747377212, 2.85621812015739, -1.42508799557892], + [1, 0.693653682358234, -0.372427592839556, 0.0636776137471783, 1.82874542721073, 0.130632161210927, -1.16129265848742, 1.73585993123616, -1.30682168717905, -0.299530023180281, 0.295512337319828], + [1, -1.8735541830099, -0.0695718540206667, 0.866295569448035, -0.679785807217032, 0.0275869723485229, -0.179963563951892, 0.6889154607863, -0.624606816929714, 0.692373668247422, 0.56339090338052], + [1, -1.73180768797382, 0.862273445542995, 0.867847034650347, -0.800207190855285, -0.498620730215513, 1.25067764657238, -1.21529756716038, -0.781750558849035, -1.29675529503271, -0.942918938100083], + [1, 0.421123584887627, -1.12181782931092, -1.00757457211965, 0.451425623241913, 1.07719797613661, 0.889574753751807, 0.0926264976901534, 0.14472072823686, 0.378590556908429, 0.222495133213569], + [1, 1.00965484327849, 1.28504178394656, -0.621336955831796, -0.611912602733629, 0.827665135396787, 0.489708937513227, -0.341405101711432, 0.444198250586928, -0.883396914013108, 1.12223178807264], + [1, -2.37565513152811, -0.489871848987026, 0.310168915801165, -0.712236356498569, -1.21922342453499, 0.0865409666133056, -1.32891382281543, -1.7195240218047, 1.13064659514944, 1.4919446940026], + [1, -0.105219097714593, 1.52846085311843, 0.651836359352243, 0.195321497445668, 0.239423570898547, -0.644399186140423, -0.00818908863580715, 0.423153617383867, -0.780131904911149, -0.872214420893613], + [1, 0.49850039148782, 0.19605316592762, 0.231160889615635, -0.415619035398341, 1.32303548160389, -0.0304166406722172, -0.829144743811355, 0.248822986747802, -0.0633209667617982, -1.12469595243983], + [1, 0.802441524954512, -0.551953059844806, -1.22574852353819, -2.51715055168043, 0.599243144624066, -0.251839757926003, -0.183678362703344, -0.21392582273683, -0.748666186956258, 1.87897862468052], + [1, -1.99255748041697, -0.159703157602388, 2.69019440788199, -0.11211837920953, 0.215333368793776, -0.875013250269436, 0.923196996206639, 0.561301406175048, -1.25346181746125, -0.0375637692066811], + [1, -0.702745591957903, -0.0651234988745126, -0.696092244696305, 1.19680949473656, -0.0439294523573796, 0.455335668248792, 0.358928975009762, 1.60570216304396, 1.40565299933258, -0.904345523546809], + [1, 0.379894480629561, 0.452913853797053, -0.415680745052475, -1.07033631854822, -0.149517167362454, 1.44011408993319, -1.92095298302295, -0.849323646110693, 0.389114021352288, 0.84798113758633], + [1, 2.08042938621585, 0.504741851083371, 0.157586794840594, 0.192604834131031, -0.908540752552747, 0.569735822567425, -0.468092416680777, 0.411212639515081, -1.46961874043417, -1.48347539004031], + [1, 0.257791519051102, 0.622768463900631, -1.1107316241956, 0.222774729530555, -0.514593291687584, 0.209637051890878, -0.475358459370414, 1.45683774154108, -0.254124160573491, 0.0660848591005551], + [1, -0.283732446994841, 0.816674011202948, -0.112426484135226, 0.172538897025755, 1.32751169574348, -0.0246710329055809, -2.04593246556492, -0.445309556402265, -0.0694877208593518, -3.08601697327639], + [1, -0.0190015555738483, 0.104778804464658, 0.553266052319703, -0.805974033676877, -0.0911419088371737, 1.7454435456204, -0.150145335852918, -1.24833764953502, 0.601445542038601, 1.28360988668305], + [1, -1.00553517385343, 1.08573489739494, -0.722453423729968, 2.68412340803426, 1.54204781627178, 1.88168251807946, 1.24406605919476, -0.908509146952982, 0.674833818306598, -0.353065726112611], + [1, -1.0896675272145, -0.528029862164413, 0.20962404178469, 0.5155673678897, -0.325929964199562, -1.18593310641456, 0.571160567645386, -1.67514197499712, -0.570682276506979, 1.91019592901482], + [1, 0.718223773378655, 0.0327688798603419, 0.0987110701573598, -0.400132870020175, -1.82065021951179, -0.0265262096663069, 0.431164210156002, 0.285379423298436, 0.822429871058678, 0.282552290158411], + [1, 1.4724712639388, 0.234106732065385, -0.109314669558112, 0.887775187771138, -0.40096812238335, -0.884016808297759, 0.327993611205178, -0.360940467038774, 1.39719386297545, 1.3213995423476], + [1, 1.08303460891901, -0.385317514391063, 0.474992452527201, 1.14207447316021, -0.0011562563940528, 0.26215171386988, -1.70953446832215, -0.0234578454826057, -1.16478094124291, 0.619136301149652], + [1, 0.730695477396637, -0.692302969793542, 0.657537618570311, -0.163631255640282, 0.487205248509283, -0.129348792353689, 0.408095329142076, -0.933366007630125, -0.664692347132072, -1.73100899266394], + [1, 0.460086859539689, -0.463083842825973, -0.26160531495232, -1.22812811572387, 2.25407832930624, 0.0661225471044981, -0.58980247182501, -0.251177472832379, 0.670408652687654, 0.57799168890036], + [1, -0.562587897936453, 0.390694169340507, -0.0804471507299054, -0.830847712256365, 0.207810772688773, -0.826352501093119, -0.814280183445037, -0.752041174804001, -0.00341753280133889, -0.375539210169388] + ], + "ids": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100], + "y": [0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1], + "N": 1000 +} diff --git a/src/test/test-models/performance/logistic.data.R b/src/test/test-models/performance/logistic.data.R deleted file mode 100644 index f5dd5907e4..0000000000 --- a/src/test/test-models/performance/logistic.data.R +++ /dev/null @@ -1,52 +0,0 @@ -N <- -128 -M <- -2 -y <- -c(0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, -1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, -1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, -1, 1, 0) -x <- -structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1.3297992629225, 1.2724293214294, 0.414641434456408, --1.53995004190371, -0.928567034713538, -0.29472044679056, -0.00576717274753696, -2.40465338885795, 0.76359346114046, -0.799009248989368, -1.14765700923635, --0.289461573688223, -0.299215117897316, -0.411510832795067, 0.252223448156132, --0.891921127284569, 0.435683299355719, -1.23753842192996, -0.224267885278309, -0.377395645981701, 0.133336360814841, 0.804189509744908, -0.0571067743838088, -0.503607972233726, 1.08576936214569, -0.69095383969683, -1.28459935387219, -0.046726172188352, -0.235706556439501, -0.542888255010254, -0.433310317456782, --0.649471646796233, 0.726750747385451, 1.1519117540872, 0.992160365445798, --0.429513109491881, 1.23830410085338, -0.279346281854269, 1.75790308981071, -0.560746090888056, -0.452783972553158, -0.832043296117832, -1.16657054708471, --1.0655905803883, -1.563782051071, 1.15653699715018, 0.83204712857239, --0.227328691424755, 0.266137361672105, -0.376702718583628, 2.44136462889459, --0.795339117255372, -0.0548774737115786, 0.250141322854153, 0.618243293566247, --0.172623502645857, -2.22390027400994, -1.26361438497058, 0.358728895971352, --0.0110454784656636, -0.940649162618608, -0.115825322156954, --0.814968708869917, 0.242263480859686, -1.4250983947325, 0.36594112304922, -0.248412648872596, 0.0652881816716207, 0.0191563916602738, 0.257338377155533, --0.649010077708898, -0.119168762418038, 0.66413569989411, 1.10096910219409, -0.14377148075807, -0.117753598165951, -0.912068366948338, -1.43758624082998, --0.797089525071965, 1.25408310644997, 0.77214218580453, -0.21951562675344, --0.424810283377287, -0.418980099421959, 0.996986860909106, -0.275778029088027, -1.2560188173061, 0.646674390495345, 1.29931230256343, -0.873262111744435, -0.00837095999603331, -0.880871723252545, 0.59625901661066, 0.119717641289537, --0.282173877322451, 1.45598840106634, 0.229019590694692, 0.996543928544126, -0.781859184600258, -0.776776621764597, -0.615989907707918, 0.0465803028049967, --1.13038577760069, 0.576718781896486, -1.28074943178832, 1.62544730346494, --0.500696596002705, 1.67829720781629, -0.412519887482398, -0.97228683550556, -0.0253828675878054, 0.0274753367451927, -1.68018272239593, 1.05375086302862, --1.11959910457218, 0.335617209968815, 0.494795767113158, 0.138052708711737, --0.118792025778828, 0.197684262345795, -1.06869271125479, -0.803213217364741, --1.11376513631953, 1.58009168370384, 1.49781876103841, 0.262645458662762, --1.23290119957126, -0.00372353379218051), .Dim = c(128L, 2L)) diff --git a/src/test/test-models/performance/logistic.data.json b/src/test/test-models/performance/logistic.data.json new file mode 100644 index 0000000000..592e89be51 --- /dev/null +++ b/src/test/test-models/performance/logistic.data.json @@ -0,0 +1,135 @@ +{ + "x": [ + [1, 1.3297992629225], + [1, 1.2724293214294], + [1, 0.414641434456408], + [1, -1.53995004190371], + [1, -0.928567034713538], + [1, -0.29472044679056], + [1, -0.00576717274753696], + [1, 2.40465338885795], + [1, 0.76359346114046], + [1, -0.799009248989368], + [1, -1.14765700923635], + [1, -0.289461573688223], + [1, -0.299215117897316], + [1, -0.411510832795067], + [1, 0.252223448156132], + [1, -0.891921127284569], + [1, 0.435683299355719], + [1, -1.23753842192996], + [1, -0.224267885278309], + [1, 0.377395645981701], + [1, 0.133336360814841], + [1, 0.804189509744908], + [1, -0.0571067743838088], + [1, 0.503607972233726], + [1, 1.08576936214569], + [1, -0.69095383969683], + [1, -1.28459935387219], + [1, 0.046726172188352], + [1, -0.235706556439501], + [1, -0.542888255010254], + [1, -0.433310317456782], + [1, -0.649471646796233], + [1, 0.726750747385451], + [1, 1.1519117540872], + [1, 0.992160365445798], + [1, -0.429513109491881], + [1, 1.23830410085338], + [1, -0.279346281854269], + [1, 1.75790308981071], + [1, 0.560746090888056], + [1, -0.452783972553158], + [1, -0.832043296117832], + [1, -1.16657054708471], + [1, -1.0655905803883], + [1, -1.563782051071], + [1, 1.15653699715018], + [1, 0.83204712857239], + [1, -0.227328691424755], + [1, 0.266137361672105], + [1, -0.376702718583628], + [1, 2.44136462889459], + [1, -0.795339117255372], + [1, -0.0548774737115786], + [1, 0.250141322854153], + [1, 0.618243293566247], + [1, -0.172623502645857], + [1, -2.22390027400994], + [1, -1.26361438497058], + [1, 0.358728895971352], + [1, -0.0110454784656636], + [1, -0.940649162618608], + [1, -0.115825322156954], + [1, -0.814968708869917], + [1, 0.242263480859686], + [1, -1.4250983947325], + [1, 0.36594112304922], + [1, 0.248412648872596], + [1, 0.0652881816716207], + [1, 0.0191563916602738], + [1, 0.257338377155533], + [1, -0.649010077708898], + [1, -0.119168762418038], + [1, 0.66413569989411], + [1, 1.10096910219409], + [1, 0.14377148075807], + [1, -0.117753598165951], + [1, -0.912068366948338], + [1, -1.43758624082998], + [1, -0.797089525071965], + [1, 1.25408310644997], + [1, 0.77214218580453], + [1, -0.21951562675344], + [1, -0.424810283377287], + [1, -0.418980099421959], + [1, 0.996986860909106], + [1, -0.275778029088027], + [1, 1.2560188173061], + [1, 0.646674390495345], + [1, 1.29931230256343], + [1, -0.873262111744435], + [1, 0.00837095999603331], + [1, -0.880871723252545], + [1, 0.59625901661066], + [1, 0.119717641289537], + [1, -0.282173877322451], + [1, 1.45598840106634], + [1, 0.229019590694692], + [1, 0.996543928544126], + [1, 0.781859184600258], + [1, -0.776776621764597], + [1, -0.615989907707918], + [1, 0.0465803028049967], + [1, -1.13038577760069], + [1, 0.576718781896486], + [1, -1.28074943178832], + [1, 1.62544730346494], + [1, -0.500696596002705], + [1, 1.67829720781629], + [1, -0.412519887482398], + [1, -0.97228683550556], + [1, 0.0253828675878054], + [1, 0.0274753367451927], + [1, -1.68018272239593], + [1, 1.05375086302862], + [1, -1.11959910457218], + [1, 0.335617209968815], + [1, 0.494795767113158], + [1, 0.138052708711737], + [1, -0.118792025778828], + [1, 0.197684262345795], + [1, -1.06869271125479], + [1, -0.803213217364741], + [1, -1.11376513631953], + [1, 1.58009168370384], + [1, 1.49781876103841], + [1, 0.262645458662762], + [1, -1.23290119957126], + [1, -0.00372353379218051] + ], + "y": [0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0], + "M": 2, + "N": 128 +} diff --git a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp index 629ff3ac5a..ff0a0c197e 100644 --- a/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/expl_leapfrog_test.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include @@ -23,10 +23,10 @@ class McmcHmcIntegratorsExplLeapfrogF : public testing::Test { diag_e_integrator() {} void SetUp() { - static const std::string DATA("mu <- 0.0\ny <- 0\n"); + static const std::string DATA("{\"mu\":0.0, \"y\":0}"); std::stringstream data_stream(DATA); // setup hamiltonian - stan::io::dump data_var_context(data_stream); + stan::json::json_data data_var_context(data_stream); model = new command_model_namespace::command_model(data_var_context); debug.str(""); diff --git a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp index 3944f0d5e2..1af9dceb16 100644 --- a/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp +++ b/src/test/unit/mcmc/hmc/integrators/impl_leapfrog_test.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -24,10 +24,10 @@ class McmcHmcIntegratorsImplLeapfrogF : public testing::Test { diag_e_integrator() {} void SetUp() { - static const std::string DATA("mu <- 0.0\ny <- 0\n"); + static const std::string DATA("{\"mu\":0.0, \"y\":0}"); std::stringstream data_stream(DATA); // setup hamiltonian - stan::io::dump data_var_context(data_stream); + stan::json::json_data data_var_context(data_stream); model = new command_model_namespace::command_model(data_var_context); debug.str(""); diff --git a/src/test/unit/services/sample/standalone_gqs_parallel_test.cpp b/src/test/unit/services/sample/standalone_gqs_parallel_test.cpp index b07cf79569..3dbe943bb8 100644 --- a/src/test/unit/services/sample/standalone_gqs_parallel_test.cpp +++ b/src/test/unit/services/sample/standalone_gqs_parallel_test.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -26,9 +26,9 @@ class ServicesStandaloneGQ : public ::testing::Test { ServicesStandaloneGQ() : data_var_context([]() { std::fstream data_stream( - "src/test/test-models/good/services/bernoulli.data.R", + "src/test/test-models/good/services/bernoulli.data.json", std::fstream::in); - stan::io::dump data_context(data_stream); + stan::json::json_data data_context(data_stream); data_stream.close(); return data_context; }()), @@ -36,7 +36,7 @@ class ServicesStandaloneGQ : public ::testing::Test { logger_ss(), logger(logger_ss, logger_ss, logger_ss, logger_ss, logger_ss), model(data_var_context) {} - stan::io::dump data_var_context; + stan::json::json_data data_var_context; stan::test::unit::instrumented_interrupt interrupt; std::stringstream logger_ss; stan::callbacks::stream_logger logger; diff --git a/src/test/unit/services/sample/standalone_gqs_test.cpp b/src/test/unit/services/sample/standalone_gqs_test.cpp index e730e298b3..da4bda0ca8 100644 --- a/src/test/unit/services/sample/standalone_gqs_test.cpp +++ b/src/test/unit/services/sample/standalone_gqs_test.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -19,9 +19,9 @@ class ServicesStandaloneGQ : public ::testing::Test { void SetUp() { std::fstream data_stream( - "src/test/test-models/good/services/bernoulli.data.R", + "src/test/test-models/good/services/bernoulli.data.json", std::fstream::in); - stan::io::dump data_var_context(data_stream); + stan::json::json_data data_var_context(data_stream); data_stream.close(); model = new stan_model(data_var_context); } diff --git a/src/test/unit/variational/gradient_warn_test.cpp b/src/test/unit/variational/gradient_warn_test.cpp index de9b476b26..d44e1a4d68 100644 --- a/src/test/unit/variational/gradient_warn_test.cpp +++ b/src/test/unit/variational/gradient_warn_test.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -20,9 +21,9 @@ class advi_test : public ::testing::Test { void SetUp() { std::fstream data_stream( - "src/test/test-models/good/variational/gradient_warn.data.R", + "src/test/test-models/good/variational/gradient_warn.data.json", std::fstream::in); - stan::io::dump data_var_context(data_stream); + stan::json::json_data data_var_context(data_stream); data_stream.close(); model_ = new stan_model(data_var_context, 0, &model_stream_); diff --git a/src/test/unit/variational/hier_logistic_cp_test.cpp b/src/test/unit/variational/hier_logistic_cp_test.cpp index 1c1fea788b..89f49ae18e 100644 --- a/src/test/unit/variational/hier_logistic_cp_test.cpp +++ b/src/test/unit/variational/hier_logistic_cp_test.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -14,9 +15,9 @@ typedef hier_logistic_cp_model_namespace::hier_logistic_cp_model Model_cp; TEST(advi_test, hier_logistic_cp_constraint_meanfield) { // Create mock data_var_context std::fstream data_stream( - "src/test/test-models/good/variational/hier_logistic.data.R", + "src/test/test-models/good/variational/hier_logistic.data.json", std::fstream::in); - stan::io::dump data_var_context(data_stream); + stan::json::json_data data_var_context(data_stream); data_stream.close(); std::stringstream output; diff --git a/src/test/unit/variational/hier_logistic_test.cpp b/src/test/unit/variational/hier_logistic_test.cpp index a469fba98e..cd6291c494 100644 --- a/src/test/unit/variational/hier_logistic_test.cpp +++ b/src/test/unit/variational/hier_logistic_test.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -19,9 +20,9 @@ class advi_test : public ::testing::Test { void SetUp() { // Create mock data_var_context std::fstream data_stream( - "src/test/test-models/good/variational/hier_logistic.data.R", + "src/test/test-models/good/variational/hier_logistic.data.json", std::fstream::in); - stan::io::dump data_var_context(data_stream); + stan::json::json_data data_var_context(data_stream); data_stream.close(); model_ = new stan_model(data_var_context, 0, &model_stream_); From dc8179d69c20b6183ac0a5833bb3cb2df3bed7d1 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Wed, 7 Feb 2024 16:30:01 -0500 Subject: [PATCH 24/93] Clean up ADVI tests --- src/test/unit/variational/advi_messages_test.cpp | 7 ++----- .../advi_multivar_no_constraint_test.cpp | 11 +++-------- .../advi_multivar_with_constraint_test.cpp | 11 +++-------- .../variational/advi_univar_no_constraint_test.cpp | 11 +++-------- .../advi_univar_with_constraint_test.cpp | 13 ++++--------- src/test/unit/variational/eta_adapt_big_test.cpp | 5 ++--- src/test/unit/variational/eta_adapt_fail_test.cpp | 5 ++--- src/test/unit/variational/eta_adapt_small_test.cpp | 5 ++--- 8 files changed, 21 insertions(+), 47 deletions(-) diff --git a/src/test/unit/variational/advi_messages_test.cpp b/src/test/unit/variational/advi_messages_test.cpp index 3371186cba..864bda14dd 100644 --- a/src/test/unit/variational/advi_messages_test.cpp +++ b/src/test/unit/variational/advi_messages_test.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -22,11 +23,7 @@ class advi_test : public ::testing::Test { = "Informational Message: The ELBO at a previous iteration is larger " "than the ELBO upon convergence!"; - // Create mock data_var_context - static const std::string DATA = ""; - std::stringstream data_stream(DATA); - stan::io::dump data_var_context(data_stream); - // data_stream.close(); + stan::io::empty_var_context data_var_context; model_ = new stan_model(data_var_context, 0, &model_stream_); cont_params_ = Eigen::VectorXd::Zero(model_->num_params_r()); diff --git a/src/test/unit/variational/advi_multivar_no_constraint_test.cpp b/src/test/unit/variational/advi_multivar_no_constraint_test.cpp index a0513690c7..0bcdb1a687 100644 --- a/src/test/unit/variational/advi_multivar_no_constraint_test.cpp +++ b/src/test/unit/variational/advi_multivar_no_constraint_test.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -11,10 +12,7 @@ typedef multivariate_no_constraint_model_namespace:: multivariate_no_constraint_model Model; TEST(advi_test, multivar_no_constraint_fullrank) { - // Create mock data_var_context - static const std::string DATA = ""; - std::stringstream data_stream(DATA); - stan::io::dump dummy_context(data_stream); + stan::io::empty_var_context dummy_context; // Instantiate model Model my_model(dummy_context); @@ -130,10 +128,7 @@ TEST(advi_test, multivar_no_constraint_fullrank) { } TEST(advi_test, multivar_no_constraint_meanfield) { - // Create mock data_var_context - static const std::string DATA = ""; - std::stringstream data_stream(DATA); - stan::io::dump dummy_context(data_stream); + stan::io::empty_var_context dummy_context; // Instantiate model Model my_model(dummy_context); diff --git a/src/test/unit/variational/advi_multivar_with_constraint_test.cpp b/src/test/unit/variational/advi_multivar_with_constraint_test.cpp index ae6bcf6d88..622a8a0aee 100644 --- a/src/test/unit/variational/advi_multivar_with_constraint_test.cpp +++ b/src/test/unit/variational/advi_multivar_with_constraint_test.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -11,10 +12,7 @@ typedef multivariate_with_constraint_model_namespace:: multivariate_with_constraint_model Model; TEST(advi_test, multivar_with_constraint_fullrank) { - // Create mock data_var_context - static const std::string DATA = ""; - std::stringstream data_stream(DATA); - stan::io::dump dummy_context(data_stream); + stan::io::empty_var_context dummy_context; // Instantiate model Model my_model(dummy_context); @@ -69,10 +67,7 @@ TEST(advi_test, multivar_with_constraint_fullrank) { } TEST(advi_test, multivar_with_constraint_meanfield) { - // Create mock data_var_context - static const std::string DATA = ""; - std::stringstream data_stream(DATA); - stan::io::dump dummy_context(data_stream); + stan::io::empty_var_context dummy_context; // Instantiate model Model my_model(dummy_context); diff --git a/src/test/unit/variational/advi_univar_no_constraint_test.cpp b/src/test/unit/variational/advi_univar_no_constraint_test.cpp index ef8d5fd1dc..645944b986 100644 --- a/src/test/unit/variational/advi_univar_no_constraint_test.cpp +++ b/src/test/unit/variational/advi_univar_no_constraint_test.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -12,10 +13,7 @@ typedef univariate_no_constraint_model_namespace::univariate_no_constraint_model Model; TEST(advi_test, univar_no_constraint_fullrank) { - // Create mock data_var_context - static const std::string DATA = ""; - std::stringstream data_stream(DATA); - stan::io::dump dummy_context(data_stream); + stan::io::empty_var_context dummy_context; // Instantiate model Model my_model(dummy_context); @@ -137,10 +135,7 @@ TEST(advi_test, univar_no_constraint_fullrank) { } TEST(advi_test, univar_no_constraint_meanfield) { - // Create mock data_var_context - static const std::string DATA = ""; - std::stringstream data_stream(DATA); - stan::io::dump dummy_context(data_stream); + stan::io::empty_var_context dummy_context; // Instantiate model Model my_model(dummy_context); diff --git a/src/test/unit/variational/advi_univar_with_constraint_test.cpp b/src/test/unit/variational/advi_univar_with_constraint_test.cpp index d28844a01f..cfd437ee21 100644 --- a/src/test/unit/variational/advi_univar_with_constraint_test.cpp +++ b/src/test/unit/variational/advi_univar_with_constraint_test.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -12,10 +13,7 @@ typedef univariate_with_constraint_model_namespace:: univariate_with_constraint_model Model; TEST(advi_test, univar_with_constraint_fullrank) { - // Create mock data_var_context - static const std::string DATA = ""; - std::stringstream data_stream(DATA); - stan::io::dump dummy_context(data_stream); + stan::io::empty_var_context dummy_context; // Instantiate model Model my_model(dummy_context); @@ -142,11 +140,8 @@ TEST(advi_test, univar_with_constraint_fullrank) { } TEST(advi_test, univar_with_constraint_meanfield) { - // Create mock data_var_context - static const std::string DATA = ""; - std::stringstream data_stream(DATA); - stan::io::dump dummy_context(data_stream); - + stan::io::empty_var_context dummy_context; + // Instantiate model Model my_model(dummy_context); diff --git a/src/test/unit/variational/eta_adapt_big_test.cpp b/src/test/unit/variational/eta_adapt_big_test.cpp index 2d7f7a2ce5..632b984530 100644 --- a/src/test/unit/variational/eta_adapt_big_test.cpp +++ b/src/test/unit/variational/eta_adapt_big_test.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -15,9 +16,7 @@ class eta_adapt_big_test : public ::testing::Test { log_stream_) {} void SetUp() { - static const std::string DATA = ""; - std::stringstream data_stream(DATA); - stan::io::dump data_var_context(data_stream); + stan::io::empty_var_context data_var_context; model_ = new stan_model(data_var_context, 0, &model_stream_); cont_params_ = Eigen::VectorXd::Zero(model_->num_params_r()); diff --git a/src/test/unit/variational/eta_adapt_fail_test.cpp b/src/test/unit/variational/eta_adapt_fail_test.cpp index 84229f839c..aee3cba4cd 100644 --- a/src/test/unit/variational/eta_adapt_fail_test.cpp +++ b/src/test/unit/variational/eta_adapt_fail_test.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -15,9 +16,7 @@ class eta_should_fail_test : public ::testing::Test { log_stream_) {} void SetUp() { - static const std::string DATA = ""; - std::stringstream data_stream(DATA); - stan::io::dump data_var_context(data_stream); + stan::io::empty_var_context data_var_context; model_ = new stan_model(data_var_context, 0, &model_stream_); cont_params_ = Eigen::VectorXd::Zero(model_->num_params_r()); diff --git a/src/test/unit/variational/eta_adapt_small_test.cpp b/src/test/unit/variational/eta_adapt_small_test.cpp index 715d68c4c7..d52017b3dc 100644 --- a/src/test/unit/variational/eta_adapt_small_test.cpp +++ b/src/test/unit/variational/eta_adapt_small_test.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -16,9 +17,7 @@ class eta_adapt_small_test : public ::testing::Test { log_stream_) {} void SetUp() { - static const std::string DATA = ""; - std::stringstream data_stream(DATA); - stan::io::dump data_var_context(data_stream); + stan::io::empty_var_context data_var_context; model_ = new stan_model(data_var_context, 0, &model_stream_); cont_params_ = Eigen::VectorXd::Zero(model_->num_params_r()); From ba49cb058d00de494a539a970aa499cb522e133d Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Wed, 7 Feb 2024 16:30:30 -0500 Subject: [PATCH 25/93] Rewrite create_inv_metric helpers to avoid using io::dump --- src/stan/services/sample/hmc_nuts_dense_e.hpp | 6 +++--- .../sample/hmc_nuts_dense_e_adapt.hpp | 14 ++++++------- src/stan/services/sample/hmc_nuts_diag_e.hpp | 6 +++--- .../services/sample/hmc_nuts_diag_e_adapt.hpp | 14 ++++++------- .../services/sample/hmc_static_dense_e.hpp | 2 +- .../sample/hmc_static_dense_e_adapt.hpp | 2 +- .../services/sample/hmc_static_diag_e.hpp | 2 +- .../sample/hmc_static_diag_e_adapt.hpp | 2 +- .../util/create_unit_e_dense_inv_metric.hpp | 20 +++++++++---------- .../util/create_unit_e_diag_inv_metric.hpp | 15 +++++++------- .../sample/hmc_nuts_dense_inv_metric_test.cpp | 3 ++- .../sample/hmc_nuts_diag_inv_metric_test.cpp | 3 ++- .../hmc_static_dense_inv_metric_test.cpp | 3 ++- .../hmc_static_diag_inv_metric_test.cpp | 3 ++- .../unit/services/util/inv_metric_test.cpp | 13 ++++++------ 15 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/stan/services/sample/hmc_nuts_dense_e.hpp b/src/stan/services/sample/hmc_nuts_dense_e.hpp index bd20ad6c86..d76ebb0930 100644 --- a/src/stan/services/sample/hmc_nuts_dense_e.hpp +++ b/src/stan/services/sample/hmc_nuts_dense_e.hpp @@ -123,7 +123,7 @@ int hmc_nuts_dense_e(Model& model, const stan::io::var_context& init, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - stan::io::dump dmp + auto dmp = util::create_unit_e_dense_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; @@ -297,10 +297,10 @@ int hmc_nuts_dense_e(Model& model, size_t num_chains, max_depth, interrupt, logger, init_writer[0], sample_writer[0], diagnostic_writer[0]); } - std::vector> unit_e_metrics; + std::vector> unit_e_metrics; unit_e_metrics.reserve(num_chains); for (size_t i = 0; i < num_chains; ++i) { - unit_e_metrics.emplace_back(std::make_unique( + unit_e_metrics.emplace_back(std::make_unique( util::create_unit_e_dense_inv_metric(model.num_params_r()))); } return hmc_nuts_dense_e(model, num_chains, init, unit_e_metrics, random_seed, diff --git a/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp index 6ea6e38e10..b8c34b84b9 100644 --- a/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp @@ -206,8 +206,7 @@ int hmc_nuts_dense_e_adapt( callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer, callbacks::structured_writer& metric_writer) { - stan::io::dump dmp - = util::create_unit_e_dense_inv_metric(model.num_params_r()); + auto dmp = util::create_unit_e_dense_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; return hmc_nuts_dense_e_adapt( model, init, unit_e_metric, random_seed, chain, init_radius, num_warmup, @@ -259,8 +258,7 @@ int hmc_nuts_dense_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - stan::io::dump dmp - = util::create_unit_e_dense_inv_metric(model.num_params_r()); + auto dmp = util::create_unit_e_dense_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; callbacks::structured_writer dummy_metric_writer; return hmc_nuts_dense_e_adapt( @@ -543,10 +541,10 @@ int hmc_nuts_dense_e_adapt( std::vector& sample_writer, std::vector& diagnostic_writer, std::vector& metric_writer) { - std::vector> unit_e_metric; + std::vector> unit_e_metric; unit_e_metric.reserve(num_chains); for (size_t i = 0; i < num_chains; ++i) { - unit_e_metric.emplace_back(std::make_unique( + unit_e_metric.emplace_back(std::make_unique( util::create_unit_e_dense_inv_metric(model.num_params_r()))); } if (num_chains == 1) { @@ -623,10 +621,10 @@ int hmc_nuts_dense_e_adapt( std::vector& init_writer, std::vector& sample_writer, std::vector& diagnostic_writer) { - std::vector> unit_e_metric; + std::vector> unit_e_metric; unit_e_metric.reserve(num_chains); for (size_t i = 0; i < num_chains; ++i) { - unit_e_metric.emplace_back(std::make_unique( + unit_e_metric.emplace_back(std::make_unique( util::create_unit_e_dense_inv_metric(model.num_params_r()))); } std::vector dummy_metric_writer( diff --git a/src/stan/services/sample/hmc_nuts_diag_e.hpp b/src/stan/services/sample/hmc_nuts_diag_e.hpp index 321608bd0b..25a4b9aa9c 100644 --- a/src/stan/services/sample/hmc_nuts_diag_e.hpp +++ b/src/stan/services/sample/hmc_nuts_diag_e.hpp @@ -121,7 +121,7 @@ int hmc_nuts_diag_e(Model& model, const stan::io::var_context& init, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - stan::io::dump dmp + auto dmp = util::create_unit_e_diag_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; @@ -293,10 +293,10 @@ int hmc_nuts_diag_e(Model& model, size_t num_chains, max_depth, interrupt, logger, init_writer[0], sample_writer[0], diagnostic_writer[0]); } - std::vector> unit_e_metrics; + std::vector> unit_e_metrics; unit_e_metrics.reserve(num_chains); for (size_t i = 0; i < num_chains; ++i) { - unit_e_metrics.emplace_back(std::make_unique( + unit_e_metrics.emplace_back(std::make_unique( util::create_unit_e_diag_inv_metric(model.num_params_r()))); } return hmc_nuts_diag_e(model, num_chains, init, unit_e_metrics, random_seed, diff --git a/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp index 8f6abed49b..1f2167004f 100644 --- a/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp @@ -206,8 +206,7 @@ int hmc_nuts_diag_e_adapt( callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer, callbacks::structured_writer& metric_writer) { - stan::io::dump dmp - = util::create_unit_e_diag_inv_metric(model.num_params_r()); + auto dmp = util::create_unit_e_diag_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; return hmc_nuts_diag_e_adapt( model, init, unit_e_metric, random_seed, chain, init_radius, num_warmup, @@ -259,8 +258,7 @@ int hmc_nuts_diag_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - stan::io::dump dmp - = util::create_unit_e_diag_inv_metric(model.num_params_r()); + auto dmp = util::create_unit_e_diag_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; callbacks::structured_writer dummy_metric_writer; return hmc_nuts_diag_e_adapt( @@ -543,10 +541,10 @@ int hmc_nuts_diag_e_adapt( std::vector& sample_writer, std::vector& diagnostic_writer, std::vector& metric_writer) { - std::vector> unit_e_metric; + std::vector> unit_e_metric; unit_e_metric.reserve(num_chains); for (size_t i = 0; i < num_chains; ++i) { - unit_e_metric.emplace_back(std::make_unique( + unit_e_metric.emplace_back(std::make_unique( util::create_unit_e_diag_inv_metric(model.num_params_r()))); } if (num_chains == 1) { @@ -625,10 +623,10 @@ int hmc_nuts_diag_e_adapt( std::vector& init_writer, std::vector& sample_writer, std::vector& diagnostic_writer) { - std::vector> unit_e_metric; + std::vector> unit_e_metric; unit_e_metric.reserve(num_chains); for (size_t i = 0; i < num_chains; ++i) { - unit_e_metric.emplace_back(std::make_unique( + unit_e_metric.emplace_back(std::make_unique( util::create_unit_e_diag_inv_metric(model.num_params_r()))); } std::vector dummy_metric_writer( diff --git a/src/stan/services/sample/hmc_static_dense_e.hpp b/src/stan/services/sample/hmc_static_dense_e.hpp index 4d2ac82881..a47a39eb9d 100644 --- a/src/stan/services/sample/hmc_static_dense_e.hpp +++ b/src/stan/services/sample/hmc_static_dense_e.hpp @@ -116,7 +116,7 @@ int hmc_static_dense_e( double stepsize_jitter, double int_time, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - stan::io::dump dmp + auto dmp = util::create_unit_e_dense_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; diff --git a/src/stan/services/sample/hmc_static_dense_e_adapt.hpp b/src/stan/services/sample/hmc_static_dense_e_adapt.hpp index 709a875e59..f2c610141e 100644 --- a/src/stan/services/sample/hmc_static_dense_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_dense_e_adapt.hpp @@ -148,7 +148,7 @@ int hmc_static_dense_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - stan::io::dump dmp + auto dmp = util::create_unit_e_dense_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; diff --git a/src/stan/services/sample/hmc_static_diag_e.hpp b/src/stan/services/sample/hmc_static_diag_e.hpp index d478307744..23985e1ab0 100644 --- a/src/stan/services/sample/hmc_static_diag_e.hpp +++ b/src/stan/services/sample/hmc_static_diag_e.hpp @@ -121,7 +121,7 @@ int hmc_static_diag_e(Model& model, const stan::io::var_context& init, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - stan::io::dump dmp + auto dmp = util::create_unit_e_diag_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; diff --git a/src/stan/services/sample/hmc_static_diag_e_adapt.hpp b/src/stan/services/sample/hmc_static_diag_e_adapt.hpp index 86d0ee6acf..4687c60bb4 100644 --- a/src/stan/services/sample/hmc_static_diag_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_diag_e_adapt.hpp @@ -146,7 +146,7 @@ int hmc_static_diag_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - stan::io::dump dmp + auto dmp = util::create_unit_e_diag_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; diff --git a/src/stan/services/util/create_unit_e_dense_inv_metric.hpp b/src/stan/services/util/create_unit_e_dense_inv_metric.hpp index ee9afc670a..d8448ada2c 100644 --- a/src/stan/services/util/create_unit_e_dense_inv_metric.hpp +++ b/src/stan/services/util/create_unit_e_dense_inv_metric.hpp @@ -1,8 +1,7 @@ #ifndef STAN_SERVICES_UTIL_CREATE_UNIT_E_DENSE_INV_METRIC_HPP #define STAN_SERVICES_UTIL_CREATE_UNIT_E_DENSE_INV_METRIC_HPP -#include -#include +#include #include namespace stan { @@ -16,14 +15,15 @@ namespace util { * @param[in] num_params expected number of dense elements * @return var_context */ -inline stan::io::dump create_unit_e_dense_inv_metric(size_t num_params) { - auto num_params_str = std::to_string(num_params); - std::string dims("),.Dim=c(" + num_params_str + ", " + num_params_str + "))"); - Eigen::IOFormat RFmt(Eigen::StreamPrecision, Eigen::DontAlignCols, ", ", ",", - "", "", "inv_metric <- structure(c(", dims); - std::stringstream txt; - txt << Eigen::MatrixXd::Identity(num_params, num_params).format(RFmt); - return stan::io::dump(txt); +inline auto create_unit_e_dense_inv_metric(size_t num_params) { + std::vector names{"inv_metric"}; + std::vector vals(num_params * num_params, 0.0); + for (size_t i = 0; i < num_params; ++i) { + vals[i * num_params + i] = 1.0; + } + std::vector> dimss{{num_params, num_params}}; + + return stan::io::array_var_context(names, vals, dimss); } } // namespace util } // namespace services diff --git a/src/stan/services/util/create_unit_e_diag_inv_metric.hpp b/src/stan/services/util/create_unit_e_diag_inv_metric.hpp index e14a80e328..6db1d21147 100644 --- a/src/stan/services/util/create_unit_e_diag_inv_metric.hpp +++ b/src/stan/services/util/create_unit_e_diag_inv_metric.hpp @@ -1,7 +1,7 @@ #ifndef STAN_SERVICES_UTIL_CREATE_UNIT_E_DIAG_INV_METRIC_HPP #define STAN_SERVICES_UTIL_CREATE_UNIT_E_DIAG_INV_METRIC_HPP -#include +#include #include namespace stan { @@ -15,13 +15,12 @@ namespace util { * @param[in] num_params expected number of diagonal elements * @return var_context */ -inline stan::io::dump create_unit_e_diag_inv_metric(size_t num_params) { - std::string dims("),.Dim=c(" + std::to_string(num_params) + "))"); - Eigen::IOFormat RFmt(Eigen::StreamPrecision, Eigen::DontAlignCols, ", ", ",", - "", "", "inv_metric <- structure(c(", dims); - std::stringstream txt; - txt << Eigen::VectorXd::Ones(num_params).format(RFmt); - return stan::io::dump(txt); +inline auto create_unit_e_diag_inv_metric(size_t num_params) { + std::vector names{"inv_metric"}; + std::vector vals(num_params, 1.0); + std::vector> dimss{{num_params}}; + + return stan::io::array_var_context(names, vals, dimss); } } // namespace util } // namespace services diff --git a/src/test/unit/services/sample/hmc_nuts_dense_inv_metric_test.cpp b/src/test/unit/services/sample/hmc_nuts_dense_inv_metric_test.cpp index fa73c8ceb9..f721c06f3c 100644 --- a/src/test/unit/services/sample/hmc_nuts_dense_inv_metric_test.cpp +++ b/src/test/unit/services/sample/hmc_nuts_dense_inv_metric_test.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -46,7 +47,7 @@ TEST_F(ServicesSampleHmcNutsDenseEMassMatrix, ident_no_adapt) { interrupt, logger, init, parameter, diagnostic); EXPECT_EQ(0, return_code); - stan::io::dump dmp = stan::services::util::create_unit_e_dense_inv_metric(3); + auto dmp = stan::services::util::create_unit_e_dense_inv_metric(3); stan::io::var_context& inv_metric = dmp; std::vector dense_vals = inv_metric.vals_r("inv_metric"); // check returned Euclidean metric diff --git a/src/test/unit/services/sample/hmc_nuts_diag_inv_metric_test.cpp b/src/test/unit/services/sample/hmc_nuts_diag_inv_metric_test.cpp index bc52864570..d7681a401b 100644 --- a/src/test/unit/services/sample/hmc_nuts_diag_inv_metric_test.cpp +++ b/src/test/unit/services/sample/hmc_nuts_diag_inv_metric_test.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -46,7 +47,7 @@ TEST_F(ServicesSampleHmcNutsDiagEMassMatrix, unit_e_no_adapt) { interrupt, logger, init, parameter, diagnostic); EXPECT_EQ(0, return_code); - stan::io::dump dmp = stan::services::util::create_unit_e_diag_inv_metric(3); + auto dmp = stan::services::util::create_unit_e_diag_inv_metric(3); stan::io::var_context& inv_metric = dmp; std::vector diag_vals = inv_metric.vals_r("inv_metric"); stan::test::unit::check_adaptation(3, diag_vals, parameter, 0.2); diff --git a/src/test/unit/services/sample/hmc_static_dense_inv_metric_test.cpp b/src/test/unit/services/sample/hmc_static_dense_inv_metric_test.cpp index 76bcc6ad3a..fd6ff2be63 100644 --- a/src/test/unit/services/sample/hmc_static_dense_inv_metric_test.cpp +++ b/src/test/unit/services/sample/hmc_static_dense_inv_metric_test.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -47,7 +48,7 @@ TEST_F(ServicesSampleHmcStaticDenseEMassMatrix, unit_e_no_adapt) { interrupt, logger, init, parameter, diagnostic); EXPECT_EQ(0, return_code); - stan::io::dump dmp = stan::services::util::create_unit_e_dense_inv_metric(3); + auto dmp = stan::services::util::create_unit_e_dense_inv_metric(3); stan::io::var_context& inv_metric = dmp; std::vector dense_vals = inv_metric.vals_r("inv_metric"); // check returned Euclidean metric diff --git a/src/test/unit/services/sample/hmc_static_diag_inv_metric_test.cpp b/src/test/unit/services/sample/hmc_static_diag_inv_metric_test.cpp index e2aa616860..d67107d820 100644 --- a/src/test/unit/services/sample/hmc_static_diag_inv_metric_test.cpp +++ b/src/test/unit/services/sample/hmc_static_diag_inv_metric_test.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -46,7 +47,7 @@ TEST_F(ServicesSampleHmcStaticDiagEMassMatrix, unit_e_no_adapt) { interrupt, logger, init, parameter, diagnostic); EXPECT_EQ(0, return_code); - stan::io::dump dmp = stan::services::util::create_unit_e_diag_inv_metric(3); + auto dmp = stan::services::util::create_unit_e_diag_inv_metric(3); stan::io::var_context& inv_metric = dmp; std::vector diag_vals = inv_metric.vals_r("inv_metric"); // check returned Euclidean metric diff --git a/src/test/unit/services/util/inv_metric_test.cpp b/src/test/unit/services/util/inv_metric_test.cpp index 42affe333a..505f527ff5 100644 --- a/src/test/unit/services/util/inv_metric_test.cpp +++ b/src/test/unit/services/util/inv_metric_test.cpp @@ -1,8 +1,9 @@ #include +#include #include TEST(inv_metric, create_diag_sz1) { - stan::io::dump dmp = stan::services::util::create_unit_e_diag_inv_metric(1); + auto dmp = stan::services::util::create_unit_e_diag_inv_metric(1); stan::io::var_context& inv_inv_metric = dmp; std::vector diag_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(1, diag_vals.size()); @@ -10,14 +11,14 @@ TEST(inv_metric, create_diag_sz1) { } TEST(inv_metric, create_diag_sz0) { - stan::io::dump dmp = stan::services::util::create_unit_e_diag_inv_metric(0); + auto dmp = stan::services::util::create_unit_e_diag_inv_metric(0); stan::io::var_context& inv_inv_metric = dmp; std::vector diag_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(0, diag_vals.size()); } TEST(inv_metric, create_diag_sz100) { - stan::io::dump dmp = stan::services::util::create_unit_e_diag_inv_metric(100); + auto dmp = stan::services::util::create_unit_e_diag_inv_metric(100); stan::io::var_context& inv_inv_metric = dmp; std::vector diag_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(100, diag_vals.size()); @@ -26,7 +27,7 @@ TEST(inv_metric, create_diag_sz100) { } TEST(inv_metric, create_dense_sz2) { - stan::io::dump dmp = stan::services::util::create_unit_e_dense_inv_metric(2); + auto dmp = stan::services::util::create_unit_e_dense_inv_metric(2); stan::io::var_context& inv_inv_metric = dmp; std::vector dense_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(4, dense_vals.size()); @@ -35,7 +36,7 @@ TEST(inv_metric, create_dense_sz2) { } TEST(inv_metric, create_dense_sz3) { - stan::io::dump dmp = stan::services::util::create_unit_e_dense_inv_metric(3); + auto dmp = stan::services::util::create_unit_e_dense_inv_metric(3); stan::io::var_context& inv_inv_metric = dmp; std::vector dense_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(9, dense_vals.size()); @@ -51,7 +52,7 @@ TEST(inv_metric, create_dense_sz3) { } TEST(inv_metric, create_dense_sz10) { - stan::io::dump dmp = stan::services::util::create_unit_e_dense_inv_metric(10); + auto dmp = stan::services::util::create_unit_e_dense_inv_metric(10); stan::io::var_context& inv_inv_metric = dmp; std::vector dense_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(100, dense_vals.size()); From cc2e030f32d33e8245811385d84ff8a9e4556437 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Wed, 7 Feb 2024 16:45:17 -0500 Subject: [PATCH 26/93] Remove from most remaining tests --- .../sample/hmc_nuts_dense_inv_metric_test.cpp | 37 +++++++++++-------- .../sample/hmc_nuts_diag_inv_metric_test.cpp | 12 +++--- .../hmc_static_dense_inv_metric_test.cpp | 36 ++++++++++-------- .../hmc_static_diag_inv_metric_test.cpp | 12 +++--- 4 files changed, 53 insertions(+), 44 deletions(-) diff --git a/src/test/unit/services/sample/hmc_nuts_dense_inv_metric_test.cpp b/src/test/unit/services/sample/hmc_nuts_dense_inv_metric_test.cpp index f721c06f3c..cae4bb7c19 100644 --- a/src/test/unit/services/sample/hmc_nuts_dense_inv_metric_test.cpp +++ b/src/test/unit/services/sample/hmc_nuts_dense_inv_metric_test.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -100,14 +100,18 @@ TEST_F(ServicesSampleHmcNutsDenseEMassMatrix, use_metric_no_adapt) { stan::test::unit::instrumented_interrupt interrupt; EXPECT_EQ(interrupt.call_count(), 0); - std::string txt - = "inv_metric <- structure(c(" - "0.640211, 0.156096, -0.374048, " - "0.156096, 1.41239, -0.0412753, " - "-0.374048, -0.0412753, 1.29567 " - "), .Dim = c(3,3))"; + std::string txt = R"json( +{ + "inv_metric": [ + [0.640211, 0.156096, -0.374048], + [0.156096, 1.41239, -0.0412753], + [-0.374048, -0.0412753, 1.29567] + ] +} +)json"; + std::stringstream in(txt); - stan::io::dump dump(in); + stan::json::json_data dump(in); stan::io::var_context& inv_metric = dump; int return_code = stan::services::sample::hmc_nuts_dense_e( @@ -143,14 +147,17 @@ TEST_F(ServicesSampleHmcNutsDenseEMassMatrix, use_metric_skip_adapt) { stan::test::unit::instrumented_interrupt interrupt; EXPECT_EQ(interrupt.call_count(), 0); - std::string txt - = "inv_metric <- structure(c(" - "0.640211, 0.156096, -0.374048, " - "0.156096, 1.41239, -0.0412753, " - "-0.374048, -0.0412753, 1.29567 " - "), .Dim = c(3,3))"; + std::string txt = R"json( +{ + "inv_metric": [ + [0.640211, 0.156096, -0.374048], + [0.156096, 1.41239, -0.0412753], + [-0.374048, -0.0412753, 1.29567] + ] +} +)json"; std::stringstream in(txt); - stan::io::dump dump(in); + stan::json::json_data dump(in); stan::io::var_context& inv_metric = dump; int return_code = stan::services::sample::hmc_nuts_dense_e_adapt( diff --git a/src/test/unit/services/sample/hmc_nuts_diag_inv_metric_test.cpp b/src/test/unit/services/sample/hmc_nuts_diag_inv_metric_test.cpp index d7681a401b..053ba7e45e 100644 --- a/src/test/unit/services/sample/hmc_nuts_diag_inv_metric_test.cpp +++ b/src/test/unit/services/sample/hmc_nuts_diag_inv_metric_test.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -99,10 +99,9 @@ TEST_F(ServicesSampleHmcNutsDiagEMassMatrix, use_metric_no_adapt) { stan::test::unit::instrumented_interrupt interrupt; EXPECT_EQ(interrupt.call_count(), 0); - std::string txt - = "inv_metric <- structure(c(0.787405, 0.884987, 1.19869),.Dim=c(3))"; + std::string txt = R"json({"inv_metric" : [0.787405, 0.884987, 1.19869]})json"; std::stringstream in(txt); - stan::io::dump dump(in); + stan::json::json_data dump(in); stan::io::var_context& inv_metric = dump; int return_code = stan::services::sample::hmc_nuts_diag_e( @@ -141,10 +140,9 @@ TEST_F(ServicesSampleHmcNutsDiagEMassMatrix, use_metric_skip_adapt) { stan::test::unit::instrumented_interrupt interrupt; EXPECT_EQ(interrupt.call_count(), 0); - std::string txt - = "inv_metric <- structure(c(0.787405, 0.884987, 1.19869),.Dim=c(3))"; + std::string txt = R"json({"inv_metric":[0.787405, 0.884987, 1.19869]})json"; std::stringstream in(txt); - stan::io::dump dump(in); + stan::json::json_data dump(in); stan::io::var_context& inv_metric = dump; int return_code = stan::services::sample::hmc_nuts_diag_e_adapt( diff --git a/src/test/unit/services/sample/hmc_static_dense_inv_metric_test.cpp b/src/test/unit/services/sample/hmc_static_dense_inv_metric_test.cpp index fd6ff2be63..f29b2a40b9 100644 --- a/src/test/unit/services/sample/hmc_static_dense_inv_metric_test.cpp +++ b/src/test/unit/services/sample/hmc_static_dense_inv_metric_test.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -100,14 +100,17 @@ TEST_F(ServicesSampleHmcStaticDenseEMassMatrix, use_metric_no_adapt) { stan::test::unit::instrumented_interrupt interrupt; EXPECT_EQ(interrupt.call_count(), 0); - std::string txt - = "inv_metric <- structure(c(" - " 0.926739, 0.0734898, -0.12395, " - " 0.0734898, 0.876038, -0.051543, " - " -0.12395, -0.051543, 0.8274 " - "), .Dim = c(3,3))"; + std::string txt = R"json( +{ + "inv_metric": [ + [0.926739, 0.0734898, -0.12395], + [0.0734898, 0.876038, -0.051543], + [-0.12395, -0.051543, 0.8274] + ] +} +)json"; std::stringstream in(txt); - stan::io::dump dump(in); + stan::json::json_data dump(in); stan::io::var_context& inv_metric = dump; int return_code = stan::services::sample::hmc_static_dense_e( @@ -144,14 +147,17 @@ TEST_F(ServicesSampleHmcStaticDenseEMassMatrix, use_metric_skip_adapt) { stan::test::unit::instrumented_interrupt interrupt; EXPECT_EQ(interrupt.call_count(), 0); - std::string txt - = "inv_metric <- structure(c(" - " 0.926739, 0.0734898, -0.12395, " - " 0.0734898, 0.876038, -0.051543, " - " -0.12395, -0.051543, 0.8274 " - "), .Dim = c(3,3))"; + std::string txt = R"json( +{ + "inv_metric": [ + [0.926739, 0.0734898, -0.12395], + [0.0734898, 0.876038, -0.051543], + [-0.12395, -0.051543, 0.8274] + ] +} +)json"; std::stringstream in(txt); - stan::io::dump dump(in); + stan::json::json_data dump(in); stan::io::var_context& inv_metric = dump; int return_code = stan::services::sample::hmc_static_dense_e_adapt( diff --git a/src/test/unit/services/sample/hmc_static_diag_inv_metric_test.cpp b/src/test/unit/services/sample/hmc_static_diag_inv_metric_test.cpp index d67107d820..311f9e3780 100644 --- a/src/test/unit/services/sample/hmc_static_diag_inv_metric_test.cpp +++ b/src/test/unit/services/sample/hmc_static_diag_inv_metric_test.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include @@ -99,10 +99,9 @@ TEST_F(ServicesSampleHmcStaticDiagEMassMatrix, use_metric_no_adapt) { stan::test::unit::instrumented_interrupt interrupt; EXPECT_EQ(interrupt.call_count(), 0); - std::string txt - = "inv_metric <- structure(c(0.787405, 0.884987, 1.19869),.Dim=c(3))"; + std::string txt = R"json({"inv_metric":[0.787405, 0.884987, 1.19869]})json"; std::stringstream in(txt); - stan::io::dump dump(in); + stan::json::json_data dump(in); stan::io::var_context& inv_metric = dump; int return_code = stan::services::sample::hmc_static_diag_e( @@ -139,10 +138,9 @@ TEST_F(ServicesSampleHmcStaticDiagEMassMatrix, use_metric_skip_adapt) { stan::test::unit::instrumented_interrupt interrupt; EXPECT_EQ(interrupt.call_count(), 0); - std::string txt - = "inv_metric <- structure(c(0.787405, 0.884987, 1.19869),.Dim=c(3))"; + std::string txt = R"json({"inv_metric":[0.787405, 0.884987, 1.19869]})json"; std::stringstream in(txt); - stan::io::dump dump(in); + stan::json::json_data dump(in); stan::io::var_context& inv_metric = dump; int return_code = stan::services::sample::hmc_static_diag_e_adapt( From d2504e80b64dde75c2e6e1be277f10c2648acf36 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Wed, 7 Feb 2024 16:52:26 -0500 Subject: [PATCH 27/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- src/stan/services/sample/hmc_nuts_dense_e.hpp | 3 +-- src/stan/services/sample/hmc_nuts_diag_e.hpp | 3 +-- src/stan/services/sample/hmc_static_dense_e.hpp | 3 +-- src/stan/services/sample/hmc_static_dense_e_adapt.hpp | 3 +-- src/stan/services/sample/hmc_static_diag_e.hpp | 3 +-- src/stan/services/sample/hmc_static_diag_e_adapt.hpp | 3 +-- src/test/unit/variational/advi_univar_with_constraint_test.cpp | 2 +- src/test/unit/variational/eta_adapt_big_test.cpp | 2 +- src/test/unit/variational/eta_adapt_fail_test.cpp | 2 +- 9 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/stan/services/sample/hmc_nuts_dense_e.hpp b/src/stan/services/sample/hmc_nuts_dense_e.hpp index d76ebb0930..5c793213e6 100644 --- a/src/stan/services/sample/hmc_nuts_dense_e.hpp +++ b/src/stan/services/sample/hmc_nuts_dense_e.hpp @@ -123,8 +123,7 @@ int hmc_nuts_dense_e(Model& model, const stan::io::var_context& init, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp - = util::create_unit_e_dense_inv_metric(model.num_params_r()); + auto dmp = util::create_unit_e_dense_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; return hmc_nuts_dense_e(model, init, unit_e_metric, random_seed, chain, diff --git a/src/stan/services/sample/hmc_nuts_diag_e.hpp b/src/stan/services/sample/hmc_nuts_diag_e.hpp index 25a4b9aa9c..d56c759235 100644 --- a/src/stan/services/sample/hmc_nuts_diag_e.hpp +++ b/src/stan/services/sample/hmc_nuts_diag_e.hpp @@ -121,8 +121,7 @@ int hmc_nuts_diag_e(Model& model, const stan::io::var_context& init, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp - = util::create_unit_e_diag_inv_metric(model.num_params_r()); + auto dmp = util::create_unit_e_diag_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; return hmc_nuts_diag_e(model, init, unit_e_metric, random_seed, chain, diff --git a/src/stan/services/sample/hmc_static_dense_e.hpp b/src/stan/services/sample/hmc_static_dense_e.hpp index a47a39eb9d..0fe07911d1 100644 --- a/src/stan/services/sample/hmc_static_dense_e.hpp +++ b/src/stan/services/sample/hmc_static_dense_e.hpp @@ -116,8 +116,7 @@ int hmc_static_dense_e( double stepsize_jitter, double int_time, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp - = util::create_unit_e_dense_inv_metric(model.num_params_r()); + auto dmp = util::create_unit_e_dense_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; return hmc_static_dense_e(model, init, unit_e_metric, random_seed, chain, diff --git a/src/stan/services/sample/hmc_static_dense_e_adapt.hpp b/src/stan/services/sample/hmc_static_dense_e_adapt.hpp index f2c610141e..677ca0750d 100644 --- a/src/stan/services/sample/hmc_static_dense_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_dense_e_adapt.hpp @@ -148,8 +148,7 @@ int hmc_static_dense_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp - = util::create_unit_e_dense_inv_metric(model.num_params_r()); + auto dmp = util::create_unit_e_dense_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; return hmc_static_dense_e_adapt( diff --git a/src/stan/services/sample/hmc_static_diag_e.hpp b/src/stan/services/sample/hmc_static_diag_e.hpp index 23985e1ab0..96d1387ef7 100644 --- a/src/stan/services/sample/hmc_static_diag_e.hpp +++ b/src/stan/services/sample/hmc_static_diag_e.hpp @@ -121,8 +121,7 @@ int hmc_static_diag_e(Model& model, const stan::io::var_context& init, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp - = util::create_unit_e_diag_inv_metric(model.num_params_r()); + auto dmp = util::create_unit_e_diag_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; return hmc_static_diag_e(model, init, unit_e_metric, random_seed, chain, diff --git a/src/stan/services/sample/hmc_static_diag_e_adapt.hpp b/src/stan/services/sample/hmc_static_diag_e_adapt.hpp index 4687c60bb4..4bf7c228b2 100644 --- a/src/stan/services/sample/hmc_static_diag_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_diag_e_adapt.hpp @@ -146,8 +146,7 @@ int hmc_static_diag_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp - = util::create_unit_e_diag_inv_metric(model.num_params_r()); + auto dmp = util::create_unit_e_diag_inv_metric(model.num_params_r()); stan::io::var_context& unit_e_metric = dmp; return hmc_static_diag_e_adapt( diff --git a/src/test/unit/variational/advi_univar_with_constraint_test.cpp b/src/test/unit/variational/advi_univar_with_constraint_test.cpp index cfd437ee21..3812ff4762 100644 --- a/src/test/unit/variational/advi_univar_with_constraint_test.cpp +++ b/src/test/unit/variational/advi_univar_with_constraint_test.cpp @@ -141,7 +141,7 @@ TEST(advi_test, univar_with_constraint_fullrank) { TEST(advi_test, univar_with_constraint_meanfield) { stan::io::empty_var_context dummy_context; - + // Instantiate model Model my_model(dummy_context); diff --git a/src/test/unit/variational/eta_adapt_big_test.cpp b/src/test/unit/variational/eta_adapt_big_test.cpp index 632b984530..170d5d7054 100644 --- a/src/test/unit/variational/eta_adapt_big_test.cpp +++ b/src/test/unit/variational/eta_adapt_big_test.cpp @@ -16,7 +16,7 @@ class eta_adapt_big_test : public ::testing::Test { log_stream_) {} void SetUp() { - stan::io::empty_var_context data_var_context; + stan::io::empty_var_context data_var_context; model_ = new stan_model(data_var_context, 0, &model_stream_); cont_params_ = Eigen::VectorXd::Zero(model_->num_params_r()); diff --git a/src/test/unit/variational/eta_adapt_fail_test.cpp b/src/test/unit/variational/eta_adapt_fail_test.cpp index aee3cba4cd..587a8acf1b 100644 --- a/src/test/unit/variational/eta_adapt_fail_test.cpp +++ b/src/test/unit/variational/eta_adapt_fail_test.cpp @@ -16,7 +16,7 @@ class eta_should_fail_test : public ::testing::Test { log_stream_) {} void SetUp() { - stan::io::empty_var_context data_var_context; + stan::io::empty_var_context data_var_context; model_ = new stan_model(data_var_context, 0, &model_stream_); cont_params_ = Eigen::VectorXd::Zero(model_->num_params_r()); From 9f98bdfc89667f6c3b4500fa1ce3d6b0c02a60ff Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Wed, 7 Feb 2024 21:07:27 -0500 Subject: [PATCH 28/93] Updates the Math submodule to c6254fbd45. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 8e4e4e6ffc..c6254fbd45 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 8e4e4e6ffcf643a47849f18da64bc98ea2a37331 +Subproject commit c6254fbd45662b94189fff04f58f3b2f748da428 From fa564009620920485c7ffe989bcec04a82c22266 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Thu, 8 Feb 2024 14:17:12 -0500 Subject: [PATCH 29/93] Better names than 'dmp' --- src/stan/services/sample/hmc_nuts_dense_e.hpp | 6 ++--- .../sample/hmc_nuts_dense_e_adapt.hpp | 10 ++++---- src/stan/services/sample/hmc_nuts_diag_e.hpp | 6 ++--- .../services/sample/hmc_nuts_diag_e_adapt.hpp | 12 +++++----- .../services/sample/hmc_static_dense_e.hpp | 6 ++--- .../sample/hmc_static_dense_e_adapt.hpp | 5 ++-- .../services/sample/hmc_static_diag_e.hpp | 5 ++-- .../sample/hmc_static_diag_e_adapt.hpp | 5 ++-- .../sample/hmc_nuts_dense_inv_metric_test.cpp | 10 ++++---- .../sample/hmc_nuts_diag_inv_metric_test.cpp | 10 ++++---- .../hmc_static_dense_inv_metric_test.cpp | 10 ++++---- .../hmc_static_diag_inv_metric_test.cpp | 10 ++++---- .../unit/services/util/inv_metric_test.cpp | 24 +++++++++---------- 13 files changed, 50 insertions(+), 69 deletions(-) diff --git a/src/stan/services/sample/hmc_nuts_dense_e.hpp b/src/stan/services/sample/hmc_nuts_dense_e.hpp index 5c793213e6..d582e1c6c6 100644 --- a/src/stan/services/sample/hmc_nuts_dense_e.hpp +++ b/src/stan/services/sample/hmc_nuts_dense_e.hpp @@ -123,10 +123,8 @@ int hmc_nuts_dense_e(Model& model, const stan::io::var_context& init, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp = util::create_unit_e_dense_inv_metric(model.num_params_r()); - stan::io::var_context& unit_e_metric = dmp; - - return hmc_nuts_dense_e(model, init, unit_e_metric, random_seed, chain, + auto default_metric = util::create_unit_e_dense_inv_metric(model.num_params_r()); + return hmc_nuts_dense_e(model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, interrupt, logger, init_writer, diff --git a/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp index b8c34b84b9..95bca2bff7 100644 --- a/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp @@ -206,10 +206,9 @@ int hmc_nuts_dense_e_adapt( callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer, callbacks::structured_writer& metric_writer) { - auto dmp = util::create_unit_e_dense_inv_metric(model.num_params_r()); - stan::io::var_context& unit_e_metric = dmp; + auto default_metric = util::create_unit_e_dense_inv_metric(model.num_params_r()); return hmc_nuts_dense_e_adapt( - model, init, unit_e_metric, random_seed, chain, init_radius, num_warmup, + model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, init_buffer, term_buffer, window, interrupt, logger, init_writer, sample_writer, diagnostic_writer, @@ -258,11 +257,10 @@ int hmc_nuts_dense_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp = util::create_unit_e_dense_inv_metric(model.num_params_r()); - stan::io::var_context& unit_e_metric = dmp; + auto default_metric = util::create_unit_e_dense_inv_metric(model.num_params_r()); callbacks::structured_writer dummy_metric_writer; return hmc_nuts_dense_e_adapt( - model, init, unit_e_metric, random_seed, chain, init_radius, num_warmup, + model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, init_buffer, term_buffer, window, interrupt, logger, init_writer, sample_writer, diagnostic_writer, diff --git a/src/stan/services/sample/hmc_nuts_diag_e.hpp b/src/stan/services/sample/hmc_nuts_diag_e.hpp index d56c759235..17f6f86428 100644 --- a/src/stan/services/sample/hmc_nuts_diag_e.hpp +++ b/src/stan/services/sample/hmc_nuts_diag_e.hpp @@ -121,10 +121,8 @@ int hmc_nuts_diag_e(Model& model, const stan::io::var_context& init, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp = util::create_unit_e_diag_inv_metric(model.num_params_r()); - stan::io::var_context& unit_e_metric = dmp; - - return hmc_nuts_diag_e(model, init, unit_e_metric, random_seed, chain, + auto default_metric = util::create_unit_e_diag_inv_metric(model.num_params_r()); + return hmc_nuts_diag_e(model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, interrupt, logger, init_writer, diff --git a/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp index 1f2167004f..1044d9ed53 100644 --- a/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp @@ -206,10 +206,10 @@ int hmc_nuts_diag_e_adapt( callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer, callbacks::structured_writer& metric_writer) { - auto dmp = util::create_unit_e_diag_inv_metric(model.num_params_r()); - stan::io::var_context& unit_e_metric = dmp; + auto default_metric + = util::create_unit_e_diag_inv_metric(model.num_params_r()); return hmc_nuts_diag_e_adapt( - model, init, unit_e_metric, random_seed, chain, init_radius, num_warmup, + model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, init_buffer, term_buffer, window, interrupt, logger, init_writer, sample_writer, diagnostic_writer, @@ -258,11 +258,11 @@ int hmc_nuts_diag_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp = util::create_unit_e_diag_inv_metric(model.num_params_r()); - stan::io::var_context& unit_e_metric = dmp; + auto default_metric + = util::create_unit_e_diag_inv_metric(model.num_params_r()); callbacks::structured_writer dummy_metric_writer; return hmc_nuts_diag_e_adapt( - model, init, unit_e_metric, random_seed, chain, init_radius, num_warmup, + model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, max_depth, delta, gamma, kappa, t0, init_buffer, term_buffer, window, interrupt, logger, init_writer, sample_writer, diagnostic_writer, diff --git a/src/stan/services/sample/hmc_static_dense_e.hpp b/src/stan/services/sample/hmc_static_dense_e.hpp index 0fe07911d1..962441912d 100644 --- a/src/stan/services/sample/hmc_static_dense_e.hpp +++ b/src/stan/services/sample/hmc_static_dense_e.hpp @@ -116,10 +116,8 @@ int hmc_static_dense_e( double stepsize_jitter, double int_time, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp = util::create_unit_e_dense_inv_metric(model.num_params_r()); - stan::io::var_context& unit_e_metric = dmp; - - return hmc_static_dense_e(model, init, unit_e_metric, random_seed, chain, + auto default_metric = util::create_unit_e_dense_inv_metric(model.num_params_r()); + return hmc_static_dense_e(model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, int_time, interrupt, logger, init_writer, diff --git a/src/stan/services/sample/hmc_static_dense_e_adapt.hpp b/src/stan/services/sample/hmc_static_dense_e_adapt.hpp index 677ca0750d..f1027ca837 100644 --- a/src/stan/services/sample/hmc_static_dense_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_dense_e_adapt.hpp @@ -148,11 +148,10 @@ int hmc_static_dense_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp = util::create_unit_e_dense_inv_metric(model.num_params_r()); - stan::io::var_context& unit_e_metric = dmp; + auto default_metric = util::create_unit_e_dense_inv_metric(model.num_params_r()); return hmc_static_dense_e_adapt( - model, init, unit_e_metric, random_seed, chain, init_radius, num_warmup, + model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, int_time, delta, gamma, kappa, t0, init_buffer, term_buffer, window, interrupt, logger, init_writer, sample_writer, diagnostic_writer); diff --git a/src/stan/services/sample/hmc_static_diag_e.hpp b/src/stan/services/sample/hmc_static_diag_e.hpp index 96d1387ef7..2c1733d2cc 100644 --- a/src/stan/services/sample/hmc_static_diag_e.hpp +++ b/src/stan/services/sample/hmc_static_diag_e.hpp @@ -121,10 +121,9 @@ int hmc_static_diag_e(Model& model, const stan::io::var_context& init, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp = util::create_unit_e_diag_inv_metric(model.num_params_r()); - stan::io::var_context& unit_e_metric = dmp; + auto default_metric = util::create_unit_e_diag_inv_metric(model.num_params_r()); - return hmc_static_diag_e(model, init, unit_e_metric, random_seed, chain, + return hmc_static_diag_e(model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, int_time, interrupt, logger, init_writer, diff --git a/src/stan/services/sample/hmc_static_diag_e_adapt.hpp b/src/stan/services/sample/hmc_static_diag_e_adapt.hpp index 4bf7c228b2..1b6c0b566c 100644 --- a/src/stan/services/sample/hmc_static_diag_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_diag_e_adapt.hpp @@ -146,11 +146,10 @@ int hmc_static_diag_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto dmp = util::create_unit_e_diag_inv_metric(model.num_params_r()); - stan::io::var_context& unit_e_metric = dmp; + auto default_metric = util::create_unit_e_diag_inv_metric(model.num_params_r()); return hmc_static_diag_e_adapt( - model, init, unit_e_metric, random_seed, chain, init_radius, num_warmup, + model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, int_time, delta, gamma, kappa, t0, init_buffer, term_buffer, window, interrupt, logger, init_writer, sample_writer, diagnostic_writer); diff --git a/src/test/unit/services/sample/hmc_nuts_dense_inv_metric_test.cpp b/src/test/unit/services/sample/hmc_nuts_dense_inv_metric_test.cpp index cae4bb7c19..0f7a3eb95f 100644 --- a/src/test/unit/services/sample/hmc_nuts_dense_inv_metric_test.cpp +++ b/src/test/unit/services/sample/hmc_nuts_dense_inv_metric_test.cpp @@ -47,8 +47,8 @@ TEST_F(ServicesSampleHmcNutsDenseEMassMatrix, ident_no_adapt) { interrupt, logger, init, parameter, diagnostic); EXPECT_EQ(0, return_code); - auto dmp = stan::services::util::create_unit_e_dense_inv_metric(3); - stan::io::var_context& inv_metric = dmp; + auto default_metric = stan::services::util::create_unit_e_dense_inv_metric(3); + stan::io::var_context& inv_metric = default_metric; std::vector dense_vals = inv_metric.vals_r("inv_metric"); // check returned Euclidean metric stan::test::unit::check_adaptation(3, 3, dense_vals, parameter, 0.1); @@ -111,8 +111,7 @@ TEST_F(ServicesSampleHmcNutsDenseEMassMatrix, use_metric_no_adapt) { )json"; std::stringstream in(txt); - stan::json::json_data dump(in); - stan::io::var_context& inv_metric = dump; + stan::json::json_data inv_metric(in); int return_code = stan::services::sample::hmc_nuts_dense_e( model, context, inv_metric, random_seed, chain, init_radius, num_warmup, @@ -157,8 +156,7 @@ TEST_F(ServicesSampleHmcNutsDenseEMassMatrix, use_metric_skip_adapt) { } )json"; std::stringstream in(txt); - stan::json::json_data dump(in); - stan::io::var_context& inv_metric = dump; + stan::json::json_data inv_metric(in); int return_code = stan::services::sample::hmc_nuts_dense_e_adapt( model, context, inv_metric, random_seed, chain, init_radius, num_warmup, diff --git a/src/test/unit/services/sample/hmc_nuts_diag_inv_metric_test.cpp b/src/test/unit/services/sample/hmc_nuts_diag_inv_metric_test.cpp index 053ba7e45e..2c0b175eb2 100644 --- a/src/test/unit/services/sample/hmc_nuts_diag_inv_metric_test.cpp +++ b/src/test/unit/services/sample/hmc_nuts_diag_inv_metric_test.cpp @@ -47,8 +47,8 @@ TEST_F(ServicesSampleHmcNutsDiagEMassMatrix, unit_e_no_adapt) { interrupt, logger, init, parameter, diagnostic); EXPECT_EQ(0, return_code); - auto dmp = stan::services::util::create_unit_e_diag_inv_metric(3); - stan::io::var_context& inv_metric = dmp; + auto default_metric = stan::services::util::create_unit_e_diag_inv_metric(3); + stan::io::var_context& inv_metric = default_metric; std::vector diag_vals = inv_metric.vals_r("inv_metric"); stan::test::unit::check_adaptation(3, diag_vals, parameter, 0.2); } @@ -101,8 +101,7 @@ TEST_F(ServicesSampleHmcNutsDiagEMassMatrix, use_metric_no_adapt) { std::string txt = R"json({"inv_metric" : [0.787405, 0.884987, 1.19869]})json"; std::stringstream in(txt); - stan::json::json_data dump(in); - stan::io::var_context& inv_metric = dump; + stan::json::json_data inv_metric(in); int return_code = stan::services::sample::hmc_nuts_diag_e( model, context, inv_metric, random_seed, chain, init_radius, num_warmup, @@ -142,8 +141,7 @@ TEST_F(ServicesSampleHmcNutsDiagEMassMatrix, use_metric_skip_adapt) { std::string txt = R"json({"inv_metric":[0.787405, 0.884987, 1.19869]})json"; std::stringstream in(txt); - stan::json::json_data dump(in); - stan::io::var_context& inv_metric = dump; + stan::json::json_data inv_metric(in); int return_code = stan::services::sample::hmc_nuts_diag_e_adapt( model, context, inv_metric, random_seed, chain, init_radius, num_warmup, diff --git a/src/test/unit/services/sample/hmc_static_dense_inv_metric_test.cpp b/src/test/unit/services/sample/hmc_static_dense_inv_metric_test.cpp index f29b2a40b9..74d8b4f8aa 100644 --- a/src/test/unit/services/sample/hmc_static_dense_inv_metric_test.cpp +++ b/src/test/unit/services/sample/hmc_static_dense_inv_metric_test.cpp @@ -48,8 +48,8 @@ TEST_F(ServicesSampleHmcStaticDenseEMassMatrix, unit_e_no_adapt) { interrupt, logger, init, parameter, diagnostic); EXPECT_EQ(0, return_code); - auto dmp = stan::services::util::create_unit_e_dense_inv_metric(3); - stan::io::var_context& inv_metric = dmp; + auto default_metric = stan::services::util::create_unit_e_dense_inv_metric(3); + stan::io::var_context& inv_metric = default_metric; std::vector dense_vals = inv_metric.vals_r("inv_metric"); // check returned Euclidean metric stan::test::unit::check_adaptation(3, dense_vals, parameter, 0.2); @@ -110,8 +110,7 @@ TEST_F(ServicesSampleHmcStaticDenseEMassMatrix, use_metric_no_adapt) { } )json"; std::stringstream in(txt); - stan::json::json_data dump(in); - stan::io::var_context& inv_metric = dump; + stan::json::json_data inv_metric(in); int return_code = stan::services::sample::hmc_static_dense_e( model, context, inv_metric, random_seed, chain, init_radius, num_warmup, @@ -157,8 +156,7 @@ TEST_F(ServicesSampleHmcStaticDenseEMassMatrix, use_metric_skip_adapt) { } )json"; std::stringstream in(txt); - stan::json::json_data dump(in); - stan::io::var_context& inv_metric = dump; + stan::json::json_data inv_metric(in); int return_code = stan::services::sample::hmc_static_dense_e_adapt( model, context, inv_metric, random_seed, chain, init_radius, num_warmup, diff --git a/src/test/unit/services/sample/hmc_static_diag_inv_metric_test.cpp b/src/test/unit/services/sample/hmc_static_diag_inv_metric_test.cpp index 311f9e3780..9a913940eb 100644 --- a/src/test/unit/services/sample/hmc_static_diag_inv_metric_test.cpp +++ b/src/test/unit/services/sample/hmc_static_diag_inv_metric_test.cpp @@ -47,8 +47,8 @@ TEST_F(ServicesSampleHmcStaticDiagEMassMatrix, unit_e_no_adapt) { interrupt, logger, init, parameter, diagnostic); EXPECT_EQ(0, return_code); - auto dmp = stan::services::util::create_unit_e_diag_inv_metric(3); - stan::io::var_context& inv_metric = dmp; + auto default_metric = stan::services::util::create_unit_e_diag_inv_metric(3); + stan::io::var_context& inv_metric = default_metric; std::vector diag_vals = inv_metric.vals_r("inv_metric"); // check returned Euclidean metric stan::test::unit::check_adaptation(3, diag_vals, parameter, 0.2); @@ -101,8 +101,7 @@ TEST_F(ServicesSampleHmcStaticDiagEMassMatrix, use_metric_no_adapt) { std::string txt = R"json({"inv_metric":[0.787405, 0.884987, 1.19869]})json"; std::stringstream in(txt); - stan::json::json_data dump(in); - stan::io::var_context& inv_metric = dump; + stan::json::json_data inv_metric(in); int return_code = stan::services::sample::hmc_static_diag_e( model, context, inv_metric, random_seed, chain, init_radius, num_warmup, @@ -140,8 +139,7 @@ TEST_F(ServicesSampleHmcStaticDiagEMassMatrix, use_metric_skip_adapt) { std::string txt = R"json({"inv_metric":[0.787405, 0.884987, 1.19869]})json"; std::stringstream in(txt); - stan::json::json_data dump(in); - stan::io::var_context& inv_metric = dump; + stan::json::json_data inv_metric(in); int return_code = stan::services::sample::hmc_static_diag_e_adapt( model, context, inv_metric, random_seed, chain, init_radius, num_warmup, diff --git a/src/test/unit/services/util/inv_metric_test.cpp b/src/test/unit/services/util/inv_metric_test.cpp index 505f527ff5..78542890eb 100644 --- a/src/test/unit/services/util/inv_metric_test.cpp +++ b/src/test/unit/services/util/inv_metric_test.cpp @@ -3,23 +3,23 @@ #include TEST(inv_metric, create_diag_sz1) { - auto dmp = stan::services::util::create_unit_e_diag_inv_metric(1); - stan::io::var_context& inv_inv_metric = dmp; + auto default_metric = stan::services::util::create_unit_e_diag_inv_metric(1); + stan::io::var_context& inv_inv_metric = default_metric; std::vector diag_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(1, diag_vals.size()); ASSERT_NEAR(1.0, diag_vals[0], 0.0001); } TEST(inv_metric, create_diag_sz0) { - auto dmp = stan::services::util::create_unit_e_diag_inv_metric(0); - stan::io::var_context& inv_inv_metric = dmp; + auto default_metric = stan::services::util::create_unit_e_diag_inv_metric(0); + stan::io::var_context& inv_inv_metric = default_metric; std::vector diag_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(0, diag_vals.size()); } TEST(inv_metric, create_diag_sz100) { - auto dmp = stan::services::util::create_unit_e_diag_inv_metric(100); - stan::io::var_context& inv_inv_metric = dmp; + auto default_metric = stan::services::util::create_unit_e_diag_inv_metric(100); + stan::io::var_context& inv_inv_metric = default_metric; std::vector diag_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(100, diag_vals.size()); ASSERT_NEAR(1.0, diag_vals[0], 0.0001); @@ -27,8 +27,8 @@ TEST(inv_metric, create_diag_sz100) { } TEST(inv_metric, create_dense_sz2) { - auto dmp = stan::services::util::create_unit_e_dense_inv_metric(2); - stan::io::var_context& inv_inv_metric = dmp; + auto default_metric = stan::services::util::create_unit_e_dense_inv_metric(2); + stan::io::var_context& inv_inv_metric = default_metric; std::vector dense_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(4, dense_vals.size()); ASSERT_NEAR(1.0, dense_vals[0], 0.0001); @@ -36,8 +36,8 @@ TEST(inv_metric, create_dense_sz2) { } TEST(inv_metric, create_dense_sz3) { - auto dmp = stan::services::util::create_unit_e_dense_inv_metric(3); - stan::io::var_context& inv_inv_metric = dmp; + auto default_metric = stan::services::util::create_unit_e_dense_inv_metric(3); + stan::io::var_context& inv_inv_metric = default_metric; std::vector dense_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(9, dense_vals.size()); ASSERT_NEAR(1.0, dense_vals[0], 0.0001); @@ -52,8 +52,8 @@ TEST(inv_metric, create_dense_sz3) { } TEST(inv_metric, create_dense_sz10) { - auto dmp = stan::services::util::create_unit_e_dense_inv_metric(10); - stan::io::var_context& inv_inv_metric = dmp; + auto default_metric = stan::services::util::create_unit_e_dense_inv_metric(10); + stan::io::var_context& inv_inv_metric = default_metric; std::vector dense_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(100, dense_vals.size()); ASSERT_NEAR(1.0, dense_vals[0], 0.0001); From e4c466c2965e60e84f2badea5efa3695d8fdfedb Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Thu, 8 Feb 2024 14:17:51 -0500 Subject: [PATCH 30/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- src/stan/services/sample/hmc_nuts_dense_e.hpp | 3 ++- src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp | 6 ++++-- src/stan/services/sample/hmc_nuts_diag_e.hpp | 3 ++- src/stan/services/sample/hmc_static_dense_e.hpp | 3 ++- src/stan/services/sample/hmc_static_dense_e_adapt.hpp | 3 ++- src/stan/services/sample/hmc_static_diag_e.hpp | 3 ++- src/stan/services/sample/hmc_static_diag_e_adapt.hpp | 3 ++- src/test/unit/services/util/inv_metric_test.cpp | 6 ++++-- 8 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/stan/services/sample/hmc_nuts_dense_e.hpp b/src/stan/services/sample/hmc_nuts_dense_e.hpp index d582e1c6c6..73e0a2af1d 100644 --- a/src/stan/services/sample/hmc_nuts_dense_e.hpp +++ b/src/stan/services/sample/hmc_nuts_dense_e.hpp @@ -123,7 +123,8 @@ int hmc_nuts_dense_e(Model& model, const stan::io::var_context& init, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto default_metric = util::create_unit_e_dense_inv_metric(model.num_params_r()); + auto default_metric + = util::create_unit_e_dense_inv_metric(model.num_params_r()); return hmc_nuts_dense_e(model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, diff --git a/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp index 95bca2bff7..913c50152a 100644 --- a/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp @@ -206,7 +206,8 @@ int hmc_nuts_dense_e_adapt( callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer, callbacks::structured_writer& metric_writer) { - auto default_metric = util::create_unit_e_dense_inv_metric(model.num_params_r()); + auto default_metric + = util::create_unit_e_dense_inv_metric(model.num_params_r()); return hmc_nuts_dense_e_adapt( model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, @@ -257,7 +258,8 @@ int hmc_nuts_dense_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto default_metric = util::create_unit_e_dense_inv_metric(model.num_params_r()); + auto default_metric + = util::create_unit_e_dense_inv_metric(model.num_params_r()); callbacks::structured_writer dummy_metric_writer; return hmc_nuts_dense_e_adapt( model, init, default_metric, random_seed, chain, init_radius, num_warmup, diff --git a/src/stan/services/sample/hmc_nuts_diag_e.hpp b/src/stan/services/sample/hmc_nuts_diag_e.hpp index 17f6f86428..e693ed0a83 100644 --- a/src/stan/services/sample/hmc_nuts_diag_e.hpp +++ b/src/stan/services/sample/hmc_nuts_diag_e.hpp @@ -121,7 +121,8 @@ int hmc_nuts_diag_e(Model& model, const stan::io::var_context& init, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto default_metric = util::create_unit_e_diag_inv_metric(model.num_params_r()); + auto default_metric + = util::create_unit_e_diag_inv_metric(model.num_params_r()); return hmc_nuts_diag_e(model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, diff --git a/src/stan/services/sample/hmc_static_dense_e.hpp b/src/stan/services/sample/hmc_static_dense_e.hpp index 962441912d..c337636f9c 100644 --- a/src/stan/services/sample/hmc_static_dense_e.hpp +++ b/src/stan/services/sample/hmc_static_dense_e.hpp @@ -116,7 +116,8 @@ int hmc_static_dense_e( double stepsize_jitter, double int_time, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto default_metric = util::create_unit_e_dense_inv_metric(model.num_params_r()); + auto default_metric + = util::create_unit_e_dense_inv_metric(model.num_params_r()); return hmc_static_dense_e(model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, save_warmup, refresh, stepsize, stepsize_jitter, diff --git a/src/stan/services/sample/hmc_static_dense_e_adapt.hpp b/src/stan/services/sample/hmc_static_dense_e_adapt.hpp index f1027ca837..21bd6d711d 100644 --- a/src/stan/services/sample/hmc_static_dense_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_dense_e_adapt.hpp @@ -148,7 +148,8 @@ int hmc_static_dense_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto default_metric = util::create_unit_e_dense_inv_metric(model.num_params_r()); + auto default_metric + = util::create_unit_e_dense_inv_metric(model.num_params_r()); return hmc_static_dense_e_adapt( model, init, default_metric, random_seed, chain, init_radius, num_warmup, diff --git a/src/stan/services/sample/hmc_static_diag_e.hpp b/src/stan/services/sample/hmc_static_diag_e.hpp index 2c1733d2cc..87ea955f84 100644 --- a/src/stan/services/sample/hmc_static_diag_e.hpp +++ b/src/stan/services/sample/hmc_static_diag_e.hpp @@ -121,7 +121,8 @@ int hmc_static_diag_e(Model& model, const stan::io::var_context& init, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto default_metric = util::create_unit_e_diag_inv_metric(model.num_params_r()); + auto default_metric + = util::create_unit_e_diag_inv_metric(model.num_params_r()); return hmc_static_diag_e(model, init, default_metric, random_seed, chain, init_radius, num_warmup, num_samples, num_thin, diff --git a/src/stan/services/sample/hmc_static_diag_e_adapt.hpp b/src/stan/services/sample/hmc_static_diag_e_adapt.hpp index 1b6c0b566c..88979dc341 100644 --- a/src/stan/services/sample/hmc_static_diag_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_diag_e_adapt.hpp @@ -146,7 +146,8 @@ int hmc_static_diag_e_adapt( unsigned int window, callbacks::interrupt& interrupt, callbacks::logger& logger, callbacks::writer& init_writer, callbacks::writer& sample_writer, callbacks::writer& diagnostic_writer) { - auto default_metric = util::create_unit_e_diag_inv_metric(model.num_params_r()); + auto default_metric + = util::create_unit_e_diag_inv_metric(model.num_params_r()); return hmc_static_diag_e_adapt( model, init, default_metric, random_seed, chain, init_radius, num_warmup, diff --git a/src/test/unit/services/util/inv_metric_test.cpp b/src/test/unit/services/util/inv_metric_test.cpp index 78542890eb..0c2f3888e1 100644 --- a/src/test/unit/services/util/inv_metric_test.cpp +++ b/src/test/unit/services/util/inv_metric_test.cpp @@ -18,7 +18,8 @@ TEST(inv_metric, create_diag_sz0) { } TEST(inv_metric, create_diag_sz100) { - auto default_metric = stan::services::util::create_unit_e_diag_inv_metric(100); + auto default_metric + = stan::services::util::create_unit_e_diag_inv_metric(100); stan::io::var_context& inv_inv_metric = default_metric; std::vector diag_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(100, diag_vals.size()); @@ -52,7 +53,8 @@ TEST(inv_metric, create_dense_sz3) { } TEST(inv_metric, create_dense_sz10) { - auto default_metric = stan::services::util::create_unit_e_dense_inv_metric(10); + auto default_metric + = stan::services::util::create_unit_e_dense_inv_metric(10); stan::io::var_context& inv_inv_metric = default_metric; std::vector dense_vals = inv_inv_metric.vals_r("inv_metric"); EXPECT_EQ(100, dense_vals.size()); From 643fd8b5ba649d1b3a849517fe1ab456e6917929 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Wed, 24 Jan 2024 16:24:32 -0500 Subject: [PATCH 31/93] Only swallow domain_errors --- src/stan/mcmc/hmc/hamiltonians/base_hamiltonian.hpp | 4 ++-- src/stan/services/pathfinder/single.hpp | 6 +++--- src/stan/services/util/gq_writer.hpp | 12 +++++++++++- src/stan/services/util/mcmc_writer.hpp | 7 ++++++- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/stan/mcmc/hmc/hamiltonians/base_hamiltonian.hpp b/src/stan/mcmc/hmc/hamiltonians/base_hamiltonian.hpp index ab47e01068..abb575bfb6 100644 --- a/src/stan/mcmc/hmc/hamiltonians/base_hamiltonian.hpp +++ b/src/stan/mcmc/hmc/hamiltonians/base_hamiltonian.hpp @@ -52,7 +52,7 @@ class base_hamiltonian { void update_potential(Point& z, callbacks::logger& logger) { try { z.V = -stan::model::log_prob_propto(model_, z.q); - } catch (const std::exception& e) { + } catch (const std::domain_error& e) { this->write_error_msg_(e, logger); z.V = std::numeric_limits::infinity(); } @@ -62,7 +62,7 @@ class base_hamiltonian { try { stan::model::gradient(model_, z.q, z.V, z.g, logger); z.V = -z.V; - } catch (const std::exception& e) { + } catch (const std::domain_error& e) { this->write_error_msg_(e, logger); z.V = std::numeric_limits::infinity(); } diff --git a/src/stan/services/pathfinder/single.hpp b/src/stan/services/pathfinder/single.hpp index fb7f3295a4..8536178f4f 100644 --- a/src/stan/services/pathfinder/single.hpp +++ b/src/stan/services/pathfinder/single.hpp @@ -250,7 +250,7 @@ inline elbo_est_t est_approx_draws(LPF&& lp_fun, ConstrainF&& constrain_fun, approx_samples_col = approx_samples.col(i); ++lp_fun_calls; lp_mat.coeffRef(i, 1) = lp_fun(approx_samples_col, pathfinder_ss); - } catch (const std::exception& e) { + } catch (const std::domain_error& e) { lp_mat.coeffRef(i, 1) = -std::numeric_limits::infinity(); } log_stream(logger, pathfinder_ss, iter_msg); @@ -530,7 +530,7 @@ auto pathfinder_impl(RNG&& rng, LPFun&& lp_fun, ConstrainFun&& constrain_fun, lp_fun, constrain_fun, rng, taylor_appx, num_elbo_draws, alpha, iter_msg, logger), taylor_appx); - } catch (const std::exception& e) { + } catch (const std::domain_error& e) { logger.warn(iter_msg + "ELBO estimation failed " + " with error: " + e.what()); return std::make_pair(internal::elbo_est_t{}, internal::taylor_approx_t{}); @@ -900,7 +900,7 @@ inline auto pathfinder_lbfgs_single( approx_samples_constrained_col) .matrix(); } - } catch (const std::exception& e) { + } catch (const std::domain_error& e) { std::string err_msg = e.what(); logger.warn(path_num + "Final sampling approximation failed with error: " + err_msg); diff --git a/src/stan/services/util/gq_writer.hpp b/src/stan/services/util/gq_writer.hpp index c844a54dd2..5cb8e6eb78 100644 --- a/src/stan/services/util/gq_writer.hpp +++ b/src/stan/services/util/gq_writer.hpp @@ -79,10 +79,15 @@ class gq_writer { model.write_array(rng, draw, params_i, values, false, true, &ss); if (ss.str().length() > 0) logger_.info(ss); + } catch (const std::domain_error& e) { + if (ss.str().length() > 0) + logger_.info(ss); + logger_.info(e.what()); } catch (const std::exception& e) { if (ss.str().length() > 0) logger_.info(ss); logger_.info(e.what()); + throw; } std::vector gq_values(values.begin() + num_constrained_params_, @@ -110,11 +115,16 @@ class gq_writer { if (ss.str().length() > 0) { logger_.info(ss); } - } catch (const std::exception& e) { + } catch (const std::domain_error& e) { if (ss.str().length() > 0) { logger_.info(ss); } logger_.info(e.what()); + } catch (const std::exception& e) { + if (ss.str().length() > 0) + logger_.info(ss); + logger_.info(e.what()); + throw; } sample_writer_(values); } diff --git a/src/stan/services/util/mcmc_writer.hpp b/src/stan/services/util/mcmc_writer.hpp index d51f168c9b..7f5d566185 100644 --- a/src/stan/services/util/mcmc_writer.hpp +++ b/src/stan/services/util/mcmc_writer.hpp @@ -111,11 +111,16 @@ class mcmc_writer { sample.cont_params().data() + sample.cont_params().size()); model.write_array(rng, cont_params, params_i, model_values, true, true, &ss); - } catch (const std::exception& e) { + } catch (const std::domain_error& e) { if (ss.str().length() > 0) logger_.info(ss); ss.str(""); logger_.info(e.what()); + } catch (const std::exception& e) { + if (ss.str().length() > 0) + logger_.info(ss); + logger_.info(e.what()); + throw; } if (ss.str().length() > 0) logger_.info(ss); From 5681a8182fb5131a8f31d08934833037461a0b14 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Thu, 25 Jan 2024 09:45:34 -0500 Subject: [PATCH 32/93] A few more places --- src/stan/optimization/bfgs.hpp | 4 ++-- src/stan/optimization/newton.hpp | 2 +- src/stan/services/pathfinder/single.hpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stan/optimization/bfgs.hpp b/src/stan/optimization/bfgs.hpp index 53e7fa075b..86a5a20cca 100644 --- a/src/stan/optimization/bfgs.hpp +++ b/src/stan/optimization/bfgs.hpp @@ -309,7 +309,7 @@ class ModelAdaptor { try { f = -log_prob_propto(_model, _x, _params_i, _msgs); - } catch (const std::exception &e) { + } catch (const std::domain_error &e) { if (_msgs) (*_msgs) << e.what() << std::endl; return 1; @@ -341,7 +341,7 @@ class ModelAdaptor { try { f = -log_prob_grad(_model, _x, _params_i, _g, _msgs); - } catch (const std::exception &e) { + } catch (const std::domain_error &e) { if (_msgs) (*_msgs) << e.what() << std::endl; return 1; diff --git a/src/stan/optimization/newton.hpp b/src/stan/optimization/newton.hpp index 624a8c8dbc..b6f24d3eb0 100644 --- a/src/stan/optimization/newton.hpp +++ b/src/stan/optimization/newton.hpp @@ -60,7 +60,7 @@ double newton_step(M& model, std::vector& params_r, try { f1 = stan::model::log_prob_grad(model, new_params_r, params_i, gradient); - } catch (std::exception& e) { + } catch (std::domain_error& e) { // FIXME: this is not a good way to handle a general exception f1 = -1e100; } diff --git a/src/stan/services/pathfinder/single.hpp b/src/stan/services/pathfinder/single.hpp index 8536178f4f..0f0c7457ba 100644 --- a/src/stan/services/pathfinder/single.hpp +++ b/src/stan/services/pathfinder/single.hpp @@ -820,7 +820,7 @@ inline auto pathfinder_lbfgs_single( logger.info(lbfgs_ss); lbfgs_ss.str(""); } - throw e; + throw; } } if (unlikely(save_iterations)) { From 2709df7f11af708477088f5609f6f70163ee5135 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Thu, 25 Jan 2024 10:40:49 -0500 Subject: [PATCH 33/93] Maintain exception safety in top-level services functions --- .../services/experimental/advi/fullrank.hpp | 9 +- .../services/experimental/advi/meanfield.hpp | 9 +- src/stan/services/optimize/bfgs.hpp | 42 +++++++-- src/stan/services/optimize/lbfgs.hpp | 30 ++++++- src/stan/services/optimize/newton.hpp | 2 +- src/stan/services/pathfinder/multi.hpp | 49 ++++++----- src/stan/services/pathfinder/single.hpp | 7 +- src/stan/services/sample/fixed_param.hpp | 58 +++++++------ src/stan/services/sample/hmc_nuts_dense_e.hpp | 44 ++++++---- .../sample/hmc_nuts_dense_e_adapt.hpp | 49 ++++++----- src/stan/services/sample/hmc_nuts_diag_e.hpp | 12 ++- .../services/sample/hmc_nuts_diag_e_adapt.hpp | 49 ++++++----- src/stan/services/sample/hmc_nuts_unit_e.hpp | 47 ++++++---- .../services/sample/hmc_nuts_unit_e_adapt.hpp | 49 ++++++----- .../services/sample/hmc_static_dense_e.hpp | 11 ++- .../sample/hmc_static_dense_e_adapt.hpp | 13 ++- .../services/sample/hmc_static_diag_e.hpp | 12 ++- .../sample/hmc_static_diag_e_adapt.hpp | 14 ++- .../services/sample/hmc_static_unit_e.hpp | 11 ++- .../sample/hmc_static_unit_e_adapt.hpp | 13 ++- src/stan/services/sample/standalone_gqs.hpp | 86 +++++++++++-------- 21 files changed, 395 insertions(+), 221 deletions(-) diff --git a/src/stan/services/experimental/advi/fullrank.hpp b/src/stan/services/experimental/advi/fullrank.hpp index 96cf5d05c0..5fba2e4e02 100644 --- a/src/stan/services/experimental/advi/fullrank.hpp +++ b/src/stan/services/experimental/advi/fullrank.hpp @@ -86,8 +86,13 @@ int fullrank(Model& model, const stan::io::var_context& init, stan::rng_t> cmd_advi(model, cont_params, rng, grad_samples, elbo_samples, eval_elbo, output_samples); - cmd_advi.run(eta, adapt_engaged, adapt_iterations, tol_rel_obj, - max_iterations, logger, parameter_writer, diagnostic_writer); + try { + cmd_advi.run(eta, adapt_engaged, adapt_iterations, tol_rel_obj, + max_iterations, logger, parameter_writer, diagnostic_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return stan::services::error_codes::OK; } diff --git a/src/stan/services/experimental/advi/meanfield.hpp b/src/stan/services/experimental/advi/meanfield.hpp index 6cffe548ac..49bee28505 100644 --- a/src/stan/services/experimental/advi/meanfield.hpp +++ b/src/stan/services/experimental/advi/meanfield.hpp @@ -85,8 +85,13 @@ int meanfield(Model& model, const stan::io::var_context& init, stan::rng_t> cmd_advi(model, cont_params, rng, grad_samples, elbo_samples, eval_elbo, output_samples); - cmd_advi.run(eta, adapt_engaged, adapt_iterations, tol_rel_obj, - max_iterations, logger, parameter_writer, diagnostic_writer); + try { + cmd_advi.run(eta, adapt_engaged, adapt_iterations, tol_rel_obj, + max_iterations, logger, parameter_writer, diagnostic_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return stan::services::error_codes::OK; } diff --git a/src/stan/services/optimize/bfgs.hpp b/src/stan/services/optimize/bfgs.hpp index 2819b853a6..bcb0e49f31 100644 --- a/src/stan/services/optimize/bfgs.hpp +++ b/src/stan/services/optimize/bfgs.hpp @@ -96,7 +96,16 @@ int bfgs(Model& model, const stan::io::var_context& init, if (save_iterations) { std::vector values; std::stringstream msg; - model.write_array(rng, cont_vector, disc_vector, values, true, true, &msg); + try { + model.write_array(rng, cont_vector, disc_vector, values, true, true, + &msg); + } catch (const std::exception& e) { + if (msg.str().length() > 0) { + logger.info(msg); + } + logger.error(e.what()); + return error_codes::SOFTWARE; + } if (msg.str().length() > 0) logger.info(msg); @@ -119,7 +128,13 @@ int bfgs(Model& model, const stan::io::var_context& init, " # evals" " Notes "); - ret = bfgs.step(); + try { + ret = bfgs.step(); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } + lp = bfgs.logp(); bfgs.params_r(cont_vector); @@ -150,8 +165,16 @@ int bfgs(Model& model, const stan::io::var_context& init, if (save_iterations) { std::vector values; std::stringstream msg; - model.write_array(rng, cont_vector, disc_vector, values, true, true, - &msg); + try { + model.write_array(rng, cont_vector, disc_vector, values, true, true, + &msg); + } catch (const std::exception& e) { + if (msg.str().length() > 0) { + logger.info(msg); + } + logger.error(e.what()); + return error_codes::SOFTWARE; + } // This if is here to match the pre-refactor behavior if (msg.str().length() > 0) logger.info(msg); @@ -164,7 +187,16 @@ int bfgs(Model& model, const stan::io::var_context& init, if (!save_iterations) { std::vector values; std::stringstream msg; - model.write_array(rng, cont_vector, disc_vector, values, true, true, &msg); + try { + model.write_array(rng, cont_vector, disc_vector, values, true, true, + &msg); + } catch (const std::exception& e) { + if (msg.str().length() > 0) { + logger.info(msg); + } + logger.error(e.what()); + return error_codes::SOFTWARE; + } if (msg.str().length() > 0) logger.info(msg); values.insert(values.begin(), lp); diff --git a/src/stan/services/optimize/lbfgs.hpp b/src/stan/services/optimize/lbfgs.hpp index 083e37ffed..9045b5470e 100644 --- a/src/stan/services/optimize/lbfgs.hpp +++ b/src/stan/services/optimize/lbfgs.hpp @@ -123,7 +123,12 @@ int lbfgs(Model& model, const stan::io::var_context& init, " # evals" " Notes "); - ret = lbfgs.step(); + try { + ret = lbfgs.step(); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } lp = lbfgs.logp(); lbfgs.params_r(cont_vector); @@ -154,8 +159,16 @@ int lbfgs(Model& model, const stan::io::var_context& init, if (save_iterations) { std::vector values; std::stringstream msg; - model.write_array(rng, cont_vector, disc_vector, values, true, true, - &msg); + try { + model.write_array(rng, cont_vector, disc_vector, values, true, true, + &msg); + } catch (const std::exception& e) { + if (msg.str().length() > 0) { + logger.info(msg); + } + logger.error(e.what()); + return error_codes::SOFTWARE; + } if (msg.str().length() > 0) logger.info(msg); @@ -167,7 +180,16 @@ int lbfgs(Model& model, const stan::io::var_context& init, if (!save_iterations) { std::vector values; std::stringstream msg; - model.write_array(rng, cont_vector, disc_vector, values, true, true, &msg); + try { + model.write_array(rng, cont_vector, disc_vector, values, true, true, + &msg); + } catch (const std::exception& e) { + if (msg.str().length() > 0) { + logger.info(msg); + } + logger.error(e.what()); + return error_codes::SOFTWARE; + } if (msg.str().length() > 0) logger.info(msg); diff --git a/src/stan/services/optimize/newton.hpp b/src/stan/services/optimize/newton.hpp index 081365f0a9..db64f6e46c 100644 --- a/src/stan/services/optimize/newton.hpp +++ b/src/stan/services/optimize/newton.hpp @@ -62,7 +62,7 @@ int newton(Model& model, const stan::io::var_context& init, lp = model.template log_prob(cont_vector, disc_vector, &message); logger.info(message); - } catch (const std::exception& e) { + } catch (const std::domain_error& e) { logger.info(""); logger.info( "Informational Message: The current" diff --git a/src/stan/services/pathfinder/multi.hpp b/src/stan/services/pathfinder/multi.hpp index e87eaa63e3..924f0806b3 100644 --- a/src/stan/services/pathfinder/multi.hpp +++ b/src/stan/services/pathfinder/multi.hpp @@ -117,28 +117,33 @@ inline int pathfinder_lbfgs_multi( individual_samples; individual_samples.resize(num_paths); std::atomic lp_calls{0}; - tbb::parallel_for( - tbb::blocked_range(0, num_paths), [&](tbb::blocked_range r) { - for (int iter = r.begin(); iter < r.end(); ++iter) { - auto pathfinder_ret - = stan::services::pathfinder::pathfinder_lbfgs_single( - model, *(init[iter]), random_seed, stride_id + iter, - init_radius, history_size, init_alpha, tol_obj, tol_rel_obj, - tol_grad, tol_rel_grad, tol_param, num_iterations, - num_elbo_draws, num_draws, save_iterations, refresh, - interrupt, logger, init_writers[iter], - single_path_parameter_writer[iter], - single_path_diagnostic_writer[iter], calculate_lp); - if (unlikely(std::get<0>(pathfinder_ret) != error_codes::OK)) { - logger.error(std::string("Pathfinder iteration: ") - + std::to_string(iter) + " failed."); - return; + try { + tbb::parallel_for( + tbb::blocked_range(0, num_paths), [&](tbb::blocked_range r) { + for (int iter = r.begin(); iter < r.end(); ++iter) { + auto pathfinder_ret + = stan::services::pathfinder::pathfinder_lbfgs_single( + model, *(init[iter]), random_seed, stride_id + iter, + init_radius, history_size, init_alpha, tol_obj, tol_rel_obj, + tol_grad, tol_rel_grad, tol_param, num_iterations, + num_elbo_draws, num_draws, save_iterations, refresh, + interrupt, logger, init_writers[iter], + single_path_parameter_writer[iter], + single_path_diagnostic_writer[iter], calculate_lp); + if (unlikely(std::get<0>(pathfinder_ret) != error_codes::OK)) { + logger.error(std::string("Pathfinder iteration: ") + + std::to_string(iter) + " failed."); + return; + } + individual_lp_ratios[iter] = std::move(std::get<1>(pathfinder_ret)); + individual_samples[iter] = std::move(std::get<2>(pathfinder_ret)); + lp_calls += std::get<3>(pathfinder_ret); } - individual_lp_ratios[iter] = std::move(std::get<1>(pathfinder_ret)); - individual_samples[iter] = std::move(std::get<2>(pathfinder_ret)); - lp_calls += std::get<3>(pathfinder_ret); - } - }); + }); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } // if any pathfinders failed, we want to remove their empty results individual_lp_ratios.erase( @@ -231,7 +236,7 @@ inline int pathfinder_lbfgs_multi( parameter_writer(total_time_str); } parameter_writer(); - return 0; + return error_codes::OK; } } // namespace pathfinder } // namespace services diff --git a/src/stan/services/pathfinder/single.hpp b/src/stan/services/pathfinder/single.hpp index 0f0c7457ba..4719a40e1e 100644 --- a/src/stan/services/pathfinder/single.hpp +++ b/src/stan/services/pathfinder/single.hpp @@ -820,7 +820,12 @@ inline auto pathfinder_lbfgs_single( logger.info(lbfgs_ss); lbfgs_ss.str(""); } - throw; + if (ReturnLpSamples) { + throw; + } else { + logger.error(e.what()); + return error_codes::SOFTWARE; + } } } if (unlikely(save_iterations)) { diff --git a/src/stan/services/sample/fixed_param.hpp b/src/stan/services/sample/fixed_param.hpp index f407b14f57..17e04a621e 100644 --- a/src/stan/services/sample/fixed_param.hpp +++ b/src/stan/services/sample/fixed_param.hpp @@ -74,9 +74,14 @@ int fixed_param(Model& model, const stan::io::var_context& init, writer.write_diagnostic_names(s, sampler, model); auto start = std::chrono::steady_clock::now(); - util::generate_transitions(sampler, num_samples, 0, num_samples, num_thin, - refresh, true, false, writer, s, model, rng, - interrupt, logger); + try { + util::generate_transitions(sampler, num_samples, 0, num_samples, num_thin, + refresh, true, false, writer, s, model, rng, + interrupt, logger); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } auto end = std::chrono::steady_clock::now(); double sample_delta_t = std::chrono::duration_cast(end - start) @@ -156,27 +161,32 @@ int fixed_param(Model& model, const std::size_t num_chains, writers[i].write_diagnostic_names(samples[i], samplers[i], model); } - tbb::parallel_for( - tbb::blocked_range(0, num_chains, 1), - [&samplers, &writers, &samples, &model, &rngs, &interrupt, &logger, - num_samples, num_thin, refresh, chain, - num_chains](const tbb::blocked_range& r) { - for (size_t i = r.begin(); i != r.end(); ++i) { - auto start = std::chrono::steady_clock::now(); - util::generate_transitions(samplers[i], num_samples, 0, num_samples, - num_thin, refresh, true, false, writers[i], - samples[i], model, rngs[i], interrupt, - logger, chain + i, num_chains); - auto end = std::chrono::steady_clock::now(); - double sample_delta_t - = std::chrono::duration_cast(end - - start) - .count() - / 1000.0; - writers[i].write_timing(0.0, sample_delta_t); - } - }, - tbb::simple_partitioner()); + try { + tbb::parallel_for( + tbb::blocked_range(0, num_chains, 1), + [&samplers, &writers, &samples, &model, &rngs, &interrupt, &logger, + num_samples, num_thin, refresh, chain, + num_chains](const tbb::blocked_range& r) { + for (size_t i = r.begin(); i != r.end(); ++i) { + auto start = std::chrono::steady_clock::now(); + util::generate_transitions( + samplers[i], num_samples, 0, num_samples, num_thin, refresh, + true, false, writers[i], samples[i], model, rngs[i], interrupt, + logger, chain + i, num_chains); + auto end = std::chrono::steady_clock::now(); + double sample_delta_t + = std::chrono::duration_cast(end + - start) + .count() + / 1000.0; + writers[i].write_timing(0.0, sample_delta_t); + } + }, + tbb::simple_partitioner()); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } diff --git a/src/stan/services/sample/hmc_nuts_dense_e.hpp b/src/stan/services/sample/hmc_nuts_dense_e.hpp index 73e0a2af1d..0fb818b19c 100644 --- a/src/stan/services/sample/hmc_nuts_dense_e.hpp +++ b/src/stan/services/sample/hmc_nuts_dense_e.hpp @@ -81,9 +81,14 @@ int hmc_nuts_dense_e(Model& model, const stan::io::var_context& init, sampler.set_stepsize_jitter(stepsize_jitter); sampler.set_max_depth(max_depth); - util::run_sampler(sampler, model, cont_vector, num_warmup, num_samples, - num_thin, refresh, save_warmup, rng, interrupt, logger, - sample_writer, diagnostic_writer); + try { + util::run_sampler(sampler, model, cont_vector, num_warmup, num_samples, + num_thin, refresh, save_warmup, rng, interrupt, logger, + sample_writer, diagnostic_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } @@ -221,20 +226,25 @@ int hmc_nuts_dense_e(Model& model, size_t num_chains, logger.error(e.what()); return error_codes::CONFIG; } - tbb::parallel_for( - tbb::blocked_range(0, num_chains, 1), - [num_warmup, num_samples, num_thin, refresh, save_warmup, num_chains, - init_chain_id, &samplers, &model, &rngs, &interrupt, &logger, - &sample_writer, &cont_vectors, - &diagnostic_writer](const tbb::blocked_range& r) { - for (size_t i = r.begin(); i != r.end(); ++i) { - util::run_sampler(samplers[i], model, cont_vectors[i], num_warmup, - num_samples, num_thin, refresh, save_warmup, - rngs[i], interrupt, logger, sample_writer[i], - diagnostic_writer[i], init_chain_id + i); - } - }, - tbb::simple_partitioner()); + try { + tbb::parallel_for( + tbb::blocked_range(0, num_chains, 1), + [num_warmup, num_samples, num_thin, refresh, save_warmup, num_chains, + init_chain_id, &samplers, &model, &rngs, &interrupt, &logger, + &sample_writer, &cont_vectors, + &diagnostic_writer](const tbb::blocked_range& r) { + for (size_t i = r.begin(); i != r.end(); ++i) { + util::run_sampler(samplers[i], model, cont_vectors[i], num_warmup, + num_samples, num_thin, refresh, save_warmup, + rngs[i], interrupt, logger, sample_writer[i], + diagnostic_writer[i], init_chain_id + i); + } + }, + tbb::simple_partitioner()); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } diff --git a/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp index 913c50152a..ce1befff87 100644 --- a/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_dense_e_adapt.hpp @@ -98,11 +98,15 @@ int hmc_nuts_dense_e_adapt( sampler.set_window_params(num_warmup, init_buffer, term_buffer, window, logger); - - util::run_adaptive_sampler(sampler, model, cont_vector, num_warmup, - num_samples, num_thin, refresh, save_warmup, rng, - interrupt, logger, sample_writer, - diagnostic_writer, metric_writer); + try { + util::run_adaptive_sampler(sampler, model, cont_vector, num_warmup, + num_samples, num_thin, refresh, save_warmup, rng, + interrupt, logger, sample_writer, + diagnostic_writer, metric_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } @@ -379,21 +383,26 @@ int hmc_nuts_dense_e_adapt( logger.error(e.what()); return error_codes::CONFIG; } - tbb::parallel_for( - tbb::blocked_range(0, num_chains, 1), - [num_warmup, num_samples, num_thin, refresh, save_warmup, num_chains, - init_chain_id, &samplers, &model, &rngs, &interrupt, &logger, - &sample_writer, &cont_vectors, &diagnostic_writer, - &metric_writer](const tbb::blocked_range& r) { - for (size_t i = r.begin(); i != r.end(); ++i) { - util::run_adaptive_sampler( - samplers[i], model, cont_vectors[i], num_warmup, num_samples, - num_thin, refresh, save_warmup, rngs[i], interrupt, logger, - sample_writer[i], diagnostic_writer[i], metric_writer[i], - init_chain_id + i, num_chains); - } - }, - tbb::simple_partitioner()); + try { + tbb::parallel_for( + tbb::blocked_range(0, num_chains, 1), + [num_warmup, num_samples, num_thin, refresh, save_warmup, num_chains, + init_chain_id, &samplers, &model, &rngs, &interrupt, &logger, + &sample_writer, &cont_vectors, &diagnostic_writer, + &metric_writer](const tbb::blocked_range& r) { + for (size_t i = r.begin(); i != r.end(); ++i) { + util::run_adaptive_sampler( + samplers[i], model, cont_vectors[i], num_warmup, num_samples, + num_thin, refresh, save_warmup, rngs[i], interrupt, logger, + sample_writer[i], diagnostic_writer[i], metric_writer[i], + init_chain_id + i, num_chains); + } + }, + tbb::simple_partitioner()); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } diff --git a/src/stan/services/sample/hmc_nuts_diag_e.hpp b/src/stan/services/sample/hmc_nuts_diag_e.hpp index e693ed0a83..bb789c0151 100644 --- a/src/stan/services/sample/hmc_nuts_diag_e.hpp +++ b/src/stan/services/sample/hmc_nuts_diag_e.hpp @@ -79,10 +79,14 @@ int hmc_nuts_diag_e(Model& model, const stan::io::var_context& init, sampler.set_stepsize_jitter(stepsize_jitter); sampler.set_max_depth(max_depth); - util::run_sampler(sampler, model, cont_vector, num_warmup, num_samples, - num_thin, refresh, save_warmup, rng, interrupt, logger, - sample_writer, diagnostic_writer); - + try { + util::run_sampler(sampler, model, cont_vector, num_warmup, num_samples, + num_thin, refresh, save_warmup, rng, interrupt, logger, + sample_writer, diagnostic_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } diff --git a/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp index 1044d9ed53..ec48ade0b5 100644 --- a/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp @@ -99,11 +99,15 @@ int hmc_nuts_diag_e_adapt( sampler.set_window_params(num_warmup, init_buffer, term_buffer, window, logger); - util::run_adaptive_sampler(sampler, model, cont_vector, num_warmup, - num_samples, num_thin, refresh, save_warmup, rng, - interrupt, logger, sample_writer, - diagnostic_writer, metric_writer); - + try { + util::run_adaptive_sampler(sampler, model, cont_vector, num_warmup, + num_samples, num_thin, refresh, save_warmup, rng, + interrupt, logger, sample_writer, + diagnostic_writer, metric_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } @@ -379,21 +383,26 @@ int hmc_nuts_diag_e_adapt( logger.error(e.what()); return error_codes::CONFIG; } - tbb::parallel_for( - tbb::blocked_range(0, num_chains, 1), - [num_warmup, num_samples, num_thin, refresh, save_warmup, num_chains, - init_chain_id, &samplers, &model, &rngs, &interrupt, &logger, - &sample_writer, &cont_vectors, &diagnostic_writer, - &metric_writer](const tbb::blocked_range& r) { - for (size_t i = r.begin(); i != r.end(); ++i) { - util::run_adaptive_sampler( - samplers[i], model, cont_vectors[i], num_warmup, num_samples, - num_thin, refresh, save_warmup, rngs[i], interrupt, logger, - sample_writer[i], diagnostic_writer[i], metric_writer[i], - init_chain_id + i, num_chains); - } - }, - tbb::simple_partitioner()); + try { + tbb::parallel_for( + tbb::blocked_range(0, num_chains, 1), + [num_warmup, num_samples, num_thin, refresh, save_warmup, num_chains, + init_chain_id, &samplers, &model, &rngs, &interrupt, &logger, + &sample_writer, &cont_vectors, &diagnostic_writer, + &metric_writer](const tbb::blocked_range& r) { + for (size_t i = r.begin(); i != r.end(); ++i) { + util::run_adaptive_sampler( + samplers[i], model, cont_vectors[i], num_warmup, num_samples, + num_thin, refresh, save_warmup, rngs[i], interrupt, logger, + sample_writer[i], diagnostic_writer[i], metric_writer[i], + init_chain_id + i, num_chains); + } + }, + tbb::simple_partitioner()); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } diff --git a/src/stan/services/sample/hmc_nuts_unit_e.hpp b/src/stan/services/sample/hmc_nuts_unit_e.hpp index 01c9fe2e1b..c7a2ca7c1b 100644 --- a/src/stan/services/sample/hmc_nuts_unit_e.hpp +++ b/src/stan/services/sample/hmc_nuts_unit_e.hpp @@ -69,10 +69,14 @@ int hmc_nuts_unit_e(Model& model, const stan::io::var_context& init, sampler.set_stepsize_jitter(stepsize_jitter); sampler.set_max_depth(max_depth); - util::run_sampler(sampler, model, cont_vector, num_warmup, num_samples, - num_thin, refresh, save_warmup, rng, interrupt, logger, - sample_writer, diagnostic_writer); - + try { + util::run_sampler(sampler, model, cont_vector, num_warmup, num_samples, + num_thin, refresh, save_warmup, rng, interrupt, logger, + sample_writer, diagnostic_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } @@ -155,21 +159,26 @@ int hmc_nuts_unit_e(Model& model, size_t num_chains, logger.error(e.what()); return error_codes::CONFIG; } - tbb::parallel_for( - tbb::blocked_range(0, num_chains, 1), - [num_warmup, num_samples, num_thin, refresh, save_warmup, num_chains, - init_chain_id, &samplers, &model, &rngs, &interrupt, &logger, - &sample_writer, &cont_vectors, - &diagnostic_writer](const tbb::blocked_range& r) { - for (size_t i = r.begin(); i != r.end(); ++i) { - util::run_sampler(samplers[i], model, cont_vectors[i], num_warmup, - num_samples, num_thin, refresh, save_warmup, - rngs[i], interrupt, logger, sample_writer[i], - diagnostic_writer[i], init_chain_id + i, - num_chains); - } - }, - tbb::simple_partitioner()); + try { + tbb::parallel_for( + tbb::blocked_range(0, num_chains, 1), + [num_warmup, num_samples, num_thin, refresh, save_warmup, num_chains, + init_chain_id, &samplers, &model, &rngs, &interrupt, &logger, + &sample_writer, &cont_vectors, + &diagnostic_writer](const tbb::blocked_range& r) { + for (size_t i = r.begin(); i != r.end(); ++i) { + util::run_sampler(samplers[i], model, cont_vectors[i], num_warmup, + num_samples, num_thin, refresh, save_warmup, + rngs[i], interrupt, logger, sample_writer[i], + diagnostic_writer[i], init_chain_id + i, + num_chains); + } + }, + tbb::simple_partitioner()); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } diff --git a/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp index 889c6d8920..5d74dae176 100644 --- a/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp @@ -83,11 +83,15 @@ int hmc_nuts_unit_e_adapt( sampler.get_stepsize_adaptation().set_kappa(kappa); sampler.get_stepsize_adaptation().set_t0(t0); - util::run_adaptive_sampler(sampler, model, cont_vector, num_warmup, - num_samples, num_thin, refresh, save_warmup, rng, - interrupt, logger, sample_writer, - diagnostic_writer, metric_writer); - + try { + util::run_adaptive_sampler(sampler, model, cont_vector, num_warmup, + num_samples, num_thin, refresh, save_warmup, rng, + interrupt, logger, sample_writer, + diagnostic_writer, metric_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } @@ -228,21 +232,26 @@ int hmc_nuts_unit_e_adapt( logger.error(e.what()); return error_codes::CONFIG; } - tbb::parallel_for( - tbb::blocked_range(0, num_chains, 1), - [num_warmup, num_samples, num_thin, refresh, save_warmup, num_chains, - init_chain_id, &samplers, &model, &rngs, &interrupt, &logger, - &sample_writer, &cont_vectors, &diagnostic_writer, - &metric_writer](const tbb::blocked_range& r) { - for (size_t i = r.begin(); i != r.end(); ++i) { - util::run_adaptive_sampler( - samplers[i], model, cont_vectors[i], num_warmup, num_samples, - num_thin, refresh, save_warmup, rngs[i], interrupt, logger, - sample_writer[i], diagnostic_writer[i], metric_writer[i], - init_chain_id + i, num_chains); - } - }, - tbb::simple_partitioner()); + try { + tbb::parallel_for( + tbb::blocked_range(0, num_chains, 1), + [num_warmup, num_samples, num_thin, refresh, save_warmup, num_chains, + init_chain_id, &samplers, &model, &rngs, &interrupt, &logger, + &sample_writer, &cont_vectors, &diagnostic_writer, + &metric_writer](const tbb::blocked_range& r) { + for (size_t i = r.begin(); i != r.end(); ++i) { + util::run_adaptive_sampler( + samplers[i], model, cont_vectors[i], num_warmup, num_samples, + num_thin, refresh, save_warmup, rngs[i], interrupt, logger, + sample_writer[i], diagnostic_writer[i], metric_writer[i], + init_chain_id + i, num_chains); + } + }, + tbb::simple_partitioner()); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } diff --git a/src/stan/services/sample/hmc_static_dense_e.hpp b/src/stan/services/sample/hmc_static_dense_e.hpp index c337636f9c..c093161738 100644 --- a/src/stan/services/sample/hmc_static_dense_e.hpp +++ b/src/stan/services/sample/hmc_static_dense_e.hpp @@ -76,9 +76,14 @@ int hmc_static_dense_e( sampler.set_nominal_stepsize_and_T(stepsize, int_time); sampler.set_stepsize_jitter(stepsize_jitter); - util::run_sampler(sampler, model, cont_vector, num_warmup, num_samples, - num_thin, refresh, save_warmup, rng, interrupt, logger, - sample_writer, diagnostic_writer); + try { + util::run_sampler(sampler, model, cont_vector, num_warmup, num_samples, + num_thin, refresh, save_warmup, rng, interrupt, logger, + sample_writer, diagnostic_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } diff --git a/src/stan/services/sample/hmc_static_dense_e_adapt.hpp b/src/stan/services/sample/hmc_static_dense_e_adapt.hpp index 21bd6d711d..b56082620a 100644 --- a/src/stan/services/sample/hmc_static_dense_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_dense_e_adapt.hpp @@ -98,10 +98,15 @@ int hmc_static_dense_e_adapt( logger); callbacks::structured_writer dummy_metric_writer; - util::run_adaptive_sampler(sampler, model, cont_vector, num_warmup, - num_samples, num_thin, refresh, save_warmup, rng, - interrupt, logger, sample_writer, - diagnostic_writer, dummy_metric_writer); + try { + util::run_adaptive_sampler(sampler, model, cont_vector, num_warmup, + num_samples, num_thin, refresh, save_warmup, rng, + interrupt, logger, sample_writer, + diagnostic_writer, dummy_metric_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } diff --git a/src/stan/services/sample/hmc_static_diag_e.hpp b/src/stan/services/sample/hmc_static_diag_e.hpp index 87ea955f84..b19c211047 100644 --- a/src/stan/services/sample/hmc_static_diag_e.hpp +++ b/src/stan/services/sample/hmc_static_diag_e.hpp @@ -78,10 +78,14 @@ int hmc_static_diag_e(Model& model, const stan::io::var_context& init, sampler.set_metric(inv_metric); sampler.set_nominal_stepsize_and_T(stepsize, int_time); sampler.set_stepsize_jitter(stepsize_jitter); - - util::run_sampler(sampler, model, cont_vector, num_warmup, num_samples, - num_thin, refresh, save_warmup, rng, interrupt, logger, - sample_writer, diagnostic_writer); + try { + util::run_sampler(sampler, model, cont_vector, num_warmup, num_samples, + num_thin, refresh, save_warmup, rng, interrupt, logger, + sample_writer, diagnostic_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } diff --git a/src/stan/services/sample/hmc_static_diag_e_adapt.hpp b/src/stan/services/sample/hmc_static_diag_e_adapt.hpp index 88979dc341..e4041b59b3 100644 --- a/src/stan/services/sample/hmc_static_diag_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_diag_e_adapt.hpp @@ -96,10 +96,16 @@ int hmc_static_diag_e_adapt( logger); callbacks::structured_writer dummy_metric_writer; - util::run_adaptive_sampler(sampler, model, cont_vector, num_warmup, - num_samples, num_thin, refresh, save_warmup, rng, - interrupt, logger, sample_writer, - diagnostic_writer, dummy_metric_writer); + + try { + util::run_adaptive_sampler(sampler, model, cont_vector, num_warmup, + num_samples, num_thin, refresh, save_warmup, rng, + interrupt, logger, sample_writer, + diagnostic_writer, dummy_metric_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } diff --git a/src/stan/services/sample/hmc_static_unit_e.hpp b/src/stan/services/sample/hmc_static_unit_e.hpp index d50c902479..8e2b8428fb 100644 --- a/src/stan/services/sample/hmc_static_unit_e.hpp +++ b/src/stan/services/sample/hmc_static_unit_e.hpp @@ -68,9 +68,14 @@ int hmc_static_unit_e(Model& model, const stan::io::var_context& init, sampler.set_nominal_stepsize_and_T(stepsize, int_time); sampler.set_stepsize_jitter(stepsize_jitter); - util::run_sampler(sampler, model, cont_vector, num_warmup, num_samples, - num_thin, refresh, save_warmup, rng, interrupt, logger, - sample_writer, diagnostic_writer); + try { + util::run_sampler(sampler, model, cont_vector, num_warmup, num_samples, + num_thin, refresh, save_warmup, rng, interrupt, logger, + sample_writer, diagnostic_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } diff --git a/src/stan/services/sample/hmc_static_unit_e_adapt.hpp b/src/stan/services/sample/hmc_static_unit_e_adapt.hpp index fb0da9aff5..bf4bf5c17e 100644 --- a/src/stan/services/sample/hmc_static_unit_e_adapt.hpp +++ b/src/stan/services/sample/hmc_static_unit_e_adapt.hpp @@ -80,10 +80,15 @@ int hmc_static_unit_e_adapt( sampler.get_stepsize_adaptation().set_t0(t0); callbacks::structured_writer dummy_metric_writer; - util::run_adaptive_sampler(sampler, model, cont_vector, num_warmup, - num_samples, num_thin, refresh, save_warmup, rng, - interrupt, logger, sample_writer, - diagnostic_writer, dummy_metric_writer); + try { + util::run_adaptive_sampler(sampler, model, cont_vector, num_warmup, + num_samples, num_thin, refresh, save_warmup, rng, + interrupt, logger, sample_writer, + diagnostic_writer, dummy_metric_writer); + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_codes::OK; } diff --git a/src/stan/services/sample/standalone_gqs.hpp b/src/stan/services/sample/standalone_gqs.hpp index 378be61106..c792acd08f 100644 --- a/src/stan/services/sample/standalone_gqs.hpp +++ b/src/stan/services/sample/standalone_gqs.hpp @@ -67,19 +67,23 @@ int standalone_generate(const Model &model, const Eigen::MatrixXd &draws, std::vector unconstrained_params_r; std::vector row(draws.cols()); - - for (size_t i = 0; i < draws.rows(); ++i) { - Eigen::Map(&row[0], draws.cols()) = draws.row(i); - try { - model.unconstrain_array(row, unconstrained_params_r, &msg); - } catch (const std::exception &e) { - if (msg.str().length() > 0) - logger.error(msg); - logger.error(e.what()); - return error_codes::DATAERR; + try { + for (size_t i = 0; i < draws.rows(); ++i) { + Eigen::Map(&row[0], draws.cols()) = draws.row(i); + try { + model.unconstrain_array(row, unconstrained_params_r, &msg); + } catch (const std::exception &e) { + if (msg.str().length() > 0) + logger.error(msg); + logger.error(e.what()); + return error_codes::DATAERR; + } + interrupt(); // call out to interrupt and fail + writer.write_gq_values(model, rng, unconstrained_params_r); } - interrupt(); // call out to interrupt and fail - writer.write_gq_values(model, rng, unconstrained_params_r); + } catch (const std::exception &e) { + logger.error(e.what()); + return error_codes::SOFTWARE; } return error_codes::OK; } @@ -147,34 +151,40 @@ int standalone_generate(const Model &model, const int num_chains, rngs.emplace_back(util::create_rng(seed, i + 1)); } bool error_any = false; - tbb::parallel_for( - tbb::blocked_range(0, num_chains, 1), - [&draws, &model, &logger, &interrupt, &writers, &rngs, - &error_any](const tbb::blocked_range &r) { - Eigen::VectorXd unconstrained_params_r(draws[0].cols()); - Eigen::VectorXd row(draws[0].cols()); - std::stringstream msg; - for (size_t slice_idx = r.begin(); slice_idx != r.end(); ++slice_idx) { - for (size_t i = 0; i < draws[slice_idx].rows(); ++i) { - if (error_any) - return; - try { - row = draws[slice_idx].row(i); - model.unconstrain_array(row, unconstrained_params_r, &msg); - } catch (const std::exception &e) { - if (msg.str().length() > 0) - logger.error(msg); - logger.error(e.what()); - error_any = true; - return; + try { + tbb::parallel_for( + tbb::blocked_range(0, num_chains, 1), + [&draws, &model, &logger, &interrupt, &writers, &rngs, + &error_any](const tbb::blocked_range &r) { + Eigen::VectorXd unconstrained_params_r(draws[0].cols()); + Eigen::VectorXd row(draws[0].cols()); + std::stringstream msg; + for (size_t slice_idx = r.begin(); slice_idx != r.end(); + ++slice_idx) { + for (size_t i = 0; i < draws[slice_idx].rows(); ++i) { + if (error_any) + return; + try { + row = draws[slice_idx].row(i); + model.unconstrain_array(row, unconstrained_params_r, &msg); + } catch (const std::domain_error &e) { + if (msg.str().length() > 0) + logger.error(msg); + logger.error(e.what()); + error_any = true; + return; + } + interrupt(); // call out to interrupt and fail + writers[slice_idx].write_gq_values(model, rngs[slice_idx], + unconstrained_params_r); } - interrupt(); // call out to interrupt and fail - writers[slice_idx].write_gq_values(model, rngs[slice_idx], - unconstrained_params_r); } - } - }, - tbb::simple_partitioner()); + }, + tbb::simple_partitioner()); + } catch (const std::exception &e) { + logger.error(e.what()); + return error_codes::SOFTWARE; + } return error_any ? error_codes::DATAERR : error_codes::OK; } From 759a5692b86ac4b12154379dba73319dff6ebe6d Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Thu, 25 Jan 2024 10:51:44 -0500 Subject: [PATCH 34/93] Fix pathfinder return --- src/stan/services/pathfinder/single.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/stan/services/pathfinder/single.hpp b/src/stan/services/pathfinder/single.hpp index 4719a40e1e..9b19f0be29 100644 --- a/src/stan/services/pathfinder/single.hpp +++ b/src/stan/services/pathfinder/single.hpp @@ -821,10 +821,14 @@ inline auto pathfinder_lbfgs_single( lbfgs_ss.str(""); } if (ReturnLpSamples) { + // we want to terminate multi-path pathfinder during these unrecoverable + // exceptions throw; } else { logger.error(e.what()); - return error_codes::SOFTWARE; + return internal::ret_pathfinder( + error_codes::SOFTWARE, Eigen::Array(0), + Eigen::Matrix(0, 0), 0); } } } From 50617bd3600001a0da1abf94f060073ac82ec102 Mon Sep 17 00:00:00 2001 From: aleksgorica Date: Sun, 11 Feb 2024 14:22:47 +0100 Subject: [PATCH 35/93] Eigen::Index; index without calculating rows, cols; removed online way of calculating variance and averages --- .../compute_potential_scale_reduction.hpp | 83 +++++++------------ 1 file changed, 32 insertions(+), 51 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 17a0197104..fcc3ee41ce 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -27,45 +27,39 @@ namespace analyze { */ Eigen::MatrixXd rank_transform(const Eigen::MatrixXd& draws) { - int rows = draws.rows(); - int cols = draws.cols(); - int size = rows * cols; - Eigen::MatrixXd rankMatrix = Eigen::MatrixXd::Zero(rows, cols); + const Eigen::Index rows = draws.rows(); + const Eigen::Index cols = draws.cols(); + const Eigen::Index size = rows * cols; - std::vector> valueWithIndex(size); + std::vector> value_with_index(size); - for (int col = 0; col < cols; ++col) { - for (int row = 0; row < rows; ++row) { - int index - = col * rows + row; // Calculating linear index in column-major order - valueWithIndex[index] = {draws(row, col), index}; - } + for (Eigen::Index i = 0; i < size; ++i) { + value_with_index[i] = {draws(i), i}; } - std::sort(valueWithIndex.begin(), valueWithIndex.end()); + std::sort(value_with_index.begin(), value_with_index.end()); + + + Eigen::MatrixXd rankMatrix = Eigen::MatrixXd::Zero(rows, cols); // Assigning average ranks - for (int i = 0; i < size; ++i) { + for (Eigen::Index i = 0; i < size; ++i) { // Handle ties by averaging ranks - int j = i; - double sumRanks = 0; - int count = 0; + Eigen::Index j = i+1; + double sumRanks = j; + Eigen::Index count = 1; - while (j < size && valueWithIndex[j].first == valueWithIndex[i].first) { + while (j < size && value_with_index[j].first == value_with_index[i].first) { sumRanks += j + 1; // Rank starts from 1 ++j; ++count; } - double avgRank = sumRanks / count; - boost::math::normal_distribution - dist; // Standard normal distribution - for (int k = i; k < j; ++k) { - int index = valueWithIndex[k].second; - int row = index % rows; // Adjusting row index for column-major order - int col = index / rows; // Adjusting column index for column-major order + boost::math::normal_distribution dist; + for (std::size_t k = i; k < j; ++k) { + Eigen::Index index = value_with_index[k].second; double p = (avgRank - 3.0 / 8.0) / (size - 2.0 * 3.0 / 8.0 + 1.0); - rankMatrix(row, col) = boost::math::quantile(dist, p); + rankMatrix(index) = boost::math::quantile(dist, p); } i = j - 1; // Skip over tied elements } @@ -73,41 +67,28 @@ Eigen::MatrixXd rank_transform(const Eigen::MatrixXd& draws) { } /** - * Computes square root of marginal posterior variance of the estimand by + * Computes square root of marginal posterior variance of the estimand by the * weigted average of within-chain variance W and between-chain variance B. * * @param draws stores chains in columns * @return square root of ((N-1)/N)W + B/N * */ + inline double rhat(const Eigen::MatrixXd& draws) { - int num_chains = draws.cols(); - int num_draws = draws.rows(); + const Eigen::Index num_chains = draws.cols(); + const Eigen::Index num_draws = draws.rows(); + Eigen::VectorXd chain_mean(num_chains); - boost::accumulators::accumulator_set< - double, boost::accumulators::stats> - acc_chain_mean; - Eigen::VectorXd chain_var(num_chains); - double unbiased_var_scale = num_draws / (num_draws - 1.0); - for (int chain = 0; chain < num_chains; ++chain) { - boost::accumulators::accumulator_set< - double, boost::accumulators::stats> - acc_draw; - for (int n = 0; n < num_draws; ++n) { - acc_draw(draws(n, chain)); - } - chain_mean(chain) = boost::accumulators::mean(acc_draw); - acc_chain_mean(chain_mean(chain)); - chain_var(chain) - = boost::accumulators::variance(acc_draw) * unbiased_var_scale; + chain_mean = draws.colwise().mean(); + double total_mean = chain_mean.mean(); + double var_between = num_draws * (chain_mean.array() - total_mean).square().sum() / (num_chains-1); + double var_sum = 0; + for (Eigen::Index col = 0; col < num_chains; ++col) { + var_sum += (draws.col(col).array() - chain_mean(col)).square().sum() / (num_draws - 1); } - - double var_between = num_draws * boost::accumulators::variance(acc_chain_mean) - * num_chains / (num_chains - 1); - double var_within = chain_var.mean(); - - return sqrt((var_between / var_within + num_draws - 1) / num_draws); + double var_within = var_sum / num_chains; + return sqrt((var_between / var_within + num_draws - 1) / num_draws); } /** From dc130f84ab476d648e43c201f713be4707ae3fcc Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Sun, 11 Feb 2024 08:24:13 -0500 Subject: [PATCH 36/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- .../mcmc/compute_potential_scale_reduction.hpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index fcc3ee41ce..dfce574666 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -39,13 +39,12 @@ Eigen::MatrixXd rank_transform(const Eigen::MatrixXd& draws) { std::sort(value_with_index.begin(), value_with_index.end()); - Eigen::MatrixXd rankMatrix = Eigen::MatrixXd::Zero(rows, cols); // Assigning average ranks for (Eigen::Index i = 0; i < size; ++i) { // Handle ties by averaging ranks - Eigen::Index j = i+1; + Eigen::Index j = i + 1; double sumRanks = j; Eigen::Index count = 1; @@ -55,7 +54,7 @@ Eigen::MatrixXd rank_transform(const Eigen::MatrixXd& draws) { ++count; } double avgRank = sumRanks / count; - boost::math::normal_distribution dist; + boost::math::normal_distribution dist; for (std::size_t k = i; k < j; ++k) { Eigen::Index index = value_with_index[k].second; double p = (avgRank - 3.0 / 8.0) / (size - 2.0 * 3.0 / 8.0 + 1.0); @@ -82,13 +81,16 @@ inline double rhat(const Eigen::MatrixXd& draws) { Eigen::VectorXd chain_mean(num_chains); chain_mean = draws.colwise().mean(); double total_mean = chain_mean.mean(); - double var_between = num_draws * (chain_mean.array() - total_mean).square().sum() / (num_chains-1); + double var_between = num_draws + * (chain_mean.array() - total_mean).square().sum() + / (num_chains - 1); double var_sum = 0; for (Eigen::Index col = 0; col < num_chains; ++col) { - var_sum += (draws.col(col).array() - chain_mean(col)).square().sum() / (num_draws - 1); + var_sum += (draws.col(col).array() - chain_mean(col)).square().sum() + / (num_draws - 1); } double var_within = var_sum / num_chains; - return sqrt((var_between / var_within + num_draws - 1) / num_draws); + return sqrt((var_between / var_within + num_draws - 1) / num_draws); } /** From 24ef95f1cd6344e2d641646eab357fbb6cf16b56 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 13 Feb 2024 12:16:55 -0500 Subject: [PATCH 37/93] Move try/catch outside optimization loop --- src/stan/services/optimize/bfgs.hpp | 110 +++++++++++++-------------- src/stan/services/optimize/lbfgs.hpp | 107 ++++++++++++-------------- 2 files changed, 102 insertions(+), 115 deletions(-) diff --git a/src/stan/services/optimize/bfgs.hpp b/src/stan/services/optimize/bfgs.hpp index bcb0e49f31..f282de6f98 100644 --- a/src/stan/services/optimize/bfgs.hpp +++ b/src/stan/services/optimize/bfgs.hpp @@ -114,74 +114,68 @@ int bfgs(Model& model, const stan::io::var_context& init, } int ret = 0; - while (ret == 0) { - interrupt(); - if (refresh > 0 - && (bfgs.iter_num() == 0 || ((bfgs.iter_num() + 1) % refresh == 0))) - logger.info( - " Iter" - " log prob" - " ||dx||" - " ||grad||" - " alpha" - " alpha0" - " # evals" - " Notes "); + try { + while (ret == 0) { + interrupt(); + if (refresh > 0 + && (bfgs.iter_num() == 0 || ((bfgs.iter_num() + 1) % refresh == 0))) + logger.info( + " Iter" + " log prob" + " ||dx||" + " ||grad||" + " alpha" + " alpha0" + " # evals" + " Notes "); - try { ret = bfgs.step(); - } catch (const std::exception& e) { - logger.error(e.what()); - return error_codes::SOFTWARE; - } - lp = bfgs.logp(); - bfgs.params_r(cont_vector); - - if (refresh > 0 - && (ret != 0 || !bfgs.note().empty() || bfgs.iter_num() == 0 - || ((bfgs.iter_num() + 1) % refresh == 0))) { - std::stringstream msg; - msg << " " << std::setw(7) << bfgs.iter_num() << " "; - msg << " " << std::setw(12) << std::setprecision(6) << lp << " "; - msg << " " << std::setw(12) << std::setprecision(6) - << bfgs.prev_step_size() << " "; - msg << " " << std::setw(12) << std::setprecision(6) - << bfgs.curr_g().norm() << " "; - msg << " " << std::setw(10) << std::setprecision(4) << bfgs.alpha() - << " "; - msg << " " << std::setw(10) << std::setprecision(4) << bfgs.alpha0() - << " "; - msg << " " << std::setw(7) << bfgs.grad_evals() << " "; - msg << " " << bfgs.note() << " "; - logger.info(msg); - } + lp = bfgs.logp(); + bfgs.params_r(cont_vector); + + if (refresh > 0 + && (ret != 0 || !bfgs.note().empty() || bfgs.iter_num() == 0 + || ((bfgs.iter_num() + 1) % refresh == 0))) { + std::stringstream msg; + msg << " " << std::setw(7) << bfgs.iter_num() << " "; + msg << " " << std::setw(12) << std::setprecision(6) << lp << " "; + msg << " " << std::setw(12) << std::setprecision(6) + << bfgs.prev_step_size() << " "; + msg << " " << std::setw(12) << std::setprecision(6) + << bfgs.curr_g().norm() << " "; + msg << " " << std::setw(10) << std::setprecision(4) << bfgs.alpha() + << " "; + msg << " " << std::setw(10) << std::setprecision(4) << bfgs.alpha0() + << " "; + msg << " " << std::setw(7) << bfgs.grad_evals() << " "; + msg << " " << bfgs.note() << " "; + logger.info(msg); + } - if (bfgs_ss.str().length() > 0) { - logger.info(bfgs_ss); - bfgs_ss.str(""); - } + if (bfgs_ss.str().length() > 0) { + logger.info(bfgs_ss); + bfgs_ss.str(""); + } - if (save_iterations) { - std::vector values; - std::stringstream msg; - try { + if (save_iterations) { + std::vector values; + std::stringstream msg; model.write_array(rng, cont_vector, disc_vector, values, true, true, &msg); - } catch (const std::exception& e) { - if (msg.str().length() > 0) { + + // This if is here to match the pre-refactor behavior + if (msg.str().length() > 0) logger.info(msg); - } - logger.error(e.what()); - return error_codes::SOFTWARE; - } - // This if is here to match the pre-refactor behavior - if (msg.str().length() > 0) - logger.info(msg); - values.insert(values.begin(), lp); - parameter_writer(values); + values.insert(values.begin(), lp); + parameter_writer(values); + } } + + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; } if (!save_iterations) { diff --git a/src/stan/services/optimize/lbfgs.hpp b/src/stan/services/optimize/lbfgs.hpp index 9045b5470e..bf50e9088f 100644 --- a/src/stan/services/optimize/lbfgs.hpp +++ b/src/stan/services/optimize/lbfgs.hpp @@ -109,72 +109,65 @@ int lbfgs(Model& model, const stan::io::var_context& init, } int ret = 0; - while (ret == 0) { - interrupt(); - if (refresh > 0 - && (lbfgs.iter_num() == 0 || ((lbfgs.iter_num() + 1) % refresh == 0))) - logger.info( - " Iter" - " log prob" - " ||dx||" - " ||grad||" - " alpha" - " alpha0" - " # evals" - " Notes "); + try { + while (ret == 0) { + interrupt(); + if (refresh > 0 + && (lbfgs.iter_num() == 0 || ((lbfgs.iter_num() + 1) % refresh == 0))) + logger.info( + " Iter" + " log prob" + " ||dx||" + " ||grad||" + " alpha" + " alpha0" + " # evals" + " Notes "); - try { ret = lbfgs.step(); - } catch (const std::exception& e) { - logger.error(e.what()); - return error_codes::SOFTWARE; - } - lp = lbfgs.logp(); - lbfgs.params_r(cont_vector); - - if (refresh > 0 - && (ret != 0 || !lbfgs.note().empty() || lbfgs.iter_num() == 0 - || ((lbfgs.iter_num() + 1) % refresh == 0))) { - std::stringstream msg; - msg << " " << std::setw(7) << lbfgs.iter_num() << " "; - msg << " " << std::setw(12) << std::setprecision(6) << lp << " "; - msg << " " << std::setw(12) << std::setprecision(6) - << lbfgs.prev_step_size() << " "; - msg << " " << std::setw(12) << std::setprecision(6) - << lbfgs.curr_g().norm() << " "; - msg << " " << std::setw(10) << std::setprecision(4) << lbfgs.alpha() - << " "; - msg << " " << std::setw(10) << std::setprecision(4) << lbfgs.alpha0() - << " "; - msg << " " << std::setw(7) << lbfgs.grad_evals() << " "; - msg << " " << lbfgs.note() << " "; - logger.info(msg); - } - if (lbfgs_ss.str().length() > 0) { - logger.info(lbfgs_ss); - lbfgs_ss.str(""); - } + lp = lbfgs.logp(); + lbfgs.params_r(cont_vector); + + if (refresh > 0 + && (ret != 0 || !lbfgs.note().empty() || lbfgs.iter_num() == 0 + || ((lbfgs.iter_num() + 1) % refresh == 0))) { + std::stringstream msg; + msg << " " << std::setw(7) << lbfgs.iter_num() << " "; + msg << " " << std::setw(12) << std::setprecision(6) << lp << " "; + msg << " " << std::setw(12) << std::setprecision(6) + << lbfgs.prev_step_size() << " "; + msg << " " << std::setw(12) << std::setprecision(6) + << lbfgs.curr_g().norm() << " "; + msg << " " << std::setw(10) << std::setprecision(4) << lbfgs.alpha() + << " "; + msg << " " << std::setw(10) << std::setprecision(4) << lbfgs.alpha0() + << " "; + msg << " " << std::setw(7) << lbfgs.grad_evals() << " "; + msg << " " << lbfgs.note() << " "; + logger.info(msg); + } - if (save_iterations) { - std::vector values; - std::stringstream msg; - try { + if (lbfgs_ss.str().length() > 0) { + logger.info(lbfgs_ss); + lbfgs_ss.str(""); + } + + if (save_iterations) { + std::vector values; + std::stringstream msg; model.write_array(rng, cont_vector, disc_vector, values, true, true, &msg); - } catch (const std::exception& e) { - if (msg.str().length() > 0) { + if (msg.str().length() > 0) logger.info(msg); - } - logger.error(e.what()); - return error_codes::SOFTWARE; - } - if (msg.str().length() > 0) - logger.info(msg); - values.insert(values.begin(), lp); - parameter_writer(values); + values.insert(values.begin(), lp); + parameter_writer(values); + } } + } catch (const std::exception& e) { + logger.error(e.what()); + return error_codes::SOFTWARE; } if (!save_iterations) { From c95036b4ea48d711aae15bfbc36fc26e406d36f0 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 13 Feb 2024 12:20:17 -0500 Subject: [PATCH 38/93] cpplint fix --- src/stan/services/optimize/bfgs.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/stan/services/optimize/bfgs.hpp b/src/stan/services/optimize/bfgs.hpp index f282de6f98..37cd0a5897 100644 --- a/src/stan/services/optimize/bfgs.hpp +++ b/src/stan/services/optimize/bfgs.hpp @@ -172,7 +172,6 @@ int bfgs(Model& model, const stan::io::var_context& init, parameter_writer(values); } } - } catch (const std::exception& e) { logger.error(e.what()); return error_codes::SOFTWARE; From 223497ac7d011544ace7b8ab9531dedf26d9e9f8 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 30 Jan 2024 14:21:47 -0500 Subject: [PATCH 39/93] Change RNG to boost::mixmax --- src/stan/services/util/create_rng.hpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/stan/services/util/create_rng.hpp b/src/stan/services/util/create_rng.hpp index 9d3b79a1d3..231b57170b 100644 --- a/src/stan/services/util/create_rng.hpp +++ b/src/stan/services/util/create_rng.hpp @@ -1,11 +1,11 @@ #ifndef STAN_SERVICES_UTIL_CREATE_RNG_HPP #define STAN_SERVICES_UTIL_CREATE_RNG_HPP -#include +#include namespace stan { -using rng_t = boost::ecuyer1988; +using rng_t = boost::random::mixmax; namespace services { namespace util { @@ -26,12 +26,7 @@ namespace util { * @return an stan::rng_t instance */ inline rng_t create_rng(unsigned int seed, unsigned int chain) { - using boost::uintmax_t; - static constexpr uintmax_t DISCARD_STRIDE = static_cast(1) << 50; - rng_t rng(seed); - // always discard at least 1 to avoid issue with small seeds for certain RNG - // distributions. See stan#3167 and boostorg/random#92 - rng.discard(std::max(static_cast(1), DISCARD_STRIDE * chain)); + rng_t rng(seed + chain); return rng; } From 3b75dc05d898293c23c183e5bf394ba505f7e58e Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 30 Jan 2024 16:34:18 -0500 Subject: [PATCH 40/93] Update seed/rng-dependent tests --- .../unit/mcmc/hmc/nuts/base_nuts_test.cpp | 6 +- .../unit/mcmc/hmc/nuts/softabs_nuts_test.cpp | 16 ++--- .../unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp | 16 ++--- .../derived_static_uniform_test.cpp | 64 +++++++++---------- .../unit/mcmc/hmc/xhmc/base_xhmc_test.cpp | 4 +- .../unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp | 18 +++--- .../unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp | 18 +++--- .../services/pathfinder/normal_glm_test.cpp | 30 +++++---- src/test/unit/services/pathfinder/util.hpp | 6 +- .../unit/variational/advi_messages_test.cpp | 2 +- .../unit/variational/eta_adapt_small_test.cpp | 7 +- 11 files changed, 97 insertions(+), 90 deletions(-) diff --git a/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp b/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp index ba814578cf..3f230d01a3 100644 --- a/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp @@ -333,7 +333,7 @@ TEST(McmcNutsBaseNuts, divergence_test) { } TEST(McmcNutsBaseNuts, transition) { - stan::rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; double init_momentum = 1.5; @@ -362,7 +362,7 @@ TEST(McmcNutsBaseNuts, transition) { EXPECT_EQ((2 << (sampler.get_max_depth() - 1)) - 1, sampler.n_leapfrog_); EXPECT_FALSE(sampler.divergent_); - EXPECT_EQ(21 * init_momentum, s.cont_params()(0)); + EXPECT_EQ(-31 * init_momentum, s.cont_params()(0)); EXPECT_EQ(0, s.log_prob()); EXPECT_EQ(1, s.accept_stat()); EXPECT_EQ("", debug.str()); @@ -373,7 +373,7 @@ TEST(McmcNutsBaseNuts, transition) { } TEST(McmcNutsBaseNuts, transition_egde_momenta) { - stan::rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(424243, 0); int model_size = 1; double init_momentum = 1.5; diff --git a/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp b/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp index 62fc69aa5b..e9d64cd9fa 100644 --- a/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp @@ -309,7 +309,7 @@ TEST(McmcSoftAbsNuts, tree_boundary_test) { } TEST(McmcSoftAbsNuts, transition_test) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::softabs_point z_init(3); z_init.q(0) = 1; @@ -338,15 +338,15 @@ TEST(McmcSoftAbsNuts, transition_test) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_EQ(4, sampler.depth_); - EXPECT_EQ((2 << 3) - 1, sampler.n_leapfrog_); + EXPECT_EQ(5, sampler.depth_); + EXPECT_EQ((2 << 4) - 1, sampler.n_leapfrog_); EXPECT_FALSE(sampler.divergent_); - EXPECT_FLOAT_EQ(1.9313564, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-0.86902142, s.cont_params()(1)); - EXPECT_FLOAT_EQ(1.6008, s.cont_params()(2)); - EXPECT_FLOAT_EQ(-3.5239484, s.log_prob()); - EXPECT_FLOAT_EQ(0.99690288, s.accept_stat()); + EXPECT_FLOAT_EQ(-1.7373296, s.cont_params()(0)); + EXPECT_FLOAT_EQ(1.0898665, s.cont_params()(1)); + EXPECT_FLOAT_EQ(-0.38303182, s.cont_params()(2)); + EXPECT_FLOAT_EQ(-2.1764181, s.log_prob()); + EXPECT_FLOAT_EQ(0.9993856, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); diff --git a/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp b/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp index 076e12ce7b..43f6ecb04d 100644 --- a/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp @@ -309,7 +309,7 @@ TEST(McmcUnitENuts, tree_boundary_test) { } TEST(McmcUnitENuts, transition_test) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::unit_e_point z_init(3); z_init.q(0) = 1; @@ -338,15 +338,15 @@ TEST(McmcUnitENuts, transition_test) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_EQ(4, sampler.depth_); - EXPECT_EQ((2 << 3) - 1, sampler.n_leapfrog_); + EXPECT_EQ(5, sampler.depth_); + EXPECT_EQ((2 << 4) - 1, sampler.n_leapfrog_); EXPECT_FALSE(sampler.divergent_); - EXPECT_FLOAT_EQ(1.8718261, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-0.74208695, s.cont_params()(1)); - EXPECT_FLOAT_EQ(1.5202962, s.cont_params()(2)); - EXPECT_FLOAT_EQ(-3.1828632, s.log_prob()); - EXPECT_FLOAT_EQ(0.99604273, s.accept_stat()); + EXPECT_FLOAT_EQ(-1.7890506, s.cont_params()(0)); + EXPECT_FLOAT_EQ(1.2320533, s.cont_params()(1)); + EXPECT_FLOAT_EQ(-0.62397981, s.cont_params()(2)); + EXPECT_FLOAT_EQ(-2.554004, s.log_prob()); + EXPECT_FLOAT_EQ(0.99910343, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); diff --git a/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp b/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp index 0791f94319..bd01ec70d2 100644 --- a/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp +++ b/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp @@ -15,7 +15,7 @@ #include TEST(McmcStaticUniform, unit_e_transition) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::unit_e_point z_init(1); z_init.q(0) = 1; @@ -41,9 +41,9 @@ TEST(McmcStaticUniform, unit_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(0.27224374, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-0.037058324, s.log_prob()); - EXPECT_FLOAT_EQ(0.9998666, s.accept_stat()); + EXPECT_FLOAT_EQ(1.5896972, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-1.2635686, s.log_prob()); + EXPECT_FLOAT_EQ(0.9994188, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -52,7 +52,7 @@ TEST(McmcStaticUniform, unit_e_transition) { } TEST(McmcStaticUniform, diag_e_transition) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::diag_e_point z_init(1); z_init.q(0) = 1; @@ -78,9 +78,9 @@ TEST(McmcStaticUniform, diag_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(0.27224374, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-0.037058324, s.log_prob()); - EXPECT_FLOAT_EQ(0.9998666, s.accept_stat()); + EXPECT_FLOAT_EQ(1.5896972, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-1.2635686, s.log_prob()); + EXPECT_FLOAT_EQ(0.9994188, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -89,7 +89,7 @@ TEST(McmcStaticUniform, diag_e_transition) { } TEST(McmcStaticUniform, dense_e_transition) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::dense_e_point z_init(1); z_init.q(0) = 1; @@ -115,9 +115,9 @@ TEST(McmcStaticUniform, dense_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(0.27224374, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-0.037058324, s.log_prob()); - EXPECT_FLOAT_EQ(0.9998666, s.accept_stat()); + EXPECT_FLOAT_EQ(1.5896972, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-1.2635686, s.log_prob()); + EXPECT_FLOAT_EQ(0.9994188, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -126,7 +126,7 @@ TEST(McmcStaticUniform, dense_e_transition) { } TEST(McmcStaticUniform, softabs_transition) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::softabs_point z_init(1); z_init.q(0) = 1; @@ -152,9 +152,9 @@ TEST(McmcStaticUniform, softabs_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(0.37006485, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-0.068473995, s.log_prob()); - EXPECT_FLOAT_EQ(0.9999119, s.accept_stat()); + EXPECT_FLOAT_EQ(1.5338461, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-1.176342, s.log_prob()); + EXPECT_FLOAT_EQ(0.9996115, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -163,7 +163,7 @@ TEST(McmcStaticUniform, softabs_transition) { } TEST(McmcStaticUniform, adapt_unit_e_transition) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::unit_e_point z_init(1); z_init.q(0) = 1; @@ -189,9 +189,9 @@ TEST(McmcStaticUniform, adapt_unit_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(0.27224374, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-0.037058324, s.log_prob()); - EXPECT_FLOAT_EQ(0.9998666, s.accept_stat()); + EXPECT_FLOAT_EQ(1.5896972, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-1.2635686, s.log_prob()); + EXPECT_FLOAT_EQ(0.9994188, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -200,7 +200,7 @@ TEST(McmcStaticUniform, adapt_unit_e_transition) { } TEST(McmcStaticUniform, adapt_diag_e_transition) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::diag_e_point z_init(1); z_init.q(0) = 1; @@ -226,9 +226,9 @@ TEST(McmcStaticUniform, adapt_diag_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(0.27224374, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-0.037058324, s.log_prob()); - EXPECT_FLOAT_EQ(0.9998666, s.accept_stat()); + EXPECT_FLOAT_EQ(1.5896972, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-1.2635686, s.log_prob()); + EXPECT_FLOAT_EQ(0.9994188, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -237,7 +237,7 @@ TEST(McmcStaticUniform, adapt_diag_e_transition) { } TEST(McmcStaticUniform, adapt_dense_e_transition) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::dense_e_point z_init(1); z_init.q(0) = 1; @@ -263,9 +263,9 @@ TEST(McmcStaticUniform, adapt_dense_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(0.27224374, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-0.037058324, s.log_prob()); - EXPECT_FLOAT_EQ(0.9998666, s.accept_stat()); + EXPECT_FLOAT_EQ(1.5896972, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-1.2635686, s.log_prob()); + EXPECT_FLOAT_EQ(0.9994188, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -274,7 +274,7 @@ TEST(McmcStaticUniform, adapt_dense_e_transition) { } TEST(McmcStaticUniform, adapt_softabs_e_transition) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::softabs_point z_init(1); z_init.q(0) = 1; @@ -300,9 +300,9 @@ TEST(McmcStaticUniform, adapt_softabs_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(0.37006485, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-0.068473995, s.log_prob()); - EXPECT_FLOAT_EQ(0.9999119, s.accept_stat()); + EXPECT_FLOAT_EQ(1.5338461, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-1.176342, s.log_prob()); + EXPECT_FLOAT_EQ(0.9996115, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); diff --git a/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp b/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp index f09b4374ed..619f291a6e 100644 --- a/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp +++ b/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp @@ -221,7 +221,7 @@ TEST(McmcXHMCBaseXHMC, divergence_test) { } TEST(McmcXHMCBaseXHMC, transition) { - stan::rng_t base_rng(0); + stan::rng_t base_rng = stan::services::util::create_rng(0, 0); int model_size = 1; double init_momentum = 1.5; @@ -245,7 +245,7 @@ TEST(McmcXHMCBaseXHMC, transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_EQ(31.5, s.cont_params()(0)); + EXPECT_EQ(-31 * init_momentum, s.cont_params()(0)); EXPECT_EQ(0, s.log_prob()); EXPECT_EQ(1, s.accept_stat()); EXPECT_EQ("", debug.str()); diff --git a/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp b/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp index 274732fc14..f5db914a35 100644 --- a/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp +++ b/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp @@ -8,7 +8,7 @@ #include TEST(McmcUnitEXHMC, build_tree) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(4839294, 0); stan::mcmc::softabs_point z_init(3); z_init.q(0) = 1; @@ -58,13 +58,13 @@ TEST(McmcUnitEXHMC, build_tree) { EXPECT_FLOAT_EQ(1.5019561, sampler.z().p(1)); EXPECT_FLOAT_EQ(-1.5019561, sampler.z().p(2)); - EXPECT_FLOAT_EQ(0.8330583, z_propose.q(0)); - EXPECT_FLOAT_EQ(-0.8330583, z_propose.q(1)); - EXPECT_FLOAT_EQ(0.8330583, z_propose.q(2)); + EXPECT_FLOAT_EQ(0.42903179, z_propose.q(0)); + EXPECT_FLOAT_EQ(-0.42903179, z_propose.q(1)); + EXPECT_FLOAT_EQ(0.42903179, z_propose.q(2)); - EXPECT_FLOAT_EQ(-1.1836562, z_propose.p(0)); - EXPECT_FLOAT_EQ(1.1836562, z_propose.p(1)); - EXPECT_FLOAT_EQ(-1.1836562, z_propose.p(2)); + EXPECT_FLOAT_EQ(-1.4385087, z_propose.p(0)); + EXPECT_FLOAT_EQ(1.4385087, z_propose.p(1)); + EXPECT_FLOAT_EQ(-1.4385087, z_propose.p(2)); EXPECT_EQ(8, n_leapfrog); EXPECT_FLOAT_EQ(3.7645235, ave); @@ -79,7 +79,7 @@ TEST(McmcUnitEXHMC, build_tree) { } TEST(McmcUnitEXHMC, transition) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(483294, 0); stan::mcmc::softabs_point z_init(3); z_init.q(0) = 1; @@ -112,7 +112,7 @@ TEST(McmcUnitEXHMC, transition) { EXPECT_FLOAT_EQ(-1, s.cont_params()(1)); EXPECT_FLOAT_EQ(1, s.cont_params()(2)); EXPECT_FLOAT_EQ(-1.5, s.log_prob()); - EXPECT_FLOAT_EQ(0.99829924, s.accept_stat()); + EXPECT_FLOAT_EQ(0.99993229, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); diff --git a/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp b/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp index 87726ad499..0f9dcbb8dd 100644 --- a/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp +++ b/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp @@ -8,7 +8,7 @@ #include TEST(McmcUnitEXHMC, build_tree) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(483294, 0); stan::mcmc::unit_e_point z_init(3); z_init.q(0) = 1; @@ -58,13 +58,13 @@ TEST(McmcUnitEXHMC, build_tree) { EXPECT_FLOAT_EQ(1.4131583, sampler.z().p(1)); EXPECT_FLOAT_EQ(-1.4131583, sampler.z().p(2)); - EXPECT_FLOAT_EQ(0.78105003, z_propose.q(0)); - EXPECT_FLOAT_EQ(-0.78105003, z_propose.q(1)); - EXPECT_FLOAT_EQ(0.78105003, z_propose.q(2)); + EXPECT_FLOAT_EQ(0.65928948, z_propose.q(0)); + EXPECT_FLOAT_EQ(-0.65928948, z_propose.q(1)); + EXPECT_FLOAT_EQ(0.65928948, z_propose.q(2)); - EXPECT_FLOAT_EQ(-1.1785525, z_propose.p(0)); - EXPECT_FLOAT_EQ(1.1785525, z_propose.p(1)); - EXPECT_FLOAT_EQ(-1.1785525, z_propose.p(2)); + EXPECT_FLOAT_EQ(-1.2505695, z_propose.p(0)); + EXPECT_FLOAT_EQ(1.2505695, z_propose.p(1)); + EXPECT_FLOAT_EQ(-1.2505695, z_propose.p(2)); EXPECT_EQ(8, n_leapfrog); EXPECT_FLOAT_EQ(4.2207355, ave); @@ -79,7 +79,7 @@ TEST(McmcUnitEXHMC, build_tree) { } TEST(McmcUnitEXHMC, transition) { - stan::rng_t base_rng(4839294); + stan::rng_t base_rng = stan::services::util::create_rng(483294, 0); stan::mcmc::unit_e_point z_init(3); z_init.q(0) = 1; @@ -112,7 +112,7 @@ TEST(McmcUnitEXHMC, transition) { EXPECT_FLOAT_EQ(-1, s.cont_params()(1)); EXPECT_FLOAT_EQ(1, s.cont_params()(2)); EXPECT_FLOAT_EQ(-1.5, s.log_prob()); - EXPECT_FLOAT_EQ(0.99805242, s.accept_stat()); + EXPECT_FLOAT_EQ(0.99994934, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); diff --git a/src/test/unit/services/pathfinder/normal_glm_test.cpp b/src/test/unit/services/pathfinder/normal_glm_test.cpp index 445c2ff53b..1fd4863291 100644 --- a/src/test/unit/services/pathfinder/normal_glm_test.cpp +++ b/src/test/unit/services/pathfinder/normal_glm_test.cpp @@ -83,17 +83,19 @@ TEST_F(ServicesPathfinderGLM, single) { constexpr int refresh = 1; stan::test::mock_callback callback; - stan::io::empty_var_context empty_context; // = init_init_context(); + stan::io::array_var_context init_context = init_init_context(); std::unique_ptr empty_ostream(nullptr); stan::test::test_logger logger(std::move(empty_ostream)); std::vector> input_iters; - stan::services::pathfinder::pathfinder_lbfgs_single( - model, empty_context, seed, chain, init_radius, history_size, init_alpha, + int rc = stan::services::pathfinder::pathfinder_lbfgs_single( + model, init_context, seed, chain, init_radius, history_size, init_alpha, tol_obj, tol_rel_obj, tol_grad, tol_rel_grad, tol_param, num_iterations, num_elbo_draws, num_draws, save_iterations, refresh, callback, logger, init, parameter, diagnostics); + ASSERT_EQ(rc, 0); + Eigen::MatrixXd param_vals = std::move(parameter.values_); Eigen::IOFormat CommaInitFmt(Eigen::StreamPrecision, 0, ", ", ", ", "\n", "", "", ""); @@ -154,17 +156,18 @@ TEST_F(ServicesPathfinderGLM, single_noreturnlp) { constexpr bool calculate_lp = false; stan::test::mock_callback callback; - stan::io::empty_var_context empty_context; // = init_init_context(); + stan::io::array_var_context init_context = init_init_context(); std::unique_ptr empty_ostream(nullptr); stan::test::test_logger logger(std::move(empty_ostream)); std::vector> input_iters; - stan::services::pathfinder::pathfinder_lbfgs_single( - model, empty_context, seed, chain, init_radius, history_size, init_alpha, + int rc = stan::services::pathfinder::pathfinder_lbfgs_single( + model, init_context, seed, chain, init_radius, history_size, init_alpha, tol_obj, tol_rel_obj, tol_grad, tol_rel_grad, tol_param, num_iterations, num_elbo_draws, num_draws, save_iterations, refresh, callback, logger, init, parameter, diagnostics, calculate_lp); + ASSERT_EQ(rc, 0); Eigen::MatrixXd param_vals = std::move(parameter.values_); for (Eigen::Index i = 0; i < num_elbo_draws; ++i) { EXPECT_FALSE(std::isnan(param_vals.coeff(1, num_draws + i))) @@ -206,7 +209,7 @@ TEST_F(ServicesPathfinderGLM, multi) { std::make_unique(init_init_context())); } stan::test::mock_callback callback; - stan::services::pathfinder::pathfinder_lbfgs_multi( + int rc = stan::services::pathfinder::pathfinder_lbfgs_multi( model, single_path_inits, seed, chain, init_radius, history_size, init_alpha, tol_obj, tol_rel_obj, tol_grad, tol_rel_grad, tol_param, num_iterations, num_elbo_draws, num_draws, num_multi_draws, num_paths, @@ -214,6 +217,7 @@ TEST_F(ServicesPathfinderGLM, multi) { std::vector(num_paths, init), single_path_parameter_writer, single_path_diagnostic_writer, parameter, diagnostics); + ASSERT_EQ(rc, 0); Eigen::MatrixXd param_vals(parameter.eigen_states_.size(), parameter.eigen_states_[0].size()); @@ -291,7 +295,7 @@ TEST_F(ServicesPathfinderGLM, multi_noresample) { std::make_unique(init_init_context())); } stan::test::mock_callback callback; - stan::services::pathfinder::pathfinder_lbfgs_multi( + int rc = stan::services::pathfinder::pathfinder_lbfgs_multi( model, single_path_inits, seed, chain, init_radius, history_size, init_alpha, tol_obj, tol_rel_obj, tol_grad, tol_rel_grad, tol_param, num_iterations, num_elbo_draws, num_draws, num_multi_draws, num_paths, @@ -299,6 +303,7 @@ TEST_F(ServicesPathfinderGLM, multi_noresample) { std::vector(num_paths, init), single_path_parameter_writer, single_path_diagnostic_writer, parameter, diagnostics, calculate_lp, resample); + ASSERT_EQ(rc, 0); Eigen::MatrixXd param_vals = parameter.values_; Eigen::IOFormat CommaInitFmt(Eigen::StreamPrecision, 0, ", ", ", ", "\n", "", @@ -340,7 +345,7 @@ TEST_F(ServicesPathfinderGLM, multi_noresample_noreturnlp) { std::make_unique(init_init_context())); } stan::test::mock_callback callback; - stan::services::pathfinder::pathfinder_lbfgs_multi( + int rc = stan::services::pathfinder::pathfinder_lbfgs_multi( model, single_path_inits, seed, chain, init_radius, history_size, init_alpha, tol_obj, tol_rel_obj, tol_grad, tol_rel_grad, tol_param, num_iterations, num_elbo_draws, num_draws, num_multi_draws, num_paths, @@ -348,6 +353,7 @@ TEST_F(ServicesPathfinderGLM, multi_noresample_noreturnlp) { std::vector(num_paths, init), single_path_parameter_writer, single_path_diagnostic_writer, parameter, diagnostics, calculate_lp, resample); + ASSERT_EQ(rc, 0); Eigen::MatrixXd param_vals = parameter.values_; Eigen::IOFormat CommaInitFmt(Eigen::StreamPrecision, 0, ", ", ", ", "\n", "", @@ -399,7 +405,7 @@ TEST_F(ServicesPathfinderGLM, multi_resample_noreturnlp) { std::make_unique(init_init_context())); } stan::test::mock_callback callback; - stan::services::pathfinder::pathfinder_lbfgs_multi( + int rc = stan::services::pathfinder::pathfinder_lbfgs_multi( model, single_path_inits, seed, chain, init_radius, history_size, init_alpha, tol_obj, tol_rel_obj, tol_grad, tol_rel_grad, tol_param, num_iterations, num_elbo_draws, num_draws, num_multi_draws, num_paths, @@ -407,6 +413,7 @@ TEST_F(ServicesPathfinderGLM, multi_resample_noreturnlp) { std::vector(num_paths, init), single_path_parameter_writer, single_path_diagnostic_writer, parameter, diagnostics, calculate_lp, resample); + ASSERT_EQ(rc, 0); Eigen::MatrixXd param_vals = parameter.values_; Eigen::IOFormat CommaInitFmt(Eigen::StreamPrecision, 0, ", ", ", ", "\n", "", @@ -458,7 +465,7 @@ TEST_F(ServicesPathfinderGLM, multi_noresample_returnlp) { std::make_unique(init_init_context())); } stan::test::mock_callback callback; - stan::services::pathfinder::pathfinder_lbfgs_multi( + int rc = stan::services::pathfinder::pathfinder_lbfgs_multi( model, single_path_inits, seed, chain, init_radius, history_size, init_alpha, tol_obj, tol_rel_obj, tol_grad, tol_rel_grad, tol_param, num_iterations, num_elbo_draws, num_draws, num_multi_draws, num_paths, @@ -466,6 +473,7 @@ TEST_F(ServicesPathfinderGLM, multi_noresample_returnlp) { std::vector(num_paths, init), single_path_parameter_writer, single_path_diagnostic_writer, parameter, diagnostics, calculate_lp, resample); + ASSERT_EQ(rc, 0); Eigen::MatrixXd param_vals = parameter.values_; Eigen::IOFormat CommaInitFmt(Eigen::StreamPrecision, 0, ", ", ", ", "\n", "", diff --git a/src/test/unit/services/pathfinder/util.hpp b/src/test/unit/services/pathfinder/util.hpp index 53dda37731..6320f64873 100644 --- a/src/test/unit/services/pathfinder/util.hpp +++ b/src/test/unit/services/pathfinder/util.hpp @@ -93,7 +93,11 @@ class test_logger : public stan::callbacks::logger { * * @param[in] message message */ - virtual void error(const std::string& message) { *log_ << message << "\n"; } + virtual void error(const std::string& message) { + if (log_ != nullptr) { + *log_ << message << "\n"; + } + } /** * Logs an error with error log level. diff --git a/src/test/unit/variational/advi_messages_test.cpp b/src/test/unit/variational/advi_messages_test.cpp index 864bda14dd..67946fcc22 100644 --- a/src/test/unit/variational/advi_messages_test.cpp +++ b/src/test/unit/variational/advi_messages_test.cpp @@ -27,7 +27,7 @@ class advi_test : public ::testing::Test { model_ = new stan_model(data_var_context, 0, &model_stream_); cont_params_ = Eigen::VectorXd::Zero(model_->num_params_r()); - base_rng_.seed(3021828106u); + base_rng_.seed(3021828109u); model_stream_.str(""); log_stream_.str(""); parameter_stream_.str(""); diff --git a/src/test/unit/variational/eta_adapt_small_test.cpp b/src/test/unit/variational/eta_adapt_small_test.cpp index d52017b3dc..96e4bb16ee 100644 --- a/src/test/unit/variational/eta_adapt_small_test.cpp +++ b/src/test/unit/variational/eta_adapt_small_test.cpp @@ -21,7 +21,7 @@ class eta_adapt_small_test : public ::testing::Test { model_ = new stan_model(data_var_context, 0, &model_stream_); cont_params_ = Eigen::VectorXd::Zero(model_->num_params_r()); - base_rng_.seed(727802408); + base_rng_.seed(727802409); model_stream_.str(""); log_stream_.str(""); @@ -59,11 +59,6 @@ TEST_F(eta_adapt_small_test, eta_should_be_small) { stan::variational::normal_fullrank fullrank_init = stan::variational::normal_fullrank(cont_params_); -#if BOOST_VERSION >= 106400 EXPECT_EQ(0.1, advi_meanfield_->adapt_eta(meanfield_init, 1000, logger)); EXPECT_EQ(0.1, advi_fullrank_->adapt_eta(fullrank_init, 1000, logger)); -#else - EXPECT_EQ(0.1, advi_meanfield_->adapt_eta(meanfield_init, 50, logger)); - EXPECT_EQ(0.1, advi_fullrank_->adapt_eta(fullrank_init, 50, logger)); -#endif } From b13d08d7457a4fe753eef1afdf99899395b5ee37 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Fri, 16 Feb 2024 22:01:06 -0500 Subject: [PATCH 41/93] Updates the Math submodule to 8558ce891a. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index c6254fbd45..8558ce891a 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit c6254fbd45662b94189fff04f58f3b2f748da428 +Subproject commit 8558ce891a2315a6b5fba9d5f082abbbeb2292be From 41fd137d7cf89db794210142d6c61f07cf9f0b0a Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Mon, 19 Feb 2024 11:53:27 -0500 Subject: [PATCH 42/93] Updates the Math submodule to c12fff9f53. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 8558ce891a..c12fff9f53 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 8558ce891a2315a6b5fba9d5f082abbbeb2292be +Subproject commit c12fff9f53868808024e183e6a39763d8eafcd42 From 3433d9c7dfc91ab364d0c8b4e199812d9c5aaa89 Mon Sep 17 00:00:00 2001 From: aleksgorica Date: Mon, 26 Feb 2024 11:33:55 +0100 Subject: [PATCH 43/93] duplicated functions and test for rank version of compute_potential_scale_reduction --- .../compute_potential_scale_reduction.hpp | 158 +++++++++++- src/stan/mcmc/chains.hpp | 19 ++ ...compute_potential_scale_reduction_test.cpp | 238 +++++++++++++++++- 3 files changed, 404 insertions(+), 11 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index fcc3ee41ce..99afda60dc 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -91,6 +91,75 @@ inline double rhat(const Eigen::MatrixXd& draws) { return sqrt((var_between / var_within + num_draws - 1) / num_draws); } + +/** + * Computes the potential scale reduction (Rhat) using rank based diagnostic for the specified + * parameter across all kept samples. + * Based on paper https://arxiv.org/abs/1903.08008 + * + * Current implementation assumes draws are stored in contiguous + * blocks of memory. Chains are trimmed from the back to match the + * length of the shortest chain. + * + * @param draws stores pointers to arrays of chains + * @param sizes stores sizes of chains + * @return potential scale reduction for the specified parameter + */ +inline double compute_potential_scale_reduction_rank(std::vector draws, std::vector sizes) { +int num_chains = sizes.size(); + size_t num_draws = sizes[0]; + if (num_draws == 0) { + return std::numeric_limits::quiet_NaN(); + } + for (int chain = 1; chain < num_chains; ++chain) { + num_draws = std::min(num_draws, sizes[chain]); + } + + // check if chains are constant; all equal to first draw's value + bool are_all_const = false; + Eigen::VectorXd init_draw = Eigen::VectorXd::Zero(num_chains); + + for (int chain = 0; chain < num_chains; chain++) { + Eigen::Map> draw( + draws[chain], sizes[chain]); + + for (int n = 0; n < num_draws; n++) { + if (!std::isfinite(draw(n))) { + return std::numeric_limits::quiet_NaN(); + } + } + + init_draw(chain) = draw(0); + + if (draw.isApproxToConstant(draw(0))) { + are_all_const |= true; + } + } + + if (are_all_const) { + // If all chains are constant then return NaN + // if they all equal the same constant value + if (init_draw.isApproxToConstant(init_draw(0))) { + return std::numeric_limits::quiet_NaN(); + } + } + + Eigen::MatrixXd matrix(num_draws, num_chains); + + for (int col = 0; col < num_chains; ++col) { + for (int row = 0; row < num_draws; ++row) { + matrix(row, col) = draws[col][row]; + } + } + + double rhat_bulk = rhat(rank_transform(matrix)); + double rhat_tail = rhat(rank_transform( + (matrix.array() - math::quantile(matrix.reshaped(), 0.5)).abs())); + + return std::max(rhat_bulk, rhat_tail); +} + + /** * Computes the potential scale reduction (Rhat) for the specified * parameter across all kept samples. @@ -155,11 +224,31 @@ inline double compute_potential_scale_reduction( } } - double rhat_bulk = rhat(rank_transform(matrix)); - double rhat_tail = rhat(rank_transform( - (matrix.array() - math::quantile(matrix.reshaped(), 0.5)).abs())); + return rhat(matrix); +} - return std::max(rhat_bulk, rhat_tail); +/** + * Computes the potential scale reduction (Rhat) using rank based diagnostic for the specified + * parameter across all kept samples. + * Based on paper https://arxiv.org/abs/1903.08008 + * + * See more details in Stan reference manual section "Potential + * Scale Reduction". http://mc-stan.org/users/documentation + * + * Current implementation assumes draws are stored in contiguous + * blocks of memory. Chains are trimmed from the back to match the + * length of the shortest chain. Argument size will be broadcast to + * same length as draws. + * + * @param draws stores pointers to arrays of chains + * @param size stores sizes of chains + * @return potential scale reduction for the specified parameter + */ +inline double compute_potential_scale_reduction_rank( + std::vector draws, size_t size) { + int num_chains = draws.size(); + std::vector sizes(num_chains, size); + return compute_potential_scale_reduction_rank(draws, sizes); } /** @@ -185,6 +274,41 @@ inline double compute_potential_scale_reduction( return compute_potential_scale_reduction(draws, sizes); } + +/** + * Computes the potential scale reduction (Rhat) using rank based diagnostic for the specified + * parameter across all kept samples. + * Based on paper https://arxiv.org/abs/1903.08008 + * + * When the number of total draws N is odd, the (N+1)/2th draw is ignored. + * + * See more details in Stan reference manual section "Potential + * Scale Reduction". http://mc-stan.org/users/documentation + * + * Current implementation assumes draws are stored in contiguous + * blocks of memory. Chains are trimmed from the back to match the + * length of the shortest chain. + * + * @param draws stores pointers to arrays of chains + * @param sizes stores sizes of chains + * @return potential scale reduction for the specified parameter + */ +inline double compute_split_potential_scale_reduction_rank( + std::vector draws, std::vector sizes) { + int num_chains = sizes.size(); + size_t num_draws = sizes[0]; + for (int chain = 1; chain < num_chains; ++chain) { + num_draws = std::min(num_draws, sizes[chain]); + } + + std::vector split_draws = split_chains(draws, sizes); + + double half = num_draws / 2.0; + std::vector half_sizes(2 * num_chains, std::floor(half)); + + return compute_potential_scale_reduction_rank(split_draws, half_sizes); +} + /** * Computes the split potential scale reduction (Rhat) for the * specified parameter across all kept samples. When the number of @@ -217,6 +341,32 @@ inline double compute_split_potential_scale_reduction( return compute_potential_scale_reduction(split_draws, half_sizes); } +/** + * Computes the potential scale reduction (Rhat) using rank based diagnostic for the specified + * parameter across all kept samples. + * Based on paper https://arxiv.org/abs/1903.08008 + * + * When the number of total draws N is odd, the (N+1)/2th draw is ignored. + * + * See more details in Stan reference manual section "Potential + * Scale Reduction". http://mc-stan.org/users/documentation + * + * Current implementation assumes draws are stored in contiguous + * blocks of memory. Chains are trimmed from the back to match the + * length of the shortest chain. Argument size will be broadcast to + * same length as draws. + * + * @param draws stores pointers to arrays of chains + * @param size stores sizes of chains + * @return potential scale reduction for the specified parameter + */ +inline double compute_split_potential_scale_reduction_rank( + std::vector draws, size_t size) { + int num_chains = draws.size(); + std::vector sizes(num_chains, size); + return compute_split_potential_scale_reduction_rank(draws, sizes); +} + /** * Computes the split potential scale reduction (Rhat) for the * specified parameter across all kept samples. When the number of diff --git a/src/stan/mcmc/chains.hpp b/src/stan/mcmc/chains.hpp index 507a5bc537..820eeb363d 100644 --- a/src/stan/mcmc/chains.hpp +++ b/src/stan/mcmc/chains.hpp @@ -595,6 +595,21 @@ class chains { return split_effective_sample_size(index(name)); } + double split_potential_scale_reduction_rank(const int index) const { + int n_chains = num_chains(); + std::vector draws(n_chains); + std::vector sizes(n_chains); + int n_kept_samples = 0; + for (int chain = 0; chain < n_chains; ++chain) { + n_kept_samples = num_kept_samples(chain); + draws[chain] + = samples_(chain).col(index).bottomRows(n_kept_samples).data(); + sizes[chain] = n_kept_samples; + } + + return analyze::compute_split_potential_scale_reduction_rank(draws, sizes); + } + double split_potential_scale_reduction(const int index) const { int n_chains = num_chains(); std::vector draws(n_chains); @@ -610,6 +625,10 @@ class chains { return analyze::compute_split_potential_scale_reduction(draws, sizes); } + double split_potential_scale_reduction_rank(const std::string& name) const { + return split_potential_scale_reduction_rank(index(name)); + } + double split_potential_scale_reduction(const std::string& name) const { return split_potential_scale_reduction(index(name)); } diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 2f64f659eb..d1b20978c5 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -27,6 +27,44 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction) { stan::io::stan_csv blocker2 = stan::io::stan_csv_reader::parse(blocker2_stream, &out); EXPECT_EQ("", out.str()); + stan::mcmc::chains<> chains(blocker1); + chains.add(blocker2); + + Eigen::VectorXd rhat(48); + rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, + 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, + 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, + 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, + 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, + 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, + 1.00735; + + // replicates calls to stan::analyze::compute_effective_sample_size + // for any interface *without* access to chains class + Eigen::Matrix samples( + chains.num_chains()); + std::vector draws(chains.num_chains()); + std::vector sizes(chains.num_chains()); + for (int index = 4; index < chains.num_params(); index++) { + for (int chain = 0; chain < chains.num_chains(); ++chain) { + samples(chain) = chains.samples(chain, index); + draws[chain] = &samples(chain)(0); + sizes[chain] = samples(chain).size(); + } + ASSERT_NEAR(rhat(index - 4), + stan::analyze::compute_potential_scale_reduction(draws, sizes), + 1.0) + << "rhat for index: " << index + << ", parameter: " << chains.param_name(index); + } +} +TEST_F(ComputeRhat, compute_potential_scale_reduction_rank) { + std::stringstream out; + stan::io::stan_csv blocker1 + = stan::io::stan_csv_reader::parse(blocker1_stream, &out); + stan::io::stan_csv blocker2 + = stan::io::stan_csv_reader::parse(blocker2_stream, &out); + EXPECT_EQ("", out.str()); stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); @@ -52,13 +90,15 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction) { sizes[chain] = samples(chain).size(); } ASSERT_NEAR(rhat(index - 4), - stan::analyze::compute_potential_scale_reduction(draws, sizes), + stan::analyze::compute_potential_scale_reduction_rank(draws, sizes), 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } } + + TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { std::stringstream out; stan::io::stan_csv blocker1 @@ -70,6 +110,45 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); + Eigen::VectorXd rhat(48); + rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, + 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, + 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, + 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, + 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, + 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, + 1.00735; + + Eigen::Matrix samples( + chains.num_chains()); + std::vector draws(chains.num_chains()); + std::vector sizes(chains.num_chains()); + for (int index = 4; index < chains.num_params(); index++) { + for (int chain = 0; chain < chains.num_chains(); ++chain) { + samples(chain) = chains.samples(chain, index); + draws[chain] = &samples(chain)(0); + } + size_t size = samples(0).size(); + ASSERT_NEAR(rhat(index - 4), + stan::analyze::compute_potential_scale_reduction(draws, size), + 1) + << "rhat for index: " << index + << ", parameter: " << chains.param_name(index); + } +} + + +TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_convenience) { + std::stringstream out; + stan::io::stan_csv blocker1 + = stan::io::stan_csv_reader::parse(blocker1_stream, &out); + stan::io::stan_csv blocker2 + = stan::io::stan_csv_reader::parse(blocker2_stream, &out); + EXPECT_EQ("", out.str()); + + stan::mcmc::chains<> chains(blocker1); + chains.add(blocker2); + Eigen::VectorXd rhat(48); rhat << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, 1.00201, 0.999558, 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, @@ -89,13 +168,14 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { } size_t size = samples(0).size(); ASSERT_NEAR(rhat(index - 4), - stan::analyze::compute_potential_scale_reduction(draws, size), + stan::analyze::compute_potential_scale_reduction_rank(draws, size), 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } } + TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction) { std::stringstream out; stan::io::stan_csv blocker1 @@ -107,6 +187,40 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); + Eigen::VectorXd rhat(48); + rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, + 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, + 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, + 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, + 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, + 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, + 1.00735; + + for (int index = 4; index < chains.num_params(); index++) { + ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), + 1e-4) + << "rhat for index: " << index + << ", parameter: " << chains.param_name(index); + } + + for (int index = 0; index < chains.num_params(); index++) { + std::string name = chains.param_name(index); + ASSERT_EQ(chains.split_potential_scale_reduction(index), + chains.split_potential_scale_reduction(name)); + } +} + +TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction_rank) { + std::stringstream out; + stan::io::stan_csv blocker1 + = stan::io::stan_csv_reader::parse(blocker1_stream, &out); + stan::io::stan_csv blocker2 + = stan::io::stan_csv_reader::parse(blocker2_stream, &out); + EXPECT_EQ("", out.str()); + + stan::mcmc::chains<> chains(blocker1); + chains.add(blocker2); + Eigen::VectorXd rhat(48); rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, @@ -116,7 +230,7 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction) { 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; for (int index = 4; index < chains.num_params(); index++) { - ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), + ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction_rank(index), 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); @@ -124,8 +238,8 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction) { for (int index = 0; index < chains.num_params(); index++) { std::string name = chains.param_name(index); - ASSERT_EQ(chains.split_potential_scale_reduction(index), - chains.split_potential_scale_reduction(name)); + ASSERT_EQ(chains.split_potential_scale_reduction_rank(index), + chains.split_potential_scale_reduction_rank(name)); } } @@ -141,6 +255,48 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction) { chains.add(blocker2); + Eigen::VectorXd rhat(48); + rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, + 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, + 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, + 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, + 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, + 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, + 1.00735; + + // replicates calls to stan::analyze::compute_effective_sample_size + // for any interface *without* access to chains class + Eigen::Matrix samples( + chains.num_chains()); + std::vector draws(chains.num_chains()); + std::vector sizes(chains.num_chains()); + for (int index = 4; index < chains.num_params(); index++) { + for (int chain = 0; chain < chains.num_chains(); ++chain) { + samples(chain) = chains.samples(chain, index); + draws[chain] = &samples(chain)(0); + sizes[chain] = samples(chain).size(); + } + ASSERT_NEAR( + rhat(index - 4), + stan::analyze::compute_split_potential_scale_reduction(draws, sizes), + 1.0) + << "rhat for index: " << index + << ", parameter: " << chains.param_name(index); + } +} + +TEST_F(ComputeRhat, compute_split_potential_scale_reduction_rank) { + std::stringstream out; + stan::io::stan_csv blocker1 + = stan::io::stan_csv_reader::parse(blocker1_stream, &out); + stan::io::stan_csv blocker2 + = stan::io::stan_csv_reader::parse(blocker2_stream, &out); + EXPECT_EQ("", out.str()); + + stan::mcmc::chains<> chains(blocker1); + + chains.add(blocker2); + Eigen::VectorXd rhat(48); rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, @@ -163,7 +319,7 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction) { } ASSERT_NEAR( rhat(index - 4), - stan::analyze::compute_split_potential_scale_reduction(draws, sizes), + stan::analyze::compute_split_potential_scale_reduction_rank(draws, sizes), 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); @@ -181,6 +337,47 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); + Eigen::VectorXd rhat(48); + rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, + 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, + 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, + 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, + 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, + 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, + 1.00735; + + Eigen::Matrix samples( + chains.num_chains()); + std::vector draws(chains.num_chains()); + std::vector sizes(chains.num_chains()); + for (int index = 4; index < chains.num_params(); index++) { + for (int chain = 0; chain < chains.num_chains(); ++chain) { + samples(chain) = chains.samples(chain, index); + draws[chain] = &samples(chain)(0); + } + size_t size = samples(0).size(); + std::cout << "RHAT" << std::endl; + std::cout << stan::analyze::compute_split_potential_scale_reduction(draws, size) << std::endl; + ASSERT_NEAR( + rhat(index - 4), + stan::analyze::compute_split_potential_scale_reduction(draws, size), + 1e-4) + << "rhat for index: " << index + << ", parameter: " << chains.param_name(index); + } +} + +TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience_rank) { + std::stringstream out; + stan::io::stan_csv blocker1 + = stan::io::stan_csv_reader::parse(blocker1_stream, &out); + stan::io::stan_csv blocker2 + = stan::io::stan_csv_reader::parse(blocker2_stream, &out); + EXPECT_EQ("", out.str()); + + stan::mcmc::chains<> chains(blocker1); + chains.add(blocker2); + Eigen::VectorXd rhat(48); rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, @@ -193,6 +390,11 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience) { chains.num_chains()); std::vector draws(chains.num_chains()); std::vector sizes(chains.num_chains()); + std::cout << "SAMPLES: \n"; + for (int i = 0; i < 10; i++) { + std::cout << chains.samples(0, 4)(i) << std::endl; + } + for (int index = 4; index < chains.num_params(); index++) { for (int chain = 0; chain < chains.num_chains(); ++chain) { samples(chain) = chains.samples(chain, index); @@ -201,7 +403,7 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience) { size_t size = samples(0).size(); ASSERT_NEAR( rhat(index - 4), - stan::analyze::compute_split_potential_scale_reduction(draws, size), + stan::analyze::compute_split_potential_scale_reduction_rank(draws, size), 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); @@ -219,6 +421,17 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_constant) { << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); } +TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_constant) { + std::vector param_names{"a"}; + stan::mcmc::chains<> chains(param_names); + Eigen::Matrix draws; + draws << 1.0, 1.0; + chains.add(draws); + + ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction_rank(0))) + << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); +} + TEST_F(ComputeRhat, compute_potential_scale_reduction_nan) { std::vector param_names{"a"}; stan::mcmc::chains<> chains(param_names); @@ -229,3 +442,14 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_nan) { ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction(0))) << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); } + +TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_nan) { + std::vector param_names{"a"}; + stan::mcmc::chains<> chains(param_names); + Eigen::Matrix draws; + draws << 1.0, std::numeric_limits::quiet_NaN(); + chains.add(draws); + + ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction_rank(0))) + << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); +} \ No newline at end of file From 30333ce83ef72749c052f578ac07ca57c5b1b3b7 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Mon, 26 Feb 2024 06:05:51 -0500 Subject: [PATCH 44/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- .../compute_potential_scale_reduction.hpp | 38 ++++++++--------- ...compute_potential_scale_reduction_test.cpp | 42 +++++++++---------- 2 files changed, 39 insertions(+), 41 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 45ba1d8647..94295cf749 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -93,11 +93,10 @@ inline double rhat(const Eigen::MatrixXd& draws) { return sqrt((var_between / var_within + num_draws - 1) / num_draws); } - /** - * Computes the potential scale reduction (Rhat) using rank based diagnostic for the specified - * parameter across all kept samples. - * Based on paper https://arxiv.org/abs/1903.08008 + * Computes the potential scale reduction (Rhat) using rank based diagnostic for + * the specified parameter across all kept samples. Based on paper + * https://arxiv.org/abs/1903.08008 * * Current implementation assumes draws are stored in contiguous * blocks of memory. Chains are trimmed from the back to match the @@ -107,8 +106,9 @@ inline double rhat(const Eigen::MatrixXd& draws) { * @param sizes stores sizes of chains * @return potential scale reduction for the specified parameter */ -inline double compute_potential_scale_reduction_rank(std::vector draws, std::vector sizes) { -int num_chains = sizes.size(); +inline double compute_potential_scale_reduction_rank( + std::vector draws, std::vector sizes) { + int num_chains = sizes.size(); size_t num_draws = sizes[0]; if (num_draws == 0) { return std::numeric_limits::quiet_NaN(); @@ -161,7 +161,6 @@ int num_chains = sizes.size(); return std::max(rhat_bulk, rhat_tail); } - /** * Computes the potential scale reduction (Rhat) for the specified * parameter across all kept samples. @@ -230,9 +229,9 @@ inline double compute_potential_scale_reduction( } /** - * Computes the potential scale reduction (Rhat) using rank based diagnostic for the specified - * parameter across all kept samples. - * Based on paper https://arxiv.org/abs/1903.08008 + * Computes the potential scale reduction (Rhat) using rank based diagnostic for + * the specified parameter across all kept samples. Based on paper + * https://arxiv.org/abs/1903.08008 * * See more details in Stan reference manual section "Potential * Scale Reduction". http://mc-stan.org/users/documentation @@ -276,12 +275,11 @@ inline double compute_potential_scale_reduction( return compute_potential_scale_reduction(draws, sizes); } - /** - * Computes the potential scale reduction (Rhat) using rank based diagnostic for the specified - * parameter across all kept samples. - * Based on paper https://arxiv.org/abs/1903.08008 - * + * Computes the potential scale reduction (Rhat) using rank based diagnostic for + * the specified parameter across all kept samples. Based on paper + * https://arxiv.org/abs/1903.08008 + * * When the number of total draws N is odd, the (N+1)/2th draw is ignored. * * See more details in Stan reference manual section "Potential @@ -344,12 +342,12 @@ inline double compute_split_potential_scale_reduction( } /** - * Computes the potential scale reduction (Rhat) using rank based diagnostic for the specified - * parameter across all kept samples. - * Based on paper https://arxiv.org/abs/1903.08008 - * + * Computes the potential scale reduction (Rhat) using rank based diagnostic for + * the specified parameter across all kept samples. Based on paper + * https://arxiv.org/abs/1903.08008 + * * When the number of total draws N is odd, the (N+1)/2th draw is ignored. - * + * * See more details in Stan reference manual section "Potential * Scale Reduction". http://mc-stan.org/users/documentation * diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index d1b20978c5..7422e657bd 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -89,16 +89,15 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank) { draws[chain] = &samples(chain)(0); sizes[chain] = samples(chain).size(); } - ASSERT_NEAR(rhat(index - 4), - stan::analyze::compute_potential_scale_reduction_rank(draws, sizes), - 1e-4) + ASSERT_NEAR( + rhat(index - 4), + stan::analyze::compute_potential_scale_reduction_rank(draws, sizes), + 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } } - - TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { std::stringstream out; stan::io::stan_csv blocker1 @@ -137,7 +136,6 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { } } - TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_convenience) { std::stringstream out; stan::io::stan_csv blocker1 @@ -167,15 +165,15 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_convenience) { draws[chain] = &samples(chain)(0); } size_t size = samples(0).size(); - ASSERT_NEAR(rhat(index - 4), - stan::analyze::compute_potential_scale_reduction_rank(draws, size), - 1e-4) + ASSERT_NEAR( + rhat(index - 4), + stan::analyze::compute_potential_scale_reduction_rank(draws, size), + 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } } - TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction) { std::stringstream out; stan::io::stan_csv blocker1 @@ -230,8 +228,8 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction_rank) { 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; for (int index = 4; index < chains.num_params(); index++) { - ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction_rank(index), - 1e-4) + ASSERT_NEAR(rhat(index - 4), + chains.split_potential_scale_reduction_rank(index), 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } @@ -317,10 +315,10 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_rank) { draws[chain] = &samples(chain)(0); sizes[chain] = samples(chain).size(); } - ASSERT_NEAR( - rhat(index - 4), - stan::analyze::compute_split_potential_scale_reduction_rank(draws, sizes), - 1e-4) + ASSERT_NEAR(rhat(index - 4), + stan::analyze::compute_split_potential_scale_reduction_rank( + draws, sizes), + 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } @@ -357,7 +355,9 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience) { } size_t size = samples(0).size(); std::cout << "RHAT" << std::endl; - std::cout << stan::analyze::compute_split_potential_scale_reduction(draws, size) << std::endl; + std::cout << stan::analyze::compute_split_potential_scale_reduction(draws, + size) + << std::endl; ASSERT_NEAR( rhat(index - 4), stan::analyze::compute_split_potential_scale_reduction(draws, size), @@ -401,10 +401,10 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience_rank) { draws[chain] = &samples(chain)(0); } size_t size = samples(0).size(); - ASSERT_NEAR( - rhat(index - 4), - stan::analyze::compute_split_potential_scale_reduction_rank(draws, size), - 1e-4) + ASSERT_NEAR(rhat(index - 4), + stan::analyze::compute_split_potential_scale_reduction_rank( + draws, size), + 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } From 77d875fe10638d00a876d44655704e37560a3391 Mon Sep 17 00:00:00 2001 From: aleksgorica Date: Mon, 26 Feb 2024 19:39:04 +0100 Subject: [PATCH 45/93] test chains_test changed --- src/test/unit/mcmc/chains_test.cpp | 43 +++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/src/test/unit/mcmc/chains_test.cpp b/src/test/unit/mcmc/chains_test.cpp index 41bd645a75..f8ca33a852 100644 --- a/src/test/unit/mcmc/chains_test.cpp +++ b/src/test/unit/mcmc/chains_test.cpp @@ -852,6 +852,43 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); + Eigen::VectorXd rhat(48); + rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, + 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, + 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, + 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, + 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, + 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, + 1.00735; + + for (int index = 4; index < chains.num_params(); index++) { + ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), + 1e-4) + << "rhat for index: " << index + << ", parameter: " << chains.param_name(index); + } + + for (int index = 0; index < chains.num_params(); index++) { + std::string name = chains.param_name(index); + ASSERT_EQ(chains.split_potential_scale_reduction(index), + chains.split_potential_scale_reduction(name)); + } +} + + + + +TEST_F(McmcChains, blocker_split_potential_scale_reduction_rank) { + std::stringstream out; + stan::io::stan_csv blocker1 + = stan::io::stan_csv_reader::parse(blocker1_stream, &out); + stan::io::stan_csv blocker2 + = stan::io::stan_csv_reader::parse(blocker2_stream, &out); + EXPECT_EQ("", out.str()); + + stan::mcmc::chains<> chains(blocker1); + chains.add(blocker2); + Eigen::VectorXd rhat(48); rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, @@ -861,7 +898,7 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction) { 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; for (int index = 4; index < chains.num_params(); index++) { - ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), + ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction_rank(index), 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); @@ -869,7 +906,7 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction) { for (int index = 0; index < chains.num_params(); index++) { std::string name = chains.param_name(index); - ASSERT_EQ(chains.split_potential_scale_reduction(index), - chains.split_potential_scale_reduction(name)); + ASSERT_EQ(chains.split_potential_scale_reduction_rank(index), + chains.split_potential_scale_reduction_rank(name)); } } From da10f8ffa2cba885844257200681312732317887 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Mon, 26 Feb 2024 14:03:06 -0500 Subject: [PATCH 46/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- src/test/unit/mcmc/chains_test.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/test/unit/mcmc/chains_test.cpp b/src/test/unit/mcmc/chains_test.cpp index f8ca33a852..d9c8194e43 100644 --- a/src/test/unit/mcmc/chains_test.cpp +++ b/src/test/unit/mcmc/chains_test.cpp @@ -875,9 +875,6 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction) { } } - - - TEST_F(McmcChains, blocker_split_potential_scale_reduction_rank) { std::stringstream out; stan::io::stan_csv blocker1 @@ -898,8 +895,8 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction_rank) { 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; for (int index = 4; index < chains.num_params(); index++) { - ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction_rank(index), - 1e-4) + ASSERT_NEAR(rhat(index - 4), + chains.split_potential_scale_reduction_rank(index), 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } From d0d88d5bfe78fdfdbf7f350b73859a94cfa71677 Mon Sep 17 00:00:00 2001 From: Nicusor Serban Date: Tue, 27 Feb 2024 18:10:39 +0100 Subject: [PATCH 47/93] Removed deprecated flags in perReport plugin --- Jenkinsfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2d6ae4e46b..52bc5a34ff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -200,10 +200,8 @@ pipeline { tools: [ cppLint(id: "cpplint", name: "Linting & Doc checks@CPPLINT") ], - blameDisabled: false, qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]], healthy: 10, unhealthy: 100, minimumSeverity: 'HIGH', - referenceJobName: env.BRANCH_NAME deleteDir() } @@ -509,10 +507,8 @@ pipeline { gcc4(id: "pipeline_gcc4", name: "GNU C Compiler"), clang(id: "pipeline_clang", name: "LLVM/Clang") ], - blameDisabled: false, qualityGates: [[threshold: 30, type: 'TOTAL', unstable: true]], - healthy: 10, unhealthy: 100, minimumSeverity: 'HIGH', - referenceJobName: env.BRANCH_NAME + healthy: 10, unhealthy: 100, minimumSeverity: 'HIGH' } } success { From 348716b22e624b98000a6ee4a4389603da861493 Mon Sep 17 00:00:00 2001 From: Nicusor Serban Date: Tue, 27 Feb 2024 18:20:43 +0100 Subject: [PATCH 48/93] Fix recordIssues syntax --- Jenkinsfile | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 52bc5a34ff..21af74470f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -192,17 +192,17 @@ pipeline { } post { always { - - recordIssues id: "lint_doc_checks", - name: "Linting & Doc checks", - enabledForFailure: true, - aggregatingResults : true, - tools: [ - cppLint(id: "cpplint", name: "Linting & Doc checks@CPPLINT") - ], - qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]], - healthy: 10, unhealthy: 100, minimumSeverity: 'HIGH', - + recordIssues( + id: "lint_doc_checks", + name: "Linting & Doc checks", + enabledForFailure: true, + aggregatingResults : true, + tools: [ + cppLint(id: "cpplint", name: "Linting & Doc checks@CPPLINT") + ], + qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]], + healthy: 10, unhealthy: 100, minimumSeverity: 'HIGH' + ) deleteDir() } } @@ -496,19 +496,21 @@ pipeline { post { always { node("linux") { - recordIssues id: "pipeline", - name: "Entire pipeline results", - enabledForFailure: true, - aggregatingResults : false, - filters: [ - excludeFile('lib/.*') - ], - tools: [ - gcc4(id: "pipeline_gcc4", name: "GNU C Compiler"), - clang(id: "pipeline_clang", name: "LLVM/Clang") - ], - qualityGates: [[threshold: 30, type: 'TOTAL', unstable: true]], - healthy: 10, unhealthy: 100, minimumSeverity: 'HIGH' + recordIssues( + id: "pipeline", + name: "Entire pipeline results", + enabledForFailure: true, + aggregatingResults : false, + filters: [ + excludeFile('lib/.*') + ], + tools: [ + gcc4(id: "pipeline_gcc4", name: "GNU C Compiler"), + clang(id: "pipeline_clang", name: "LLVM/Clang") + ], + qualityGates: [[threshold: 30, type: 'TOTAL', unstable: true]], + healthy: 10, unhealthy: 100, minimumSeverity: 'HIGH' + ) } } success { From c3b11016406f13172789fe18e8023ad011d4e0f1 Mon Sep 17 00:00:00 2001 From: aleksgorica Date: Wed, 28 Feb 2024 19:10:29 +0100 Subject: [PATCH 49/93] added test values from arviz --- .../compute_potential_scale_reduction.hpp | 4 +-- ...compute_potential_scale_reduction_test.cpp | 33 +++++-------------- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 94295cf749..082cc28c6d 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -26,7 +26,7 @@ namespace analyze { * */ -Eigen::MatrixXd rank_transform(const Eigen::MatrixXd& draws) { +inline Eigen::MatrixXd rank_transform(const Eigen::MatrixXd& draws) { const Eigen::Index rows = draws.rows(); const Eigen::Index cols = draws.cols(); const Eigen::Index size = rows * cols; @@ -116,7 +116,7 @@ inline double compute_potential_scale_reduction_rank( for (int chain = 1; chain < num_chains; ++chain) { num_draws = std::min(num_draws, sizes[chain]); } - + // check if chains are constant; all equal to first draw's value bool are_all_const = false; Eigen::VectorXd init_draw = Eigen::VectorXd::Zero(num_chains); diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 7422e657bd..04dc5c04bd 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -31,13 +31,8 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, - 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, - 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, - 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, - 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, - 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, - 1.00735; + rhat << 1.00042,1.00036,0.99955,1.00047,1.00119,1.00089,1.00018,1.00019,1.00226,0.99954,0.9996,0.99951,1.00237,1.00515,1.00566,0.99957,1.00099,1.00853,1.0008,0.99961,1.0006,1.00046,1.01023,0.9996,1.0011,0.99967,0.99973,0.99958,1.00242,1.00213,1.00244,0.99998,0.99969,1.00079,0.99955,1.0009,1.00136,1.00288,1.00036,0.99989,1.00077,0.99997,1.00194,0.99972,1.00257,1.00109,1.00004,0.99955; + // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -53,7 +48,7 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction) { } ASSERT_NEAR(rhat(index - 4), stan::analyze::compute_potential_scale_reduction(draws, sizes), - 1.0) + 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } @@ -110,13 +105,7 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, - 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, - 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, - 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, - 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, - 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, - 1.00735; + rhat << 1.00042,1.00036,0.99955,1.00047,1.00119,1.00089,1.00018,1.00019,1.00226,0.99954,0.9996,0.99951,1.00237,1.00515,1.00566,0.99957,1.00099,1.00853,1.0008,0.99961,1.0006,1.00046,1.01023,0.9996,1.0011,0.99967,0.99973,0.99958,1.00242,1.00213,1.00244,0.99998,0.99969,1.00079,0.99955,1.0009,1.00136,1.00288,1.00036,0.99989,1.00077,0.99997,1.00194,0.99972,1.00257,1.00109,1.00004,0.99955; Eigen::Matrix samples( chains.num_chains()); @@ -127,10 +116,12 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { samples(chain) = chains.samples(chain, index); draws[chain] = &samples(chain)(0); } + + size_t size = samples(0).size(); ASSERT_NEAR(rhat(index - 4), stan::analyze::compute_potential_scale_reduction(draws, size), - 1) + 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } @@ -277,7 +268,7 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction) { ASSERT_NEAR( rhat(index - 4), stan::analyze::compute_split_potential_scale_reduction(draws, sizes), - 1.0) + 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } @@ -354,10 +345,6 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience) { draws[chain] = &samples(chain)(0); } size_t size = samples(0).size(); - std::cout << "RHAT" << std::endl; - std::cout << stan::analyze::compute_split_potential_scale_reduction(draws, - size) - << std::endl; ASSERT_NEAR( rhat(index - 4), stan::analyze::compute_split_potential_scale_reduction(draws, size), @@ -390,10 +377,6 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience_rank) { chains.num_chains()); std::vector draws(chains.num_chains()); std::vector sizes(chains.num_chains()); - std::cout << "SAMPLES: \n"; - for (int i = 0; i < 10; i++) { - std::cout << chains.samples(0, 4)(i) << std::endl; - } for (int index = 4; index < chains.num_params(); index++) { for (int chain = 0; chain < chains.num_chains(); ++chain) { From 51ad447d6965a59da24c6365c078450bdaebea9b Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Wed, 28 Feb 2024 13:16:43 -0500 Subject: [PATCH 50/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- .../mcmc/compute_potential_scale_reduction.hpp | 2 +- .../compute_potential_scale_reduction_test.cpp | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 082cc28c6d..3cd230540a 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -116,7 +116,7 @@ inline double compute_potential_scale_reduction_rank( for (int chain = 1; chain < num_chains; ++chain) { num_draws = std::min(num_draws, sizes[chain]); } - + // check if chains are constant; all equal to first draw's value bool are_all_const = false; Eigen::VectorXd init_draw = Eigen::VectorXd::Zero(num_chains); diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 04dc5c04bd..6faa735f73 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -31,8 +31,13 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00042,1.00036,0.99955,1.00047,1.00119,1.00089,1.00018,1.00019,1.00226,0.99954,0.9996,0.99951,1.00237,1.00515,1.00566,0.99957,1.00099,1.00853,1.0008,0.99961,1.0006,1.00046,1.01023,0.9996,1.0011,0.99967,0.99973,0.99958,1.00242,1.00213,1.00244,0.99998,0.99969,1.00079,0.99955,1.0009,1.00136,1.00288,1.00036,0.99989,1.00077,0.99997,1.00194,0.99972,1.00257,1.00109,1.00004,0.99955; - + rhat << 1.00042, 1.00036, 0.99955, 1.00047, 1.00119, 1.00089, 1.00018, + 1.00019, 1.00226, 0.99954, 0.9996, 0.99951, 1.00237, 1.00515, 1.00566, + 0.99957, 1.00099, 1.00853, 1.0008, 0.99961, 1.0006, 1.00046, 1.01023, + 0.9996, 1.0011, 0.99967, 0.99973, 0.99958, 1.00242, 1.00213, 1.00244, + 0.99998, 0.99969, 1.00079, 0.99955, 1.0009, 1.00136, 1.00288, 1.00036, + 0.99989, 1.00077, 0.99997, 1.00194, 0.99972, 1.00257, 1.00109, 1.00004, + 0.99955; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -105,7 +110,13 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00042,1.00036,0.99955,1.00047,1.00119,1.00089,1.00018,1.00019,1.00226,0.99954,0.9996,0.99951,1.00237,1.00515,1.00566,0.99957,1.00099,1.00853,1.0008,0.99961,1.0006,1.00046,1.01023,0.9996,1.0011,0.99967,0.99973,0.99958,1.00242,1.00213,1.00244,0.99998,0.99969,1.00079,0.99955,1.0009,1.00136,1.00288,1.00036,0.99989,1.00077,0.99997,1.00194,0.99972,1.00257,1.00109,1.00004,0.99955; + rhat << 1.00042, 1.00036, 0.99955, 1.00047, 1.00119, 1.00089, 1.00018, + 1.00019, 1.00226, 0.99954, 0.9996, 0.99951, 1.00237, 1.00515, 1.00566, + 0.99957, 1.00099, 1.00853, 1.0008, 0.99961, 1.0006, 1.00046, 1.01023, + 0.9996, 1.0011, 0.99967, 0.99973, 0.99958, 1.00242, 1.00213, 1.00244, + 0.99998, 0.99969, 1.00079, 0.99955, 1.0009, 1.00136, 1.00288, 1.00036, + 0.99989, 1.00077, 0.99997, 1.00194, 0.99972, 1.00257, 1.00109, 1.00004, + 0.99955; Eigen::Matrix samples( chains.num_chains()); @@ -117,7 +128,6 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { draws[chain] = &samples(chain)(0); } - size_t size = samples(0).size(); ASSERT_NEAR(rhat(index - 4), stan::analyze::compute_potential_scale_reduction(draws, size), From 2caacdbf1502a1cfb84bed70f765f6d75a0d7fff Mon Sep 17 00:00:00 2001 From: Nicusor Serban Date: Sat, 16 Mar 2024 08:24:19 +0200 Subject: [PATCH 51/93] Move post success step to linux node for os deps --- Jenkinsfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 21af74470f..e95ce380cc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -514,9 +514,11 @@ pipeline { } } success { - script { - utils.updateUpstream(env,'cmdstan') - utils.mailBuildResults("SUCCESSFUL") + node("linux") { + script { + utils.updateUpstream(env,'cmdstan') + utils.mailBuildResults("SUCCESSFUL") + } } } unstable { script { utils.mailBuildResults("UNSTABLE", "stan-buildbot@googlegroups.com") } } From 90c74336cf496bfe8787ceab55f1ad9955d2f2fd Mon Sep 17 00:00:00 2001 From: Nicusor Serban Date: Mon, 18 Mar 2024 11:39:53 +0100 Subject: [PATCH 52/93] Revert earlier Jenkinsfile changes --- Jenkinsfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e95ce380cc..21af74470f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -514,11 +514,9 @@ pipeline { } } success { - node("linux") { - script { - utils.updateUpstream(env,'cmdstan') - utils.mailBuildResults("SUCCESSFUL") - } + script { + utils.updateUpstream(env,'cmdstan') + utils.mailBuildResults("SUCCESSFUL") } } unstable { script { utils.mailBuildResults("UNSTABLE", "stan-buildbot@googlegroups.com") } } From cbb289e34903e804781fcf7c63020fd714e85e83 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Wed, 20 Mar 2024 14:16:29 -0400 Subject: [PATCH 53/93] Clean up various doxygen or compiler warnings --- src/stan/services/pathfinder/multi.hpp | 2 +- src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp | 2 -- src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp | 4 +++- .../services/sample/hmc_nuts_unit_e_adapt_parallel_test.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/stan/services/pathfinder/multi.hpp b/src/stan/services/pathfinder/multi.hpp index 924f0806b3..1707d5d332 100644 --- a/src/stan/services/pathfinder/multi.hpp +++ b/src/stan/services/pathfinder/multi.hpp @@ -82,7 +82,7 @@ namespace pathfinder { * sample. If `false`, (`num_draws` - `num_elbo_draws`) of the joint log * probability calculations will be `NA` and psis resampling will not be * performed. - * @param[in] psis_resampling If `true`, psis resampling is performed over the + * @param[in] psis_resample If `true`, psis resampling is performed over the * samples returned by all of the individual pathfinders and `num_multi_draws` * samples are written to `parameter_writer`. If `false`, no psis resampling is * performed and (`num_paths` * `num_draws`) samples are written to diff --git a/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp index ec48ade0b5..0cd79933a8 100644 --- a/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_diag_e_adapt.hpp @@ -588,8 +588,6 @@ int hmc_nuts_diag_e_adapt( * length as this value. * @param[in] init A std vector of init var contexts for initialization of each * chain. - * @param[in] init_inv_metric var context exposing an initial diagonal - * inverse Euclidean metric (must be positive definite) * @param[in] random_seed random seed for the random number generator * @param[in] init_chain_id first chain id. The pseudo random number generator * will advance by for each chain by an integer sequence from `init_chain_id` to diff --git a/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp b/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp index 5d74dae176..af0e7bee1d 100644 --- a/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp +++ b/src/stan/services/sample/hmc_nuts_unit_e_adapt.hpp @@ -272,7 +272,9 @@ int hmc_nuts_unit_e_adapt( * @param[in] init An std vector of init var contexts for initialization of each * chain. * @param[in] random_seed random seed for the random number generator - * @param[in] chain chain id to advance the pseudo random number generator + * @param[in] init_chain_id first chain id. The pseudo random number generator + * will advance for each chain by an integer sequence from `init_chain_id` to + * `init_chain_id + num_chains - 1` * @param[in] init_radius radius to initialize * @param[in] num_warmup Number of warmup samples * @param[in] num_samples Number of samples diff --git a/src/test/unit/services/sample/hmc_nuts_unit_e_adapt_parallel_test.cpp b/src/test/unit/services/sample/hmc_nuts_unit_e_adapt_parallel_test.cpp index 2889c6b229..ed1525263b 100644 --- a/src/test/unit/services/sample/hmc_nuts_unit_e_adapt_parallel_test.cpp +++ b/src/test/unit/services/sample/hmc_nuts_unit_e_adapt_parallel_test.cpp @@ -21,7 +21,7 @@ struct deleter_noop { class ServicesSampleHmcNutsUnitEAdaptPar : public testing::Test { public: ServicesSampleHmcNutsUnitEAdaptPar() - : ss_metric(num_chains), model(data_context, 0, &model_log) { + : model(data_context, 0, &model_log), ss_metric(num_chains) { for (int i = 0; i < num_chains; ++i) { init.push_back(stan::test::unit::instrumented_writer{}); parameter.push_back(stan::test::unit::instrumented_writer{}); From ea57252abf6aaa165578ce9fe4680f1a3a79c8ac Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Thu, 21 Mar 2024 11:49:52 -0400 Subject: [PATCH 54/93] Updates the Math submodule to 33b9a828bb. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index c12fff9f53..33b9a828bb 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit c12fff9f53868808024e183e6a39763d8eafcd42 +Subproject commit 33b9a828bbcf927be839ee306f87a99c2f88b07c From 5b73f278d3c2096337d0c6780ebbab7f5a778e48 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Fri, 22 Mar 2024 18:56:59 -0400 Subject: [PATCH 55/93] Updates the Math submodule to e8ab249582. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 33b9a828bb..e8ab249582 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 33b9a828bbcf927be839ee306f87a99c2f88b07c +Subproject commit e8ab249582eb77e8c18c810c015a9420ef45cc46 From 951ce92cee114881c9baa556bb63cebffb9f7772 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Sun, 24 Mar 2024 08:29:03 -0400 Subject: [PATCH 56/93] Updates the Math submodule to b010193521. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index e8ab249582..b010193521 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit e8ab249582eb77e8c18c810c015a9420ef45cc46 +Subproject commit b010193521f9a11feca8f1093ddd215331719a0f From 71bfbcf2185f95e904fb03b304cd6cb8570daafb Mon Sep 17 00:00:00 2001 From: aleksgorica Date: Mon, 25 Mar 2024 14:35:42 +0100 Subject: [PATCH 57/93] smaller changes for comments in pull request --- .../compute_potential_scale_reduction.hpp | 272 +++++++++--------- ...compute_potential_scale_reduction_test.cpp | 39 ++- 2 files changed, 163 insertions(+), 148 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 3cd230540a..4082f8ec0b 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -21,76 +21,76 @@ namespace analyze { * Computes normalized average ranks for draws. Transforming them to normal * scores using inverse normal transformation and a fractional offset. Based on * paper https://arxiv.org/abs/1903.08008 - * @param draws stores chains in columns + * @param chains stores chains in columns * @return normal scores for average ranks of draws - * */ - -inline Eigen::MatrixXd rank_transform(const Eigen::MatrixXd& draws) { - const Eigen::Index rows = draws.rows(); - const Eigen::Index cols = draws.cols(); +inline Eigen::MatrixXd rank_transform(const Eigen::MatrixXd& chains) { + const Eigen::Index rows = chains.rows(); + const Eigen::Index cols = chains.cols(); const Eigen::Index size = rows * cols; std::vector> value_with_index(size); for (Eigen::Index i = 0; i < size; ++i) { - value_with_index[i] = {draws(i), i}; + value_with_index[i] = {chains(i), i}; } std::sort(value_with_index.begin(), value_with_index.end()); - Eigen::MatrixXd rankMatrix = Eigen::MatrixXd::Zero(rows, cols); + Eigen::MatrixXd rank_matrix = Eigen::MatrixXd::Zero(rows, cols); // Assigning average ranks for (Eigen::Index i = 0; i < size; ++i) { // Handle ties by averaging ranks Eigen::Index j = i + 1; - double sumRanks = j; + double sum_ranks = j; Eigen::Index count = 1; while (j < size && value_with_index[j].first == value_with_index[i].first) { - sumRanks += j + 1; // Rank starts from 1 + sum_ranks += j + 1; // Rank starts from 1 ++j; ++count; } - double avgRank = sumRanks / count; + double avg_rank = sum_ranks / count; boost::math::normal_distribution dist; for (std::size_t k = i; k < j; ++k) { - Eigen::Index index = value_with_index[k].second; - double p = (avgRank - 3.0 / 8.0) / (size - 2.0 * 3.0 / 8.0 + 1.0); - rankMatrix(index) = boost::math::quantile(dist, p); + double p = (avg_rank - 3.0 / 8.0) / (size - 2.0 * 3.0 / 8.0 + 1.0); + const Eigen::Index index = value_with_index[k].second; + rank_matrix(index) = boost::math::quantile(dist, p); } i = j - 1; // Skip over tied elements } - return rankMatrix; + return rank_matrix; } /** * Computes square root of marginal posterior variance of the estimand by the * weigted average of within-chain variance W and between-chain variance B. * - * @param draws stores chains in columns + * @param chains stores chains in columns * @return square root of ((N-1)/N)W + B/N - * */ - -inline double rhat(const Eigen::MatrixXd& draws) { - const Eigen::Index num_chains = draws.cols(); - const Eigen::Index num_draws = draws.rows(); - - Eigen::VectorXd chain_mean(num_chains); - chain_mean = draws.colwise().mean(); - double total_mean = chain_mean.mean(); - double var_between = num_draws - * (chain_mean.array() - total_mean).square().sum() +inline double rhat(const Eigen::MatrixXd& chains) { + const Eigen::Index num_chains = chains.cols(); + const Eigen::Index num_draws = chains.rows(); + + Eigen::RowVectorXd within_chain_means = chains.colwise().mean(); + double across_chain_mean = within_chain_means.mean(); + double between_variance = num_draws + * (within_chain_means.array() - across_chain_mean).square().sum() / (num_chains - 1); - double var_sum = 0; - for (Eigen::Index col = 0; col < num_chains; ++col) { - var_sum += (draws.col(col).array() - chain_mean(col)).square().sum() - / (num_draws - 1); - } - double var_within = var_sum / num_chains; - return sqrt((var_between / var_within + num_draws - 1) / num_draws); + double within_variance = + // Divide each row by chains and get sum of squares for each chain (getting a vector back) + ((chains.rowwise() - within_chain_means) + .array() + .square() + .colwise() + // divide each sum of square by num_draws, sum the sum of squares, and divide by num chains + .sum() / (num_draws - 1.0)) + .sum() / num_chains; + + return sqrt((between_variance / within_variance + num_draws - 1) / num_draws); + } /** @@ -102,43 +102,51 @@ inline double rhat(const Eigen::MatrixXd& draws) { * blocks of memory. Chains are trimmed from the back to match the * length of the shortest chain. * - * @param draws stores pointers to arrays of chains + * @param chain_begin stores pointers to arrays of chains * @param sizes stores sizes of chains * @return potential scale reduction for the specified parameter */ inline double compute_potential_scale_reduction_rank( - std::vector draws, std::vector sizes) { - int num_chains = sizes.size(); - size_t num_draws = sizes[0]; - if (num_draws == 0) { - return std::numeric_limits::quiet_NaN(); - } - for (int chain = 1; chain < num_chains; ++chain) { - num_draws = std::min(num_draws, sizes[chain]); + const std::vector& chain_begins, const std::vector& chain_sizes) { + std::vector nonzero_chain_begins; + std::vector nonzero_chain_sizes; + for (size_t i = 0; i < chain_sizes.size(); ++i) { + if (chain_sizes[i]) { + nonzero_chain_begins.push_back(chain_begins[i]); + nonzero_chain_sizes.push_back(chain_sizes[i]); + } + } + if (!nonzero_chain_sizes.size()) { + return std::numeric_limits::quiet_NaN(); + } + std::size_t num_nonzero_chains = nonzero_chain_sizes.size(); + std::size_t min_num_draws = nonzero_chain_sizes[0]; + for (std::size_t chain = 1; chain < num_nonzero_chains; ++chain) { + min_num_draws = std::min(min_num_draws, nonzero_chain_sizes[chain]); } // check if chains are constant; all equal to first draw's value bool are_all_const = false; - Eigen::VectorXd init_draw = Eigen::VectorXd::Zero(num_chains); + Eigen::VectorXd init_draw = Eigen::VectorXd::Zero(num_nonzero_chains); + Eigen::MatrixXd draws_matrix(min_num_draws, num_nonzero_chains); - for (int chain = 0; chain < num_chains; chain++) { - Eigen::Map> draw( - draws[chain], sizes[chain]); + for (std::size_t chain = 0; chain < num_nonzero_chains; chain++) { + Eigen::Map> draws( + nonzero_chain_begins[chain], nonzero_chain_sizes[chain]); - for (int n = 0; n < num_draws; n++) { - if (!std::isfinite(draw(n))) { + for (std::size_t n = 0; n < min_num_draws; n++) { + if (!std::isfinite(draws(n))) { return std::numeric_limits::quiet_NaN(); } + draws_matrix(n, chain) = draws(n); } - init_draw(chain) = draw(0); - - if (draw.isApproxToConstant(draw(0))) { + init_draw(chain) = draws(0); + if (!draws.isApproxToConstant(draws(0))) { are_all_const |= true; } } - - if (are_all_const) { + if (are_all_const) { // If all chains are constant then return NaN // if they all equal the same constant value if (init_draw.isApproxToConstant(init_draw(0))) { @@ -146,18 +154,11 @@ inline double compute_potential_scale_reduction_rank( } } - Eigen::MatrixXd matrix(num_draws, num_chains); - - for (int col = 0; col < num_chains; ++col) { - for (int row = 0; row < num_draws; ++row) { - matrix(row, col) = draws[col][row]; - } - } - - double rhat_bulk = rhat(rank_transform(matrix)); + double rhat_bulk = rhat(rank_transform(draws_matrix)); double rhat_tail = rhat(rank_transform( - (matrix.array() - math::quantile(matrix.reshaped(), 0.5)).abs())); + (draws_matrix.array() - math::quantile(draws_matrix.reshaped(), 0.5)).abs())); + // return std::make_pair(rhat_bulk, rhat_tail); return std::max(rhat_bulk, rhat_tail); } @@ -169,47 +170,54 @@ inline double compute_potential_scale_reduction_rank( * Scale Reduction". http://mc-stan.org/users/documentation * * Current implementation assumes draws are stored in contiguous - * blocks of memory. Chains are trimmed from the back to match the + * blocks of memory. Chains are trimmed from the back to match the * length of the shortest chain. * - * @param draws stores pointers to arrays of chains - * @param sizes stores sizes of chains + * @param chain_begins stores pointers to arrays of chains + * @param chain_sizes stores sizes of chains * @return potential scale reduction for the specified parameter */ - inline double compute_potential_scale_reduction( - std::vector draws, std::vector sizes) { - int num_chains = sizes.size(); - size_t num_draws = sizes[0]; - if (num_draws == 0) { - return std::numeric_limits::quiet_NaN(); - } - for (int chain = 1; chain < num_chains; ++chain) { - num_draws = std::min(num_draws, sizes[chain]); + const std::vector& chain_begins, const std::vector& chain_sizes) { + std::vector nonzero_chain_begins; + std::vector nonzero_chain_sizes; + for (size_t i = 0; i < chain_sizes.size(); ++i) { + if (chain_sizes[i]) { + nonzero_chain_begins.push_back(chain_begins[i]); + nonzero_chain_sizes.push_back(chain_sizes[i]); + } + } + if (!nonzero_chain_sizes.size()) { + return std::numeric_limits::quiet_NaN(); + } + std::size_t num_nonzero_chains = nonzero_chain_sizes.size(); + std::size_t min_num_draws = nonzero_chain_sizes[0]; + for (std::size_t chain = 1; chain < num_nonzero_chains; ++chain) { + min_num_draws = std::min(min_num_draws, nonzero_chain_sizes[chain]); } // check if chains are constant; all equal to first draw's value bool are_all_const = false; - Eigen::VectorXd init_draw = Eigen::VectorXd::Zero(num_chains); + Eigen::VectorXd init_draw = Eigen::VectorXd::Zero(num_nonzero_chains); + Eigen::MatrixXd draws_matrix(min_num_draws, num_nonzero_chains); - for (int chain = 0; chain < num_chains; chain++) { - Eigen::Map> draw( - draws[chain], sizes[chain]); + for (std::size_t chain = 0; chain < num_nonzero_chains; chain++) { + Eigen::Map> draws( + nonzero_chain_begins[chain], nonzero_chain_sizes[chain]); - for (int n = 0; n < num_draws; n++) { - if (!std::isfinite(draw(n))) { + for (std::size_t n = 0; n < min_num_draws; n++) { + if (!std::isfinite(draws(n))) { return std::numeric_limits::quiet_NaN(); } + draws_matrix(n, chain) = draws(n); } - init_draw(chain) = draw(0); - - if (draw.isApproxToConstant(draw(0))) { + init_draw(chain) = draws(0); + if (!draws.isApproxToConstant(draws(0))) { are_all_const |= true; } } - - if (are_all_const) { + if (are_all_const) { // If all chains are constant then return NaN // if they all equal the same constant value if (init_draw.isApproxToConstant(init_draw(0))) { @@ -217,15 +225,7 @@ inline double compute_potential_scale_reduction( } } - Eigen::MatrixXd matrix(num_draws, num_chains); - - for (int col = 0; col < num_chains; ++col) { - for (int row = 0; row < num_draws; ++row) { - matrix(row, col) = draws[col][row]; - } - } - - return rhat(matrix); + return rhat(draws_matrix); } /** @@ -237,19 +237,19 @@ inline double compute_potential_scale_reduction( * Scale Reduction". http://mc-stan.org/users/documentation * * Current implementation assumes draws are stored in contiguous - * blocks of memory. Chains are trimmed from the back to match the - * length of the shortest chain. Argument size will be broadcast to + * blocks of memory. Chains are trimmed from the back to match the + * length of the shortest chain. Argument size will be broadcast to * same length as draws. * - * @param draws stores pointers to arrays of chains + * @param chain_begins stores pointers to arrays of chains * @param size stores sizes of chains * @return potential scale reduction for the specified parameter */ inline double compute_potential_scale_reduction_rank( - std::vector draws, size_t size) { - int num_chains = draws.size(); + const std::vector& chain_begins, size_t size) { + size_t num_chains = chain_begins.size(); std::vector sizes(num_chains, size); - return compute_potential_scale_reduction_rank(draws, sizes); + return compute_potential_scale_reduction_rank(chain_begins, sizes); } /** @@ -259,20 +259,20 @@ inline double compute_potential_scale_reduction_rank( * See more details in Stan reference manual section "Potential * Scale Reduction". http://mc-stan.org/users/documentation * - * Current implementation assumes draws are stored in contiguous - * blocks of memory. Chains are trimmed from the back to match the - * length of the shortest chain. Argument size will be broadcast to + * Current implementation assumes draws are stored in contiguousdereck lively ii height weight + * blocks of memory. Chains are trimmed from the back to match the + * length of the shortest chain. Argument size will be broadcast to * same length as draws. * - * @param draws stores pointers to arrays of chains + * @param chain_begins stores pointers to arrays of chains * @param size stores sizes of chains * @return potential scale reduction for the specified parameter */ inline double compute_potential_scale_reduction( - std::vector draws, size_t size) { - int num_chains = draws.size(); + const std::vector& chain_begins, size_t size) { + size_t num_chains = chain_begins.size(); std::vector sizes(num_chains, size); - return compute_potential_scale_reduction(draws, sizes); + return compute_potential_scale_reduction(chain_begins, sizes); } /** @@ -286,25 +286,25 @@ inline double compute_potential_scale_reduction( * Scale Reduction". http://mc-stan.org/users/documentation * * Current implementation assumes draws are stored in contiguous - * blocks of memory. Chains are trimmed from the back to match the + * blocks of memory. Chains are trimmed from the back to match the * length of the shortest chain. * - * @param draws stores pointers to arrays of chains - * @param sizes stores sizes of chains + * @param chain_begins stores pointers to arrays of chains + * @param chain_sizes stores sizes of chains * @return potential scale reduction for the specified parameter */ inline double compute_split_potential_scale_reduction_rank( - std::vector draws, std::vector sizes) { - int num_chains = sizes.size(); - size_t num_draws = sizes[0]; - for (int chain = 1; chain < num_chains; ++chain) { - num_draws = std::min(num_draws, sizes[chain]); + const std::vector& chain_begins, const std::vector& chain_sizes) { + size_t num_chains = chain_sizes.size(); + size_t num_draws = chain_sizes[0]; + for (size_t chain = 1; chain < num_chains; ++chain) { + num_draws = std::min(num_draws, chain_sizes[chain]); } - std::vector split_draws = split_chains(draws, sizes); + std::vector split_draws = split_chains(chain_begins, chain_sizes); - double half = num_draws / 2.0; - std::vector half_sizes(2 * num_chains, std::floor(half)); + size_t half = std::floor(num_draws / 2.0); + std::vector half_sizes(2 * num_chains, half); return compute_potential_scale_reduction_rank(split_draws, half_sizes); } @@ -321,19 +321,19 @@ inline double compute_split_potential_scale_reduction_rank( * blocks of memory. Chains are trimmed from the back to match the * length of the shortest chain. * - * @param draws stores pointers to arrays of chains - * @param sizes stores sizes of chains + * @param chain_begins stores pointers to arrays of chains + * @param chain_sizes stores sizes of chains * @return potential scale reduction for the specified parameter */ inline double compute_split_potential_scale_reduction( - std::vector draws, std::vector sizes) { - int num_chains = sizes.size(); - size_t num_draws = sizes[0]; - for (int chain = 1; chain < num_chains; ++chain) { - num_draws = std::min(num_draws, sizes[chain]); + const std::vector& chain_begins, const std::vector& chain_sizes) { + size_t num_chains = chain_sizes.size(); + size_t num_draws = chain_sizes[0]; + for (size_t chain = 1; chain < num_chains; ++chain) { + num_draws = std::min(num_draws, chain_sizes[chain]); } - std::vector split_draws = split_chains(draws, sizes); + std::vector split_draws = split_chains(chain_begins, chain_sizes); double half = num_draws / 2.0; std::vector half_sizes(2 * num_chains, std::floor(half)); @@ -356,15 +356,15 @@ inline double compute_split_potential_scale_reduction( * length of the shortest chain. Argument size will be broadcast to * same length as draws. * - * @param draws stores pointers to arrays of chains + * @param chain_begins stores pointers to arrays of chains * @param size stores sizes of chains * @return potential scale reduction for the specified parameter */ inline double compute_split_potential_scale_reduction_rank( - std::vector draws, size_t size) { - int num_chains = draws.size(); + const std::vector& chain_begins, size_t size) { + size_t num_chains = chain_begins.size(); std::vector sizes(num_chains, size); - return compute_split_potential_scale_reduction_rank(draws, sizes); + return compute_split_potential_scale_reduction_rank(chain_begins, sizes); } /** @@ -380,15 +380,15 @@ inline double compute_split_potential_scale_reduction_rank( * length of the shortest chain. Argument size will be broadcast to * same length as draws. * - * @param draws stores pointers to arrays of chains + * @param chain_begins stores pointers to arrays of chains * @param size stores sizes of chains * @return potential scale reduction for the specified parameter */ inline double compute_split_potential_scale_reduction( - std::vector draws, size_t size) { - int num_chains = draws.size(); + const std::vector& chain_begins, size_t size) { + size_t num_chains = chain_begins.size(); std::vector sizes(num_chains, size); - return compute_split_potential_scale_reduction(draws, sizes); + return compute_split_potential_scale_reduction(chain_begins, sizes); } } // namespace analyze diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 6faa735f73..0d69d57ae8 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -70,12 +70,12 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, - 1.00201, 0.999558, 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, - 1.00134, 1.00895, 1.00079, 1.00368, 1.00092, 1.00133, 1.01005, 1.00107, - 1.00151, 1.00229, 0.999998, 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, - 1.001, 1.01267, 1.00011, 1.00066, 1.00091, 1.00237, 1.00019, 1.00104, - 1.00341, 0.999815, 1.00033, 0.999672, 1.00306, 1.00072, 1.00191, 1.00658; + rhat << 1.00067,1.00497,1.00918,1.00055,1.0015,1.00088,1.00776,1.00042,1.00201,0.99956,0.99984,1.00054,1.00403,1.00516,1.00591,1.00627,1.00134,1.00895,1.00079,1.00368,1.00092,1.00133,1.01005,1.00107,1.00151,1.00229,1.0,1.00008,1.00315,1.00277,1.00247,1.00003,1.001,1.01267,1.00011,1.00066,1.00091,1.00237,1.00019,1.00104,1.00341,0.99981,1.00033,0.99967,1.00306,1.00072,1.00191,1.00658; + + // Eigen::VectorXd rhat_bulk(48); + // rhat_bulk << 1.00067,0.99979,0.99966,1.00055,1.0011,1.00088,1.00032,0.99997,1.00201,0.99956,0.99956,0.9995,1.00292,1.00516,1.00591,0.99975,1.00088,1.00895,1.00079,0.99953,1.00092,1.00044,1.01005,0.9996,1.00151,0.99966,0.99965,0.99963,1.00315,1.00277,1.00247,1.00003,0.99994,1.00116,0.99952,1.0005,1.00091,1.00213,1.00019,0.99977,1.0003,0.99981,1.00003,0.99967,1.00306,1.00072,0.9996,0.99979; + // Eigen::VectorXd rhat_tail(48); + // rhat_tail << 1.00063,1.00497,1.00918,0.99965,1.0015,0.99962,1.00776,1.00042,0.99963,0.99951,0.99984,1.00054,1.00403,1.00107,1.00287,1.00627,1.00134,0.99957,0.99997,1.00368,1.00053,1.00133,1.00589,1.00107,1.00031,1.00229,1.0,1.00008,1.0001,1.00116,1.00219,0.99992,1.001,1.01267,1.00011,1.00066,1.00065,1.00237,0.9995,1.00104,1.00341,0.99958,1.00033,0.9996,0.99957,1.00058,1.00191,1.00658; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -89,6 +89,15 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank) { draws[chain] = &samples(chain)(0); sizes[chain] = samples(chain).size(); } + + // double [computed_bulk_rhat, computed_tail_rhat] = stan::analyze::compute_potential_scale_reduction_rank(draws, sizes); + // double expected_bulk_rhat = rhat_bulk(index - 4); + // double expected_tail_rhat = rhat_tail(index - 4); + + // ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) + // << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + // ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) + // << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); ASSERT_NEAR( rhat(index - 4), stan::analyze::compute_potential_scale_reduction_rank(draws, sizes), @@ -234,7 +243,6 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction_rank) { << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } - for (int index = 0; index < chains.num_params(); index++) { std::string name = chains.param_name(index); ASSERT_EQ(chains.split_potential_scale_reduction_rank(index), @@ -406,9 +414,14 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience_rank) { TEST_F(ComputeRhat, compute_potential_scale_reduction_constant) { std::vector param_names{"a"}; stan::mcmc::chains<> chains(param_names); - Eigen::Matrix draws; - draws << 1.0, 1.0; - chains.add(draws); + Eigen::Matrix draws1; + draws1 << 1.0, 1.0, 2.0; + chains.add(draws1); + Eigen::Matrix draws2; + draws2 << 4.0, 4.0, 4.0; + chains.add(draws2); + + std::cout << "SOMETHING" << std::endl; ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction(0))) << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); @@ -442,7 +455,9 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_nan) { Eigen::Matrix draws; draws << 1.0, std::numeric_limits::quiet_NaN(); chains.add(draws); - ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction_rank(0))) << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); -} \ No newline at end of file +} + + + From 385c80bbd4f0de9e1e2be50683ed9d8ab9bbbe09 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Mon, 25 Mar 2024 09:36:24 -0400 Subject: [PATCH 58/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- .../compute_potential_scale_reduction.hpp | 105 ++++++++++-------- ...compute_potential_scale_reduction_test.cpp | 27 +++-- 2 files changed, 75 insertions(+), 57 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 4082f8ec0b..111e2a796c 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -74,23 +74,27 @@ inline double rhat(const Eigen::MatrixXd& chains) { const Eigen::Index num_chains = chains.cols(); const Eigen::Index num_draws = chains.rows(); - Eigen::RowVectorXd within_chain_means = chains.colwise().mean(); + Eigen::RowVectorXd within_chain_means = chains.colwise().mean(); double across_chain_mean = within_chain_means.mean(); - double between_variance = num_draws - * (within_chain_means.array() - across_chain_mean).square().sum() - / (num_chains - 1); + double between_variance + = num_draws + * (within_chain_means.array() - across_chain_mean).square().sum() + / (num_chains - 1); double within_variance = - // Divide each row by chains and get sum of squares for each chain (getting a vector back) + // Divide each row by chains and get sum of squares for each chain + // (getting a vector back) ((chains.rowwise() - within_chain_means) - .array() - .square() - .colwise() - // divide each sum of square by num_draws, sum the sum of squares, and divide by num chains - .sum() / (num_draws - 1.0)) - .sum() / num_chains; - - return sqrt((between_variance / within_variance + num_draws - 1) / num_draws); - + .array() + .square() + .colwise() + // divide each sum of square by num_draws, sum the sum of squares, + // and divide by num chains + .sum() + / (num_draws - 1.0)) + .sum() + / num_chains; + + return sqrt((between_variance / within_variance + num_draws - 1) / num_draws); } /** @@ -107,18 +111,19 @@ inline double rhat(const Eigen::MatrixXd& chains) { * @return potential scale reduction for the specified parameter */ inline double compute_potential_scale_reduction_rank( - const std::vector& chain_begins, const std::vector& chain_sizes) { - std::vector nonzero_chain_begins; - std::vector nonzero_chain_sizes; - for (size_t i = 0; i < chain_sizes.size(); ++i) { - if (chain_sizes[i]) { - nonzero_chain_begins.push_back(chain_begins[i]); - nonzero_chain_sizes.push_back(chain_sizes[i]); - } - } - if (!nonzero_chain_sizes.size()) { - return std::numeric_limits::quiet_NaN(); - } + const std::vector& chain_begins, + const std::vector& chain_sizes) { + std::vector nonzero_chain_begins; + std::vector nonzero_chain_sizes; + for (size_t i = 0; i < chain_sizes.size(); ++i) { + if (chain_sizes[i]) { + nonzero_chain_begins.push_back(chain_begins[i]); + nonzero_chain_sizes.push_back(chain_sizes[i]); + } + } + if (!nonzero_chain_sizes.size()) { + return std::numeric_limits::quiet_NaN(); + } std::size_t num_nonzero_chains = nonzero_chain_sizes.size(); std::size_t min_num_draws = nonzero_chain_sizes[0]; for (std::size_t chain = 1; chain < num_nonzero_chains; ++chain) { @@ -146,7 +151,7 @@ inline double compute_potential_scale_reduction_rank( are_all_const |= true; } } - if (are_all_const) { + if (are_all_const) { // If all chains are constant then return NaN // if they all equal the same constant value if (init_draw.isApproxToConstant(init_draw(0))) { @@ -156,7 +161,8 @@ inline double compute_potential_scale_reduction_rank( double rhat_bulk = rhat(rank_transform(draws_matrix)); double rhat_tail = rhat(rank_transform( - (draws_matrix.array() - math::quantile(draws_matrix.reshaped(), 0.5)).abs())); + (draws_matrix.array() - math::quantile(draws_matrix.reshaped(), 0.5)) + .abs())); // return std::make_pair(rhat_bulk, rhat_tail); return std::max(rhat_bulk, rhat_tail); @@ -178,18 +184,19 @@ inline double compute_potential_scale_reduction_rank( * @return potential scale reduction for the specified parameter */ inline double compute_potential_scale_reduction( - const std::vector& chain_begins, const std::vector& chain_sizes) { - std::vector nonzero_chain_begins; - std::vector nonzero_chain_sizes; - for (size_t i = 0; i < chain_sizes.size(); ++i) { - if (chain_sizes[i]) { - nonzero_chain_begins.push_back(chain_begins[i]); - nonzero_chain_sizes.push_back(chain_sizes[i]); - } - } - if (!nonzero_chain_sizes.size()) { - return std::numeric_limits::quiet_NaN(); - } + const std::vector& chain_begins, + const std::vector& chain_sizes) { + std::vector nonzero_chain_begins; + std::vector nonzero_chain_sizes; + for (size_t i = 0; i < chain_sizes.size(); ++i) { + if (chain_sizes[i]) { + nonzero_chain_begins.push_back(chain_begins[i]); + nonzero_chain_sizes.push_back(chain_sizes[i]); + } + } + if (!nonzero_chain_sizes.size()) { + return std::numeric_limits::quiet_NaN(); + } std::size_t num_nonzero_chains = nonzero_chain_sizes.size(); std::size_t min_num_draws = nonzero_chain_sizes[0]; for (std::size_t chain = 1; chain < num_nonzero_chains; ++chain) { @@ -217,7 +224,7 @@ inline double compute_potential_scale_reduction( are_all_const |= true; } } - if (are_all_const) { + if (are_all_const) { // If all chains are constant then return NaN // if they all equal the same constant value if (init_draw.isApproxToConstant(init_draw(0))) { @@ -259,8 +266,8 @@ inline double compute_potential_scale_reduction_rank( * See more details in Stan reference manual section "Potential * Scale Reduction". http://mc-stan.org/users/documentation * - * Current implementation assumes draws are stored in contiguousdereck lively ii height weight - * blocks of memory. Chains are trimmed from the back to match the + * Current implementation assumes draws are stored in contiguousdereck lively ii + * height weight blocks of memory. Chains are trimmed from the back to match the * length of the shortest chain. Argument size will be broadcast to * same length as draws. * @@ -294,14 +301,16 @@ inline double compute_potential_scale_reduction( * @return potential scale reduction for the specified parameter */ inline double compute_split_potential_scale_reduction_rank( - const std::vector& chain_begins, const std::vector& chain_sizes) { + const std::vector& chain_begins, + const std::vector& chain_sizes) { size_t num_chains = chain_sizes.size(); size_t num_draws = chain_sizes[0]; for (size_t chain = 1; chain < num_chains; ++chain) { num_draws = std::min(num_draws, chain_sizes[chain]); } - std::vector split_draws = split_chains(chain_begins, chain_sizes); + std::vector split_draws + = split_chains(chain_begins, chain_sizes); size_t half = std::floor(num_draws / 2.0); std::vector half_sizes(2 * num_chains, half); @@ -326,14 +335,16 @@ inline double compute_split_potential_scale_reduction_rank( * @return potential scale reduction for the specified parameter */ inline double compute_split_potential_scale_reduction( - const std::vector& chain_begins, const std::vector& chain_sizes) { + const std::vector& chain_begins, + const std::vector& chain_sizes) { size_t num_chains = chain_sizes.size(); size_t num_draws = chain_sizes[0]; for (size_t chain = 1; chain < num_chains; ++chain) { num_draws = std::min(num_draws, chain_sizes[chain]); } - std::vector split_draws = split_chains(chain_begins, chain_sizes); + std::vector split_draws + = split_chains(chain_begins, chain_sizes); double half = num_draws / 2.0; std::vector half_sizes(2 * num_chains, std::floor(half)); diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 0d69d57ae8..a682e168e8 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -70,12 +70,19 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00067,1.00497,1.00918,1.00055,1.0015,1.00088,1.00776,1.00042,1.00201,0.99956,0.99984,1.00054,1.00403,1.00516,1.00591,1.00627,1.00134,1.00895,1.00079,1.00368,1.00092,1.00133,1.01005,1.00107,1.00151,1.00229,1.0,1.00008,1.00315,1.00277,1.00247,1.00003,1.001,1.01267,1.00011,1.00066,1.00091,1.00237,1.00019,1.00104,1.00341,0.99981,1.00033,0.99967,1.00306,1.00072,1.00191,1.00658; + rhat << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, + 1.00201, 0.99956, 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, + 1.00134, 1.00895, 1.00079, 1.00368, 1.00092, 1.00133, 1.01005, 1.00107, + 1.00151, 1.00229, 1.0, 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, 1.001, + 1.01267, 1.00011, 1.00066, 1.00091, 1.00237, 1.00019, 1.00104, 1.00341, + 0.99981, 1.00033, 0.99967, 1.00306, 1.00072, 1.00191, 1.00658; // Eigen::VectorXd rhat_bulk(48); - // rhat_bulk << 1.00067,0.99979,0.99966,1.00055,1.0011,1.00088,1.00032,0.99997,1.00201,0.99956,0.99956,0.9995,1.00292,1.00516,1.00591,0.99975,1.00088,1.00895,1.00079,0.99953,1.00092,1.00044,1.01005,0.9996,1.00151,0.99966,0.99965,0.99963,1.00315,1.00277,1.00247,1.00003,0.99994,1.00116,0.99952,1.0005,1.00091,1.00213,1.00019,0.99977,1.0003,0.99981,1.00003,0.99967,1.00306,1.00072,0.9996,0.99979; + // rhat_bulk + // << 1.00067,0.99979,0.99966,1.00055,1.0011,1.00088,1.00032,0.99997,1.00201,0.99956,0.99956,0.9995,1.00292,1.00516,1.00591,0.99975,1.00088,1.00895,1.00079,0.99953,1.00092,1.00044,1.01005,0.9996,1.00151,0.99966,0.99965,0.99963,1.00315,1.00277,1.00247,1.00003,0.99994,1.00116,0.99952,1.0005,1.00091,1.00213,1.00019,0.99977,1.0003,0.99981,1.00003,0.99967,1.00306,1.00072,0.9996,0.99979; // Eigen::VectorXd rhat_tail(48); - // rhat_tail << 1.00063,1.00497,1.00918,0.99965,1.0015,0.99962,1.00776,1.00042,0.99963,0.99951,0.99984,1.00054,1.00403,1.00107,1.00287,1.00627,1.00134,0.99957,0.99997,1.00368,1.00053,1.00133,1.00589,1.00107,1.00031,1.00229,1.0,1.00008,1.0001,1.00116,1.00219,0.99992,1.001,1.01267,1.00011,1.00066,1.00065,1.00237,0.9995,1.00104,1.00341,0.99958,1.00033,0.9996,0.99957,1.00058,1.00191,1.00658; + // rhat_tail + // << 1.00063,1.00497,1.00918,0.99965,1.0015,0.99962,1.00776,1.00042,0.99963,0.99951,0.99984,1.00054,1.00403,1.00107,1.00287,1.00627,1.00134,0.99957,0.99997,1.00368,1.00053,1.00133,1.00589,1.00107,1.00031,1.00229,1.0,1.00008,1.0001,1.00116,1.00219,0.99992,1.001,1.01267,1.00011,1.00066,1.00065,1.00237,0.9995,1.00104,1.00341,0.99958,1.00033,0.9996,0.99957,1.00058,1.00191,1.00658; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -90,14 +97,17 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank) { sizes[chain] = samples(chain).size(); } - // double [computed_bulk_rhat, computed_tail_rhat] = stan::analyze::compute_potential_scale_reduction_rank(draws, sizes); + // double [computed_bulk_rhat, computed_tail_rhat] = + // stan::analyze::compute_potential_scale_reduction_rank(draws, sizes); // double expected_bulk_rhat = rhat_bulk(index - 4); // double expected_tail_rhat = rhat_tail(index - 4); // ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) - // << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + // << "Bulk Rhat mismatch for index: " << index << ", parameter: " << + // chains.param_name(index); // ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) - // << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + // << "Tail Rhat mismatch for index: " << index << ", parameter: " << + // chains.param_name(index); ASSERT_NEAR( rhat(index - 4), stan::analyze::compute_potential_scale_reduction_rank(draws, sizes), @@ -417,7 +427,7 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_constant) { Eigen::Matrix draws1; draws1 << 1.0, 1.0, 2.0; chains.add(draws1); - Eigen::Matrix draws2; + Eigen::Matrix draws2; draws2 << 4.0, 4.0, 4.0; chains.add(draws2); @@ -458,6 +468,3 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_nan) { ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction_rank(0))) << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); } - - - From 51a2504724a37fabb11fcd98b18eded545f631d6 Mon Sep 17 00:00:00 2001 From: aleksgorica Date: Tue, 26 Mar 2024 16:15:48 +0100 Subject: [PATCH 59/93] returning pair for rank rhat --- .../compute_potential_scale_reduction.hpp | 64 ++--- src/stan/mcmc/chains.hpp | 4 +- ...compute_potential_scale_reduction_test.cpp | 253 +++++++++++------- src/test/unit/mcmc/chains_test.cpp | 37 ++- 4 files changed, 218 insertions(+), 140 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 111e2a796c..8c024a96dc 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -110,20 +110,19 @@ inline double rhat(const Eigen::MatrixXd& chains) { * @param sizes stores sizes of chains * @return potential scale reduction for the specified parameter */ -inline double compute_potential_scale_reduction_rank( - const std::vector& chain_begins, - const std::vector& chain_sizes) { - std::vector nonzero_chain_begins; - std::vector nonzero_chain_sizes; - for (size_t i = 0; i < chain_sizes.size(); ++i) { - if (chain_sizes[i]) { - nonzero_chain_begins.push_back(chain_begins[i]); - nonzero_chain_sizes.push_back(chain_sizes[i]); - } - } - if (!nonzero_chain_sizes.size()) { - return std::numeric_limits::quiet_NaN(); - } +inline std::pair compute_potential_scale_reduction_rank( + const std::vector& chain_begins, const std::vector& chain_sizes) { + std::vector nonzero_chain_begins; + std::vector nonzero_chain_sizes; + for (size_t i = 0; i < chain_sizes.size(); ++i) { + if (chain_sizes[i]) { + nonzero_chain_begins.push_back(chain_begins[i]); + nonzero_chain_sizes.push_back(chain_sizes[i]); + } + } + if (!nonzero_chain_sizes.size()) { + return {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}; + } std::size_t num_nonzero_chains = nonzero_chain_sizes.size(); std::size_t min_num_draws = nonzero_chain_sizes[0]; for (std::size_t chain = 1; chain < num_nonzero_chains; ++chain) { @@ -141,21 +140,20 @@ inline double compute_potential_scale_reduction_rank( for (std::size_t n = 0; n < min_num_draws; n++) { if (!std::isfinite(draws(n))) { - return std::numeric_limits::quiet_NaN(); + return {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}; } draws_matrix(n, chain) = draws(n); } init_draw(chain) = draws(0); - if (!draws.isApproxToConstant(draws(0))) { - are_all_const |= true; - } + are_all_const |= !draws.isApproxToConstant(draws(0)); + } if (are_all_const) { // If all chains are constant then return NaN // if they all equal the same constant value if (init_draw.isApproxToConstant(init_draw(0))) { - return std::numeric_limits::quiet_NaN(); + return {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}; } } @@ -164,8 +162,8 @@ inline double compute_potential_scale_reduction_rank( (draws_matrix.array() - math::quantile(draws_matrix.reshaped(), 0.5)) .abs())); - // return std::make_pair(rhat_bulk, rhat_tail); - return std::max(rhat_bulk, rhat_tail); + return std::make_pair(rhat_bulk, rhat_tail); + //return std::max(rhat_bulk, rhat_tail); } /** @@ -220,17 +218,14 @@ inline double compute_potential_scale_reduction( } init_draw(chain) = draws(0); - if (!draws.isApproxToConstant(draws(0))) { - are_all_const |= true; - } + + are_all_const |= !draws.isApproxToConstant(draws(0)); } - if (are_all_const) { - // If all chains are constant then return NaN - // if they all equal the same constant value - if (init_draw.isApproxToConstant(init_draw(0))) { - return std::numeric_limits::quiet_NaN(); - } + // if they all equal the same constant value + if (init_draw.isApproxToConstant(init_draw(0))) { + return std::numeric_limits::quiet_NaN(); } + return rhat(draws_matrix); } @@ -252,7 +247,7 @@ inline double compute_potential_scale_reduction( * @param size stores sizes of chains * @return potential scale reduction for the specified parameter */ -inline double compute_potential_scale_reduction_rank( +inline std::pair compute_potential_scale_reduction_rank( const std::vector& chain_begins, size_t size) { size_t num_chains = chain_begins.size(); std::vector sizes(num_chains, size); @@ -300,9 +295,8 @@ inline double compute_potential_scale_reduction( * @param chain_sizes stores sizes of chains * @return potential scale reduction for the specified parameter */ -inline double compute_split_potential_scale_reduction_rank( - const std::vector& chain_begins, - const std::vector& chain_sizes) { +inline std::pair compute_split_potential_scale_reduction_rank( + const std::vector& chain_begins, const std::vector& chain_sizes) { size_t num_chains = chain_sizes.size(); size_t num_draws = chain_sizes[0]; for (size_t chain = 1; chain < num_chains; ++chain) { @@ -371,7 +365,7 @@ inline double compute_split_potential_scale_reduction( * @param size stores sizes of chains * @return potential scale reduction for the specified parameter */ -inline double compute_split_potential_scale_reduction_rank( +inline std::pair compute_split_potential_scale_reduction_rank( const std::vector& chain_begins, size_t size) { size_t num_chains = chain_begins.size(); std::vector sizes(num_chains, size); diff --git a/src/stan/mcmc/chains.hpp b/src/stan/mcmc/chains.hpp index 820eeb363d..18b93c504c 100644 --- a/src/stan/mcmc/chains.hpp +++ b/src/stan/mcmc/chains.hpp @@ -595,7 +595,7 @@ class chains { return split_effective_sample_size(index(name)); } - double split_potential_scale_reduction_rank(const int index) const { + std::pair split_potential_scale_reduction_rank(const int index) const { int n_chains = num_chains(); std::vector draws(n_chains); std::vector sizes(n_chains); @@ -625,7 +625,7 @@ class chains { return analyze::compute_split_potential_scale_reduction(draws, sizes); } - double split_potential_scale_reduction_rank(const std::string& name) const { + std::pair split_potential_scale_reduction_rank(const std::string& name) const { return split_potential_scale_reduction_rank(index(name)); } diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index a682e168e8..9fe188c19e 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -69,20 +69,13 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); - Eigen::VectorXd rhat(48); - rhat << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, - 1.00201, 0.99956, 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, - 1.00134, 1.00895, 1.00079, 1.00368, 1.00092, 1.00133, 1.01005, 1.00107, - 1.00151, 1.00229, 1.0, 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, 1.001, - 1.01267, 1.00011, 1.00066, 1.00091, 1.00237, 1.00019, 1.00104, 1.00341, - 0.99981, 1.00033, 0.99967, 1.00306, 1.00072, 1.00191, 1.00658; - - // Eigen::VectorXd rhat_bulk(48); - // rhat_bulk - // << 1.00067,0.99979,0.99966,1.00055,1.0011,1.00088,1.00032,0.99997,1.00201,0.99956,0.99956,0.9995,1.00292,1.00516,1.00591,0.99975,1.00088,1.00895,1.00079,0.99953,1.00092,1.00044,1.01005,0.9996,1.00151,0.99966,0.99965,0.99963,1.00315,1.00277,1.00247,1.00003,0.99994,1.00116,0.99952,1.0005,1.00091,1.00213,1.00019,0.99977,1.0003,0.99981,1.00003,0.99967,1.00306,1.00072,0.9996,0.99979; - // Eigen::VectorXd rhat_tail(48); - // rhat_tail - // << 1.00063,1.00497,1.00918,0.99965,1.0015,0.99962,1.00776,1.00042,0.99963,0.99951,0.99984,1.00054,1.00403,1.00107,1.00287,1.00627,1.00134,0.99957,0.99997,1.00368,1.00053,1.00133,1.00589,1.00107,1.00031,1.00229,1.0,1.00008,1.0001,1.00116,1.00219,0.99992,1.001,1.01267,1.00011,1.00066,1.00065,1.00237,0.9995,1.00104,1.00341,0.99958,1.00033,0.9996,0.99957,1.00058,1.00191,1.00658; + // Eigen::VectorXd rhat(48); + // rhat << 1.00067,1.00497,1.00918,1.00055,1.0015,1.00088,1.00776,1.00042,1.00201,0.99956,0.99984,1.00054,1.00403,1.00516,1.00591,1.00627,1.00134,1.00895,1.00079,1.00368,1.00092,1.00133,1.01005,1.00107,1.00151,1.00229,1.0,1.00008,1.00315,1.00277,1.00247,1.00003,1.001,1.01267,1.00011,1.00066,1.00091,1.00237,1.00019,1.00104,1.00341,0.99981,1.00033,0.99967,1.00306,1.00072,1.00191,1.00658; + + Eigen::VectorXd rhat_bulk(48); + rhat_bulk << 1.00067,0.99979,0.99966,1.00055,1.0011,1.00088,1.00032,0.99997,1.00201,0.99956,0.99956,0.9995,1.00292,1.00516,1.00591,0.99975,1.00088,1.00895,1.00079,0.99953,1.00092,1.00044,1.01005,0.9996,1.00151,0.99966,0.99965,0.99963,1.00315,1.00277,1.00247,1.00003,0.99994,1.00116,0.99952,1.0005,1.00091,1.00213,1.00019,0.99977,1.0003,0.99981,1.00003,0.99967,1.00306,1.00072,0.9996,0.99979; + Eigen::VectorXd rhat_tail(48); + rhat_tail << 1.00063,1.00497,1.00918,0.99965,1.0015,0.99962,1.00776,1.00042,0.99963,0.99951,0.99984,1.00054,1.00403,1.00107,1.00287,1.00627,1.00134,0.99957,0.99997,1.00368,1.00053,1.00133,1.00589,1.00107,1.00031,1.00229,1.0,1.00008,1.0001,1.00116,1.00219,0.99992,1.001,1.01267,1.00011,1.00066,1.00065,1.00237,0.9995,1.00104,1.00341,0.99958,1.00033,0.9996,0.99957,1.00058,1.00191,1.00658; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -96,24 +89,21 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank) { draws[chain] = &samples(chain)(0); sizes[chain] = samples(chain).size(); } - - // double [computed_bulk_rhat, computed_tail_rhat] = - // stan::analyze::compute_potential_scale_reduction_rank(draws, sizes); - // double expected_bulk_rhat = rhat_bulk(index - 4); - // double expected_tail_rhat = rhat_tail(index - 4); - - // ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) - // << "Bulk Rhat mismatch for index: " << index << ", parameter: " << - // chains.param_name(index); - // ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) - // << "Tail Rhat mismatch for index: " << index << ", parameter: " << - // chains.param_name(index); - ASSERT_NEAR( - rhat(index - 4), - stan::analyze::compute_potential_scale_reduction_rank(draws, sizes), - 1e-4) - << "rhat for index: " << index - << ", parameter: " << chains.param_name(index); + double computed_bulk_rhat, computed_tail_rhat; + std::tie(computed_bulk_rhat, computed_tail_rhat) = stan::analyze::compute_potential_scale_reduction_rank(draws, sizes); + double expected_bulk_rhat = rhat_bulk(index - 4); + double expected_tail_rhat = rhat_tail(index - 4); + + ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) + << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) + << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + // ASSERT_NEAR( + // rhat(index - 4), + // stan::analyze::compute_potential_scale_reduction_rank(draws, sizes), + // 1e-4) + // << "rhat for index: " << index + // << ", parameter: " << chains.param_name(index); } } @@ -167,13 +157,20 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_convenience) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); - Eigen::VectorXd rhat(48); - rhat << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, - 1.00201, 0.999558, 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, - 1.00134, 1.00895, 1.00079, 1.00368, 1.00092, 1.00133, 1.01005, 1.00107, - 1.00151, 1.00229, 0.999998, 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, - 1.001, 1.01267, 1.00011, 1.00066, 1.00091, 1.00237, 1.00019, 1.00104, - 1.00341, 0.999815, 1.00033, 0.999672, 1.00306, 1.00072, 1.00191, 1.00658; + // Eigen::VectorXd rhat(48); + // rhat << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, + // 1.00201, 0.999558, 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, + // 1.00134, 1.00895, 1.00079, 1.00368, 1.00092, 1.00133, 1.01005, 1.00107, + // 1.00151, 1.00229, 0.999998, 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, + // 1.001, 1.01267, 1.00011, 1.00066, 1.00091, 1.00237, 1.00019, 1.00104, + // 1.00341, 0.999815, 1.00033, 0.999672, 1.00306, 1.00072, 1.00191, 1.00658; + + + Eigen::VectorXd rhat_bulk(48); + rhat_bulk << 1.00067,0.99979,0.99966,1.00055,1.0011,1.00088,1.00032,0.99997,1.00201,0.99956,0.99956,0.9995,1.00292,1.00516,1.00591,0.99975,1.00088,1.00895,1.00079,0.99953,1.00092,1.00044,1.01005,0.9996,1.00151,0.99966,0.99965,0.99963,1.00315,1.00277,1.00247,1.00003,0.99994,1.00116,0.99952,1.0005,1.00091,1.00213,1.00019,0.99977,1.0003,0.99981,1.00003,0.99967,1.00306,1.00072,0.9996,0.99979; + Eigen::VectorXd rhat_tail(48); + rhat_tail << 1.00063,1.00497,1.00918,0.99965,1.0015,0.99962,1.00776,1.00042,0.99963,0.99951,0.99984,1.00054,1.00403,1.00107,1.00287,1.00627,1.00134,0.99957,0.99997,1.00368,1.00053,1.00133,1.00589,1.00107,1.00031,1.00229,1.0,1.00008,1.0001,1.00116,1.00219,0.99992,1.001,1.01267,1.00011,1.00066,1.00065,1.00237,0.9995,1.00104,1.00341,0.99958,1.00033,0.9996,0.99957,1.00058,1.00191,1.00658; + Eigen::Matrix samples( chains.num_chains()); @@ -185,12 +182,22 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_convenience) { draws[chain] = &samples(chain)(0); } size_t size = samples(0).size(); - ASSERT_NEAR( - rhat(index - 4), - stan::analyze::compute_potential_scale_reduction_rank(draws, size), - 1e-4) - << "rhat for index: " << index - << ", parameter: " << chains.param_name(index); + + double computed_bulk_rhat, computed_tail_rhat; + std::tie(computed_bulk_rhat, computed_tail_rhat) = stan::analyze::compute_potential_scale_reduction_rank(draws, size); + double expected_bulk_rhat = rhat_bulk(index - 4); + double expected_tail_rhat = rhat_tail(index - 4); + + ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) + << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) + << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + // ASSERT_NEAR( + // rhat(index - 4), + // stan::analyze::compute_potential_scale_reduction_rank(draws, size), + // 1e-4) + // << "rhat for index: " << index + // << ", parameter: " << chains.param_name(index); } } @@ -239,19 +246,35 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction_rank) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); - Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, - 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, - 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, - 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, - 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, - 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; + // Eigen::VectorXd rhat(48); + // rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, + // 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, + // 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, + // 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, + // 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, + // 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; + + Eigen::VectorXd rhat_bulk(48); + rhat_bulk << 1.0078,1.0109,0.99919,1.001,1.00401,1.00992,1.00182,1.00519,1.00095,1.00351,1.00554,1.00075,1.00595,1.00473,1.00546,1.01304,1.00166,1.0074,1.00178,1.00588,1.00406,1.00129,1.00976,1.0013,1.00193,1.00104,0.99938,1.00025,1.01082,1.0019,1.00354,1.0043,1.00111,1.00281,1.00436,1.00515,1.00325,1.0089,1.00222,1.00118,1.00191,1.00283,1.0003,1.00216,1.00335,1.00133,1.00023,1.0109; + Eigen::VectorXd rhat_tail(48); + rhat_tail << 1.00097,1.00422,1.00731,1.00333,1.00337,0.99917,1.00734,1.00633,1.00074,1.00906,1.01019,1.00074,1.00447,1.00383,1.00895,1.00389,1.00052,1.00188,1.00236,1.00284,1.00414,1.00303,1.00327,1.00295,1.00037,1.0044,1.00488,1.00178,1.00475,1.00082,1.00413,1.01303,1.0024,1.01148,1.00098,1.00078,1.00712,1.00595,1.00124,1.00112,1.00381,1.0006,1.00188,1.00225,1.0026,1.0009,1.00209,1.00464; + for (int index = 4; index < chains.num_params(); index++) { - ASSERT_NEAR(rhat(index - 4), - chains.split_potential_scale_reduction_rank(index), 1e-4) - << "rhat for index: " << index - << ", parameter: " << chains.param_name(index); + double computed_bulk_rhat, computed_tail_rhat; + std::tie(computed_bulk_rhat, computed_tail_rhat) = chains.split_potential_scale_reduction_rank(index); + double expected_bulk_rhat = rhat_bulk(index - 4); + double expected_tail_rhat = rhat_tail(index - 4); + + ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) + << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) + << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + + // ASSERT_NEAR(rhat(index - 4), + // chains.split_potential_scale_reduction_rank(index), 1e-4) + // << "rhat for index: " << index + // << ", parameter: " << chains.param_name(index); } for (int index = 0; index < chains.num_params(); index++) { std::string name = chains.param_name(index); @@ -314,13 +337,18 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_rank) { chains.add(blocker2); - Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, - 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, - 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, - 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, - 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, - 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; + // Eigen::VectorXd rhat(48); + // rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, + // 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, + // 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, + // 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, + // 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, + // 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; + + Eigen::VectorXd rhat_bulk(48); + rhat_bulk << 1.0078,1.0109,0.99919,1.001,1.00401,1.00992,1.00182,1.00519,1.00095,1.00351,1.00554,1.00075,1.00595,1.00473,1.00546,1.01304,1.00166,1.0074,1.00178,1.00588,1.00406,1.00129,1.00976,1.0013,1.00193,1.00104,0.99938,1.00025,1.01082,1.0019,1.00354,1.0043,1.00111,1.00281,1.00436,1.00515,1.00325,1.0089,1.00222,1.00118,1.00191,1.00283,1.0003,1.00216,1.00335,1.00133,1.00023,1.0109; + Eigen::VectorXd rhat_tail(48); + rhat_tail << 1.00097,1.00422,1.00731,1.00333,1.00337,0.99917,1.00734,1.00633,1.00074,1.00906,1.01019,1.00074,1.00447,1.00383,1.00895,1.00389,1.00052,1.00188,1.00236,1.00284,1.00414,1.00303,1.00327,1.00295,1.00037,1.0044,1.00488,1.00178,1.00475,1.00082,1.00413,1.01303,1.0024,1.01148,1.00098,1.00078,1.00712,1.00595,1.00124,1.00112,1.00381,1.0006,1.00188,1.00225,1.0026,1.0009,1.00209,1.00464; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -334,12 +362,24 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_rank) { draws[chain] = &samples(chain)(0); sizes[chain] = samples(chain).size(); } - ASSERT_NEAR(rhat(index - 4), - stan::analyze::compute_split_potential_scale_reduction_rank( - draws, sizes), - 1e-4) - << "rhat for index: " << index - << ", parameter: " << chains.param_name(index); + + double computed_bulk_rhat, computed_tail_rhat; + std::tie(computed_bulk_rhat, computed_tail_rhat) = stan::analyze::compute_split_potential_scale_reduction_rank(draws, sizes); + double expected_bulk_rhat = rhat_bulk(index - 4); + double expected_tail_rhat = rhat_tail(index - 4); + + ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) + << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) + << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + + + // ASSERT_NEAR(rhat(index - 4), + // stan::analyze::compute_split_potential_scale_reduction_rank( + // draws, sizes), + // 1e-4) + // << "rhat for index: " << index + // << ", parameter: " << chains.param_name(index); } } @@ -393,13 +433,20 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience_rank) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); - Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, - 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, - 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, - 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, - 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, - 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; + // Eigen::VectorXd rhat(48); + // rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, + // 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, + // 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, + // 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, + // 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, + // 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; + + + Eigen::VectorXd rhat_bulk(48); + rhat_bulk << 1.0078,1.0109,0.99919,1.001,1.00401,1.00992,1.00182,1.00519,1.00095,1.00351,1.00554,1.00075,1.00595,1.00473,1.00546,1.01304,1.00166,1.0074,1.00178,1.00588,1.00406,1.00129,1.00976,1.0013,1.00193,1.00104,0.99938,1.00025,1.01082,1.0019,1.00354,1.0043,1.00111,1.00281,1.00436,1.00515,1.00325,1.0089,1.00222,1.00118,1.00191,1.00283,1.0003,1.00216,1.00335,1.00133,1.00023,1.0109; + Eigen::VectorXd rhat_tail(48); + rhat_tail << 1.00097,1.00422,1.00731,1.00333,1.00337,0.99917,1.00734,1.00633,1.00074,1.00906,1.01019,1.00074,1.00447,1.00383,1.00895,1.00389,1.00052,1.00188,1.00236,1.00284,1.00414,1.00303,1.00327,1.00295,1.00037,1.0044,1.00488,1.00178,1.00475,1.00082,1.00413,1.01303,1.0024,1.01148,1.00098,1.00078,1.00712,1.00595,1.00124,1.00112,1.00381,1.0006,1.00188,1.00225,1.0026,1.0009,1.00209,1.00464; + Eigen::Matrix samples( chains.num_chains()); @@ -412,26 +459,31 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience_rank) { draws[chain] = &samples(chain)(0); } size_t size = samples(0).size(); - ASSERT_NEAR(rhat(index - 4), - stan::analyze::compute_split_potential_scale_reduction_rank( - draws, size), - 1e-4) - << "rhat for index: " << index - << ", parameter: " << chains.param_name(index); + + double computed_bulk_rhat, computed_tail_rhat; + std::tie(computed_bulk_rhat, computed_tail_rhat) = stan::analyze::compute_split_potential_scale_reduction_rank(draws, size); + double expected_bulk_rhat = rhat_bulk(index - 4); + double expected_tail_rhat = rhat_tail(index - 4); + + ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) + << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) + << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + // ASSERT_NEAR(rhat(index - 4), + // stan::analyze::compute_split_potential_scale_reduction_rank( + // draws, size), + // 1e-4) + // << "rhat for index: " << index + // << ", parameter: " << chains.param_name(index); } } TEST_F(ComputeRhat, compute_potential_scale_reduction_constant) { std::vector param_names{"a"}; stan::mcmc::chains<> chains(param_names); - Eigen::Matrix draws1; - draws1 << 1.0, 1.0, 2.0; - chains.add(draws1); - Eigen::Matrix draws2; - draws2 << 4.0, 4.0, 4.0; - chains.add(draws2); - - std::cout << "SOMETHING" << std::endl; + Eigen::Matrix draws; + draws << 1.0, 1.0; + chains.add(draws); ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction(0))) << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); @@ -444,8 +496,15 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_constant) { draws << 1.0, 1.0; chains.add(draws); - ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction_rank(0))) + double computed_bulk_rhat, computed_tail_rhat; + std::tie(computed_bulk_rhat, computed_tail_rhat) = chains.split_potential_scale_reduction_rank(0); + + ASSERT_TRUE(std::isnan(computed_bulk_rhat)) + << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); + ASSERT_TRUE(std::isnan(computed_tail_rhat)) << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); + // ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction_rank(0))) + // << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); } TEST_F(ComputeRhat, compute_potential_scale_reduction_nan) { @@ -465,6 +524,16 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_nan) { Eigen::Matrix draws; draws << 1.0, std::numeric_limits::quiet_NaN(); chains.add(draws); - ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction_rank(0))) + + double computed_bulk_rhat, computed_tail_rhat; + std::tie(computed_bulk_rhat, computed_tail_rhat) = chains.split_potential_scale_reduction_rank(0); + + ASSERT_TRUE(std::isnan(computed_bulk_rhat)) << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); + ASSERT_TRUE(std::isnan(computed_tail_rhat)) + << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); + + + // ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction_rank(0))) + // << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); } diff --git a/src/test/unit/mcmc/chains_test.cpp b/src/test/unit/mcmc/chains_test.cpp index d9c8194e43..26ca3dbea6 100644 --- a/src/test/unit/mcmc/chains_test.cpp +++ b/src/test/unit/mcmc/chains_test.cpp @@ -886,19 +886,34 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction_rank) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); - Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, - 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, - 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, - 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, - 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, - 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; + // Eigen::VectorXd rhat(48); + // rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, + // 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, + // 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, + // 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, + // 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, + // 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; + + Eigen::VectorXd rhat_bulk(48); + rhat_bulk << 1.0078,1.0109,0.99919,1.001,1.00401,1.00992,1.00182,1.00519,1.00095,1.00351,1.00554,1.00075,1.00595,1.00473,1.00546,1.01304,1.00166,1.0074,1.00178,1.00588,1.00406,1.00129,1.00976,1.0013,1.00193,1.00104,0.99938,1.00025,1.01082,1.0019,1.00354,1.0043,1.00111,1.00281,1.00436,1.00515,1.00325,1.0089,1.00222,1.00118,1.00191,1.00283,1.0003,1.00216,1.00335,1.00133,1.00023,1.0109; + Eigen::VectorXd rhat_tail(48); + rhat_tail << 1.00097,1.00422,1.00731,1.00333,1.00337,0.99917,1.00734,1.00633,1.00074,1.00906,1.01019,1.00074,1.00447,1.00383,1.00895,1.00389,1.00052,1.00188,1.00236,1.00284,1.00414,1.00303,1.00327,1.00295,1.00037,1.0044,1.00488,1.00178,1.00475,1.00082,1.00413,1.01303,1.0024,1.01148,1.00098,1.00078,1.00712,1.00595,1.00124,1.00112,1.00381,1.0006,1.00188,1.00225,1.0026,1.0009,1.00209,1.00464; for (int index = 4; index < chains.num_params(); index++) { - ASSERT_NEAR(rhat(index - 4), - chains.split_potential_scale_reduction_rank(index), 1e-4) - << "rhat for index: " << index - << ", parameter: " << chains.param_name(index); + double computed_bulk_rhat, computed_tail_rhat; + std::tie(computed_bulk_rhat, computed_tail_rhat) = chains.split_potential_scale_reduction_rank(index); + double expected_bulk_rhat = rhat_bulk(index - 4); + double expected_tail_rhat = rhat_tail(index - 4); + + ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) + << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) + << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + + // ASSERT_NEAR(rhat(index - 4), + // chains.split_potential_scale_reduction_rank(index), 1e-4) + // << "rhat for index: " << index + // << ", parameter: " << chains.param_name(index); } for (int index = 0; index < chains.num_params(); index++) { From ba2b6f5a4ea4fe145acc86f7f29a4d3560568932 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Wed, 27 Mar 2024 10:36:34 -0400 Subject: [PATCH 60/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- .../compute_potential_scale_reduction.hpp | 41 +++-- src/stan/mcmc/chains.hpp | 6 +- ...compute_potential_scale_reduction_test.cpp | 170 +++++++++++++----- src/test/unit/mcmc/chains_test.cpp | 28 ++- 4 files changed, 173 insertions(+), 72 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 8c024a96dc..e9daa6f8a6 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -111,18 +111,20 @@ inline double rhat(const Eigen::MatrixXd& chains) { * @return potential scale reduction for the specified parameter */ inline std::pair compute_potential_scale_reduction_rank( - const std::vector& chain_begins, const std::vector& chain_sizes) { - std::vector nonzero_chain_begins; - std::vector nonzero_chain_sizes; - for (size_t i = 0; i < chain_sizes.size(); ++i) { - if (chain_sizes[i]) { - nonzero_chain_begins.push_back(chain_begins[i]); - nonzero_chain_sizes.push_back(chain_sizes[i]); - } - } - if (!nonzero_chain_sizes.size()) { - return {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}; - } + const std::vector& chain_begins, + const std::vector& chain_sizes) { + std::vector nonzero_chain_begins; + std::vector nonzero_chain_sizes; + for (size_t i = 0; i < chain_sizes.size(); ++i) { + if (chain_sizes[i]) { + nonzero_chain_begins.push_back(chain_begins[i]); + nonzero_chain_sizes.push_back(chain_sizes[i]); + } + } + if (!nonzero_chain_sizes.size()) { + return {std::numeric_limits::quiet_NaN(), + std::numeric_limits::quiet_NaN()}; + } std::size_t num_nonzero_chains = nonzero_chain_sizes.size(); std::size_t min_num_draws = nonzero_chain_sizes[0]; for (std::size_t chain = 1; chain < num_nonzero_chains; ++chain) { @@ -140,20 +142,21 @@ inline std::pair compute_potential_scale_reduction_rank( for (std::size_t n = 0; n < min_num_draws; n++) { if (!std::isfinite(draws(n))) { - return {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}; + return {std::numeric_limits::quiet_NaN(), + std::numeric_limits::quiet_NaN()}; } draws_matrix(n, chain) = draws(n); } init_draw(chain) = draws(0); are_all_const |= !draws.isApproxToConstant(draws(0)); - } if (are_all_const) { // If all chains are constant then return NaN // if they all equal the same constant value if (init_draw.isApproxToConstant(init_draw(0))) { - return {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}; + return {std::numeric_limits::quiet_NaN(), + std::numeric_limits::quiet_NaN()}; } } @@ -163,7 +166,7 @@ inline std::pair compute_potential_scale_reduction_rank( .abs())); return std::make_pair(rhat_bulk, rhat_tail); - //return std::max(rhat_bulk, rhat_tail); + // return std::max(rhat_bulk, rhat_tail); } /** @@ -218,14 +221,13 @@ inline double compute_potential_scale_reduction( } init_draw(chain) = draws(0); - + are_all_const |= !draws.isApproxToConstant(draws(0)); } // if they all equal the same constant value if (init_draw.isApproxToConstant(init_draw(0))) { return std::numeric_limits::quiet_NaN(); } - return rhat(draws_matrix); } @@ -296,7 +298,8 @@ inline double compute_potential_scale_reduction( * @return potential scale reduction for the specified parameter */ inline std::pair compute_split_potential_scale_reduction_rank( - const std::vector& chain_begins, const std::vector& chain_sizes) { + const std::vector& chain_begins, + const std::vector& chain_sizes) { size_t num_chains = chain_sizes.size(); size_t num_draws = chain_sizes[0]; for (size_t chain = 1; chain < num_chains; ++chain) { diff --git a/src/stan/mcmc/chains.hpp b/src/stan/mcmc/chains.hpp index 18b93c504c..a553fd36cd 100644 --- a/src/stan/mcmc/chains.hpp +++ b/src/stan/mcmc/chains.hpp @@ -595,7 +595,8 @@ class chains { return split_effective_sample_size(index(name)); } - std::pair split_potential_scale_reduction_rank(const int index) const { + std::pair split_potential_scale_reduction_rank( + const int index) const { int n_chains = num_chains(); std::vector draws(n_chains); std::vector sizes(n_chains); @@ -625,7 +626,8 @@ class chains { return analyze::compute_split_potential_scale_reduction(draws, sizes); } - std::pair split_potential_scale_reduction_rank(const std::string& name) const { + std::pair split_potential_scale_reduction_rank( + const std::string& name) const { return split_potential_scale_reduction_rank(index(name)); } diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 9fe188c19e..4625bb37b7 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -70,12 +70,25 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank) { chains.add(blocker2); // Eigen::VectorXd rhat(48); - // rhat << 1.00067,1.00497,1.00918,1.00055,1.0015,1.00088,1.00776,1.00042,1.00201,0.99956,0.99984,1.00054,1.00403,1.00516,1.00591,1.00627,1.00134,1.00895,1.00079,1.00368,1.00092,1.00133,1.01005,1.00107,1.00151,1.00229,1.0,1.00008,1.00315,1.00277,1.00247,1.00003,1.001,1.01267,1.00011,1.00066,1.00091,1.00237,1.00019,1.00104,1.00341,0.99981,1.00033,0.99967,1.00306,1.00072,1.00191,1.00658; + // rhat + // << 1.00067,1.00497,1.00918,1.00055,1.0015,1.00088,1.00776,1.00042,1.00201,0.99956,0.99984,1.00054,1.00403,1.00516,1.00591,1.00627,1.00134,1.00895,1.00079,1.00368,1.00092,1.00133,1.01005,1.00107,1.00151,1.00229,1.0,1.00008,1.00315,1.00277,1.00247,1.00003,1.001,1.01267,1.00011,1.00066,1.00091,1.00237,1.00019,1.00104,1.00341,0.99981,1.00033,0.99967,1.00306,1.00072,1.00191,1.00658; Eigen::VectorXd rhat_bulk(48); - rhat_bulk << 1.00067,0.99979,0.99966,1.00055,1.0011,1.00088,1.00032,0.99997,1.00201,0.99956,0.99956,0.9995,1.00292,1.00516,1.00591,0.99975,1.00088,1.00895,1.00079,0.99953,1.00092,1.00044,1.01005,0.9996,1.00151,0.99966,0.99965,0.99963,1.00315,1.00277,1.00247,1.00003,0.99994,1.00116,0.99952,1.0005,1.00091,1.00213,1.00019,0.99977,1.0003,0.99981,1.00003,0.99967,1.00306,1.00072,0.9996,0.99979; + rhat_bulk << 1.00067, 0.99979, 0.99966, 1.00055, 1.0011, 1.00088, 1.00032, + 0.99997, 1.00201, 0.99956, 0.99956, 0.9995, 1.00292, 1.00516, 1.00591, + 0.99975, 1.00088, 1.00895, 1.00079, 0.99953, 1.00092, 1.00044, 1.01005, + 0.9996, 1.00151, 0.99966, 0.99965, 0.99963, 1.00315, 1.00277, 1.00247, + 1.00003, 0.99994, 1.00116, 0.99952, 1.0005, 1.00091, 1.00213, 1.00019, + 0.99977, 1.0003, 0.99981, 1.00003, 0.99967, 1.00306, 1.00072, 0.9996, + 0.99979; Eigen::VectorXd rhat_tail(48); - rhat_tail << 1.00063,1.00497,1.00918,0.99965,1.0015,0.99962,1.00776,1.00042,0.99963,0.99951,0.99984,1.00054,1.00403,1.00107,1.00287,1.00627,1.00134,0.99957,0.99997,1.00368,1.00053,1.00133,1.00589,1.00107,1.00031,1.00229,1.0,1.00008,1.0001,1.00116,1.00219,0.99992,1.001,1.01267,1.00011,1.00066,1.00065,1.00237,0.9995,1.00104,1.00341,0.99958,1.00033,0.9996,0.99957,1.00058,1.00191,1.00658; + rhat_tail << 1.00063, 1.00497, 1.00918, 0.99965, 1.0015, 0.99962, 1.00776, + 1.00042, 0.99963, 0.99951, 0.99984, 1.00054, 1.00403, 1.00107, 1.00287, + 1.00627, 1.00134, 0.99957, 0.99997, 1.00368, 1.00053, 1.00133, 1.00589, + 1.00107, 1.00031, 1.00229, 1.0, 1.00008, 1.0001, 1.00116, 1.00219, + 0.99992, 1.001, 1.01267, 1.00011, 1.00066, 1.00065, 1.00237, 0.9995, + 1.00104, 1.00341, 0.99958, 1.00033, 0.9996, 0.99957, 1.00058, 1.00191, + 1.00658; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -90,14 +103,17 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank) { sizes[chain] = samples(chain).size(); } double computed_bulk_rhat, computed_tail_rhat; - std::tie(computed_bulk_rhat, computed_tail_rhat) = stan::analyze::compute_potential_scale_reduction_rank(draws, sizes); + std::tie(computed_bulk_rhat, computed_tail_rhat) + = stan::analyze::compute_potential_scale_reduction_rank(draws, sizes); double expected_bulk_rhat = rhat_bulk(index - 4); double expected_tail_rhat = rhat_tail(index - 4); ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) - << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + << "Bulk Rhat mismatch for index: " << index + << ", parameter: " << chains.param_name(index); ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) - << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + << "Tail Rhat mismatch for index: " << index + << ", parameter: " << chains.param_name(index); // ASSERT_NEAR( // rhat(index - 4), // stan::analyze::compute_potential_scale_reduction_rank(draws, sizes), @@ -158,19 +174,33 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_convenience) { chains.add(blocker2); // Eigen::VectorXd rhat(48); - // rhat << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, - // 1.00201, 0.999558, 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, + // rhat + // << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, + // 1.00201, 0.999558, + // 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, // 1.00134, 1.00895, 1.00079, 1.00368, 1.00092, 1.00133, 1.01005, 1.00107, - // 1.00151, 1.00229, 0.999998, 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, + // 1.00151, 1.00229, + // 0.999998, 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, // 1.001, 1.01267, 1.00011, 1.00066, 1.00091, 1.00237, 1.00019, 1.00104, - // 1.00341, 0.999815, 1.00033, 0.999672, 1.00306, 1.00072, 1.00191, 1.00658; - + // 1.00341, 0.999815, 1.00033, + // 0.999672, 1.00306, 1.00072, 1.00191, 1.00658; Eigen::VectorXd rhat_bulk(48); - rhat_bulk << 1.00067,0.99979,0.99966,1.00055,1.0011,1.00088,1.00032,0.99997,1.00201,0.99956,0.99956,0.9995,1.00292,1.00516,1.00591,0.99975,1.00088,1.00895,1.00079,0.99953,1.00092,1.00044,1.01005,0.9996,1.00151,0.99966,0.99965,0.99963,1.00315,1.00277,1.00247,1.00003,0.99994,1.00116,0.99952,1.0005,1.00091,1.00213,1.00019,0.99977,1.0003,0.99981,1.00003,0.99967,1.00306,1.00072,0.9996,0.99979; + rhat_bulk << 1.00067, 0.99979, 0.99966, 1.00055, 1.0011, 1.00088, 1.00032, + 0.99997, 1.00201, 0.99956, 0.99956, 0.9995, 1.00292, 1.00516, 1.00591, + 0.99975, 1.00088, 1.00895, 1.00079, 0.99953, 1.00092, 1.00044, 1.01005, + 0.9996, 1.00151, 0.99966, 0.99965, 0.99963, 1.00315, 1.00277, 1.00247, + 1.00003, 0.99994, 1.00116, 0.99952, 1.0005, 1.00091, 1.00213, 1.00019, + 0.99977, 1.0003, 0.99981, 1.00003, 0.99967, 1.00306, 1.00072, 0.9996, + 0.99979; Eigen::VectorXd rhat_tail(48); - rhat_tail << 1.00063,1.00497,1.00918,0.99965,1.0015,0.99962,1.00776,1.00042,0.99963,0.99951,0.99984,1.00054,1.00403,1.00107,1.00287,1.00627,1.00134,0.99957,0.99997,1.00368,1.00053,1.00133,1.00589,1.00107,1.00031,1.00229,1.0,1.00008,1.0001,1.00116,1.00219,0.99992,1.001,1.01267,1.00011,1.00066,1.00065,1.00237,0.9995,1.00104,1.00341,0.99958,1.00033,0.9996,0.99957,1.00058,1.00191,1.00658; - + rhat_tail << 1.00063, 1.00497, 1.00918, 0.99965, 1.0015, 0.99962, 1.00776, + 1.00042, 0.99963, 0.99951, 0.99984, 1.00054, 1.00403, 1.00107, 1.00287, + 1.00627, 1.00134, 0.99957, 0.99997, 1.00368, 1.00053, 1.00133, 1.00589, + 1.00107, 1.00031, 1.00229, 1.0, 1.00008, 1.0001, 1.00116, 1.00219, + 0.99992, 1.001, 1.01267, 1.00011, 1.00066, 1.00065, 1.00237, 0.9995, + 1.00104, 1.00341, 0.99958, 1.00033, 0.9996, 0.99957, 1.00058, 1.00191, + 1.00658; Eigen::Matrix samples( chains.num_chains()); @@ -184,14 +214,17 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_convenience) { size_t size = samples(0).size(); double computed_bulk_rhat, computed_tail_rhat; - std::tie(computed_bulk_rhat, computed_tail_rhat) = stan::analyze::compute_potential_scale_reduction_rank(draws, size); + std::tie(computed_bulk_rhat, computed_tail_rhat) + = stan::analyze::compute_potential_scale_reduction_rank(draws, size); double expected_bulk_rhat = rhat_bulk(index - 4); double expected_tail_rhat = rhat_tail(index - 4); ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) - << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + << "Bulk Rhat mismatch for index: " << index + << ", parameter: " << chains.param_name(index); ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) - << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + << "Tail Rhat mismatch for index: " << index + << ", parameter: " << chains.param_name(index); // ASSERT_NEAR( // rhat(index - 4), // stan::analyze::compute_potential_scale_reduction_rank(draws, size), @@ -247,7 +280,8 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction_rank) { chains.add(blocker2); // Eigen::VectorXd rhat(48); - // rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, + // rhat + // << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, // 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, // 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, // 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, @@ -255,21 +289,35 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction_rank) { // 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; Eigen::VectorXd rhat_bulk(48); - rhat_bulk << 1.0078,1.0109,0.99919,1.001,1.00401,1.00992,1.00182,1.00519,1.00095,1.00351,1.00554,1.00075,1.00595,1.00473,1.00546,1.01304,1.00166,1.0074,1.00178,1.00588,1.00406,1.00129,1.00976,1.0013,1.00193,1.00104,0.99938,1.00025,1.01082,1.0019,1.00354,1.0043,1.00111,1.00281,1.00436,1.00515,1.00325,1.0089,1.00222,1.00118,1.00191,1.00283,1.0003,1.00216,1.00335,1.00133,1.00023,1.0109; + rhat_bulk << 1.0078, 1.0109, 0.99919, 1.001, 1.00401, 1.00992, 1.00182, + 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, + 1.01304, 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, + 1.0013, 1.00193, 1.00104, 0.99938, 1.00025, 1.01082, 1.0019, 1.00354, + 1.0043, 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, + 1.00118, 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, + 1.0109; Eigen::VectorXd rhat_tail(48); - rhat_tail << 1.00097,1.00422,1.00731,1.00333,1.00337,0.99917,1.00734,1.00633,1.00074,1.00906,1.01019,1.00074,1.00447,1.00383,1.00895,1.00389,1.00052,1.00188,1.00236,1.00284,1.00414,1.00303,1.00327,1.00295,1.00037,1.0044,1.00488,1.00178,1.00475,1.00082,1.00413,1.01303,1.0024,1.01148,1.00098,1.00078,1.00712,1.00595,1.00124,1.00112,1.00381,1.0006,1.00188,1.00225,1.0026,1.0009,1.00209,1.00464; - + rhat_tail << 1.00097, 1.00422, 1.00731, 1.00333, 1.00337, 0.99917, 1.00734, + 1.00633, 1.00074, 1.00906, 1.01019, 1.00074, 1.00447, 1.00383, 1.00895, + 1.00389, 1.00052, 1.00188, 1.00236, 1.00284, 1.00414, 1.00303, 1.00327, + 1.00295, 1.00037, 1.0044, 1.00488, 1.00178, 1.00475, 1.00082, 1.00413, + 1.01303, 1.0024, 1.01148, 1.00098, 1.00078, 1.00712, 1.00595, 1.00124, + 1.00112, 1.00381, 1.0006, 1.00188, 1.00225, 1.0026, 1.0009, 1.00209, + 1.00464; for (int index = 4; index < chains.num_params(); index++) { double computed_bulk_rhat, computed_tail_rhat; - std::tie(computed_bulk_rhat, computed_tail_rhat) = chains.split_potential_scale_reduction_rank(index); + std::tie(computed_bulk_rhat, computed_tail_rhat) + = chains.split_potential_scale_reduction_rank(index); double expected_bulk_rhat = rhat_bulk(index - 4); double expected_tail_rhat = rhat_tail(index - 4); ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) - << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + << "Bulk Rhat mismatch for index: " << index + << ", parameter: " << chains.param_name(index); ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) - << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + << "Tail Rhat mismatch for index: " << index + << ", parameter: " << chains.param_name(index); // ASSERT_NEAR(rhat(index - 4), // chains.split_potential_scale_reduction_rank(index), 1e-4) @@ -338,7 +386,8 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_rank) { chains.add(blocker2); // Eigen::VectorXd rhat(48); - // rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, + // rhat + // << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, // 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, // 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, // 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, @@ -346,9 +395,21 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_rank) { // 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; Eigen::VectorXd rhat_bulk(48); - rhat_bulk << 1.0078,1.0109,0.99919,1.001,1.00401,1.00992,1.00182,1.00519,1.00095,1.00351,1.00554,1.00075,1.00595,1.00473,1.00546,1.01304,1.00166,1.0074,1.00178,1.00588,1.00406,1.00129,1.00976,1.0013,1.00193,1.00104,0.99938,1.00025,1.01082,1.0019,1.00354,1.0043,1.00111,1.00281,1.00436,1.00515,1.00325,1.0089,1.00222,1.00118,1.00191,1.00283,1.0003,1.00216,1.00335,1.00133,1.00023,1.0109; + rhat_bulk << 1.0078, 1.0109, 0.99919, 1.001, 1.00401, 1.00992, 1.00182, + 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, + 1.01304, 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, + 1.0013, 1.00193, 1.00104, 0.99938, 1.00025, 1.01082, 1.0019, 1.00354, + 1.0043, 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, + 1.00118, 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, + 1.0109; Eigen::VectorXd rhat_tail(48); - rhat_tail << 1.00097,1.00422,1.00731,1.00333,1.00337,0.99917,1.00734,1.00633,1.00074,1.00906,1.01019,1.00074,1.00447,1.00383,1.00895,1.00389,1.00052,1.00188,1.00236,1.00284,1.00414,1.00303,1.00327,1.00295,1.00037,1.0044,1.00488,1.00178,1.00475,1.00082,1.00413,1.01303,1.0024,1.01148,1.00098,1.00078,1.00712,1.00595,1.00124,1.00112,1.00381,1.0006,1.00188,1.00225,1.0026,1.0009,1.00209,1.00464; + rhat_tail << 1.00097, 1.00422, 1.00731, 1.00333, 1.00337, 0.99917, 1.00734, + 1.00633, 1.00074, 1.00906, 1.01019, 1.00074, 1.00447, 1.00383, 1.00895, + 1.00389, 1.00052, 1.00188, 1.00236, 1.00284, 1.00414, 1.00303, 1.00327, + 1.00295, 1.00037, 1.0044, 1.00488, 1.00178, 1.00475, 1.00082, 1.00413, + 1.01303, 1.0024, 1.01148, 1.00098, 1.00078, 1.00712, 1.00595, 1.00124, + 1.00112, 1.00381, 1.0006, 1.00188, 1.00225, 1.0026, 1.0009, 1.00209, + 1.00464; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -362,17 +423,20 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_rank) { draws[chain] = &samples(chain)(0); sizes[chain] = samples(chain).size(); } - + double computed_bulk_rhat, computed_tail_rhat; - std::tie(computed_bulk_rhat, computed_tail_rhat) = stan::analyze::compute_split_potential_scale_reduction_rank(draws, sizes); + std::tie(computed_bulk_rhat, computed_tail_rhat) + = stan::analyze::compute_split_potential_scale_reduction_rank(draws, + sizes); double expected_bulk_rhat = rhat_bulk(index - 4); double expected_tail_rhat = rhat_tail(index - 4); ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) - << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + << "Bulk Rhat mismatch for index: " << index + << ", parameter: " << chains.param_name(index); ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) - << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); - + << "Tail Rhat mismatch for index: " << index + << ", parameter: " << chains.param_name(index); // ASSERT_NEAR(rhat(index - 4), // stan::analyze::compute_split_potential_scale_reduction_rank( @@ -434,19 +498,30 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience_rank) { chains.add(blocker2); // Eigen::VectorXd rhat(48); - // rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, + // rhat + // << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, // 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, // 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, // 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, // 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, // 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; - Eigen::VectorXd rhat_bulk(48); - rhat_bulk << 1.0078,1.0109,0.99919,1.001,1.00401,1.00992,1.00182,1.00519,1.00095,1.00351,1.00554,1.00075,1.00595,1.00473,1.00546,1.01304,1.00166,1.0074,1.00178,1.00588,1.00406,1.00129,1.00976,1.0013,1.00193,1.00104,0.99938,1.00025,1.01082,1.0019,1.00354,1.0043,1.00111,1.00281,1.00436,1.00515,1.00325,1.0089,1.00222,1.00118,1.00191,1.00283,1.0003,1.00216,1.00335,1.00133,1.00023,1.0109; + rhat_bulk << 1.0078, 1.0109, 0.99919, 1.001, 1.00401, 1.00992, 1.00182, + 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, + 1.01304, 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, + 1.0013, 1.00193, 1.00104, 0.99938, 1.00025, 1.01082, 1.0019, 1.00354, + 1.0043, 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, + 1.00118, 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, + 1.0109; Eigen::VectorXd rhat_tail(48); - rhat_tail << 1.00097,1.00422,1.00731,1.00333,1.00337,0.99917,1.00734,1.00633,1.00074,1.00906,1.01019,1.00074,1.00447,1.00383,1.00895,1.00389,1.00052,1.00188,1.00236,1.00284,1.00414,1.00303,1.00327,1.00295,1.00037,1.0044,1.00488,1.00178,1.00475,1.00082,1.00413,1.01303,1.0024,1.01148,1.00098,1.00078,1.00712,1.00595,1.00124,1.00112,1.00381,1.0006,1.00188,1.00225,1.0026,1.0009,1.00209,1.00464; - + rhat_tail << 1.00097, 1.00422, 1.00731, 1.00333, 1.00337, 0.99917, 1.00734, + 1.00633, 1.00074, 1.00906, 1.01019, 1.00074, 1.00447, 1.00383, 1.00895, + 1.00389, 1.00052, 1.00188, 1.00236, 1.00284, 1.00414, 1.00303, 1.00327, + 1.00295, 1.00037, 1.0044, 1.00488, 1.00178, 1.00475, 1.00082, 1.00413, + 1.01303, 1.0024, 1.01148, 1.00098, 1.00078, 1.00712, 1.00595, 1.00124, + 1.00112, 1.00381, 1.0006, 1.00188, 1.00225, 1.0026, 1.0009, 1.00209, + 1.00464; Eigen::Matrix samples( chains.num_chains()); @@ -461,14 +536,18 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience_rank) { size_t size = samples(0).size(); double computed_bulk_rhat, computed_tail_rhat; - std::tie(computed_bulk_rhat, computed_tail_rhat) = stan::analyze::compute_split_potential_scale_reduction_rank(draws, size); + std::tie(computed_bulk_rhat, computed_tail_rhat) + = stan::analyze::compute_split_potential_scale_reduction_rank(draws, + size); double expected_bulk_rhat = rhat_bulk(index - 4); double expected_tail_rhat = rhat_tail(index - 4); ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) - << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + << "Bulk Rhat mismatch for index: " << index + << ", parameter: " << chains.param_name(index); ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) - << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + << "Tail Rhat mismatch for index: " << index + << ", parameter: " << chains.param_name(index); // ASSERT_NEAR(rhat(index - 4), // stan::analyze::compute_split_potential_scale_reduction_rank( // draws, size), @@ -481,7 +560,7 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience_rank) { TEST_F(ComputeRhat, compute_potential_scale_reduction_constant) { std::vector param_names{"a"}; stan::mcmc::chains<> chains(param_names); - Eigen::Matrix draws; + Eigen::Matrix draws; draws << 1.0, 1.0; chains.add(draws); @@ -497,7 +576,8 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_constant) { chains.add(draws); double computed_bulk_rhat, computed_tail_rhat; - std::tie(computed_bulk_rhat, computed_tail_rhat) = chains.split_potential_scale_reduction_rank(0); + std::tie(computed_bulk_rhat, computed_tail_rhat) + = chains.split_potential_scale_reduction_rank(0); ASSERT_TRUE(std::isnan(computed_bulk_rhat)) << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); @@ -526,14 +606,14 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_nan) { chains.add(draws); double computed_bulk_rhat, computed_tail_rhat; - std::tie(computed_bulk_rhat, computed_tail_rhat) = chains.split_potential_scale_reduction_rank(0); - + std::tie(computed_bulk_rhat, computed_tail_rhat) + = chains.split_potential_scale_reduction_rank(0); + ASSERT_TRUE(std::isnan(computed_bulk_rhat)) << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); ASSERT_TRUE(std::isnan(computed_tail_rhat)) << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); - // ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction_rank(0))) // << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); } diff --git a/src/test/unit/mcmc/chains_test.cpp b/src/test/unit/mcmc/chains_test.cpp index 26ca3dbea6..f2d90aaf0d 100644 --- a/src/test/unit/mcmc/chains_test.cpp +++ b/src/test/unit/mcmc/chains_test.cpp @@ -887,7 +887,8 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction_rank) { chains.add(blocker2); // Eigen::VectorXd rhat(48); - // rhat << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, + // rhat + // << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, // 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, // 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, // 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, @@ -895,20 +896,35 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction_rank) { // 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; Eigen::VectorXd rhat_bulk(48); - rhat_bulk << 1.0078,1.0109,0.99919,1.001,1.00401,1.00992,1.00182,1.00519,1.00095,1.00351,1.00554,1.00075,1.00595,1.00473,1.00546,1.01304,1.00166,1.0074,1.00178,1.00588,1.00406,1.00129,1.00976,1.0013,1.00193,1.00104,0.99938,1.00025,1.01082,1.0019,1.00354,1.0043,1.00111,1.00281,1.00436,1.00515,1.00325,1.0089,1.00222,1.00118,1.00191,1.00283,1.0003,1.00216,1.00335,1.00133,1.00023,1.0109; + rhat_bulk << 1.0078, 1.0109, 0.99919, 1.001, 1.00401, 1.00992, 1.00182, + 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, + 1.01304, 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, + 1.0013, 1.00193, 1.00104, 0.99938, 1.00025, 1.01082, 1.0019, 1.00354, + 1.0043, 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, + 1.00118, 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, + 1.0109; Eigen::VectorXd rhat_tail(48); - rhat_tail << 1.00097,1.00422,1.00731,1.00333,1.00337,0.99917,1.00734,1.00633,1.00074,1.00906,1.01019,1.00074,1.00447,1.00383,1.00895,1.00389,1.00052,1.00188,1.00236,1.00284,1.00414,1.00303,1.00327,1.00295,1.00037,1.0044,1.00488,1.00178,1.00475,1.00082,1.00413,1.01303,1.0024,1.01148,1.00098,1.00078,1.00712,1.00595,1.00124,1.00112,1.00381,1.0006,1.00188,1.00225,1.0026,1.0009,1.00209,1.00464; + rhat_tail << 1.00097, 1.00422, 1.00731, 1.00333, 1.00337, 0.99917, 1.00734, + 1.00633, 1.00074, 1.00906, 1.01019, 1.00074, 1.00447, 1.00383, 1.00895, + 1.00389, 1.00052, 1.00188, 1.00236, 1.00284, 1.00414, 1.00303, 1.00327, + 1.00295, 1.00037, 1.0044, 1.00488, 1.00178, 1.00475, 1.00082, 1.00413, + 1.01303, 1.0024, 1.01148, 1.00098, 1.00078, 1.00712, 1.00595, 1.00124, + 1.00112, 1.00381, 1.0006, 1.00188, 1.00225, 1.0026, 1.0009, 1.00209, + 1.00464; for (int index = 4; index < chains.num_params(); index++) { double computed_bulk_rhat, computed_tail_rhat; - std::tie(computed_bulk_rhat, computed_tail_rhat) = chains.split_potential_scale_reduction_rank(index); + std::tie(computed_bulk_rhat, computed_tail_rhat) + = chains.split_potential_scale_reduction_rank(index); double expected_bulk_rhat = rhat_bulk(index - 4); double expected_tail_rhat = rhat_tail(index - 4); ASSERT_NEAR(expected_bulk_rhat, computed_bulk_rhat, 1e-4) - << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + << "Bulk Rhat mismatch for index: " << index + << ", parameter: " << chains.param_name(index); ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) - << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + << "Tail Rhat mismatch for index: " << index + << ", parameter: " << chains.param_name(index); // ASSERT_NEAR(rhat(index - 4), // chains.split_potential_scale_reduction_rank(index), 1e-4) From 77727a9315699d4295a68f520098ea3c7d18f032 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Wed, 27 Mar 2024 22:08:49 -0400 Subject: [PATCH 61/93] Updates the Math submodule to 35d6d53545. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index b010193521..35d6d53545 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit b010193521f9a11feca8f1093ddd215331719a0f +Subproject commit 35d6d53545bf382b1bf8e5ea7a04469310892a2a From 73d9b01d2851d6dd98f1e43dcb56735c20da6cef Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Tue, 2 Apr 2024 12:55:50 -0400 Subject: [PATCH 62/93] Updates the Math submodule to 1f94ed3123. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 35d6d53545..1f94ed3123 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 35d6d53545bf382b1bf8e5ea7a04469310892a2a +Subproject commit 1f94ed312376f726feb820bea90ed8df27974c17 From 981eedc1472445df9dac0a5a60956e6ae5adb7f5 Mon Sep 17 00:00:00 2001 From: aleksgorica Date: Sun, 7 Apr 2024 14:11:21 +0200 Subject: [PATCH 63/93] small fixes, removed comments in tests --- .../compute_potential_scale_reduction.hpp | 52 ++++++------ ...compute_potential_scale_reduction_test.cpp | 80 +------------------ 2 files changed, 26 insertions(+), 106 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index e9daa6f8a6..2a150e0e76 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -111,20 +111,20 @@ inline double rhat(const Eigen::MatrixXd& chains) { * @return potential scale reduction for the specified parameter */ inline std::pair compute_potential_scale_reduction_rank( - const std::vector& chain_begins, - const std::vector& chain_sizes) { - std::vector nonzero_chain_begins; - std::vector nonzero_chain_sizes; - for (size_t i = 0; i < chain_sizes.size(); ++i) { - if (chain_sizes[i]) { - nonzero_chain_begins.push_back(chain_begins[i]); - nonzero_chain_sizes.push_back(chain_sizes[i]); - } - } - if (!nonzero_chain_sizes.size()) { - return {std::numeric_limits::quiet_NaN(), - std::numeric_limits::quiet_NaN()}; - } + const std::vector& chain_begins, const std::vector& chain_sizes) { + std::vector nonzero_chain_begins; + std::vector nonzero_chain_sizes; + nonzero_chain_begins.reserve(chain_begins.size()); + nonzero_chain_sizes.reserve(chain_sizes.size()); + for (size_t i = 0; i < chain_sizes.size(); ++i) { + if (chain_sizes[i]) { + nonzero_chain_begins.push_back(chain_begins[i]); + nonzero_chain_sizes.push_back(chain_sizes[i]); + } + } + if (!nonzero_chain_sizes.size()) { + return {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}; + } std::size_t num_nonzero_chains = nonzero_chain_sizes.size(); std::size_t min_num_draws = nonzero_chain_sizes[0]; for (std::size_t chain = 1; chain < num_nonzero_chains; ++chain) { @@ -151,14 +151,11 @@ inline std::pair compute_potential_scale_reduction_rank( init_draw(chain) = draws(0); are_all_const |= !draws.isApproxToConstant(draws(0)); } - if (are_all_const) { - // If all chains are constant then return NaN - // if they all equal the same constant value - if (init_draw.isApproxToConstant(init_draw(0))) { - return {std::numeric_limits::quiet_NaN(), - std::numeric_limits::quiet_NaN()}; + // If all chains are constant then return NaN + if (are_all_const && init_draw.isApproxToConstant(init_draw(0))) { + return {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}; } - } + double rhat_bulk = rhat(rank_transform(draws_matrix)); double rhat_tail = rhat(rank_transform( @@ -166,7 +163,6 @@ inline std::pair compute_potential_scale_reduction_rank( .abs())); return std::make_pair(rhat_bulk, rhat_tail); - // return std::max(rhat_bulk, rhat_tail); } /** @@ -189,6 +185,8 @@ inline double compute_potential_scale_reduction( const std::vector& chain_sizes) { std::vector nonzero_chain_begins; std::vector nonzero_chain_sizes; + nonzero_chain_begins.reserve(chain_begins.size()); + nonzero_chain_sizes.reserve(chain_sizes.size()); for (size_t i = 0; i < chain_sizes.size(); ++i) { if (chain_sizes[i]) { nonzero_chain_begins.push_back(chain_begins[i]); @@ -251,8 +249,7 @@ inline double compute_potential_scale_reduction( */ inline std::pair compute_potential_scale_reduction_rank( const std::vector& chain_begins, size_t size) { - size_t num_chains = chain_begins.size(); - std::vector sizes(num_chains, size); + std::vector sizes(chain_begins.size(), size); return compute_potential_scale_reduction_rank(chain_begins, sizes); } @@ -263,8 +260,8 @@ inline std::pair compute_potential_scale_reduction_rank( * See more details in Stan reference manual section "Potential * Scale Reduction". http://mc-stan.org/users/documentation * - * Current implementation assumes draws are stored in contiguousdereck lively ii - * height weight blocks of memory. Chains are trimmed from the back to match the + * Current implementation assumes draws are stored in contiguous + * blocks of memory. Chains are trimmed from the back to match the * length of the shortest chain. Argument size will be broadcast to * same length as draws. * @@ -274,8 +271,7 @@ inline std::pair compute_potential_scale_reduction_rank( */ inline double compute_potential_scale_reduction( const std::vector& chain_begins, size_t size) { - size_t num_chains = chain_begins.size(); - std::vector sizes(num_chains, size); + std::vector sizes(chain_begins.size(), size); return compute_potential_scale_reduction(chain_begins, sizes); } diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 4625bb37b7..0962b7f510 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -114,12 +114,6 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank) { ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); - // ASSERT_NEAR( - // rhat(index - 4), - // stan::analyze::compute_potential_scale_reduction_rank(draws, sizes), - // 1e-4) - // << "rhat for index: " << index - // << ", parameter: " << chains.param_name(index); } } @@ -173,18 +167,6 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_convenience) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); - // Eigen::VectorXd rhat(48); - // rhat - // << 1.00067, 1.00497, 1.00918, 1.00055, 1.0015, 1.00088, 1.00776, 1.00042, - // 1.00201, 0.999558, - // 0.99984, 1.00054, 1.00403, 1.00516, 1.00591, 1.00627, - // 1.00134, 1.00895, 1.00079, 1.00368, 1.00092, 1.00133, 1.01005, 1.00107, - // 1.00151, 1.00229, - // 0.999998, 1.00008, 1.00315, 1.00277, 1.00247, 1.00003, - // 1.001, 1.01267, 1.00011, 1.00066, 1.00091, 1.00237, 1.00019, 1.00104, - // 1.00341, 0.999815, 1.00033, - // 0.999672, 1.00306, 1.00072, 1.00191, 1.00658; - Eigen::VectorXd rhat_bulk(48); rhat_bulk << 1.00067, 0.99979, 0.99966, 1.00055, 1.0011, 1.00088, 1.00032, 0.99997, 1.00201, 0.99956, 0.99956, 0.9995, 1.00292, 1.00516, 1.00591, @@ -223,14 +205,7 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_convenience) { << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) - << "Tail Rhat mismatch for index: " << index - << ", parameter: " << chains.param_name(index); - // ASSERT_NEAR( - // rhat(index - 4), - // stan::analyze::compute_potential_scale_reduction_rank(draws, size), - // 1e-4) - // << "rhat for index: " << index - // << ", parameter: " << chains.param_name(index); + << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); } } @@ -279,15 +254,6 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction_rank) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); - // Eigen::VectorXd rhat(48); - // rhat - // << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, - // 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, - // 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, - // 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, - // 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, - // 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; - Eigen::VectorXd rhat_bulk(48); rhat_bulk << 1.0078, 1.0109, 0.99919, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, @@ -318,11 +284,6 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction_rank) { ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); - - // ASSERT_NEAR(rhat(index - 4), - // chains.split_potential_scale_reduction_rank(index), 1e-4) - // << "rhat for index: " << index - // << ", parameter: " << chains.param_name(index); } for (int index = 0; index < chains.num_params(); index++) { std::string name = chains.param_name(index); @@ -385,15 +346,6 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_rank) { chains.add(blocker2); - // Eigen::VectorXd rhat(48); - // rhat - // << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, - // 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, - // 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, - // 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, - // 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, - // 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; - Eigen::VectorXd rhat_bulk(48); rhat_bulk << 1.0078, 1.0109, 0.99919, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, @@ -437,13 +389,6 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_rank) { ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); - - // ASSERT_NEAR(rhat(index - 4), - // stan::analyze::compute_split_potential_scale_reduction_rank( - // draws, sizes), - // 1e-4) - // << "rhat for index: " << index - // << ", parameter: " << chains.param_name(index); } } @@ -497,15 +442,6 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience_rank) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); - // Eigen::VectorXd rhat(48); - // rhat - // << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, - // 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, - // 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, - // 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, - // 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, - // 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; - Eigen::VectorXd rhat_bulk(48); rhat_bulk << 1.0078, 1.0109, 0.99919, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, @@ -537,8 +473,7 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience_rank) { double computed_bulk_rhat, computed_tail_rhat; std::tie(computed_bulk_rhat, computed_tail_rhat) - = stan::analyze::compute_split_potential_scale_reduction_rank(draws, - size); + = stan::analyze::compute_split_potential_scale_reduction_rank(draws, size); double expected_bulk_rhat = rhat_bulk(index - 4); double expected_tail_rhat = rhat_tail(index - 4); @@ -548,12 +483,6 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience_rank) { ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); - // ASSERT_NEAR(rhat(index - 4), - // stan::analyze::compute_split_potential_scale_reduction_rank( - // draws, size), - // 1e-4) - // << "rhat for index: " << index - // << ", parameter: " << chains.param_name(index); } } @@ -583,8 +512,6 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_constant) { << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); ASSERT_TRUE(std::isnan(computed_tail_rhat)) << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); - // ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction_rank(0))) - // << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); } TEST_F(ComputeRhat, compute_potential_scale_reduction_nan) { @@ -613,7 +540,4 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_nan) { << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); ASSERT_TRUE(std::isnan(computed_tail_rhat)) << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); - - // ASSERT_TRUE(std::isnan(chains.split_potential_scale_reduction_rank(0))) - // << "rhat for index: " << 1 << ", parameter: " << chains.param_name(1); } From 971aed70bd8bfd4813c1b86e76ba63c923436393 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Sun, 7 Apr 2024 08:47:19 -0400 Subject: [PATCH 64/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- .../compute_potential_scale_reduction.hpp | 32 ++++++++++--------- ...compute_potential_scale_reduction_test.cpp | 6 ++-- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 2a150e0e76..0afaaa2517 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -111,20 +111,22 @@ inline double rhat(const Eigen::MatrixXd& chains) { * @return potential scale reduction for the specified parameter */ inline std::pair compute_potential_scale_reduction_rank( - const std::vector& chain_begins, const std::vector& chain_sizes) { - std::vector nonzero_chain_begins; - std::vector nonzero_chain_sizes; + const std::vector& chain_begins, + const std::vector& chain_sizes) { + std::vector nonzero_chain_begins; + std::vector nonzero_chain_sizes; nonzero_chain_begins.reserve(chain_begins.size()); nonzero_chain_sizes.reserve(chain_sizes.size()); - for (size_t i = 0; i < chain_sizes.size(); ++i) { - if (chain_sizes[i]) { - nonzero_chain_begins.push_back(chain_begins[i]); - nonzero_chain_sizes.push_back(chain_sizes[i]); - } - } - if (!nonzero_chain_sizes.size()) { - return {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}; - } + for (size_t i = 0; i < chain_sizes.size(); ++i) { + if (chain_sizes[i]) { + nonzero_chain_begins.push_back(chain_begins[i]); + nonzero_chain_sizes.push_back(chain_sizes[i]); + } + } + if (!nonzero_chain_sizes.size()) { + return {std::numeric_limits::quiet_NaN(), + std::numeric_limits::quiet_NaN()}; + } std::size_t num_nonzero_chains = nonzero_chain_sizes.size(); std::size_t min_num_draws = nonzero_chain_sizes[0]; for (std::size_t chain = 1; chain < num_nonzero_chains; ++chain) { @@ -153,9 +155,9 @@ inline std::pair compute_potential_scale_reduction_rank( } // If all chains are constant then return NaN if (are_all_const && init_draw.isApproxToConstant(init_draw(0))) { - return {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}; - } - + return {std::numeric_limits::quiet_NaN(), + std::numeric_limits::quiet_NaN()}; + } double rhat_bulk = rhat(rank_transform(draws_matrix)); double rhat_tail = rhat(rank_transform( diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 0962b7f510..41a102e51d 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -205,7 +205,8 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_rank_convenience) { << "Bulk Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); ASSERT_NEAR(expected_tail_rhat, computed_tail_rhat, 1e-4) - << "Tail Rhat mismatch for index: " << index << ", parameter: " << chains.param_name(index); + << "Tail Rhat mismatch for index: " << index + << ", parameter: " << chains.param_name(index); } } @@ -473,7 +474,8 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience_rank) { double computed_bulk_rhat, computed_tail_rhat; std::tie(computed_bulk_rhat, computed_tail_rhat) - = stan::analyze::compute_split_potential_scale_reduction_rank(draws, size); + = stan::analyze::compute_split_potential_scale_reduction_rank(draws, + size); double expected_bulk_rhat = rhat_bulk(index - 4); double expected_tail_rhat = rhat_tail(index - 4); From 7a4743dfea38a8b2b4c96c26057f4a7a91929e10 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Fri, 12 Apr 2024 14:52:42 -0400 Subject: [PATCH 65/93] Pathfinder: stop returning more draws than requested --- src/stan/services/pathfinder/single.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/stan/services/pathfinder/single.hpp b/src/stan/services/pathfinder/single.hpp index 9b19f0be29..d7bff70dce 100644 --- a/src/stan/services/pathfinder/single.hpp +++ b/src/stan/services/pathfinder/single.hpp @@ -933,12 +933,13 @@ inline auto pathfinder_lbfgs_single( lp_ratio = std::move(elbo_best.lp_ratio); } } else { + // output only first num_draws from what we computed for ELBO constrained_draws_mat = Eigen::Matrix( - names.size(), elbo_draws.cols()); + names.size(), num_draws); Eigen::VectorXd approx_samples_constrained_col; Eigen::VectorXd unconstrained_col; - for (Eigen::Index i = 0; i < elbo_draws.cols(); ++i) { + for (Eigen::Index i = 0; i < num_draws; ++i) { constrained_draws_mat.col(i).head(2) = elbo_lp_mat.row(i).matrix(); unconstrained_col = elbo_draws.col(i); constrained_draws_mat.col(i).tail(num_unconstrained_params) @@ -946,7 +947,7 @@ inline auto pathfinder_lbfgs_single( approx_samples_constrained_col) .matrix(); } - lp_ratio = std::move(elbo_best.lp_ratio); + lp_ratio = std::move(elbo_best.lp_ratio.head(num_draws)); } parameter_writer(constrained_draws_mat); parameter_writer(); From a133e1dbedd2770b2b0687c9ecd9f6937eabda0a Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Fri, 12 Apr 2024 15:01:27 -0400 Subject: [PATCH 66/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- src/stan/services/pathfinder/single.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stan/services/pathfinder/single.hpp b/src/stan/services/pathfinder/single.hpp index d7bff70dce..5b3bbf34d1 100644 --- a/src/stan/services/pathfinder/single.hpp +++ b/src/stan/services/pathfinder/single.hpp @@ -935,8 +935,8 @@ inline auto pathfinder_lbfgs_single( } else { // output only first num_draws from what we computed for ELBO constrained_draws_mat - = Eigen::Matrix( - names.size(), num_draws); + = Eigen::Matrix(names.size(), + num_draws); Eigen::VectorXd approx_samples_constrained_col; Eigen::VectorXd unconstrained_col; for (Eigen::Index i = 0; i < num_draws; ++i) { From eb2dffc30f55a80eb7d561d1c3613a7b353d0885 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Fri, 12 Apr 2024 15:01:27 -0400 Subject: [PATCH 67/93] Round Pareto-K value --- src/stan/services/pathfinder/psis.hpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/stan/services/pathfinder/psis.hpp b/src/stan/services/pathfinder/psis.hpp index 1684daf5cf..b4da255063 100644 --- a/src/stan/services/pathfinder/psis.hpp +++ b/src/stan/services/pathfinder/psis.hpp @@ -5,6 +5,8 @@ #include #include #include +#include +#include namespace stan { namespace services { @@ -261,10 +263,13 @@ inline Eigen::Array psis_weights( llr_weights.coeffRef(idx.coeff(i)) = smoothed.first.coeff(i); } if (smoothed.second > 0.7) { - logger.warn(std::string("Pareto k value (") + - std::to_string(smoothed.second) + ") is greater than 0.7." - " Importance resampling was not able to improve the approximation," - " which may indicate that the approximation itself is poor."); + std::stringstream s; + s << "Pareto k value (" << std::setprecision(2) << smoothed.second + << ") is greater than 0.7. Importance resampling was not able to " + << "improve the approximation, which may indicate that the " + << "approximation itself is poor."; + + logger.warn(s.str()); } } } From ed65c9e2a9fe967c239a06eb70367e55c72c7dbb Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Sat, 13 Apr 2024 12:38:45 -0400 Subject: [PATCH 68/93] Updates the Math submodule to b9d0a33291. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 1f94ed3123..b9d0a33291 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 1f94ed312376f726feb820bea90ed8df27974c17 +Subproject commit b9d0a3329108c7cb83ff76f4b475c0aa166c77e3 From 61c4c6cdbf8eb4907858168c1990f1ee28843482 Mon Sep 17 00:00:00 2001 From: aleksgorica Date: Wed, 17 Apr 2024 16:26:08 +0200 Subject: [PATCH 69/93] reverting nonrank functions --- .../compute_potential_scale_reduction.hpp | 129 ++++++++++-------- 1 file changed, 75 insertions(+), 54 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 0afaaa2517..ee28995aa9 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -175,63 +175,84 @@ inline std::pair compute_potential_scale_reduction_rank( * Scale Reduction". http://mc-stan.org/users/documentation * * Current implementation assumes draws are stored in contiguous - * blocks of memory. Chains are trimmed from the back to match the + * blocks of memory. Chains are trimmed from the back to match the * length of the shortest chain. * - * @param chain_begins stores pointers to arrays of chains - * @param chain_sizes stores sizes of chains + * @param draws stores pointers to arrays of chains + * @param sizes stores sizes of chains * @return potential scale reduction for the specified parameter */ inline double compute_potential_scale_reduction( - const std::vector& chain_begins, - const std::vector& chain_sizes) { - std::vector nonzero_chain_begins; - std::vector nonzero_chain_sizes; - nonzero_chain_begins.reserve(chain_begins.size()); - nonzero_chain_sizes.reserve(chain_sizes.size()); - for (size_t i = 0; i < chain_sizes.size(); ++i) { - if (chain_sizes[i]) { - nonzero_chain_begins.push_back(chain_begins[i]); - nonzero_chain_sizes.push_back(chain_sizes[i]); - } - } - if (!nonzero_chain_sizes.size()) { + std::vector draws, std::vector sizes) { + int num_chains = sizes.size(); + size_t num_draws = sizes[0]; + if (num_draws == 0) { return std::numeric_limits::quiet_NaN(); } - std::size_t num_nonzero_chains = nonzero_chain_sizes.size(); - std::size_t min_num_draws = nonzero_chain_sizes[0]; - for (std::size_t chain = 1; chain < num_nonzero_chains; ++chain) { - min_num_draws = std::min(min_num_draws, nonzero_chain_sizes[chain]); + for (int chain = 1; chain < num_chains; ++chain) { + num_draws = std::min(num_draws, sizes[chain]); } // check if chains are constant; all equal to first draw's value bool are_all_const = false; - Eigen::VectorXd init_draw = Eigen::VectorXd::Zero(num_nonzero_chains); - Eigen::MatrixXd draws_matrix(min_num_draws, num_nonzero_chains); + Eigen::VectorXd init_draw = Eigen::VectorXd::Zero(num_chains); - for (std::size_t chain = 0; chain < num_nonzero_chains; chain++) { - Eigen::Map> draws( - nonzero_chain_begins[chain], nonzero_chain_sizes[chain]); + for (int chain = 0; chain < num_chains; chain++) { + Eigen::Map> draw( + draws[chain], sizes[chain]); - for (std::size_t n = 0; n < min_num_draws; n++) { - if (!std::isfinite(draws(n))) { + for (int n = 0; n < num_draws; n++) { + if (!std::isfinite(draw(n))) { return std::numeric_limits::quiet_NaN(); } - draws_matrix(n, chain) = draws(n); } - init_draw(chain) = draws(0); + init_draw(chain) = draw(0); - are_all_const |= !draws.isApproxToConstant(draws(0)); + if (draw.isApproxToConstant(draw(0))) { + are_all_const |= true; + } } - // if they all equal the same constant value - if (init_draw.isApproxToConstant(init_draw(0))) { - return std::numeric_limits::quiet_NaN(); + + if (are_all_const) { + // If all chains are constant then return NaN + // if they all equal the same constant value + if (init_draw.isApproxToConstant(init_draw(0))) { + return std::numeric_limits::quiet_NaN(); + } } - return rhat(draws_matrix); + using boost::accumulators::accumulator_set; + using boost::accumulators::stats; + using boost::accumulators::tag::mean; + using boost::accumulators::tag::variance; + + Eigen::VectorXd chain_mean(num_chains); + accumulator_set> acc_chain_mean; + Eigen::VectorXd chain_var(num_chains); + double unbiased_var_scale = num_draws / (num_draws - 1.0); + + for (int chain = 0; chain < num_chains; ++chain) { + accumulator_set> acc_draw; + for (int n = 0; n < num_draws; ++n) { + acc_draw(draws[chain][n]); + } + + chain_mean(chain) = boost::accumulators::mean(acc_draw); + acc_chain_mean(chain_mean(chain)); + chain_var(chain) + = boost::accumulators::variance(acc_draw) * unbiased_var_scale; + } + + double var_between = num_draws * boost::accumulators::variance(acc_chain_mean) + * num_chains / (num_chains - 1); + double var_within = chain_var.mean(); + + // rewrote [(n-1)*W/n + B/n]/W as (n-1+ B/W)/n + return sqrt((var_between / var_within + num_draws - 1) / num_draws); } + /** * Computes the potential scale reduction (Rhat) using rank based diagnostic for * the specified parameter across all kept samples. Based on paper @@ -263,20 +284,22 @@ inline std::pair compute_potential_scale_reduction_rank( * Scale Reduction". http://mc-stan.org/users/documentation * * Current implementation assumes draws are stored in contiguous - * blocks of memory. Chains are trimmed from the back to match the - * length of the shortest chain. Argument size will be broadcast to + * blocks of memory. Chains are trimmed from the back to match the + * length of the shortest chain. Argument size will be broadcast to * same length as draws. * - * @param chain_begins stores pointers to arrays of chains + * @param draws stores pointers to arrays of chains * @param size stores sizes of chains * @return potential scale reduction for the specified parameter */ inline double compute_potential_scale_reduction( - const std::vector& chain_begins, size_t size) { - std::vector sizes(chain_begins.size(), size); - return compute_potential_scale_reduction(chain_begins, sizes); + std::vector draws, size_t size) { + int num_chains = draws.size(); + std::vector sizes(num_chains, size); + return compute_potential_scale_reduction(draws, sizes); } + /** * Computes the potential scale reduction (Rhat) using rank based diagnostic for * the specified parameter across all kept samples. Based on paper @@ -325,21 +348,19 @@ inline std::pair compute_split_potential_scale_reduction_rank( * blocks of memory. Chains are trimmed from the back to match the * length of the shortest chain. * - * @param chain_begins stores pointers to arrays of chains - * @param chain_sizes stores sizes of chains + * @param draws stores pointers to arrays of chains + * @param sizes stores sizes of chains * @return potential scale reduction for the specified parameter */ inline double compute_split_potential_scale_reduction( - const std::vector& chain_begins, - const std::vector& chain_sizes) { - size_t num_chains = chain_sizes.size(); - size_t num_draws = chain_sizes[0]; - for (size_t chain = 1; chain < num_chains; ++chain) { - num_draws = std::min(num_draws, chain_sizes[chain]); + std::vector draws, std::vector sizes) { + int num_chains = sizes.size(); + size_t num_draws = sizes[0]; + for (int chain = 1; chain < num_chains; ++chain) { + num_draws = std::min(num_draws, sizes[chain]); } - std::vector split_draws - = split_chains(chain_begins, chain_sizes); + std::vector split_draws = split_chains(draws, sizes); double half = num_draws / 2.0; std::vector half_sizes(2 * num_chains, std::floor(half)); @@ -386,15 +407,15 @@ inline std::pair compute_split_potential_scale_reduction_rank( * length of the shortest chain. Argument size will be broadcast to * same length as draws. * - * @param chain_begins stores pointers to arrays of chains + * @param draws stores pointers to arrays of chains * @param size stores sizes of chains * @return potential scale reduction for the specified parameter */ inline double compute_split_potential_scale_reduction( - const std::vector& chain_begins, size_t size) { - size_t num_chains = chain_begins.size(); + std::vector draws, size_t size) { + int num_chains = draws.size(); std::vector sizes(num_chains, size); - return compute_split_potential_scale_reduction(chain_begins, sizes); + return compute_split_potential_scale_reduction(draws, sizes); } } // namespace analyze From 51db135cbedb9f4371438297243f2d57275259f8 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Wed, 17 Apr 2024 10:27:18 -0400 Subject: [PATCH 70/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index ee28995aa9..93813775ca 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -252,7 +252,6 @@ inline double compute_potential_scale_reduction( return sqrt((var_between / var_within + num_draws - 1) / num_draws); } - /** * Computes the potential scale reduction (Rhat) using rank based diagnostic for * the specified parameter across all kept samples. Based on paper @@ -299,7 +298,6 @@ inline double compute_potential_scale_reduction( return compute_potential_scale_reduction(draws, sizes); } - /** * Computes the potential scale reduction (Rhat) using rank based diagnostic for * the specified parameter across all kept samples. Based on paper From 634034deb3abd6314d980c1aab083f64269f4019 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Thu, 18 Apr 2024 21:30:14 -0400 Subject: [PATCH 71/93] Updates the Math submodule to 11663a2e79. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index b9d0a33291..11663a2e79 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit b9d0a3329108c7cb83ff76f4b475c0aa166c77e3 +Subproject commit 11663a2e79e6dc4286ebf1399573a7048667b1c5 From f12f2591348c30e3849bb9c964ce67f248fcf6ab Mon Sep 17 00:00:00 2001 From: Steve Bronder Date: Fri, 19 Apr 2024 12:40:20 -0400 Subject: [PATCH 72/93] update so scale_reduction calls scale_reduction_rank --- .../compute_potential_scale_reduction.hpp | 73 +------------------ src/stan/mcmc/chains.hpp | 6 +- ...compute_potential_scale_reduction_test.cpp | 45 ++---------- src/test/unit/mcmc/chains_test.cpp | 23 ++---- 4 files changed, 21 insertions(+), 126 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 93813775ca..b187cb14c7 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -183,73 +183,8 @@ inline std::pair compute_potential_scale_reduction_rank( * @return potential scale reduction for the specified parameter */ inline double compute_potential_scale_reduction( - std::vector draws, std::vector sizes) { - int num_chains = sizes.size(); - size_t num_draws = sizes[0]; - if (num_draws == 0) { - return std::numeric_limits::quiet_NaN(); - } - for (int chain = 1; chain < num_chains; ++chain) { - num_draws = std::min(num_draws, sizes[chain]); - } - - // check if chains are constant; all equal to first draw's value - bool are_all_const = false; - Eigen::VectorXd init_draw = Eigen::VectorXd::Zero(num_chains); - - for (int chain = 0; chain < num_chains; chain++) { - Eigen::Map> draw( - draws[chain], sizes[chain]); - - for (int n = 0; n < num_draws; n++) { - if (!std::isfinite(draw(n))) { - return std::numeric_limits::quiet_NaN(); - } - } - - init_draw(chain) = draw(0); - - if (draw.isApproxToConstant(draw(0))) { - are_all_const |= true; - } - } - - if (are_all_const) { - // If all chains are constant then return NaN - // if they all equal the same constant value - if (init_draw.isApproxToConstant(init_draw(0))) { - return std::numeric_limits::quiet_NaN(); - } - } - - using boost::accumulators::accumulator_set; - using boost::accumulators::stats; - using boost::accumulators::tag::mean; - using boost::accumulators::tag::variance; - - Eigen::VectorXd chain_mean(num_chains); - accumulator_set> acc_chain_mean; - Eigen::VectorXd chain_var(num_chains); - double unbiased_var_scale = num_draws / (num_draws - 1.0); - - for (int chain = 0; chain < num_chains; ++chain) { - accumulator_set> acc_draw; - for (int n = 0; n < num_draws; ++n) { - acc_draw(draws[chain][n]); - } - - chain_mean(chain) = boost::accumulators::mean(acc_draw); - acc_chain_mean(chain_mean(chain)); - chain_var(chain) - = boost::accumulators::variance(acc_draw) * unbiased_var_scale; - } - - double var_between = num_draws * boost::accumulators::variance(acc_chain_mean) - * num_chains / (num_chains - 1); - double var_within = chain_var.mean(); - - // rewrote [(n-1)*W/n + B/n]/W as (n-1+ B/W)/n - return sqrt((var_between / var_within + num_draws - 1) / num_draws); + const std::vector& draws, const std::vector& sizes) { + return compute_potential_scale_reduction_rank(draws, sizes).first; } /** @@ -295,7 +230,7 @@ inline double compute_potential_scale_reduction( std::vector draws, size_t size) { int num_chains = draws.size(); std::vector sizes(num_chains, size); - return compute_potential_scale_reduction(draws, sizes); + return compute_potential_scale_reduction_rank(draws, sizes).first; } /** @@ -363,7 +298,7 @@ inline double compute_split_potential_scale_reduction( double half = num_draws / 2.0; std::vector half_sizes(2 * num_chains, std::floor(half)); - return compute_potential_scale_reduction(split_draws, half_sizes); + return compute_potential_scale_reduction_rank(split_draws, half_sizes).first; } /** diff --git a/src/stan/mcmc/chains.hpp b/src/stan/mcmc/chains.hpp index a553fd36cd..1e763d0414 100644 --- a/src/stan/mcmc/chains.hpp +++ b/src/stan/mcmc/chains.hpp @@ -623,16 +623,16 @@ class chains { sizes[chain] = n_kept_samples; } - return analyze::compute_split_potential_scale_reduction(draws, sizes); + return analyze::compute_split_potential_scale_reduction_rank(draws, sizes).first; } std::pair split_potential_scale_reduction_rank( const std::string& name) const { - return split_potential_scale_reduction_rank(index(name)); + return this->split_potential_scale_reduction_rank(index(name)); } double split_potential_scale_reduction(const std::string& name) const { - return split_potential_scale_reduction(index(name)); + return this->split_potential_scale_reduction_rank(index(name)).first; } }; diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 41a102e51d..2d7d25afc6 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -31,13 +31,7 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00042, 1.00036, 0.99955, 1.00047, 1.00119, 1.00089, 1.00018, - 1.00019, 1.00226, 0.99954, 0.9996, 0.99951, 1.00237, 1.00515, 1.00566, - 0.99957, 1.00099, 1.00853, 1.0008, 0.99961, 1.0006, 1.00046, 1.01023, - 0.9996, 1.0011, 0.99967, 0.99973, 0.99958, 1.00242, 1.00213, 1.00244, - 0.99998, 0.99969, 1.00079, 0.99955, 1.0009, 1.00136, 1.00288, 1.00036, - 0.99989, 1.00077, 0.99997, 1.00194, 0.99972, 1.00257, 1.00109, 1.00004, - 0.99955; + rhat << 1.00067, 0.999789, 0.999656, 1.00055, 1.0011, 1.00088, 1.00032, 0.999969, 1.00201, 0.999558, 0.999555, 0.9995, 1.00292, 1.00516, 1.00591, 0.999753, 1.00088, 1.00895, 1.00079, 0.99953, 1.00092, 1.00044, 1.01005, 0.999598, 1.00151, 0.999659, 0.999648, 0.999627, 1.00315, 1.00277, 1.00247, 1.00003, 0.999937, 1.00116, 0.999521, 1.0005, 1.00091, 1.00213, 1.00019, 0.999767, 1.0003, 0.999815, 1.00003, 0.999672, 1.00306, 1.00072, 0.999602, 0.999789; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -52,8 +46,7 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction) { sizes[chain] = samples(chain).size(); } ASSERT_NEAR(rhat(index - 4), - stan::analyze::compute_potential_scale_reduction(draws, sizes), - 1e-4) + stan::analyze::compute_potential_scale_reduction(draws, sizes), 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } @@ -129,13 +122,7 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00042, 1.00036, 0.99955, 1.00047, 1.00119, 1.00089, 1.00018, - 1.00019, 1.00226, 0.99954, 0.9996, 0.99951, 1.00237, 1.00515, 1.00566, - 0.99957, 1.00099, 1.00853, 1.0008, 0.99961, 1.0006, 1.00046, 1.01023, - 0.9996, 1.0011, 0.99967, 0.99973, 0.99958, 1.00242, 1.00213, 1.00244, - 0.99998, 0.99969, 1.00079, 0.99955, 1.0009, 1.00136, 1.00288, 1.00036, - 0.99989, 1.00077, 0.99997, 1.00194, 0.99972, 1.00257, 1.00109, 1.00004, - 0.99955; + rhat << 1.00067, 0.999789, 0.999656, 1.00055, 1.0011, 1.00088, 1.00032, 0.999969, 1.00201, 0.999558, 0.999555, 0.9995, 1.00292, 1.00516, 1.00591, 0.999753, 1.00088, 1.00895, 1.00079, 0.99953, 1.00092, 1.00044, 1.01005, 0.999598, 1.00151, 0.999659, 0.999648, 0.999627, 1.00315, 1.00277, 1.00247, 1.00003, 0.999937, 1.00116, 0.999521, 1.0005, 1.00091, 1.00213, 1.00019, 0.999767, 1.0003, 0.999815, 1.00003, 0.999672, 1.00306, 1.00072, 0.999602, 0.999789; Eigen::Matrix samples( chains.num_chains()); @@ -222,14 +209,7 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, - 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, - 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, - 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, - 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, - 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, - 1.00735; - + rhat << 1.0078, 1.0109, 0.999187, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, 1.00193, 1.00104, 0.999383, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; for (int index = 4; index < chains.num_params(); index++) { ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), 1e-4) @@ -306,13 +286,7 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, - 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, - 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, - 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, - 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, - 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, - 1.00735; + rhat << 1.0078, 1.0109, 0.999187, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, 1.00193, 1.00104, 0.999383, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -405,13 +379,7 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, - 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, - 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, - 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, - 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, - 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, - 1.00735; + rhat << 1.0078, 1.0109, 0.999187, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, 1.00193, 1.00104, 0.999383, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; Eigen::Matrix samples( chains.num_chains()); @@ -429,6 +397,7 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience) { 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); + } } diff --git a/src/test/unit/mcmc/chains_test.cpp b/src/test/unit/mcmc/chains_test.cpp index f2d90aaf0d..7bf581ab31 100644 --- a/src/test/unit/mcmc/chains_test.cpp +++ b/src/test/unit/mcmc/chains_test.cpp @@ -853,13 +853,13 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, - 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, - 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, - 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, - 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, - 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, - 1.00735; + rhat << 1.0078, 1.0109, 0.99919, 1.001, 1.00401, 1.00992, 1.00182, + 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, + 1.01304, 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, + 1.0013, 1.00193, 1.00104, 0.99938, 1.00025, 1.01082, 1.0019, 1.00354, + 1.0043, 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, + 1.00118, 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, + 1.0109; for (int index = 4; index < chains.num_params(); index++) { ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), @@ -886,15 +886,6 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction_rank) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); - // Eigen::VectorXd rhat(48); - // rhat - // << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, - // 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, - // 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, - // 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, - // 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, - // 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; - Eigen::VectorXd rhat_bulk(48); rhat_bulk << 1.0078, 1.0109, 0.99919, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, From da5bb8d0c07bae4fca06763faf8bf074f44d1765 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Fri, 19 Apr 2024 12:42:10 -0400 Subject: [PATCH 73/93] [Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1 --- .../compute_potential_scale_reduction.hpp | 2 +- src/stan/mcmc/chains.hpp | 3 +- ...compute_potential_scale_reduction_test.cpp | 41 +++++++++++++++---- src/test/unit/mcmc/chains_test.cpp | 13 +++--- 4 files changed, 43 insertions(+), 16 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index b187cb14c7..47d0769573 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -184,7 +184,7 @@ inline std::pair compute_potential_scale_reduction_rank( */ inline double compute_potential_scale_reduction( const std::vector& draws, const std::vector& sizes) { - return compute_potential_scale_reduction_rank(draws, sizes).first; + return compute_potential_scale_reduction_rank(draws, sizes).first; } /** diff --git a/src/stan/mcmc/chains.hpp b/src/stan/mcmc/chains.hpp index 1e763d0414..69ae7669f8 100644 --- a/src/stan/mcmc/chains.hpp +++ b/src/stan/mcmc/chains.hpp @@ -623,7 +623,8 @@ class chains { sizes[chain] = n_kept_samples; } - return analyze::compute_split_potential_scale_reduction_rank(draws, sizes).first; + return analyze::compute_split_potential_scale_reduction_rank(draws, sizes) + .first; } std::pair split_potential_scale_reduction_rank( diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 2d7d25afc6..84f6efbe81 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -31,7 +31,13 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00067, 0.999789, 0.999656, 1.00055, 1.0011, 1.00088, 1.00032, 0.999969, 1.00201, 0.999558, 0.999555, 0.9995, 1.00292, 1.00516, 1.00591, 0.999753, 1.00088, 1.00895, 1.00079, 0.99953, 1.00092, 1.00044, 1.01005, 0.999598, 1.00151, 0.999659, 0.999648, 0.999627, 1.00315, 1.00277, 1.00247, 1.00003, 0.999937, 1.00116, 0.999521, 1.0005, 1.00091, 1.00213, 1.00019, 0.999767, 1.0003, 0.999815, 1.00003, 0.999672, 1.00306, 1.00072, 0.999602, 0.999789; + rhat << 1.00067, 0.999789, 0.999656, 1.00055, 1.0011, 1.00088, 1.00032, + 0.999969, 1.00201, 0.999558, 0.999555, 0.9995, 1.00292, 1.00516, 1.00591, + 0.999753, 1.00088, 1.00895, 1.00079, 0.99953, 1.00092, 1.00044, 1.01005, + 0.999598, 1.00151, 0.999659, 0.999648, 0.999627, 1.00315, 1.00277, + 1.00247, 1.00003, 0.999937, 1.00116, 0.999521, 1.0005, 1.00091, 1.00213, + 1.00019, 0.999767, 1.0003, 0.999815, 1.00003, 0.999672, 1.00306, 1.00072, + 0.999602, 0.999789; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -46,7 +52,8 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction) { sizes[chain] = samples(chain).size(); } ASSERT_NEAR(rhat(index - 4), - stan::analyze::compute_potential_scale_reduction(draws, sizes), 1e-4) + stan::analyze::compute_potential_scale_reduction(draws, sizes), + 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); } @@ -122,7 +129,13 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00067, 0.999789, 0.999656, 1.00055, 1.0011, 1.00088, 1.00032, 0.999969, 1.00201, 0.999558, 0.999555, 0.9995, 1.00292, 1.00516, 1.00591, 0.999753, 1.00088, 1.00895, 1.00079, 0.99953, 1.00092, 1.00044, 1.01005, 0.999598, 1.00151, 0.999659, 0.999648, 0.999627, 1.00315, 1.00277, 1.00247, 1.00003, 0.999937, 1.00116, 0.999521, 1.0005, 1.00091, 1.00213, 1.00019, 0.999767, 1.0003, 0.999815, 1.00003, 0.999672, 1.00306, 1.00072, 0.999602, 0.999789; + rhat << 1.00067, 0.999789, 0.999656, 1.00055, 1.0011, 1.00088, 1.00032, + 0.999969, 1.00201, 0.999558, 0.999555, 0.9995, 1.00292, 1.00516, 1.00591, + 0.999753, 1.00088, 1.00895, 1.00079, 0.99953, 1.00092, 1.00044, 1.01005, + 0.999598, 1.00151, 0.999659, 0.999648, 0.999627, 1.00315, 1.00277, + 1.00247, 1.00003, 0.999937, 1.00116, 0.999521, 1.0005, 1.00091, 1.00213, + 1.00019, 0.999767, 1.0003, 0.999815, 1.00003, 0.999672, 1.00306, 1.00072, + 0.999602, 0.999789; Eigen::Matrix samples( chains.num_chains()); @@ -209,7 +222,12 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 0.999187, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, 1.00193, 1.00104, 0.999383, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; + rhat << 1.0078, 1.0109, 0.999187, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, + 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, + 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, + 1.00193, 1.00104, 0.999383, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, + 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, + 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; for (int index = 4; index < chains.num_params(); index++) { ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), 1e-4) @@ -286,7 +304,12 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 0.999187, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, 1.00193, 1.00104, 0.999383, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; + rhat << 1.0078, 1.0109, 0.999187, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, + 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, + 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, + 1.00193, 1.00104, 0.999383, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, + 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, + 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -379,7 +402,12 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 0.999187, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, 1.00193, 1.00104, 0.999383, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; + rhat << 1.0078, 1.0109, 0.999187, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, + 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, + 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, + 1.00193, 1.00104, 0.999383, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, + 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, + 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; Eigen::Matrix samples( chains.num_chains()); @@ -397,7 +425,6 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience) { 1e-4) << "rhat for index: " << index << ", parameter: " << chains.param_name(index); - } } diff --git a/src/test/unit/mcmc/chains_test.cpp b/src/test/unit/mcmc/chains_test.cpp index 7bf581ab31..b0d0db1d24 100644 --- a/src/test/unit/mcmc/chains_test.cpp +++ b/src/test/unit/mcmc/chains_test.cpp @@ -853,13 +853,12 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 0.99919, 1.001, 1.00401, 1.00992, 1.00182, - 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, - 1.01304, 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, - 1.0013, 1.00193, 1.00104, 0.99938, 1.00025, 1.01082, 1.0019, 1.00354, - 1.0043, 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, - 1.00118, 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, - 1.0109; + rhat << 1.0078, 1.0109, 0.99919, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, + 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, + 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, + 1.00193, 1.00104, 0.99938, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, + 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, + 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; for (int index = 4; index < chains.num_params(); index++) { ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), From 58ab01bad549344d460fba58f4541e4fe2cb7f1c Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Sat, 20 Apr 2024 08:32:52 -0400 Subject: [PATCH 74/93] Updates the Math submodule to 86a3e83e18. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 11663a2e79..86a3e83e18 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 11663a2e79e6dc4286ebf1399573a7048667b1c5 +Subproject commit 86a3e83e181b8663fee2e49cbd67e6e55e4201d1 From eb393047c97aa9da5b744dc1c044d27889dbca85 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 21 Apr 2024 13:25:18 +0300 Subject: [PATCH 75/93] Update tests to use rtools-provided make --- Jenkinsfile | 10 +++++----- runTests.py | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 21af74470f..47b3aacbbc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -192,7 +192,7 @@ pipeline { } post { always { - recordIssues( + recordIssues( id: "lint_doc_checks", name: "Linting & Doc checks", enabledForFailure: true, @@ -264,8 +264,8 @@ pipeline { SET \"PATH=C:\\PROGRA~1\\R\\R-4.1.2\\bin;%PATH%\" SET \"PATH=C:\\PROGRA~1\\Microsoft^ MPI\\Bin;%PATH%\" SET \"MPI_HOME=C:\\PROGRA~1\\Microsoft^ MPI\\Bin\" - mingw32-make.exe -f lib/stan_math/make/standalone math-libs - mingw32-make.exe -j${PARALLEL} test-headers + make.exe -f lib/stan_math/make/standalone math-libs + make.exe -j${PARALLEL} test-headers """ setupCXX(false, WIN_CXX, stanc3_bin_url()) runTestsWin("src/test/unit") @@ -448,7 +448,7 @@ pipeline { SET \"PATH=C:\\PROGRA~1\\Microsoft^ MPI\\Bin;%PATH%\" SET \"MPI_HOME=C:\\PROGRA~1\\Microsoft^ MPI\\Bin\" cd performance-tests-cmdstan/cmdstan - mingw32-make.exe -j${PARALLEL} build + make.exe -j${PARALLEL} build cd .. python ./runPerformanceTests.py -j${PARALLEL} ${integration_tests_flags()}--runs=0 stanc3/test/integration/good python ./runPerformanceTests.py -j${PARALLEL} ${integration_tests_flags()}--runs=0 example-models @@ -496,7 +496,7 @@ pipeline { post { always { node("linux") { - recordIssues( + recordIssues( id: "pipeline", name: "Entire pipeline results", enabledForFailure: true, diff --git a/runTests.py b/runTests.py index 26e8098c56..2947e11a05 100755 --- a/runTests.py +++ b/runTests.py @@ -80,8 +80,6 @@ def doCommand(command, exit_on_failure=True): """Run command as a shell command and report/exit on errors.""" print("------------------------------------------------------------") print("%s" % command) - if isWin() and command.startswith("make "): - command = command.replace("make ", "mingw32-make ") p1 = subprocess.Popen(command, shell=True) p1.wait() if exit_on_failure and (not (p1.returncode is None) and not (p1.returncode == 0)): From c22413939b7820a5203ad0d6ad79f4263012d35b Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 21 Apr 2024 13:50:53 +0300 Subject: [PATCH 76/93] Fix null usage on windows --- make/tests | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/make/tests b/make/tests index 6eff2a94d7..2cf99e2317 100644 --- a/make/tests +++ b/make/tests @@ -85,12 +85,15 @@ HEADER_TESTS := $(addsuffix -test,$(call findfiles,src/stan,*.hpp)) ifeq ($(OS),Windows_NT) DEV_NULL = nul + ifeq ($(IS_UCRT),true) + UCRT_NULL_FLAG = -S + endif else DEV_NULL = /dev/null endif %.hpp-test : %.hpp test/dummy.cpp - $(COMPILE.cpp) -O0 -include $^ -o $(DEV_NULL) + $(COMPILE.cpp) -O0 -include $^ $(UCRT_NULL_FLAG) -o $(DEV_NULL) test/dummy.cpp: @mkdir -p test From b3631beaefae57c43b3629f70ae161a2653dd334 Mon Sep 17 00:00:00 2001 From: Steve Bronder Date: Mon, 22 Apr 2024 11:03:57 -0400 Subject: [PATCH 77/93] Revert "update so scale_reduction calls scale_reduction_rank" This reverts commit f12f2591348c30e3849bb9c964ce67f248fcf6ab. --- .../compute_potential_scale_reduction.hpp | 73 ++++++++++++++++++- src/stan/mcmc/chains.hpp | 7 +- ...compute_potential_scale_reduction_test.cpp | 68 +++++++++-------- src/test/unit/mcmc/chains_test.cpp | 22 ++++-- 4 files changed, 124 insertions(+), 46 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 47d0769573..93813775ca 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -183,8 +183,73 @@ inline std::pair compute_potential_scale_reduction_rank( * @return potential scale reduction for the specified parameter */ inline double compute_potential_scale_reduction( - const std::vector& draws, const std::vector& sizes) { - return compute_potential_scale_reduction_rank(draws, sizes).first; + std::vector draws, std::vector sizes) { + int num_chains = sizes.size(); + size_t num_draws = sizes[0]; + if (num_draws == 0) { + return std::numeric_limits::quiet_NaN(); + } + for (int chain = 1; chain < num_chains; ++chain) { + num_draws = std::min(num_draws, sizes[chain]); + } + + // check if chains are constant; all equal to first draw's value + bool are_all_const = false; + Eigen::VectorXd init_draw = Eigen::VectorXd::Zero(num_chains); + + for (int chain = 0; chain < num_chains; chain++) { + Eigen::Map> draw( + draws[chain], sizes[chain]); + + for (int n = 0; n < num_draws; n++) { + if (!std::isfinite(draw(n))) { + return std::numeric_limits::quiet_NaN(); + } + } + + init_draw(chain) = draw(0); + + if (draw.isApproxToConstant(draw(0))) { + are_all_const |= true; + } + } + + if (are_all_const) { + // If all chains are constant then return NaN + // if they all equal the same constant value + if (init_draw.isApproxToConstant(init_draw(0))) { + return std::numeric_limits::quiet_NaN(); + } + } + + using boost::accumulators::accumulator_set; + using boost::accumulators::stats; + using boost::accumulators::tag::mean; + using boost::accumulators::tag::variance; + + Eigen::VectorXd chain_mean(num_chains); + accumulator_set> acc_chain_mean; + Eigen::VectorXd chain_var(num_chains); + double unbiased_var_scale = num_draws / (num_draws - 1.0); + + for (int chain = 0; chain < num_chains; ++chain) { + accumulator_set> acc_draw; + for (int n = 0; n < num_draws; ++n) { + acc_draw(draws[chain][n]); + } + + chain_mean(chain) = boost::accumulators::mean(acc_draw); + acc_chain_mean(chain_mean(chain)); + chain_var(chain) + = boost::accumulators::variance(acc_draw) * unbiased_var_scale; + } + + double var_between = num_draws * boost::accumulators::variance(acc_chain_mean) + * num_chains / (num_chains - 1); + double var_within = chain_var.mean(); + + // rewrote [(n-1)*W/n + B/n]/W as (n-1+ B/W)/n + return sqrt((var_between / var_within + num_draws - 1) / num_draws); } /** @@ -230,7 +295,7 @@ inline double compute_potential_scale_reduction( std::vector draws, size_t size) { int num_chains = draws.size(); std::vector sizes(num_chains, size); - return compute_potential_scale_reduction_rank(draws, sizes).first; + return compute_potential_scale_reduction(draws, sizes); } /** @@ -298,7 +363,7 @@ inline double compute_split_potential_scale_reduction( double half = num_draws / 2.0; std::vector half_sizes(2 * num_chains, std::floor(half)); - return compute_potential_scale_reduction_rank(split_draws, half_sizes).first; + return compute_potential_scale_reduction(split_draws, half_sizes); } /** diff --git a/src/stan/mcmc/chains.hpp b/src/stan/mcmc/chains.hpp index 69ae7669f8..a553fd36cd 100644 --- a/src/stan/mcmc/chains.hpp +++ b/src/stan/mcmc/chains.hpp @@ -623,17 +623,16 @@ class chains { sizes[chain] = n_kept_samples; } - return analyze::compute_split_potential_scale_reduction_rank(draws, sizes) - .first; + return analyze::compute_split_potential_scale_reduction(draws, sizes); } std::pair split_potential_scale_reduction_rank( const std::string& name) const { - return this->split_potential_scale_reduction_rank(index(name)); + return split_potential_scale_reduction_rank(index(name)); } double split_potential_scale_reduction(const std::string& name) const { - return this->split_potential_scale_reduction_rank(index(name)).first; + return split_potential_scale_reduction(index(name)); } }; diff --git a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp index 84f6efbe81..41a102e51d 100644 --- a/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp +++ b/src/test/unit/analyze/mcmc/compute_potential_scale_reduction_test.cpp @@ -31,13 +31,13 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00067, 0.999789, 0.999656, 1.00055, 1.0011, 1.00088, 1.00032, - 0.999969, 1.00201, 0.999558, 0.999555, 0.9995, 1.00292, 1.00516, 1.00591, - 0.999753, 1.00088, 1.00895, 1.00079, 0.99953, 1.00092, 1.00044, 1.01005, - 0.999598, 1.00151, 0.999659, 0.999648, 0.999627, 1.00315, 1.00277, - 1.00247, 1.00003, 0.999937, 1.00116, 0.999521, 1.0005, 1.00091, 1.00213, - 1.00019, 0.999767, 1.0003, 0.999815, 1.00003, 0.999672, 1.00306, 1.00072, - 0.999602, 0.999789; + rhat << 1.00042, 1.00036, 0.99955, 1.00047, 1.00119, 1.00089, 1.00018, + 1.00019, 1.00226, 0.99954, 0.9996, 0.99951, 1.00237, 1.00515, 1.00566, + 0.99957, 1.00099, 1.00853, 1.0008, 0.99961, 1.0006, 1.00046, 1.01023, + 0.9996, 1.0011, 0.99967, 0.99973, 0.99958, 1.00242, 1.00213, 1.00244, + 0.99998, 0.99969, 1.00079, 0.99955, 1.0009, 1.00136, 1.00288, 1.00036, + 0.99989, 1.00077, 0.99997, 1.00194, 0.99972, 1.00257, 1.00109, 1.00004, + 0.99955; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -129,13 +129,13 @@ TEST_F(ComputeRhat, compute_potential_scale_reduction_convenience) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.00067, 0.999789, 0.999656, 1.00055, 1.0011, 1.00088, 1.00032, - 0.999969, 1.00201, 0.999558, 0.999555, 0.9995, 1.00292, 1.00516, 1.00591, - 0.999753, 1.00088, 1.00895, 1.00079, 0.99953, 1.00092, 1.00044, 1.01005, - 0.999598, 1.00151, 0.999659, 0.999648, 0.999627, 1.00315, 1.00277, - 1.00247, 1.00003, 0.999937, 1.00116, 0.999521, 1.0005, 1.00091, 1.00213, - 1.00019, 0.999767, 1.0003, 0.999815, 1.00003, 0.999672, 1.00306, 1.00072, - 0.999602, 0.999789; + rhat << 1.00042, 1.00036, 0.99955, 1.00047, 1.00119, 1.00089, 1.00018, + 1.00019, 1.00226, 0.99954, 0.9996, 0.99951, 1.00237, 1.00515, 1.00566, + 0.99957, 1.00099, 1.00853, 1.0008, 0.99961, 1.0006, 1.00046, 1.01023, + 0.9996, 1.0011, 0.99967, 0.99973, 0.99958, 1.00242, 1.00213, 1.00244, + 0.99998, 0.99969, 1.00079, 0.99955, 1.0009, 1.00136, 1.00288, 1.00036, + 0.99989, 1.00077, 0.99997, 1.00194, 0.99972, 1.00257, 1.00109, 1.00004, + 0.99955; Eigen::Matrix samples( chains.num_chains()); @@ -222,12 +222,14 @@ TEST_F(ComputeRhat, chains_compute_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 0.999187, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, - 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, - 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, - 1.00193, 1.00104, 0.999383, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, - 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, - 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; + rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, + 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, + 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, + 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, + 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, + 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, + 1.00735; + for (int index = 4; index < chains.num_params(); index++) { ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), 1e-4) @@ -304,12 +306,13 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 0.999187, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, - 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, - 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, - 1.00193, 1.00104, 0.999383, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, - 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, - 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; + rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, + 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, + 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, + 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, + 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, + 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, + 1.00735; // replicates calls to stan::analyze::compute_effective_sample_size // for any interface *without* access to chains class @@ -402,12 +405,13 @@ TEST_F(ComputeRhat, compute_split_potential_scale_reduction_convenience) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 0.999187, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, - 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, - 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, - 1.00193, 1.00104, 0.999383, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, - 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, - 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; + rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, + 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, + 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, + 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, + 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, + 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, + 1.00735; Eigen::Matrix samples( chains.num_chains()); diff --git a/src/test/unit/mcmc/chains_test.cpp b/src/test/unit/mcmc/chains_test.cpp index b0d0db1d24..f2d90aaf0d 100644 --- a/src/test/unit/mcmc/chains_test.cpp +++ b/src/test/unit/mcmc/chains_test.cpp @@ -853,12 +853,13 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction) { chains.add(blocker2); Eigen::VectorXd rhat(48); - rhat << 1.0078, 1.0109, 0.99919, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, - 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, 1.01304, - 1.00166, 1.0074, 1.00178, 1.00588, 1.00406, 1.00129, 1.00976, 1.0013, - 1.00193, 1.00104, 0.99938, 1.00025, 1.01082, 1.0019, 1.00354, 1.0043, - 1.00111, 1.00281, 1.00436, 1.00515, 1.00325, 1.0089, 1.00222, 1.00118, - 1.00191, 1.00283, 1.0003, 1.00216, 1.00335, 1.00133, 1.00023, 1.0109; + rhat << 1.00718, 1.00473, 0.999203, 1.00061, 1.00378, 1.01031, 1.00173, + 1.0045, 1.00111, 1.00337, 1.00546, 1.00105, 1.00558, 1.00463, 1.00534, + 1.01244, 1.00174, 1.00718, 1.00186, 1.00554, 1.00436, 1.00147, 1.01017, + 1.00162, 1.00143, 1.00058, 0.999221, 1.00012, 1.01028, 1.001, 1.00305, + 1.00435, 1.00055, 1.00246, 1.00447, 1.0048, 1.00209, 1.01159, 1.00202, + 1.00077, 1.0021, 1.00262, 1.00308, 1.00197, 1.00246, 1.00085, 1.00047, + 1.00735; for (int index = 4; index < chains.num_params(); index++) { ASSERT_NEAR(rhat(index - 4), chains.split_potential_scale_reduction(index), @@ -885,6 +886,15 @@ TEST_F(McmcChains, blocker_split_potential_scale_reduction_rank) { stan::mcmc::chains<> chains(blocker1); chains.add(blocker2); + // Eigen::VectorXd rhat(48); + // rhat + // << 1.0078, 1.0109, 1.00731, 1.00333, 1.00401, 1.00992, 1.00734, 1.00633, + // 1.00095, 1.00906, 1.01019, 1.00075, 1.00595, 1.00473, 1.00895, 1.01304, + // 1.00166, 1.0074, 1.00236, 1.00588, 1.00414, 1.00303, 1.00976, 1.00295, + // 1.00193, 1.0044, 1.00488, 1.00178, 1.01082, 1.0019, 1.00413, 1.01303, + // 1.0024, 1.01148, 1.00436, 1.00515, 1.00712, 1.0089, 1.00222, 1.00118, + // 1.00381, 1.00283, 1.00188, 1.00225, 1.00335, 1.00133, 1.00209, 1.0109; + Eigen::VectorXd rhat_bulk(48); rhat_bulk << 1.0078, 1.0109, 0.99919, 1.001, 1.00401, 1.00992, 1.00182, 1.00519, 1.00095, 1.00351, 1.00554, 1.00075, 1.00595, 1.00473, 1.00546, From 04708f4c0036400c60a10b7796af66a18027dbaa Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Fri, 3 May 2024 01:57:38 -0400 Subject: [PATCH 78/93] Updates the Math submodule to 9202f1f505. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 86a3e83e18..9202f1f505 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 86a3e83e181b8663fee2e49cbd67e6e55e4201d1 +Subproject commit 9202f1f505855aed229559b309c961cebab169d7 From 8dad308af598473827c09825e109fa8d54dc0359 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Mon, 6 May 2024 11:28:53 -0400 Subject: [PATCH 79/93] Fix doxygen param names in compute_potential_scale_reduction.hpp --- src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp index 93813775ca..f4fcb971bc 100644 --- a/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp +++ b/src/stan/analyze/mcmc/compute_potential_scale_reduction.hpp @@ -106,8 +106,8 @@ inline double rhat(const Eigen::MatrixXd& chains) { * blocks of memory. Chains are trimmed from the back to match the * length of the shortest chain. * - * @param chain_begin stores pointers to arrays of chains - * @param sizes stores sizes of chains + * @param chain_begins stores pointers to arrays of chains + * @param chain_sizes stores sizes of chains * @return potential scale reduction for the specified parameter */ inline std::pair compute_potential_scale_reduction_rank( From 67dd17ed0451212624084d83e26517f94d8526eb Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Tue, 7 May 2024 06:36:33 -0400 Subject: [PATCH 80/93] Updates the Math submodule to ee65daae95. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 9202f1f505..ee65daae95 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 9202f1f505855aed229559b309c961cebab169d7 +Subproject commit ee65daae950e7fbe75b74c16af8825e4e67a2e4e From 7ffb934320ad0299d80e9b20df5bcde53257512f Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Thu, 9 May 2024 00:53:08 -0400 Subject: [PATCH 81/93] Updates the Math submodule to 1830097a0d. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index ee65daae95..1830097a0d 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit ee65daae950e7fbe75b74c16af8825e4e67a2e4e +Subproject commit 1830097a0de00b5322277b923fd6fb913050a90f From 607474b7799d64637487705d65a67027368819e7 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Sat, 11 May 2024 01:59:22 -0400 Subject: [PATCH 82/93] Updates the Math submodule to 35d37cebb0. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 1830097a0d..35d37cebb0 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 1830097a0de00b5322277b923fd6fb913050a90f +Subproject commit 35d37cebb01a9c418f02716ab0451b33bfd4ca5d From bef9c85db40013918b23602153432e2ecd7d0e94 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Sun, 12 May 2024 03:29:03 -0400 Subject: [PATCH 83/93] Updates the Math submodule to 53ff81d128. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 35d37cebb0..53ff81d128 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 35d37cebb01a9c418f02716ab0451b33bfd4ca5d +Subproject commit 53ff81d1281fe876a7422944bd3a55cb478dd55b From 1bbf73552306aae70842aeab97b44a7b2ecdca37 Mon Sep 17 00:00:00 2001 From: Nicusor Serban <48496524+serban-nicusor-toptal@users.noreply.github.com> Date: Mon, 13 May 2024 13:22:18 +0200 Subject: [PATCH 84/93] updating version numbers for 2.35.0 rc (#3284) --- .github/ISSUE_TEMPLATE.md | 2 +- src/doxygen/doxygen.cfg | 2 +- src/stan/version.hpp | 4 ++-- src/test/unit/version_test.cpp | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 8251d82562..c3ac6a5e20 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -24,4 +24,4 @@ Describe what you expect the output to be. Knowing the correct behavior is also Provide any additional information here. #### Current Version: -v2.34.1 +v2.35.0 diff --git a/src/doxygen/doxygen.cfg b/src/doxygen/doxygen.cfg index 68763e2c63..35053b4ba8 100644 --- a/src/doxygen/doxygen.cfg +++ b/src/doxygen/doxygen.cfg @@ -38,7 +38,7 @@ PROJECT_NAME = "Stan" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 2.34.1 +PROJECT_NUMBER = 2.35.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/src/stan/version.hpp b/src/stan/version.hpp index 65e3bd7116..e1c12af415 100644 --- a/src/stan/version.hpp +++ b/src/stan/version.hpp @@ -12,8 +12,8 @@ #endif #define STAN_MAJOR 2 -#define STAN_MINOR 34 -#define STAN_PATCH 1 +#define STAN_MINOR 35 +#define STAN_PATCH 0 namespace stan { diff --git a/src/test/unit/version_test.cpp b/src/test/unit/version_test.cpp index dbcf6e1bca..cc76d8f0c7 100644 --- a/src/test/unit/version_test.cpp +++ b/src/test/unit/version_test.cpp @@ -3,12 +3,12 @@ TEST(Stan, macro) { EXPECT_EQ(2, STAN_MAJOR); - EXPECT_EQ(34, STAN_MINOR); - EXPECT_EQ(1, STAN_PATCH); + EXPECT_EQ(35, STAN_MINOR); + EXPECT_EQ(0, STAN_PATCH); } TEST(Stan, version) { EXPECT_EQ("2", stan::MAJOR_VERSION); - EXPECT_EQ("34", stan::MINOR_VERSION); - EXPECT_EQ("1", stan::PATCH_VERSION); + EXPECT_EQ("35", stan::MINOR_VERSION); + EXPECT_EQ("0", stan::PATCH_VERSION); } From 3e18293272e46b35f8ac7aac4225e50a333c84a8 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Mon, 13 May 2024 22:30:12 -0400 Subject: [PATCH 85/93] Updates the Math submodule to 887a2e7ac5. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 53ff81d128..887a2e7ac5 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 53ff81d1281fe876a7422944bd3a55cb478dd55b +Subproject commit 887a2e7ac5ff978d9e2ad8823c96cd92e0c1fc85 From 8cbd2f225882df7167ebce76da8ab3224171e4b3 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Fri, 17 May 2024 01:13:06 -0400 Subject: [PATCH 86/93] Updates the Math submodule to 814d915905. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 887a2e7ac5..814d915905 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 887a2e7ac5ff978d9e2ad8823c96cd92e0c1fc85 +Subproject commit 814d91590585f52f67a1d601f5d71d4f1097c99b From ef3b05b7aa425573b736d32efca4186be7b8fb98 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Fri, 17 May 2024 15:50:38 -0400 Subject: [PATCH 87/93] Ensure mixmax rng is not initialized with all zeros --- src/stan/services/util/create_rng.hpp | 5 +- .../unit/mcmc/hmc/nuts/base_nuts_test.cpp | 4 +- .../unit/mcmc/hmc/nuts/softabs_nuts_test.cpp | 14 +++--- .../unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp | 14 +++--- .../derived_static_uniform_test.cpp | 48 +++++++++---------- .../unit/mcmc/hmc/xhmc/base_xhmc_test.cpp | 4 +- .../unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp | 16 +++---- .../unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp | 16 +++---- 8 files changed, 62 insertions(+), 59 deletions(-) diff --git a/src/stan/services/util/create_rng.hpp b/src/stan/services/util/create_rng.hpp index 231b57170b..a88d162695 100644 --- a/src/stan/services/util/create_rng.hpp +++ b/src/stan/services/util/create_rng.hpp @@ -26,7 +26,10 @@ namespace util { * @return an stan::rng_t instance */ inline rng_t create_rng(unsigned int seed, unsigned int chain) { - rng_t rng(seed + chain); + // RNG state is 128 bits, but user only provides 64 total bits + // Additionally, there are issues if all 128 bits are 0, hence + // the 1 as the second argument + rng_t rng(0, 1, seed, chain); return rng; } diff --git a/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp b/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp index 3f230d01a3..f58ccf0d60 100644 --- a/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp @@ -362,7 +362,7 @@ TEST(McmcNutsBaseNuts, transition) { EXPECT_EQ((2 << (sampler.get_max_depth() - 1)) - 1, sampler.n_leapfrog_); EXPECT_FALSE(sampler.divergent_); - EXPECT_EQ(-31 * init_momentum, s.cont_params()(0)); + EXPECT_EQ(23 * init_momentum, s.cont_params()(0)); EXPECT_EQ(0, s.log_prob()); EXPECT_EQ(1, s.accept_stat()); EXPECT_EQ("", debug.str()); @@ -373,7 +373,7 @@ TEST(McmcNutsBaseNuts, transition) { } TEST(McmcNutsBaseNuts, transition_egde_momenta) { - stan::rng_t base_rng = stan::services::util::create_rng(424243, 0); + stan::rng_t base_rng = stan::services::util::create_rng(42424253, 0); int model_size = 1; double init_momentum = 1.5; diff --git a/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp b/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp index e9d64cd9fa..8eaa84df6b 100644 --- a/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/softabs_nuts_test.cpp @@ -338,15 +338,15 @@ TEST(McmcSoftAbsNuts, transition_test) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_EQ(5, sampler.depth_); - EXPECT_EQ((2 << 4) - 1, sampler.n_leapfrog_); + EXPECT_EQ(3, sampler.depth_); + EXPECT_EQ((2 << 3) - 1, sampler.n_leapfrog_); EXPECT_FALSE(sampler.divergent_); - EXPECT_FLOAT_EQ(-1.7373296, s.cont_params()(0)); - EXPECT_FLOAT_EQ(1.0898665, s.cont_params()(1)); - EXPECT_FLOAT_EQ(-0.38303182, s.cont_params()(2)); - EXPECT_FLOAT_EQ(-2.1764181, s.log_prob()); - EXPECT_FLOAT_EQ(0.9993856, s.accept_stat()); + EXPECT_FLOAT_EQ(0.74693149, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-0.74414188, s.cont_params()(1)); + EXPECT_FLOAT_EQ(0.60859376, s.cont_params()(2)); + EXPECT_FLOAT_EQ(-0.74102008, s.log_prob()); + EXPECT_FLOAT_EQ(0.99934167, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); diff --git a/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp b/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp index 43f6ecb04d..6e5bade65a 100644 --- a/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp +++ b/src/test/unit/mcmc/hmc/nuts/unit_e_nuts_test.cpp @@ -338,15 +338,15 @@ TEST(McmcUnitENuts, transition_test) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_EQ(5, sampler.depth_); - EXPECT_EQ((2 << 4) - 1, sampler.n_leapfrog_); + EXPECT_EQ(3, sampler.depth_); + EXPECT_EQ((2 << 3) - 1, sampler.n_leapfrog_); EXPECT_FALSE(sampler.divergent_); - EXPECT_FLOAT_EQ(-1.7890506, s.cont_params()(0)); - EXPECT_FLOAT_EQ(1.2320533, s.cont_params()(1)); - EXPECT_FLOAT_EQ(-0.62397981, s.cont_params()(2)); - EXPECT_FLOAT_EQ(-2.554004, s.log_prob()); - EXPECT_FLOAT_EQ(0.99910343, s.accept_stat()); + EXPECT_FLOAT_EQ(0.70149082, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-0.69831347, s.cont_params()(1)); + EXPECT_FLOAT_EQ(0.54392564, s.cont_params()(2)); + EXPECT_FLOAT_EQ(-0.63779306, s.log_prob()); + EXPECT_FLOAT_EQ(0.99912512, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); diff --git a/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp b/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp index bd01ec70d2..15527eaa8b 100644 --- a/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp +++ b/src/test/unit/mcmc/hmc/static_uniform/derived_static_uniform_test.cpp @@ -41,9 +41,9 @@ TEST(McmcStaticUniform, unit_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(1.5896972, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-1.2635686, s.log_prob()); - EXPECT_FLOAT_EQ(0.9994188, s.accept_stat()); + EXPECT_FLOAT_EQ(1.0920367, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-0.59627211, s.log_prob()); + EXPECT_FLOAT_EQ(0.99985325, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -78,9 +78,9 @@ TEST(McmcStaticUniform, diag_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(1.5896972, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-1.2635686, s.log_prob()); - EXPECT_FLOAT_EQ(0.9994188, s.accept_stat()); + EXPECT_FLOAT_EQ(1.0920367, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-0.59627211, s.log_prob()); + EXPECT_FLOAT_EQ(0.99985325, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -115,9 +115,9 @@ TEST(McmcStaticUniform, dense_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(1.5896972, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-1.2635686, s.log_prob()); - EXPECT_FLOAT_EQ(0.9994188, s.accept_stat()); + EXPECT_FLOAT_EQ(1.0920367, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-0.59627211, s.log_prob()); + EXPECT_FLOAT_EQ(0.99985325, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -152,9 +152,9 @@ TEST(McmcStaticUniform, softabs_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(1.5338461, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-1.176342, s.log_prob()); - EXPECT_FLOAT_EQ(0.9996115, s.accept_stat()); + EXPECT_FLOAT_EQ(1.0826443, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-0.58605933, s.log_prob()); + EXPECT_FLOAT_EQ(0.99989599, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -189,9 +189,9 @@ TEST(McmcStaticUniform, adapt_unit_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(1.5896972, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-1.2635686, s.log_prob()); - EXPECT_FLOAT_EQ(0.9994188, s.accept_stat()); + EXPECT_FLOAT_EQ(1.0920367, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-0.59627211, s.log_prob()); + EXPECT_FLOAT_EQ(0.99985325, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -226,9 +226,9 @@ TEST(McmcStaticUniform, adapt_diag_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(1.5896972, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-1.2635686, s.log_prob()); - EXPECT_FLOAT_EQ(0.9994188, s.accept_stat()); + EXPECT_FLOAT_EQ(1.0920367, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-0.59627211, s.log_prob()); + EXPECT_FLOAT_EQ(0.99985325, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -263,9 +263,9 @@ TEST(McmcStaticUniform, adapt_dense_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(1.5896972, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-1.2635686, s.log_prob()); - EXPECT_FLOAT_EQ(0.9994188, s.accept_stat()); + EXPECT_FLOAT_EQ(1.0920367, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-0.59627211, s.log_prob()); + EXPECT_FLOAT_EQ(0.99985325, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); @@ -300,9 +300,9 @@ TEST(McmcStaticUniform, adapt_softabs_e_transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_FLOAT_EQ(1.5338461, s.cont_params()(0)); - EXPECT_FLOAT_EQ(-1.176342, s.log_prob()); - EXPECT_FLOAT_EQ(0.9996115, s.accept_stat()); + EXPECT_FLOAT_EQ(1.0826443, s.cont_params()(0)); + EXPECT_FLOAT_EQ(-0.58605933, s.log_prob()); + EXPECT_FLOAT_EQ(0.99989599, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); diff --git a/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp b/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp index 619f291a6e..70f9598136 100644 --- a/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp +++ b/src/test/unit/mcmc/hmc/xhmc/base_xhmc_test.cpp @@ -221,7 +221,7 @@ TEST(McmcXHMCBaseXHMC, divergence_test) { } TEST(McmcXHMCBaseXHMC, transition) { - stan::rng_t base_rng = stan::services::util::create_rng(0, 0); + stan::rng_t base_rng = stan::services::util::create_rng(1234, 0); int model_size = 1; double init_momentum = 1.5; @@ -245,7 +245,7 @@ TEST(McmcXHMCBaseXHMC, transition) { stan::mcmc::sample s = sampler.transition(init_sample, logger); - EXPECT_EQ(-31 * init_momentum, s.cont_params()(0)); + EXPECT_EQ(5 * init_momentum, s.cont_params()(0)); EXPECT_EQ(0, s.log_prob()); EXPECT_EQ(1, s.accept_stat()); EXPECT_EQ("", debug.str()); diff --git a/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp b/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp index f5db914a35..faa9620053 100644 --- a/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp +++ b/src/test/unit/mcmc/hmc/xhmc/softabs_xhmc_test.cpp @@ -58,13 +58,13 @@ TEST(McmcUnitEXHMC, build_tree) { EXPECT_FLOAT_EQ(1.5019561, sampler.z().p(1)); EXPECT_FLOAT_EQ(-1.5019561, sampler.z().p(2)); - EXPECT_FLOAT_EQ(0.42903179, z_propose.q(0)); - EXPECT_FLOAT_EQ(-0.42903179, z_propose.q(1)); - EXPECT_FLOAT_EQ(0.42903179, z_propose.q(2)); + EXPECT_FLOAT_EQ(0.8330583, z_propose.q(0)); + EXPECT_FLOAT_EQ(-0.8330583, z_propose.q(1)); + EXPECT_FLOAT_EQ(0.8330583, z_propose.q(2)); - EXPECT_FLOAT_EQ(-1.4385087, z_propose.p(0)); - EXPECT_FLOAT_EQ(1.4385087, z_propose.p(1)); - EXPECT_FLOAT_EQ(-1.4385087, z_propose.p(2)); + EXPECT_FLOAT_EQ(-1.1836562, z_propose.p(0)); + EXPECT_FLOAT_EQ(1.1836562, z_propose.p(1)); + EXPECT_FLOAT_EQ(-1.1836562, z_propose.p(2)); EXPECT_EQ(8, n_leapfrog); EXPECT_FLOAT_EQ(3.7645235, ave); @@ -79,7 +79,7 @@ TEST(McmcUnitEXHMC, build_tree) { } TEST(McmcUnitEXHMC, transition) { - stan::rng_t base_rng = stan::services::util::create_rng(483294, 0); + stan::rng_t base_rng = stan::services::util::create_rng(4832942, 0); stan::mcmc::softabs_point z_init(3); z_init.q(0) = 1; @@ -112,7 +112,7 @@ TEST(McmcUnitEXHMC, transition) { EXPECT_FLOAT_EQ(-1, s.cont_params()(1)); EXPECT_FLOAT_EQ(1, s.cont_params()(2)); EXPECT_FLOAT_EQ(-1.5, s.log_prob()); - EXPECT_FLOAT_EQ(0.99993229, s.accept_stat()); + EXPECT_FLOAT_EQ(0.99870497, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); diff --git a/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp b/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp index 0f9dcbb8dd..61639c3247 100644 --- a/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp +++ b/src/test/unit/mcmc/hmc/xhmc/unit_e_xhmc_test.cpp @@ -58,13 +58,13 @@ TEST(McmcUnitEXHMC, build_tree) { EXPECT_FLOAT_EQ(1.4131583, sampler.z().p(1)); EXPECT_FLOAT_EQ(-1.4131583, sampler.z().p(2)); - EXPECT_FLOAT_EQ(0.65928948, z_propose.q(0)); - EXPECT_FLOAT_EQ(-0.65928948, z_propose.q(1)); - EXPECT_FLOAT_EQ(0.65928948, z_propose.q(2)); + EXPECT_FLOAT_EQ(0.11940599, z_propose.q(0)); + EXPECT_FLOAT_EQ(-0.11940599, z_propose.q(1)); + EXPECT_FLOAT_EQ(0.11940599, z_propose.q(2)); - EXPECT_FLOAT_EQ(-1.2505695, z_propose.p(0)); - EXPECT_FLOAT_EQ(1.2505695, z_propose.p(1)); - EXPECT_FLOAT_EQ(-1.2505695, z_propose.p(2)); + EXPECT_FLOAT_EQ(-1.408289, z_propose.p(0)); + EXPECT_FLOAT_EQ(1.408289, z_propose.p(1)); + EXPECT_FLOAT_EQ(-1.408289, z_propose.p(2)); EXPECT_EQ(8, n_leapfrog); EXPECT_FLOAT_EQ(4.2207355, ave); @@ -79,7 +79,7 @@ TEST(McmcUnitEXHMC, build_tree) { } TEST(McmcUnitEXHMC, transition) { - stan::rng_t base_rng = stan::services::util::create_rng(483294, 0); + stan::rng_t base_rng = stan::services::util::create_rng(4832942, 0); stan::mcmc::unit_e_point z_init(3); z_init.q(0) = 1; @@ -112,7 +112,7 @@ TEST(McmcUnitEXHMC, transition) { EXPECT_FLOAT_EQ(-1, s.cont_params()(1)); EXPECT_FLOAT_EQ(1, s.cont_params()(2)); EXPECT_FLOAT_EQ(-1.5, s.log_prob()); - EXPECT_FLOAT_EQ(0.99994934, s.accept_stat()); + EXPECT_FLOAT_EQ(0.99870926, s.accept_stat()); EXPECT_EQ("", debug.str()); EXPECT_EQ("", info.str()); EXPECT_EQ("", warn.str()); From 8fbfd798f127d99b1882aa2216942ca1966b1c99 Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Tue, 21 May 2024 02:07:52 -0400 Subject: [PATCH 88/93] Updates the Math submodule to b12cfbdeb0. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 814d915905..b12cfbdeb0 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 814d91590585f52f67a1d601f5d71d4f1097c99b +Subproject commit b12cfbdeb007c77bcc8d70b31b04c9f395bfa558 From 62b2a19ebbb9efa3778b5627651093be7ad90fca Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Wed, 22 May 2024 02:05:53 -0400 Subject: [PATCH 89/93] Updates the Math submodule to 8e76f01fa0. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index b12cfbdeb0..8e76f01fa0 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit b12cfbdeb007c77bcc8d70b31b04c9f395bfa558 +Subproject commit 8e76f01fa078f27f2bff0e259fca3931da86c942 From c746ad2f9455d5abc15551e07e7273e1bb3c97ac Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Thu, 23 May 2024 07:08:38 -0400 Subject: [PATCH 90/93] Updates the Math submodule to ce63b87b13. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index 8e76f01fa0..ce63b87b13 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit 8e76f01fa078f27f2bff0e259fca3931da86c942 +Subproject commit ce63b87b1301ea0406b8dab1654f666b643693c8 From 3cf3d9ea15705519966ff27f8ceeeaaaa877011f Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Fri, 24 May 2024 11:25:32 -0400 Subject: [PATCH 91/93] Updates the Math submodule to e1fcbe8dca. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index ce63b87b13..e1fcbe8dca 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit ce63b87b1301ea0406b8dab1654f666b643693c8 +Subproject commit e1fcbe8dca2bfa85b1e109b2bfb1cf65fe0363b7 From 2e394bbc0d1d564c9aa32b873f4cb6bf3c48dd7b Mon Sep 17 00:00:00 2001 From: Stan Jenkins Date: Mon, 3 Jun 2024 10:32:51 -0400 Subject: [PATCH 92/93] Updates the Math submodule to 8a09048f51. --- lib/stan_math | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stan_math b/lib/stan_math index e1fcbe8dca..8a09048f51 160000 --- a/lib/stan_math +++ b/lib/stan_math @@ -1 +1 @@ -Subproject commit e1fcbe8dca2bfa85b1e109b2bfb1cf65fe0363b7 +Subproject commit 8a09048f5187662687e04c14d7737cf4d20a18a1 From d94c86f5a770da6ca7060c247242d14ec277a940 Mon Sep 17 00:00:00 2001 From: Nicusor Serban Date: Mon, 3 Jun 2024 16:34:54 +0200 Subject: [PATCH 93/93] Add release notes for v2.35.0 --- RELEASE-NOTES.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 302667a1f4..f1d6a1c990 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -5,6 +5,17 @@ Note: these are the release notes for the stan-dev/stan repository. Further changes may arise at the interface level (stan-dev/{rstan, pystan, cmdstan}) and math library level (stan-dev/math). +v2.35.0 (3 June 2024) +====================================================================== + + - The algorithms no longer catch `std::exception` unconditionally. The Math library uses `std::domain_error` for recoverable errors, and these are the ones which are caught. (#3259) + - Allow laplace sampling without evaluating `log_prob` for each draw. (#3261) + - Allow laplace sampling to save the Hessian as a diagnostic output. (#3261) + - Stan's RNG usages now uses a type definition `stan::rng_t` rather than hard coding a specific Boost RNG. (#3263) + - Switched the pRNG used by default in the services and tests to be `boost::mixmax`. Note that this means seeds from previous versions will lead to different numerical results in this version. (#3264) + - Add a new ranked R-hat diagnostic from [Vehtari](https://arxiv.org/abs/1903.08008). (#3266) + - Fixed an issue where Pathfinder would sometimes return more draws than requested. (#3279) + v2.34.1 (23 January 2024) ======================================================================