swh:1:snp:2c68a6c5a8af2f06ac2c0225927f25b54fd1f9d0
Raw File
Tip revision: d73e4a2afcfbd6402c11716877e8f7466f309ef4 authored by Dominique Makowski on 22 October 2020, 13:40:02 UTC
version 0.7.5
Tip revision: d73e4a2
test-mhdior.R
context("mhdior")

test_that("mhdior", {
  testthat::expect_equal(as.numeric(mhdior(x = distribution_normal(1000, mean = 5, sd = 1), range = c(-0.1, 0.1))), 1, tolerance = 0.01)
  testthat::expect_equal(as.numeric(mhdior(x = distribution_normal(1000, mean = 1, sd = 1), range = c(-0.1, 0.1))), 0.631, tolerance = 0.01)
  testthat::expect_equal(as.numeric(mhdior(x = distribution_normal(1000, mean = -1, sd = 1), range = c(-0.1, 0.1))), 0.631, tolerance = 0.01)
  testthat::expect_equal(as.numeric(mhdior(x = distribution_normal(1000, mean = 0, sd = 1), range = c(-0.1, 0.1))), -0.079, tolerance = 0.01)
  testthat::expect_equal(as.numeric(mhdior(x = distribution_normal(1000, mean = 0, sd = 0.01), range = c(-0.1, 0.1))), -1, tolerance = 0.01)
})
back to top