verbal-autopsy-software / Tariff

R package of Tariff method for VA
0 stars 4 forks source link

Question: Ranking steps unclear #18

Open mjutras-mitre opened 5 years ago

mjutras-mitre commented 5 years ago

The paper documenting this algorithm does not provide details for the ranking process. What is the pseudocode for this part of the algorithm? At a first glance it appears this code (as well as the code leading up to calling this code) may be able to be simplified.

https://github.com/verbal-autopsy-software/Tariff/blob/2324381cf330fc82f6022a950e7579fdee413271/Tariff/R/Tariff.r#L153-L176

richardli commented 5 years ago

loop over i, j, do the following:

  1. score = mat[i, j]
  2. rank = the rank of score in the vector of c(score, all[, i]) (in decreasing orders)
  3. mat[i, j] = rank