Skip to content

Commit

Permalink
Populate m_all_sample_params
Browse files Browse the repository at this point in the history
  • Loading branch information
apulsipher committed Dec 16, 2024
1 parent 1c86fd0 commit a1a79ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions epiworld.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1884,6 +1884,7 @@ inline void LFMCMC<TData>::run(
m_current_accepted_stats.resize(m_n_stats);
m_all_sample_drawn_prob.resize(m_n_samples);
m_all_sample_acceptance.resize(m_n_samples, false);
m_all_sample_params.resize(m_n_samples * m_n_params);
m_all_sample_stats.resize(m_n_samples * m_n_stats);
m_all_sample_kernel_scores.resize(m_n_samples);

Expand All @@ -1906,6 +1907,9 @@ inline void LFMCMC<TData>::run(

for (size_t k = 0u; k < m_n_params; ++k)
m_all_accepted_params[k] = m_initial_params[k];

for (size_t k = 0u; k < m_n_params; ++k)
m_all_sample_params[k] = m_initial_params[k];

// Init progress bar
progress_bar = Progress(m_n_samples, 80);
Expand Down Expand Up @@ -1937,6 +1941,9 @@ inline void LFMCMC<TData>::run(
m_all_sample_kernel_scores[i] = hr;

// Storing data
for (size_t k = 0u; k < m_n_params; ++k)
m_all_sample_params[i * m_n_params + k] = m_current_proposed_params[k];

for (size_t k = 0u; k < m_n_stats; ++k)
m_all_sample_stats[i * m_n_stats + k] = m_current_proposed_stats[k];

Expand Down
7 changes: 7 additions & 0 deletions include/epiworld/math/lfmcmc/lfmcmc-meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ inline void LFMCMC<TData>::run(
m_current_accepted_stats.resize(m_n_stats);
m_all_sample_drawn_prob.resize(m_n_samples);
m_all_sample_acceptance.resize(m_n_samples, false);
m_all_sample_params.resize(m_n_samples * m_n_params);
m_all_sample_stats.resize(m_n_samples * m_n_stats);
m_all_sample_kernel_scores.resize(m_n_samples);

Expand All @@ -265,6 +266,9 @@ inline void LFMCMC<TData>::run(

for (size_t k = 0u; k < m_n_params; ++k)
m_all_accepted_params[k] = m_initial_params[k];

for (size_t k = 0u; k < m_n_params; ++k)
m_all_sample_params[k] = m_initial_params[k];

// Init progress bar
progress_bar = Progress(m_n_samples, 80);
Expand Down Expand Up @@ -296,6 +300,9 @@ inline void LFMCMC<TData>::run(
m_all_sample_kernel_scores[i] = hr;

// Storing data
for (size_t k = 0u; k < m_n_params; ++k)
m_all_sample_params[i * m_n_params + k] = m_current_proposed_params[k];

for (size_t k = 0u; k < m_n_stats; ++k)
m_all_sample_stats[i * m_n_stats + k] = m_current_proposed_stats[k];

Expand Down

0 comments on commit a1a79ed

Please sign in to comment.