Ivory Coast Mobile Data

Wang Cheng-Jun edited this page Dec 19, 2016 · 1 revision

计算传播学是计算社会科学的重要分支。它主要关注人类传播行为的可计算性基础,以传播网络分析、传播文本挖掘、数据科学等为主要分析工具,(以非介入地方式)大规模地收集并分析人类传播行为数据,挖掘人类传播行为背后的模式和法则,分析模式背后的生成机制与基本原理,可以被广泛地应用于数据新闻和计算广告等场景,注重编程训练、数学建模、可计算思维。

Clone this wiki locally

http://localhost:8888/notebooks/GitHub/datalab/code/IvorycoastMobile.ipynb

Degree distribution

400px

Degree correlation

400px

400px

num = [1050, 423, 170, 95, 55, 36, 21, 17, 13, 10, 8, 6, 5, 4, 2, 1]
lb = range(1, 17)

def plotBoxPower(num, lb, colorline, label):
    x = np.log(lb)
    y = np.log(num)
    xx = sm.add_constant(x, prepend=True)
    res = sm.OLS(y,xx).fit()
    constant,beta = res.params
    r2 = res.rsquared
    plt.plot(lb, num, colorline, label= label)
    plt.plot(np.exp(x), np.exp(constant + x*beta),"-")
    #plt.xlim =[2, 32]
    plt.legend(loc=1,fontsize=10, numpoints=1)
    plt.yscale('log');plt.xscale('log')
    #plt.xticks([2, 4, 8, 16, 32],  ['2', '4', '8', '16', '32'])
    plt.xlabel(r'$l_{B}$')
    plt.ylabel(r'Number of Boxes')
    plt.axis('tight')
    lb_max = (np.log(1)-constant)/beta 
    print constant, beta, r2, lb_max

    
def plotBoxExponential(num, lb, colorline, label):
    x = lb
    y = np.log(num)
    xx = sm.add_constant(x, prepend=True)
    res = sm.OLS(y,xx).fit()
    constant,beta = res.params
    r2 = res.rsquared
    plt.plot(lb, num, colorline, label=label)
    plt.plot(xx, np.exp(constant+xx*beta), 'r-')
    plt.legend(loc=1,fontsize=10, numpoints=1)
    plt.yscale('log')
    plt.xlabel(r'$l_{B}$')
    plt.ylabel(r'Number of Boxes')
    lb_max = (np.log(1)-constant)/beta 
    print constant, beta, r2, lb_max

    
plotBoxPower(num, lb, 'ro', 'Ivory Coast Base Station' )

Small world vs. Fractal

400px

400px