I'm constructing a crude measure to gauge the similarity between any pairs of objects across multiple dimensions (or categories (for example, they can be percentages of GDP across economic sectors or students' grades in multiple subjects)).

Some potential candidates I have in mind are latent topics approach from the LDA (Latent Dirichlet Allocation), which assign (non-zero) probabilities for each unit across a list of K clusters, and word2vec that measures the similarity between any two corpora based on the vectorized scores of their texts. But given that the objects I want to deal are NOT text data and they usually have a fixed number of categories (e.g., academy subjects, economic sectors) with bounded distribution (say between 0 and 100). I wonder what will be a more appropriate measure for this task? A measure between 0 and 1 will be ideal.

Also, I want to do this in a pairwise manner, so that for each unit from a total of N units, the similarity measure is calculated for each unit in comparison to the rest of the N-1 units. For example, s11 (which is just 1), s12, s13, s14, their scores may be different from s21, s22, s23, s24, so on and so forth. Eventually, I want to re-arrange it into an N times N matrix for further processing.

At below, I provide export statistics (% share of 4 main commodity categories from 4 WTO members) in R as an example, hoping to use this example to find a way to (1) construct a measure for comparing trade (export) profile similarity between any country pairs and (2) arrange the output into a 4 by 4 matrix.

profile = data.frame("country" = c("Afghanistan", "Albania", "Belgium", "Canada"),

"Agricultural products"=c(65.8, 11, 10.9, 15.3), "Manufactures" = c(5.9, 69.7, 75.7, 47.9), "Fuels and mining products" = c(1, 19.2, 12.6, 29), "Others"=c(27.3, 0.7, 0.9, 7.8) )


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.