igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] eigen and evcent functions


From: Bita Shams
Subject: Re: [igraph] eigen and evcent functions
Date: Fri, 22 Nov 2013 07:58:16 -0800 (PST)

Many Thanks.
but another question is why eigen does eigen return negative velue and  evcent positive in some cases?

> sw<-watts.strogatz.game(1,100,4,0.01)
> eigen(get.adjacency(sw))$vector[1:10,1]
 [1] -0.1131806 -0.1142056 -0.1124357 -0.1117224 -0.1096733 -0.1087088 -0.1075337 -0.1064655 -0.1053954 -0.1044801
> evcent(sw,scale=F)$vector[1:10]
 [1] 0.1131806 0.1142056 0.1124357 0.1117224 0.1096733 0.1087088 0.1075337 0.1064655 0.1053954 0.1044801



On Friday, November 22, 2013 7:01 PM, Gábor Csárdi <address@hidden> wrote:
For eigen, the eigenvalues are in the columns of 'vectors', not in the
rows, so you need m$vector[,1].

Gabor

On Fri, Nov 22, 2013 at 9:14 AM, Bita Shams <address@hidden> wrote:
> Hi
> I'm trying to calculate the eigenvector correspondent to largest eigenvalue
> of graph.
> The result obtained by "eigen" and "evcent" function were completely
> different although their eigenvalue  were equal.
> I wanna know how it it is explained and which one is more reliable?
> In the following, you can see  an example
> Best Regards
> B.S
>
>
>  sw<-watts.strogatz.game(1,20,2,0.01)
>  m<-eigen(get.adjacency(sw))
>  e=evcent(sw)
>  m$value[1]
> [1] 4
>  e$value
> [1] 4
>  m$vector[1,]
>  [1] -0.223606798  0.009051041 -0.316098210  0.316015499  0.011584659
> 0.048641352 -0.312464428  0.223606798  0.017765024  0.315728370
> [11]  0.024016675  0.000000000 -0.156667569  0.418184734 -0.211845338
> 0.234779796  0.139724510  0.283684792  0.004032193  0.316202058
>  e$vector
>  [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help

>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]