justyna justyna - 3 months ago 10
R Question

Weighted degree according to Opsahl et al. (2010)

I want to calculate weighted degree for a network that I am working with. To do so, I want to use the

degree_w
function proposed by Opsahl et al. (2010). Before using it with my network, I wanted to play with it a little bit with a toy model to get a better feel for it. However, it turned out that no matter what I choose for the tuning parameter alpha,
degree_w
remains insensitive to it. When I calculate it with
alpha = 1
I get the same values as for standard
degree
(which is expected). The problem is that when I try to use
alpha = 0.5
or
alpha = 1.5
the values don't change. Can someone tell me what I am doing wrong?

Here is my model:

library("tnet")
net <- cbind(c(1,1,2,2,2,3), c(2,3,3,4,5,2), c(2,1,2,1,3,2))
degree_w(net, alpha = 1.0)
node degree output
[1,] 1 2 3
[2,] 2 3 6
[3,] 3 1 2
[4,] 4 0 0
[5,] 5 0 0
> degree_w(net, alpha = 1.5)
node degree output
[1,] 1 2 3
[2,] 2 3 6
[3,] 3 1 2
[4,] 4 0 0
[5,] 5 0 0
degree_w(net, alpha = 0.5)
node degree output
[1,] 1 2 3
[2,] 2 3 6
[3,] 3 1 2
[4,] 4 0 0
[5,] 5 0 0

Answer

Try,

degree_w(net, alpha = 1.0,measure="alpha")

The documentation isn't the greatest for this function...