[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] why different result for the same data set
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] why different result for the same data set |
Date: |
Fri, 23 Jan 2009 11:42:11 +0100 |
Dear Weijia,
plfit.r seems to optimize both xmin and alpha, igraph only optimizes
alpha. Try the xmin calculated by 'plfit.R' in power.law.fit, and then
they should give about the same results:
library(igraph)
source("http://www.santafe.edu/~aaronc/powerlaws/plfit.r")
g <- simplify(barabasi.game(10000, m=2))
deg <- degree(g, mode="in")
fit1 <- plfit(deg+1)
fit1
power.law.fit(deg+1, xmin=fit1$xmin)
Gabor
On Fri, Jan 23, 2009 at 11:28 AM, Weijia You <address@hidden> wrote:
> Dear colleagues,
>
> I'm doing the work on getting alpha.
> I tried the power.law.fit in igraph first, and get the alpha = 1.85.
> ------------------the codes are as
> follows-----------------------------------
>>library(igraph)
>>g2002911d <-
>> read.graph("o/2002/2002-9-11-dup_r",format="ncol",directed=TRUE)
>>g2002dall = degree(g2002911d, mode="all")
>>power.law.fit(g2002dall+1)
> Call:
> mle(minuslogl = mlogl, start = list(alpha = start))
> Coefficients:
> alpha
> 1.848955
> However, when I use the plfit
> (http://www.santafe.edu/~aaronc/powerlaws/plfit.r) to calculate the alpha
> again, I got
> $xmin
> [1] 19
> $alpha
> [1] 2.19
> $D
> [1] 0.02631497.
>
> ------------------the codes are as
> follows-----------------------------------
> plfit(g2002dall)
>
> I wonder if anyone happen to touch this area before and give me some hints
> on it.
>
> Thank you very much in anticipation!
>
> Weijia
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
--
Gabor Csardi <address@hidden> UNIL DGM