오늘은 power-law distribution을 만드는 방법에 대해 포스팅하려고 한다.
코드를 작성하기 전에 규격화된 함수를 구히야 하는데, 아래와 같이 따라가 보자.
Let $p(x)$ as a power-law distribution of $x$,
$$p(x)\propto x^{-\alpha}.~~~~(0)$$
(1) Without cut-off: $x\in[x_{min},\infty)$
$$\frac{C}{1-\alpha}\int_{x_{min}}^{\infty} x^{1-\alpha} dx=1$$
$$\textrm{If }\alpha>1,~ C=\frac{\alpha-1}{x_{min}^{1-\alpha}}.$$ The probabilty density funcion is
$$p(x)=\frac{\alpha-1}{x_{min}}\left(\frac{x}{x_{min}}\right)^{-\alpha}.~~~~(1)$$
(2) With a hard cut-off: $x\in\left[x_{min},x_{max}\right]$
$$C=(1-\alpha) \left[ \frac{1}{x_{max}^{1-\alpha}}-\frac{1}{x_{min}^{1-\alpha}} \right]$$
$$p(x)=\frac{\alpha-1}{x_{min}}\left(\frac{x}{x_{min}}\right)^{-\alpha}-\frac{\alpha-1}{x_{max}}\left(\frac{x}{x_{max}}\right)^{-\alpha}.~~~~~(2)$$
(3) With an exponential cut-off [1]:
If the chracteristic size is $x_c$, the distribution is $p(x) \propto x^{-\alpha}e^{-x/x_c}$. Using the upper incomple gamma fucntion $$\Gamma(s,x)=\int_x^\infty t^{s-1} e^{-t}dt,$$ one can normalize the probability distribution
$$C\int_{x_{min}}^{\infty} x^{-\alpha}e^{-x/x_c} dx=1 $$.
$$C=\frac{x_c^\alpha-1}{\Gamma(1-\alpha,x_{min}/x_c)}$$
$$p(x)=\frac{x_c^{\alpha-1}}{\Gamma(1-\alpha,x_{min}/x_c)} x^{-\alpha}e^{-x/x_c}.~~~~(3)$$
이제 함수가 준비 되었다. 다음편에서는 난수 발생기를 알아보자.
참고 문헌
[1] M. Karsai, H.-H. Jo, and K. Kaski, Bursty Human Dynamics (Springer International Publishing, Cham, 2018).
-끝.
'C, Python, and Linux' 카테고리의 다른 글
vim color scheme 설정하기 (0) | 2020.08.30 |
---|---|
[Linux] .vimrc 설정하기 (0) | 2020.08.07 |
[Linux] tar - 파일 묶기, 압축, 풀기 (0) | 2020.08.07 |
[Linux] ssh 공개키 서버에 등록하기 (0) | 2020.08.01 |
[Linux] alias 설정하기 (0) | 2020.01.27 |