On 6/3/2015 11:26 AM, Boris Steipe wrote:
If letters 1 and 2 must be equal with p=0.5, and 1 and 3 must be equal with
p=0.5, then letter 1 must be the same as either 2 or 3. Therefore:
Choose a letter.
Make a pair of (letter, (not letter)).
Reverse the pair with p = 0.5
Concatenate your letter
If letters 1 and 2 must be equal with p=0.5, and 1 and 3 must be equal with
p=0.5, then letter 1 must be the same as either 2 or 3. Therefore:
Choose a letter.
Make a pair of (letter, (not letter)).
Reverse the pair with p = 0.5
Concatenate your letter and the pair.
Is that what you need?
B.
Hi Ben,
While Jean's answer looks correct, I think that there is something
amiss with your specification of the problem. You have eight
combinations in your "possibilities". So if you draw samples "x"
where:
If p(x = possibilities[1,] | possibilities[5,]) = 0.5 AND
p(x = possibilities[2,] | possi
Ben,
Perhaps I am missing something, but couldn't you simply reduce your
possibilities to:
possibilities[c(1, 5, 2, 4), ]
Var1 Var2 Var3
[1,] "A" "A" "C"
[2,] "A" "A" "T"
[3,] "C" "A" "C"
[4,] "C" "G" "C"
If you sample from these four rows you will have a 50% chance that Var1 and
Va
Dear R-List,
I have a set of possibilities I want to sample from:
bases <- list(c('A', 'C'), c('A', 'G'), c('C', 'T'))
possibilities <- as.matrix(expand.grid(bases))
>possibilities
Var1 Var2 Var3
[1,] "A" "A" "C"
[2,] "C" "A" "C"
[3,] "A" "G" "C"
[4,] "C" "G" "C"
[5,] "A" "A" "T"
[6,]
5 matches
Mail list logo