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)) } ```