Learn R Programming

Perc (version 0.1.6)

simRankOrder: Find rank order using simulated annealing

Description

simRankOrder find the rank order for the win-loss relationship

Usage

simRankOrder(data, num = 10, alpha = NULL, kmax = 1000)

Arguments

data

a matrix. the win-loss probability matrix which is the second element of the output from conductance

num

number of SimAnnealing (default is set at 10)

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(\alpha c_{i,j} +\beta, c_{i,j}+\beta)\). In the absence of expertise to accurately estimate alpha, it is estimated from the data.

kmax

an integer between 2 to 1000, indicating the number of simulations in each SimAnnealing.

Value

a list of two dataframes.

BestSimulatedRankOrder

a dataframe representing the best simulated rank order.

Costs

the cost of each simulated annealing run

AllSimulatedRankOrder

a dataframe representing all simulated rank orders.

References

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

See Also

conductance transitivity

Examples

Run this code
# NOT RUN {
# convert an edgelist to conflict matrix
confmatrix <- as.conflictmat(sampleEdgelist)
# find dominance probability matrix
perm2 <- conductance(confmatrix, maxLength = 2)
# }
# NOT RUN {
# Note: It takes a while to run the simRankOrder example.
s.rank <- simRankOrder(perm2$p.hat, num = 10, kmax = 1000)
s.rank$BestSimulatedRankOrder
s.rank$Costs
s.rank$AllSimulatedRankOrder
# }

Run the code above in your browser using DataLab