Add Elisa ScoreDistrib code

This commit is contained in:
Paul-Corbalan 2022-04-12 17:26:00 +02:00
parent 2d48ff6db8
commit 2231672fb0
1 changed files with 19 additions and 0 deletions

View File

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