具有对数正态概率拟合和概率出现的图

时间:2017-03-24 17:25:16

标签: python

我最近开始使用python进行数据分析,并在下面给出了这个问题。 我有一组长度测量值(粘贴在下面)。我做了一个对数正常的长度。

我的剧本:

data=np.array(R0)
sig,loc, mu=lognorm.fit(data, loc=0)
print(sig, loc, mu)
est_mu=np.log(mu)
mean=np.exp(est_mu + ((sig**2)/2))
print(mean)
plt.hist(data, bins=200, normed=True, color='c', alpha=0.75)
xmin = data.min()
xmax = data.max()
x = np.linspace(xmin, xmax, 1000)
pdf = lognorm.pdf(x, sig, scale=mu)
plt.plot(x, pdf, 'k', lw=2)
plt.xlim(xmax=100)
plt.show()

17.648,27.666,11.016,9.779,9.176,21.496,          45.725,6.077,9.534,25.074,8.225,7.651,          17.229,11.251,3.598,5.252,14.622,7.1212,           3.958,11.022,23.165,8.561,7.132,4.677,          10.143,21.844,10.613,17.426,19.967,16.152,          25.279,11.379,6.137,3.982,4.015,6.116,           5.794,8.593,13.006,5.003,6.9535,5.495,           9.706,10.538,24.762,4.665,37.064,12.382,          16.636,6.002,9.035,15.035,9.986,12.981,           6.383,5.906,15.096,8.547,8.157,11.339,          15.183,12.595,5.093,91.611,6.343,3.586,           6.117,3.598,4.408,37.298,3.67,23.891,           7.809,7.409,17.367,12.122,10.231,8.354,          10.007,27.254,26.09,6.474,4.559,10.672,           5.738,2.648,8.884,106.861,2.159,10.515,           6.068,7.654,12.195,7.41,5.774,7.099,           8.744,6.014,5.934,9.664,5.296,2.15,           5.544,29.579,1.979,24.426,8.455,10.924,          15.311,4.522,5.297,8.996,15.947,10.793,          13.507,16.749,18.107,3.362,24.476,7.52,           5.756,4.873,12.076,18.12,5.756,2.742,           5.397,25.848,15.033,4.643,6.391,13.241,          11.219,11.124,10.741,11.695,5.507,16.328,           8.763,8.107,45.584,21.057,10.155,5.24,           5.178,2.367,8.164,14.347,15.214,8.474,          11.953,5.845,3.692,18.576,8.705,11.649,          24.352,20.386,9.556,7.973,8.789,26.524,           3.634,9.701,13.098,6.448,10.177,24.611,          10.61,17.789,3.418,9.355,5.672,5.555,          13.411,5.69,3.983,6.183,22.338,12.958,          12.465,7.656,5.461,5.936,10.017,7.228,           4.857,15.089,13.351,9.663,18.683,4.137,           7.508,12.724,7.287,5.868,5.205,4.285,           5.037,11.254,5.749,9.124,5.183,36.628,         221.36,8.547,9.372,8.17,5.937,7.807,          11.203,10.184,16.937,21.989,41.24,7.751,           5.155,7.208,16.618,9.411,3.475,2.69米,          18.455,47.067,8.452,6.896,6.287,12.938,          10.939,8.814,11.89,7.685,34.591,7.437,          12.402,9.728,17.018,16.65,12.904,7.016,          13.25,16.881,14.099,10.304,27.82,8.308,          10.11,7.249,8.615,10.522,9.509,5.775,           6.38,6.134,7.251,10.635,11.029,8.844,           6.585,15.063,6.129,7.213,6.864,10.368,           5.378,11.752,3.746,8.389,4.839,7.847,          24.221,13.046,15.547,5.44,8.501,5.593,          58.495,12.027,9.096,5.685,12.169,9.746,          11.714,6.655,7.936,40.984,20.386,7.965,          11.565,15.374,8.882,4.181,25.022,7.44,          17.461,11.128,11.602,26.285,14.571,9.51,           9.163,7.226,7.37,13.927,6.928,6.619,          27.418,7.555,6.282,21.891,32.833,12.918,           7.687,9.842,18.294,11.22,6.377,9.299,          11.736,22.436,34.386,10.874,5.463,12.046,          13.23,10.714,22.224,17.372,5.596,31.297,          14.381,16.848,9.195,6.425,27.292,12.945,          34.391,10.665,8.995,7.249,8.424,15.385,          53.774,23.743,4.521,9.714,12.7,33.629,          14.605,25.513,24.347,27.3,32.531,9.538,          39.054,21.92,11.28,22.648,20.664,22.578,           8.022,6.98,16.549,4.752,16.507,25.815,          25.66,36.848,17.803,13.76,13.36,8.994,          23.603,9.001,26.949,10.714,10.796,30.991,          34.404,11.877,14.423,38302,41.899,23.424,           9.967,11.532,19.422,21.605,5.905,44.344,          12.717,5.549,11.777,12.309,22.736,11.693,           9.014,4.276,14.747,16.941,9.714,17.851,          17.207,9.004,39.633,19.456,15.684,17.25,          22.088,20.25,15.725,15.793,16.781,13.373,          13.547,7.677,24.117,10.392,24.756,15.258,          12.546,72.518,35.263,5.037,13.28,14.758,          58.34,10.357,45.442,26.091,23.219,30.244,          10.34,29.596,19.727,14.878,31.585,11.789,           6.994,11.708,16.175,106.863,11.122,25.317,           7.061,26.499,6.676,21.077,8.132,7.835,           7.927,19.991,36.253,12.539,11.132,30.553,          14.955,22.234,9.776,27.305,30.167,11.229,          12.811,29.938,10.833,28.724,24.441,14.562,          26.585,11.074,12.13,8.634,25.328,14.803,          12.678,26.18,10.916,18.151,28.292,9.193,          11.639,16.1,15.228,12.954,14.962,21.931,          27.64,13.111,46.19,6.383,7.754,10。,           7.424,12.329,9.27,50.592,29.975,14.855,          17.547,14.061,12.422,17.874,22.45,15.389,          15.805,30.501,10.006,31.134,10.875,17.682,          18.235,8.77,8.25,13.128,16.129,35.083,          17.071,23.537,14.711,17.319,12.652,7.955,           8.306,23.165,18.063,17.382,14.403,11.982,          15.31,9.677,13.226,7.215,54.364,9.478,          14.531,9.991,40.147,13.544,14.622,12.526,           7.764,11.384,15.853,40.147,13.544,14.622,          12.526,7.764,11.384,33.182,7.02,21.844,          12.809,26.306,10.973,19.911,7.42,11.361,           8.275,37.98,6.114,20.564,12.127,6.207,          14.248,15.079,11.612,27.904,25.981,11.421,           8.361,18.337,23.063,10.429,52.738,38.2,          12.305,16.613,20.698,16.748,20.742,13.239,           7.735,5.009,31.637,22.905,7.092,16.358,          18.542,28.253,11.301,5.539,38.457,28.746,          15.219,8.933,7.782,8.007,11.688,8.751,          29.256,11.461,8.331,6.847,38.053,7.56,          16.814,5292,33.663,18.722,7.684,39.451,           7.711,9.792,18.945,17.884,21.036,22.555,          19.134,23.884,13.77,7.064,59.767,48.924,          14.243,11.992,23.318,25.61,15.559,42.494,          79.566,19.149,18.311,10.973,6.656,11.115,          29.099,9.043,4.241,11.848,10.527,16.133,          19.106,22.817,12.659,8.985,8.553,13.679,           9.199,17.466,9.938,9.342,10.093,8.204,           8.306,6.296,9.587,24.373,27.332,14.177,          11.264,6.475,10.362,17.01,37.356,12.779,          26.419,16.382,16.908,18.031,23.627,29.821,          15.553,18.98,19.46,40.692,12.296,8.709,          13.124,7.722,3.074,5.217,14.904,14.301,          20.765,9.689,15.225,10.912,15.686,11.919,          10.714,16.777,8.712,17.716,8.994,7.555,          23.07,24.158,10.296,16.22,5.389,9.916,           5.966,13.682,13.946,7.759,25.723,8.656,          14.763,22.582,12.798,17.976,15.203

我现在想要绘制一个数字,其中X轴上的长度测量值以及Y轴上这些长度的出现概率。我在这里找不到类似的东西。

有人可以指出进一步的方向吗?

0 个答案:

没有答案