# NOT RUN {
# Procrustean version followed by clustering
blsm_obj = estimate_latent_positions(example_adjacency_matrix,
burn_in = 3*10^4, nscan = 10^5, dynamic_plot = TRUE)
avg_latent_positions = rowMeans(blsm_obj$Iterations, dims=2)
h_cl = hclust(dist(avg_latent_positions), method="complete")
n = 3
latent_space_clusters = cutree(h_cl, k=n)
print(latent_space_clusters)
plot(avg_latent_positions, col=rainbow(n)[latent_space_clusters], pch=20)
# Non-Procrustean version followed by clustering
blsm_obj_2 = estimate_latent_positions(example_adjacency_matrix, procrustean=FALSE,
burn_in = 3*10^4, nscan = 10^5)
avg_latent_distances = rowMeans(blsm_obj_2$Iterations, dims=2)
h_cl = hclust(as.dist(avg_latent_distances), method="complete")
n = 3
latent_space_clusters_2 = cutree(h_cl, k=n)
print(latent_space_clusters_2)
# Weighted network
blsm_obj_3 = estimate_latent_positions(example_adjacency_matrix, example_weights_matrix,
burn_in = 10^5, nscan = 2*10^5, dynamic_plot = TRUE)
# }
Run the code above in your browser using DataLab