Skip to content

Commit b694d80

Browse files
authored
fix: fix in calculate_credible_set_log10bf (#868)
1 parent c252dcb commit b694d80

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/gentropy/dataset/study_locus.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,11 +553,14 @@ def calculate_credible_set_log10bf(cls: type[StudyLocus], logbfs: Column) -> Col
553553
+------------------+
554554
|credibleSetlog10BF|
555555
+------------------+
556-
| 1.4765565|
556+
| 0.6412604|
557557
+------------------+
558558
<BLANKLINE>
559559
"""
560-
logsumexp_udf = f.udf(lambda x: get_logsum(x), FloatType())
560+
# log10=log/log(10)=log*0.43429448190325176
561+
logsumexp_udf = f.udf(
562+
lambda x: (get_logsum(x) * 0.43429448190325176), FloatType()
563+
)
561564
return logsumexp_udf(logbfs).cast("double").alias("credibleSetlog10BF")
562565

563566
@classmethod

0 commit comments

Comments
 (0)