From 2231672fb07eef72a8432667b3fc7c38e5f8cb44 Mon Sep 17 00:00:00 2001 From: Paul-Corbalan <58653590+Paul-Corbalan@users.noreply.github.com> Date: Tue, 12 Apr 2022 17:26:00 +0200 Subject: [PATCH] Add Elisa ScoreDistrib code --- Comparaison_of_methods.rmd | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Comparaison_of_methods.rmd b/Comparaison_of_methods.rmd index 31047f4..f61dcc9 100644 --- a/Comparaison_of_methods.rmd +++ b/Comparaison_of_methods.rmd @@ -278,6 +278,25 @@ ScoreDistrib <- function(lambda0, lambda1, NbSeq, T){ P_X = P_X/sum(table(X)) return (list("X" = X, "P_X" = P_X)) +``` + +```{r} +ScoreDistribElisa <- function(lambda0, lambda1, NbSeq, T){ + E = ComputeE(lambda0, lambda1) + + score_max=floor(E*log(lambda1/lambda0)) + + ## score_min compute + score_min_c=floor(E*log(lambda1/lambda0)+E*(lambda0-lambda1)*T) + + l=seq(score_min_c,score_max,1) + borne_inf=(l-E*log(lambda1/lambda0))/(E*(lambda0-lambda1)) + borne_sup=(l+1-E*log(lambda1/lambda0))/(E*(lambda0-lambda1)) + proba.l=pexp(rate=lambda0,borne_inf)-pexp(rate=lambda0,borne_sup) + S=sum(proba.l) + new.proba.s=proba.l/S + + return (list("X" = l, "P_X" = new.proba.s)) } ```