conductance: compute win-loss probabilities

Description Usage Arguments Details Value References See Also Examples

View source: R/conductance.R

Description

conductance compute win-loss probabilities for all possible pairs based upon the combined information from directed wins/losses and indirect win/loss pathways from the network.

Usage

1
conductance(conf, maxLength, alpha = NULL, beta = 1, strict = FALSE)

Arguments

conf

a matrix of conf.mat class. An N-by-N conflict matrix whose (i,j)th element is the number of times i defeated j.

maxLength

an integer greater than 1 and less than 7, indicating the maximum length of paths to identify.

alpha

a positive integer that reflects the influence of an observed win/loss interaction on an underlying win-loss probability. It is used in the calculation of the posterior distribution for the win-loss probability of i over j: Beta(α c_{i,j} +β, c_{i,j}+β). In the absence of expertise to accurately estimate alpha, it is estimated from the data.

beta

a positive numeric value that, like alpha, reflects the influence of an observed win/loss interaction on an underlying win-loss probability. Both α and β are chosen such that ((α + β)/(α + 2β))^2 is equal to the order-1 transitivity of the observed network. Therefore, β is commonly set to 1.

strict

a logical vector of length 1. It is used in transitivity definition for alpha estimation. It should be set to TRUE when a transitive triangle is defined as all pathways in the triangle go to the same direction; it should be set to FALSE when a transitive triangle is defined as PRIMARY pathways in the triangle go to the same direction. Strict = FALSE by default.

Details

This function performs two major steps. First, repeated random walks through the empirical network identify all possible directed win-loss pathways between each pair of nodes in the network. Second, the information from both direct wins/losses and pathways of win/loss interactions are combined into an estimate of the underlying probability of i over j, for all ij pairs.

Value

a list of two elements.

imputed.conf

An N-by-N conflict matrix whose (i,j)th element is the 'effective' number of wins of i over j.

p.hat

An N-by-N numeric matrix whose (i,j)th element is the estimated win-loss probability. Three functions (valueConverter, individualDomProb, and dyadicLongConverter) are provided to convert win-loss probability into other formats that are easier for further analysis of win-loss probability.

References

Fushing H, McAssey M, Beisner BA, McCowan B. 2011. Ranking network of a captive rhesus macaque society: a sophisticated corporative kingdom. PLoS ONE 6(3):e17817.

See Also

as.conflictmat, findIDpaths, transitivity, simRankOrder

Examples

1
2
3
4
5
6
# convert an edgelist to conflict matrix
confmatrix <- as.conflictmat(sampleEdgelist)
# find win-loss probability matrix
perm2 <- conductance(confmatrix, 2, strict = FALSE)
perm2$imputed.conf
perm2$p.hat

Example output

             Kalani        Kale   Kalleigh      Keira    Kibitz     Kimora
Kalani   0.00000000  0.00000000  0.0000000 0.00000000 0.0000000 0.00000000
Kale     0.00000000  0.00000000  0.0000000 0.00000000 4.0557534 0.00000000
Kalleigh 0.05575338  1.00000000  0.0000000 0.11150676 0.2230135 1.11150676
Keira    0.00000000  0.00000000  0.0000000 0.00000000 0.0000000 0.00000000
Kibitz   0.00000000  6.05575338  0.0000000 0.05575338 0.0000000 0.05575338
Kimora   0.05575338  0.05575338  0.1115068 0.05575338 1.0000000 0.00000000
Kioga    0.05575338  0.05575338  3.1115068 1.05575338 0.1672601 7.11150676
Kolyma   0.00000000 17.05575338  0.0000000 0.00000000 6.0557534 0.00000000
Koppy    1.00000000  0.05575338 11.1115068 0.11150676 0.1115068 0.16726014
Kuai     0.05575338  0.11150676 12.0557534 0.05575338 3.0557534 0.11150676
Kyushu   0.00000000  0.05575338  0.1115068 1.05575338 1.1115068 8.05575338
              Kioga      Kolyma     Koppy        Kuai      Kyushu
Kalani   0.00000000  0.00000000 0.0000000  0.00000000  0.00000000
Kale     0.00000000  7.05575338 0.0000000  0.00000000  0.05575338
Kalleigh 1.16726014  0.05575338 5.1672601  6.16726014  1.16726014
Keira    0.00000000  0.00000000 0.0000000  0.00000000  0.00000000
Kibitz   0.05575338 18.05575338 0.0000000  0.05575338  1.00000000
Kimora   2.05575338  0.05575338 1.0557534  0.11150676  0.16726014
Kioga    0.00000000  0.00000000 1.1672601  2.16726014 10.16726014
Kolyma   0.00000000  0.00000000 0.0000000  0.00000000  0.05575338
Koppy    3.11150676  0.00000000 0.0000000 10.16726014  1.16726014
Kuai     0.16726014  0.05575338 5.0557534  0.00000000  3.16726014
Kyushu   9.05575338  0.05575338 0.1672601  4.05575338  0.00000000
attr(,"class")
[1] "conf.mat" "matrix"  
            Kalani      Kale  Kalleigh     Keira    Kibitz    Kimora     Kioga
Kalani   0.0000000 0.5000000 0.4236125 0.5000000 0.5000000 0.4236125 0.4236125
Kale     0.5000000 0.0000000 0.1180829 0.5000000 0.4040371 0.4236125 0.4236125
Kalleigh 0.5763875 0.8819171 0.0000000 0.6325280 0.7095211 0.8263286 0.2881139
Keira    0.5000000 0.5000000 0.3674720 0.0000000 0.4236125 0.4236125 0.1132596
Kibitz   0.5000000 0.5959629 0.2904789 0.5763875 0.0000000 0.1541064 0.3952394
Kimora   0.5763875 0.5763875 0.1736714 0.5763875 0.8458936 0.0000000 0.2332463
Kioga    0.5763875 0.5763875 0.7118861 0.8867404 0.6047606 0.7667537 0.0000000
Kolyma   0.5000000 0.7047444 0.4236125 0.5000000 0.2543067 0.4236125 0.5000000
Koppy    0.8819171 0.5763875 0.6791736 0.6325280 0.6325280 0.2100593 0.7118861
Kuai     0.5763875 0.6325280 0.6588720 0.5763875 0.9385078 0.5000000 0.1217430
Kyushu   0.5000000 0.5000000 0.1675738 0.8867404 0.5230320 0.9622779 0.4715468
            Kolyma     Koppy       Kuai    Kyushu
Kalani   0.5000000 0.1180829 0.42361253 0.5000000
Kale     0.2952556 0.4236125 0.36747202 0.5000000
Kalleigh 0.5763875 0.3208264 0.34112804 0.8324262
Keira    0.5000000 0.3674720 0.42361253 0.1132596
Kibitz   0.7456933 0.3674720 0.06149216 0.4769680
Kimora   0.5763875 0.7899407 0.50000000 0.0377221
Kioga    0.5000000 0.2881139 0.87825704 0.5284532
Kolyma   0.0000000 0.5000000 0.42361253 0.5000000
Koppy    0.5000000 0.0000000 0.66454550 0.8041909
Kuai     0.5763875 0.3354545 0.00000000 0.4410203
Kyushu   0.5000000 0.1958091 0.55897968 0.0000000

Perc documentation built on May 12, 2021, 1:08 a.m.