RAPLER / dst-1

Combine basic probability assignments with Dempster's rule of combination
6 stars 3 forks source link

bcaTrunc cannot be called as a function #6

Closed garyzhubc closed 1 year ago

garyzhubc commented 1 year ago

bcaTrunc cannot be called as a function

image

RAPLER commented 1 year ago

Go to the link I have given you ( https://github.com/RAPLER/dst-1/releases/tag/v1.5.1.9002). Look for the assets and download the source code that suits you. (.zip or .tar.gz file). After that, go to RStudio (I suppose you use this), choose Install packages and choose Install from Package Archive (instead of Repository). Then select the file you just downloaded and the package will be installed in your library.

Le mar. 4 avr. 2023 à 22:18, Peiyuan Zhu @.***> a écrit :

bcaTrunc cannot be called as a function

[image: image] https://user-images.githubusercontent.com/30366447/229964051-3c9561d9-4ebc-4fff-b575-6cecf485fd27.png

— Reply to this email directly, view it on GitHub https://github.com/RAPLER/dst-1/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5D5IKIQFHBHXMVTV7DLFTW7TI77ANCNFSM6AAAAAAWTPA3JI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

garyzhubc commented 1 year ago

Still can't use it. But I can use ?bcaTrunc to see the documentation. Unfortunately not called as as function.

RAPLER commented 1 year ago

Bug removed. Use this command to install the package from GitHub (you must install devtools package first if not on your machine already)

devtools::install_github("RAPLER/dst-1")

Le sam. 15 avr. 2023 à 19:33, Peiyuan Zhu @.***> a écrit :

Still can't use it. But I can use ?bcaTrunc to see the documentation. Unfortunately not called as as function.

— Reply to this email directly, view it on GitHub https://github.com/RAPLER/dst-1/issues/6#issuecomment-1510000605, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5D5IPRN344DO5P3M5DKRLXBMV5NANCNFSM6AAAAAAWTPA3JI . You are receiving this because you commented.Message ID: @.***>

garyzhubc commented 1 year ago

Thanks! Now it at least seems to work on a reasonable number of samples.

It now asks me to use nzdsr in the end when I call belplau. What does the entail? Would you recommend normalizing every iteration or just doing that in the end, or does it even matter?

RAPLER commented 1 year ago

D-S Theory works this way:

We define a set of possibilities F to work on, what is also called a frame of discernment in Shafer's vocabulary.

In your context, the set of possibilities is the set of 2789 SNPs. When we combine subsets of the set F some intersections may give the empty set may as a result. When this is the case, we recalculate the mass values obtained by dividing the mass value of the non-empty subsets by 1 minus the mass of the empty set. This is what the function "nzdsr" do.

The normalization is part of Dempster's rule of combination. Normalizing means that we stay in our closed world of the set of 2789 SNPs. In the closed world assumption, a empty set with non-zero mass cannot exist,so that m(ø) = 0. Hence the necessary normalization.

Some researchers do not require m(ø) = 0. This the open world assumption, meaning that our set of possibilities may be incomplete, that something is missing.

Assuming you are fine with the closed world assumption, normalization has to be done to complete Dempster's Rule.

Now, it is not necessary to normalize at each step, only at the end. The result is the same. That,s why I have separated the two operations with the two functions, dsrwon and nzdsr.

The only difference is in the way we compute the measure of contradiction between pieces of evidence. Suppose we combine bca's r1, r2, ..., rk. If we normalize at each step with function nzdsr, a global measure of conflict (C) for k steps is obtained by:

C = 1-(1-r1$con)*(1-r2$con)...(1-rk$con).

If instead we normalize only one time (at the end of the combinations), the same global measure C will be obtained.

The value C is a measure of the degree of contradiction between the bca's you have combined.

Claude

Le mar. 18 avr. 2023 à 15:28, Peiyuan Zhu @.***> a écrit :

Thanks! Now it at least seems to work on a reasonable number of samples.

It now asks me to use nzdsr in the end when I call belplau. What does the entail? Would you recommend normalizing every iteration or just doing that in the end, or does it even matter?

— Reply to this email directly, view it on GitHub https://github.com/RAPLER/dst-1/issues/6#issuecomment-1513687342, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5D5IIAXD2A5ZQPHGUTTI3XB3TNJANCNFSM6AAAAAAWTPA3JI . You are receiving this because you commented.Message ID: @.***>

garyzhubc commented 1 year ago

So it created a lot of conflict in the end. We'll need to think of how to resolve the conflict.

RAPLER commented 1 year ago

If you have a high degree of conflict, I think this is an indication that you need to rethink the way you model the data. From what I understand, the degree of conflict only reflect that you have two opposite groups of data. More you will incorporate data, more you will approach total conflict.

RAPLER commented 1 year ago

This issue seems resolved to me. Is that so?

garyzhubc commented 1 year ago

Yes, this has been resolved. I ended up using smaller mass assignment to the subsets that are not the whole set, so the conflicts ended up not piling up as fast.