Skip to content

Commit

Permalink
only use iHS for the statistic
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstaab committed Jun 10, 2015
1 parent 23b8bcc commit 33303a8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: jaatha
Version: 2.99.0.9030
Date: 2015-04-22
Version: 2.99.0.9100
Date: 2015-06-10
License: GPL (>= 3)
Title: Simulation Based Parameter Estimation in a Frequentistic Framework
Authors@R: c(
Expand Down
2 changes: 1 addition & 1 deletion R/jaatha.R
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Jaatha.initialize <- function(data, model, cores=1, scaling_factor=1,
# --- iHH Summary Statistic -------------------------------------
else if ("sumstat_ihh" %in% class(sumstat)) {
sumstats[[name]] <- Stat_Ihh$new(seg_sites, model,
sumstat, c(.5, .75, .95))
sumstat, c(.25, .5, .75, .95))
}

# --- Omega" Summary Statistic ----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion R/sum_stat_cube.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Stat_Cube <- R6Class("Stat_Cube", inherit = Stat_PoiInd,
Stat_Ihh <- R6Class("Stat_Ihh", inherit = Stat_Cube,
public = list(
to_matrix = function(value) {
do.call(rbind, lapply(value, function(x) rowMeans(x)))
do.call(rbind, lapply(value, function(x) max(x[ , 3])))
}
)
)
Expand Down
10 changes: 9 additions & 1 deletion tests/testthat/test-sumstat-cubes.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
context("SumStat Cubes")

test_that("initialization of iHH sumstat works", {
if (!requireNamespace("rehh", quietly = TRUE)) skip("rehh not installed")
skip_if_not_installed("rehh")
stat <- coala::sumstat_ihh(position = .5)
ihh = Stat_Ihh$new(sumstat_tt$seg_sites, dm_tt, stat, c(.1, .5, .9))
expect_that(ihh$get_data(), is_a("integer"))
expect_that(ihh$get_data(), is_a("integer"))
expect_that(sum(ihh$get_data()), is_more_than(0))
expect_that(ihh$get_breaks(), is_a("list"))
expect_equal(length(ihh$get_breaks()), 1)

stat <- coala::sumstat_ihh()
ihh = Stat_Ihh$new(sumstat_tt$seg_sites, dm_tt, stat, c(.1, .5, .9))
expect_that(ihh$get_data(), is_a("integer"))
expect_that(ihh$get_data(), is_a("integer"))
expect_that(sum(ihh$get_data()), is_more_than(0))
expect_that(ihh$get_breaks(), is_a("list"))
expect_equal(length(ihh$get_breaks()), 1)
})


Expand Down

0 comments on commit 33303a8

Please sign in to comment.