Questions tagged [power-law]

A power law is a functional relationship between two quantities, where one quantity varies as a power of another.

124 questions
1
vote
0 answers

bootstrap power law distribution with customize xmin

I have a data series, where fitting power law distribution with R to data with following code I obtained alpha=1.97 and xmin=0.15. pl_m= conpl$new(data) est = estimate_xmin(pl_m) when I run bootstrap to test the power law hypothesis by the bs_p =…
Neda Fathi
  • 13
  • 4
1
vote
0 answers

Why do I get different power law models between R and Python?

I've noticed that when I make a power law model in R, it almost always under-predicts compared to one made in Python. Here is an R example: #make data x <- seq(1,10,1) y <- c(1,2.1,3.5, 4.5, 4.8, 6, 9, 14, 20, 24.75) model.pl <- lm(log(y) ~…
hmnoidk
  • 545
  • 6
  • 20
1
vote
0 answers

Power law degree distribution in R

For a given number of nodes, I need to generate a network with p(p − 1)/10 edges and a power law degree distribution with an expected power parameter of 2, which should mimic real-world networks in R. Input: I have my node count as 400 and number of…
1
vote
1 answer

Drawing random numbers from a power law distribution in R

I am using the R package "poweRlaw" to estimate and subsequently draw from discrete power law distributions, however the distribution drawn from the fit does not seem to match the data. To illustrate, consider this example from a guide for this…
1
vote
0 answers

Power law from csv data (Python)

How can I fit a power law function in a plot and extract the alpha and sigma values using python? The closest I found was this, posted by the user AcCap : import powerlaw d=[6, 4, 0, 0, 0, 0, 0, 1, 3, 1, 0, 3, 3, 0, 0, 0, 0, 1, 1, 0, 0, 0, 3,2, 3,…
Kajo
  • 185
  • 6
1
vote
2 answers

how install powerlaw python package

I need to install the powerlaw package in python. if I call from the prompt, the python list turns out to be installed. Instead when I open spyder for python it doesn't recognize the package. how can I do?
Steren
  • 127
  • 2
  • 10
1
vote
0 answers

Verify power law in cellular automata

nx =10 ny=10 pmt = 7. SKH_ev = np.zeros((nx,ny)) H_ev = np.zeros((nx,ny)) SKH_ev [1:nx-1,1:ny-1] = 8*np.ones((nx-2,ny-2)) H_ev [1:nx-1,1:ny-1] = np.ones((nx-2,ny-2)) iterations= 100 reversal=0 reversalsize=[] def avalanche(SKH_ev,H_ev): global…
Steren
  • 127
  • 2
  • 10
1
vote
0 answers

Curvefitting powerlaw to double-log data

I'm trying to fit a power-law to data which is in the double log scale. Therefore I've used the curve_fit(...) function from the scipy.optimize package. To run the function I've implemented the following piece of code COR_coef[i] = curve_fit(lambda…
Kars
  • 39
  • 7
1
vote
1 answer

List of data to be update

I have a problem updating the "reversalsize" list. It should update every time with "reversal". I need to make a graph to check the power law behavior. It's a simple cellular automata simulating an avalanche behavior, along a channel. I always get…
Steren
  • 127
  • 2
  • 10
1
vote
1 answer

Python - wrrong fit

I am trying to reproduce a known fitting result (reported in a journal paper): applying a power-law model to data. As can be seen in the plot-A below, I was able to reproduce the result by using known best-fit parameters. < Plot-A: the known result…
dhwawi
  • 13
  • 4
1
vote
0 answers

Using powerlaw module in python

I'm trying to use powerlaw module for a very simple case and it's not working properly. I read the documentation but didn't understand quite well. Using the code below, I'm getting 8.36310071704202, instead of 0.5, the exponent of my lambda…
ziulfer
  • 1,339
  • 5
  • 18
  • 30
1
vote
1 answer

Gnuplot fit does not match

I try to fit my data file with a power law so I have: f(x) = a*x**b // fit f(x) 'data.txt' u 1:2 via a,b // plot 'data,txt' u 1:2 with points, f(x) My data are: 0.0001 2.283205 // 0.0002 3.007995 // 0.0003 3.535115 // 0.0004 3.960405 // 0.0005…
Xkcd
  • 11
  • 2
1
vote
1 answer

In networkx python, how to connect a new bunch of nodes and edges to each node in a graph?

Currently I created a graph as follow: import networkx as nx edges = [] for i in range (10): edges.append((i,i+1)) edges += [(10,0), (1,10), (2,8), (3,7), (4,6), (4,10), (5,10)] # create the graph G = nx.Graph() G.add_nodes_from([i for i in…
Muwei He
  • 45
  • 1
  • 5
1
vote
0 answers

Why Error on the fitting functions is too large also curve seems to pass from maximum number of points. How to reduce that error?

I want to use power law to fit on my data points because I have to calculate the value of v. But the error on my fitting parameters is too large, although curve seems to pass all data points. How to reduce is error? `import numpy as np import…
huda_
  • 57
  • 1
  • 7
1
vote
0 answers

How to find the distribution probability in user's chech-ins?

I read a paper that mentioned the user's check-in behavior follow a power-law distribution. I want to know how to I can calculate a user's check-in behavior? This is the figure of probability and they said: To obtain this measurement, we calculate…
Saeed Rahmani
  • 650
  • 1
  • 8
  • 29
1 2 3
8 9