Add Elisa ScoreDistrib code
This commit is contained in:
parent
2d48ff6db8
commit
2231672fb0
|
@ -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))
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue