Skip to content

Commit 80f82cd

Browse files
committed
minor sampling bugfix
minor bug where double calculations were occurring, causing small slow down
1 parent a437a68 commit 80f82cd

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

data/mcmc_results.rda

110 KB
Binary file not shown.

src/chain.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "chain.h"
2+
23
#include "mcmc_utils.h"
34
#include "sampler.h"
45

@@ -225,13 +226,6 @@ void Chain::update_p(int iteration)
225226
}
226227

227228
auto prev_p = p[j];
228-
229-
for (int ii = 0; ii < genotyping_data.num_samples; ++ii)
230-
{
231-
calculate_genotype_likelihood(ii, j);
232-
}
233-
double new_llik2 = calc_new_likelihood();
234-
235229
p[j] = prop_p;
236230

237231
for (int ii = 0; ii < genotyping_data.num_samples; ++ii)
@@ -564,7 +558,6 @@ void Chain::initialize_likelihood()
564558
{
565559
int num_samples = genotyping_data.num_samples;
566560
int num_loci = genotyping_data.num_loci;
567-
int sampling_depth = params.importance_sampling_depth;
568561
int row_idx, idx;
569562

570563
genotyping_llik_new.resize(num_samples * num_loci);

src/parameters.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ class Parameters
1313
int burnin;
1414
int samples;
1515
long int complexity_limit;
16-
long int importance_sampling_depth;
17-
long int importance_sampling_scaling_factor;
1816

1917
// Model Parameters
2018
// Complexity of Infection

0 commit comments

Comments
 (0)