igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] power.law.fit


From: Gabor Csardi
Subject: Re: [igraph] power.law.fit
Date: Tue, 4 Sep 2007 16:11:05 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Simone, i'm not really sure what you mean by 'seeing' the evolution
is scale free, you calculate (delta-k)/k and it is constant? 

Anyway, here's how to plot the degree distribution:

g <- barabasi.game(100000)
d <- degree(g)
dd <- as.numeric(table(d))   # alternatively degree.distribution
dd <- dd/sum(dd)

fit <- power.law.fit(d, xmin=20)

plot(dd, log="xy")
lines(seq(dd), seq(dd)^-coef(fit), col="red")

Try this with xmin=1 to see the difference.
You can have confidence intervals with: confint(fit).

In general it is hard to say that some distribution is a power-law,
unless you have data for several orders of magnitude.

G.

On Tue, Sep 04, 2007 at 11:43:22AM +0200, Simone Gabbriellini wrote:
> Gabor,
> 
> you are right: my graphs are 25 "shots" in the evolution of one  
> online community, measured using its forum communications.
> the first graph has 59 nodes, the last 571.
> 
> I see the evolution of this community is scale free, and I am looking  
> for some way to prove it, like power.law.fit().
> 
> I would like to plot for each graph the degree distribution and the  
> fit, but I don't know how..
> I need a plot with, on the x axis, the degree value, and on the y  
> axis the number of nodes that hold that degree value.
> 
> I tried with degree.distribution, but I am sorry I don't understand  
> the meaning of the results..
> 
> thanks,
> Simone
> 
> 
> 
> Il giorno 03/set/07, alle ore 22:18, Gabor Csardi ha scritto:
> 
> >Simone, i don't know your graphs, but yes, i guess that you should
> >only fit the tail, at least this works for the "standard" BA model:
> >
> >>g <- barabasi.game(100000)
> >>res <- power.law.fit(degree(g), xmin=20)
> >>res
> >
> >Call:
> >mle(minuslogl = mlogl, start = list(alpha = start))
> >
> >Coefficients:
> >   alpha
> >2.945498
> >
> >power.law.fit seems to work fine in general:
> >
> >>prob <- (1:10000)^-2.5
> >>data <- sample(1:10000, 1000, replace=TRUE, prob=prob)
> >>power.law.fit(data)
> >Call:
> >mle(minuslogl = mlogl, start = list(alpha = start))
> >
> >Coefficients:
> >   alpha
> >2.516897
> >
> >You might want to plot the degree distribution and the fit.
> >Also, see ?"mle-class" for more information about the actual fit.
> >
> >G.
> >
> >On Mon, Sep 03, 2007 at 05:51:18PM +0200, Simone Gabbriellini wrote:
> >>dear list,
> >>
> >>I've used the function power.law.fit in this way:
> >>
> >>c<-degree(myGraph);
> >>pwl<-power.law.fit(c+1);
> >>
> >>for a list of 25 graphs. Now I have values in the range 1,296295  
> >>to 1,805046.
> >>
> >>I see that the value usually expected goes between 2 to 3 for real  
> >>networks...
> >>can you help me understand my results? maybe I have to specify the  
> >>xmin value?
> >>being under 2 means something particular?
> >>
> >>thanks a lot,
> >>simone
> >>
> >>
> >
> >>_______________________________________________
> >>igraph-help mailing list
> >>address@hidden
> >>http://lists.nongnu.org/mailman/listinfo/igraph-help
> >
> >
> >-- 
> >Csardi Gabor <address@hidden>    MTA RMKI, ELTE TTK
> >
> >
> >_______________________________________________
> >igraph-help mailing list
> >address@hidden
> >http://lists.nongnu.org/mailman/listinfo/igraph-help
> 
> 
> 
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help

-- 
Csardi Gabor <address@hidden>    MTA RMKI, ELTE TTK




reply via email to

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