idem-lab / map-ir-pipeline

Prototype demonstration of stacked generalisation method used in https://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.3000633#sec010
3 stars 1 forks source link

write a test to ensure emplogit / invlogit pairs return the same data #86

Open njtierney opened 2 weeks ago

njtierney commented 2 weeks ago

E.g.,

vec_n <- rpois(10, 5) + 1
vec_y <- round(vec_n * runif(10))
emplogit2(vec_y, vec_n)
res <- emplogit2(vec_y, vec_n) |> inv_emplogit2(vec_n)
res2 <- emplogit2(vec_y, vec_n) |> invelogit(vec_n)
dplyr::near(vec_y, res)
plot(res, res2)