1

我试图弄清楚如何将已发布的模型拟合到数据集。

模型和方程的详细信息如下所示1

我有一个来自1中的方程的表观扩散 (D*) 数据框以及步数 (n)。

我需要使我的数据分布适合这个模型2

这个等式中的 D 和 x 是否相同?这让我有些困惑。

数据框:

n   D
6   16.1693
29  6.95744
23  7.66054
7   24.6076
14  8.88381
11  5.89875
33  8.16877
9   18.8922
10  15.2757
6   12.2641
9   4.2205
22  8.57661
5   2.43809
6   12.2284
9   3.5797
7   16.3401
4   9.23816
4   4.34992
10  5.77003
9   4.43707
8   3.90128
21  7.1065
15  9.08997
34  1.56546
5   15.2622
10  5.19957
5   5.86306
16  7.82247
12  8.11728
63  6.94382
19  10.6853
4   22.634
14  4.64683
15  8.83135
10  11.8849
20  9.88979
7   4.53146
4   5.58701
9   6.46933
5   3.92932
5   13.2794
9   21.9321
17  14.4281
5   4.33572
37  4.27755
11  4.43083
19  6.82866
9   14.927
29  4.39848
6   3.56756
7   5.00384
15  5.41498
7   9.67496
8   8.90499
41  5.59504
5   5.30941
11  4.05351
8   14.1295
5   6.94491
7   4.53821
6   7.43668
14  5.10146
4   18.2141
8   3.21058
12  6.26661
19  5.53264
7   9.14843
9   7.86705
13  7.79207
10  16.0144
37  5.61845
24  5.45841
8   3.72465
6   9.15419
8   9.50775
4   7.2576
5   6.8974
4   9.90056
5   1.76761
4   1.28818
67  9.4782
4   5.88126
8   11.8879
17  8.64635
10  7.49368
6   7.97186
39  6.78984
27  4.6375
6   7.21579
4   1.87345
22  7.53034
13  9.77943
5   7.02081
11  15.3463
8   1.42405
10  10.4216
8   9.32649
4   4.86869
4   8.69224
6   7.2981
5   6.32456
27  5.23167
8   4.26364
4   5.89355
6   15.0599
17  3.79605
75  5.10882
6   10.9887
26  4.29229
8   19.6015
8   7.4532
14  7.77257
5   4.02287
4   8.1798
15  4.50524
4   3.52175
6   3.77109
4   16.1092
5   10.2184
4   1.31019
7   10.9105
16  5.54095
7   8.26732
4   5.46121
7   3.14528
5   2.9076
7   5.38087
13  10.0418
8   6.00922
4   6.38978
4   1.16043
6   7.11854
18  6.61809
5   18.4267
8   9.4416
4   6.34204
4   3.97339
8   9.47709
25  5.72887
17  4.38445
4   9.39688
10  5.1629
6   5.14524
7   6.63644
7   6.61286
4   3.9732
5   5.45305
6   8.66114
10  13.8499
8   8.3179
7   6.27027
39  10.5038
4   11.675
4   2.10659
7   8.05701
8   9.1416
28  10.3282
8   6.09853
5   10.4296
49  6.73058
7   8.08364
5   5.56982
8   7.99871
11  9.07808
14  8.74915
9   3.05946
5   9.02942
24  4.65335
8   5.28659
10  11.7005
9   7.9019
13  1.7073
5   3.98097
4   7.1036
8   4.44103
8   10.5211
22  8.36037
6   16.5121
6   3.36161
7   3.85915
9   14.2648
13  13.9042
8   11.3231
8   4.24438
4   9.2
11  2.77842
4   8.07942
5   5.06842
7   10.0444
4   4.62739
4   9.07243
12  3.80894
45  5.08952
21  6.94786
6   12.6898
4   13.9838
4   6.27831
13  10.8506
4   17.543
6   14.3726
37  4.29764
11  2.84348
7   7.84218
7   1.62582
4   4.25611
4   11.8145
12  7.61603
7   13.6282
4   4.44655
8   16.8558
4   11.2504
4   0.940673
4   3.34161
16  3.00202
14  11.938
26  7.59963
7   5.14337
7   5.2484
5   4.44258
13  2.98905
5   5.10393
5   2.09328
37  3.90394
22  6.01075
17  3.9939
6   19.4055
10  8.05424
55  10.109
4   3.55426
11  2.94729
11  3.80218
6   10.8055
18  6.56886
8   11.0226
6   6.82045
4   2.42667
5   10.8811
18  5.87932
13  3.21932
4   3.36937
20  3.00249
8   6.54755
4   17.1626
7   9.7982
6   4.922
7   2.4292
4   3.74126
5   11.6342
12  9.81202
4   10.1603
4   6.64092
4   4.19567
4   4.72367
6   5.27054
4   3.61887
5   15.066
4   7.80564
4   0.994988
6   6.56088
7   3.02964
11  5.32366
29  8.41929
11  11.1174
4   20.5039
9   9.07833
25  9.91062
6   11.7417
6   5.18911
4   9.01824
45  8.09247
15  4.0735
12  19.8334
7   9.37491
7   9.68244
4   4.10823
7   6.03255
13  8.94892
6   20.4803
17  9.15187
4   41.0176
9   17.0149
15  5.91976
19  9.52719
7   13.8433
10  9.18984
18  10.3163
53  5.11534
12  5.64626
5   17.7302
25  9.71165
5   15.529
17  9.0897
15  10.383
5   4.60562
6   10.9851
7   7.48659
8   4.77201
7   10.4422
16  9.41269
19  7.46288
7   5.29129
8   12.6097
22  9.28684
74  9.29769
5   7.88201
6   7.6608
29  5.01021
8   10.8468
4   10.493
5   5.51872
8   4.00857
5   5.3458
6   7.53767
15  4.03411
32  12.4305
7   15.1404
11  3.89022
4   4.80646
7   12.8567
8   5.19944
18  12.2352
25  5.82377
4   6.82975
4   17.1336
11  3.01867
30  6.0417
6   7.5281
32  6.61119
11  5.75534
14  6.25002
40  9.02338
6   9.8725
36  8.97259
5   15.1208
27  12.6702
5   6.95754
13  11.1277
19  8.36837
6   6.0491
6   14.9543
9   6.33145
32  6.15491
9   7.69184
4   6.17417
8   12.5346
7   4.83411
4   0.886051
14  9.63098
4   4.27818
19  4.71805
25  9.41496
5   4.8577
6   5.43837
51  7.92163
39  4.27369
5   7.25765
4   3.39691
37  10.279
5   1.45927
11  3.73836
6   6.37452
6   9.58176
69  3.28546
4   4.44583
7   10.1013
10  4.86906
7   8.64699
4   9.77237
7   4.26821
5   9.10079
19  8.37994
5   18.0182
5   4.39684
4   4.80113
8   6.26875
5   19.2315
54  1.31136
33  6.49233
12  7.4871
9   4.54722
15  4.87368
8   8.14971
5   7.73712
11  4.88992
20  4.57845
4   7.51247
8   1.96748
19  6.29791
8   6.74184
9   9.57862
5   9.83782
7   11.3725
6   4.42387
10  7.06773
6   11.8456
32  5.79843
13  13.2486
13  7.0247
36  7.21733
6   12.7207
10  10.0221
12  6.14754
7   6.03929
40  8.57295
6   11.7657
38  7.99936
4   9.50411
4   14.496
35  8.14862
10  11.5238
4   9.42894
11  6.75271
8   12.3427
21  9.90872
5   19.3727
4   10.579
13  5.90007
4   11.4053
4   13.817
11  11.4348
4   11.6535
11  9.44845
4   6.04428
5   7.42656
4   5.17453
14  7.40451
5   1.69463
4   8.15573
9   9.86957
11  11.4412
7   9.51392
16  6.16268
29  11.407
18  6.67891
16  5.23633
16  14.3687
6   4.88755
53  6.12915
8   8.55567
16  6.76427
5   7.01236
13  9.59372
4   10.7199
5   15.8954
12  1.38346
19  9.7957
4   18.0668
10  12.7076
7   6.69635
10  8.19132
25  8.59163
5   24.893
4   12.0637
20  13.1037
5   13.2987
11  9.51644
9   4.72763
5   20.8506
6   11.21
8   8.19004
6   24.9133
13  10.3163
4   12.0486
4   5.05456
4   7.29071
6   2.54061
4   4.77332
7   6.60557
4   5.18637
7   3.80679
26  10.258
15  4.49815
4   18.1461
4   9.7945
4   10.1782
10  13.2135
13  10.0199
5   19.2617
5   3.9299
6   1.49049
19  11.7899
24  1.92224
6   4.27185
11  9.19738
4   22.0556
5   17.8052
32  6.4669
9   12.5228
4   2.9297
12  5.11769
4   8.19326
6   14.357
9   12.334
5   16.5749
10  4.01052
16  14.6244
19  5.51143
5   21.2266
20  3.81325
5   15.9669
4   2.68911
7   1.44358
4   2.87054
15  6.80376
4   1.82632
6   4.21866
7   15.0345
4   4.49516
5   8.39518
4   3.69212
7   9.75684
7   15.4615
10  18.8199
5   18.8258
10  3.36979
13  7.33419
6   17.0571
26  1.53175
9   9.9712
4   10.3649
38  0.740367
4   1.29965
8   2.09779
7   16.0598
7   3.41323
11  3.72058
6   4.00974
5   8.23234
4   6.61152
19  7.07587
7   11.4555
6   7.08395
4   10.972
23  0.917861
4   3.14026
7   4.22944
6   3.52015
13  5.96351
5   10.4885
8   1.23162
4   9.62736
8   5.63199
5   9.69307
4   6.09755
9   11.6543
4   1.27177
5   16.434
4   5.89135
11  7.45377
4   4.71543
8   7.15632
6   12.4733
4   7.30201
4   4.03364
4   12.2982
8   6.60874
18  8.95991
5   16.3711
6   8.3649
12  1.00274
28  7.70672
4   13.0514
8   7.89006
14  8.69344
13  5.71736
50  0.870717
6   5.6773
4   2.53118
12  9.18717
4   13.743
4   7.63913
8   6.71842
4   10.5403
5   9.84237
21  8.68478
4   7.18612
7   1.06827
8   0.751419
6   9.63001
4   9.1629
8   7.10638
4   3.78854
6   6.03218
5   4.09128
5   6.40873
8   5.67051
5   8.13922
7   9.8616
8   3.0221
22  6.18295
11  3.05981
16  4.56805
5   4.03661
66  6.15321
22  5.69653
28  13.8167
18  7.74219
4   2.93453
5   8.91556
6   3.67423
21  6.6657
4   4.82726
4   11.8191
4   9.79784
12  14.2138
25  5.97174
15  13.5428
8   6.80563
21  11.8932
6   14.6238
11  13.9869
52  4.2076
30  9.04408
4   12.8902
19  12.9141
8   2.48893
16  13.4498
4   17.5283
4   7.01612
11  8.76975
15  8.21731
4   7.88112
16  6.95465
6   4.00958
9   5.46003
4   8.24018
5   4.73601
22  7.0614
8   2.77676
13  3.16918
5   4.94642
24  12.0763
4   21.812
5   6.47157
7   17.0296
11  8.46085
13  10.8281
5   20.0598
10  6.53189
9   9.78346
6   9.00286
5   12.1462
32  6.18333
21  6.86122
6   5.47728
16  6.48787
21  6.24357
25  4.21758
8   0.806496
15  3.10368
12  10.4091
18  11.4366
9   6.2496
12  21.033
20  7.27648
8   10.7495
7   6.30541
4   1.25707
6   10.8126
21  11.6242
7   15.4946
9   9.24556
7   1.02894
4   10.1415
5   6.15597
4   7.75065
6   6.21703
5   2.95157
16  12.3517
24  6.18562
5   13.4244
19  8.34601
27  10.4223
4   5.66702
11  9.49525
5   15.7393
5   7.25596
6   3.7934
16  14.3714
11  17.4736
5   10.9433
4   8.8336
6   4.4724
9   4.94749
33  13.3733
4   9.9071
40  7.68868
7   15.1338
5   10.1261
10  13.2432
7   7.31594
6   3.65833
7   7.24156
5   4.34046
4   8.41281
4   5.21182
8   6.9173
4   13.2239
8   9.27886
8   7.46864
6   11.2666
10  5.00644
17  10.4805
4   6.07913
8   17.7638
4   2.60227
4   6.31402
7   7.84318
11  7.34386
7   5.68347
33  9.25309
6   12.2509
4   9.0981
14  5.07898
8   18.5004
12  15.2972
10  19.0073
4   6.60009
23  6.66052
4   11.1979
4   14.2767
4   4.65281
8   17.7194
6   7.71884
5   11.1417
8   16.0098
8   15.4062
4   1.79562
5   1.97934
5   2.50545
6   11.6727
4   5.20648
4   6.09141
4   9.60115
5   5.8942
10  8.69295
48  6.78206
7   16.3256
4   3.61786
5   3.96036
9   10.9963
10  5.13205
4   3.44912
6   7.54323
9   10.6859
5   3.75914
6   11.9806
4   12.0293
11  6.95981
9   10.7666
4   6.84392
4   3.65086
5   5.60636
10  10.64
5   13.3392
5   7.24023
5   3.13008
5   2.2695
9   13.159
4   6.40173
4   7.53556
4   5.24271
9   7.63686
4   8.55155
6   0.794395
12  0.774572
4   12.2137
4   5.07304
4   12.6834
6   2.51888
4   7.33227
4   0.986925
4   1.70198
16  9.28519
9   1.39987
17  2.91594
16  4.2964
7   8.99818
9   6.25679
25  8.93453
17  5.90314
16  6.80086
24  10.2752
16  6.28381
16  5.15422
5   18.1131
9   3.16139
6   8.04448
18  4.76119
9   6.81272
35  5.42931
21  18.2357
6   15.1372
7   6.99942
27  5.41456
21  5.28753
9   13.016
5   4.63557
30  5.15181
10  1.23659
4   9.02225
7   6.95968
9   9.88862
7   7.36041
13  6.98269
4   9.36711
25  10.8892
12  6.76683
44  5.07632
6   10.7961
29  8.59522
5   2.81338
4   6.28351
12  1.59647
5   5.16854
7   14.4913
8   3.97279
19  5.20089
4   1.96562
10  12.1537
4   15.3751
11  8.56482
33  6.64277
25  14.3409
7   16.7304
62  6.58747
4   2.42415
19  2.97408
20  3.60803
8   6.41198
12  5.37805
27  4.50585
4   21.1342
21  6.20593
5   31.3684
15  5.39253
5   5.47974
4   6.00669
47  5.71607
8   8.44368
49  5.7375
14  3.26521
10  6.21576
6   10.4837
7   5.24993
4   9.37565
22  5.34031
5   4.16423
5   2.28298
51  8.15904
5   19.6947
5   0.80783
8   8.06952
70  4.96765
6   14.0349
9   25.9748
4   3.7916
14  11.8718
5   7.06589
18  11.4422
8   5.59955
8   2.94877
10  10.992
31  8.48155
11  9.13858
5   5.24694
10  8.233
10  5.15933
5   5.13126
5   14.4717
4   3.0615
5   8.6877
9   10.4637
6   8.48307
11  5.84917
4   2.99477
6   8.59874
4   4.40055
10  6.35706
6   9.94606
8   0.977799
15  8.11636
10  3.25845
109 5.49411
8   2.32721
16  4.06833
19  2.10977
4   12.4984
7   36.9302
4   14.2224
4   6.87563
4   9.845
8   7.98671
9   8.97332
19  2.35613
7   7.49985
4   19.473
12  7.3042
11  4.04249
20  5.40606
7   3.74967
19  7.38808
17  4.79346
6   5.86213
38  10.4957
24  8.36563
18  2.84539
6   3.29085
8   4.9111
20  9.77446
5   14.169
17  4.13249
4   9.60407
18  7.58892
42  3.72497
9   6.91983
15  5.80645
4   18.5483
7   5.06625
42  5.59
29  12.5507
6   7.95824
11  11.4407
8   9.20384
4   6.70884
7   6.50464
5   4.37398
19  7.748
32  10.3775
6   6.63337
14  4.74974
7   15.4182
6   6.70726
5   6.69711
10  12.5341
4   21.0316
41  5.89733
21  2.41973
8   8.19385
26  8.1546
4   10.6347
16  5.8739
4   7.92148
9   9.24801
6   9.27338
31  5.60478
4   4.35284
8   10.701
8   4.36121
6   1.31401
4   19.5421
6   10.9634
4   6.13838
23  4.13052
5   13.2386
10  6.40519
53  6.63273
11  5.49061
6   3.9007
17  5.03859
5   8.30389
14  18.5018
28  8.8984
5   1.81496
48  8.91168
4   3.75839
21  2.90767
8   7.22742
33  8.15415
53  11.4095
8   18.7344
5   10.577
4   5.09826
5   2.07749
8   10.8144
7   10.2127
9   8.4347
10  10.0349
4   6.15027
6   2.28599
7   7.93572
9   7.34118
14  6.09031
7   7.3006
45  7.09423
4   1.33645
8   14.4526
4   7.08032
11  4.79024
4   12.0431
5   2.57087
16  4.86222
6   4.78049
6   3.96594
7   2.57981
41  3.7921
14  3.90545
24  3.87089
8   8.63085
12  19.1375
20  7.70843
47  7.20331
5   5.91793
5   9.86039
4   4.64594
10  5.77038
9   2.34492
38  7.51938
9   4.80303
12  14.0615
8   7.28326
19  9.66733
47  5.75326
5   3.38573
9   5.44017
24  6.87599
10  9.47107
12  6.79666
5   1.75299
38  7.69266
15  5.61026
7   13.5915
4   3.11537
12  6.39935
4   7.12639
8   1.2571
4   9.68493
18  3.9985
8   6.09214
9   13.1175
6   1.582
6   9.19583
56  5.94625
25  4.32547
4   6.1255
9   12.1471
9   3.53177
9   8.62854
22  10.6622
5   7.98789
7   9.76413
4   17.8281
65  5.71063
7   0.890085
29  3.80254
12  3.5459
20  6.15626
4   20.0254
5   8.32468
5   29.742
22  6.81443
4   2.47438
42  6.77664
18  10.6616
15  8.05075
4   9.02896
7   7.48956
6   2.91088
4   3.03396
10  7.53855
14  2.43732
10  9.00266
22  15.1172
4   2.10672
4   4.49333
7   3.15671
38  6.92405
8   13.0506
6   8.69566
10  7.03648
5   2.00527
6   0.954127
10  8.09208
4   4.96376
4   4.43958
14  5.58138
5   3.09601
11  3.5262
4   8.33322
6   11.5486
18  7.57425
5   2.83417
6   9.43153
4   0.918853
5   7.75331
4   3.19178
11  1.5561
13  8.39383
24  5.49064
5   4.88094
4   3.34757
4   5.12223
5   5.15522
25  8.43619
4   4.85253
4   35.8834
9   8.92566
5   16.3607
16  1.59487
7   23.8568
11  6.39793
4   13.6148
9   15.175
24  3.4752
8   17.818
18  11.6706
7   5.28669
33  4.91901
7   16.4209
7   11.1932
5   5.37852
8   6.68451
23  1.25288
4   11.253
16  14.2972
4   9.7042
11  6.75403
25  7.5279
5   20.385
15  14.051
5   13.0078
5   15.922
5   21.4825
8   2.09958
20  6.61385
4   1.41148
6   10.5498
7   3.93411
10  6.45799
15  8.61957
39  8.69927
6   10.745
13  5.41675
13  8.20857
6   14.7968
6   9.1487
4   13.636
5   21.4302
7   11.2109
5   6.34895
41  6.75438
4   8.76922
12  6.51222
4   26.8182
4   7.27081
4   8.40243
4   6.30526
5   7.61186
4   3.36989
4   2.92409
9   2.02215
7   2.40541
5   6.2039
16  5.02525
5   5.88596
7   4.80479
12  5.49408
10  8.70615
4   4.89584
11  6.04424
5   2.96187
4   5.31255
8   4.94725
8   14.5442
7   18.3454
9   15.0843
6   7.58322
10  4.6386
11  4.93008
10  6.58939
10  6.11791
4   7.74141
10  11.7516
4   12.3938
4   5.4703
6   2.49468
15  8.38246
4   8.3817
5   9.60288
22  11.7374
4   2.43527
5   10.3144
7   9.08492
4   3.18577
5   8.87359
4   10.5922
6   6.76757
5   5.52752
4   7.58328
5   4.05443
6   4.20954
8   14.4161
6   5.29189
29  5.52229
12  7.09305
16  6.37976
29  9.48505
5   19.3982
7   9.79444
5   8.1576
14  11.8035
5   8.43284
6   5.29265
11  7.02019
8   13.534
13  7.13543
27  5.71252
6   13.6545
8   8.04559
4   7.76255
4   8.08626
4   4.16599
8   3.77822
9   8.8568
23  10.7367
8   8.2191
5   1.74918
8   7.63465
13  9.32419
6   8.79706
5   15.4076
7   17.8238
34  10.2077
6   13.8557
12  8.07164
13  14.1308
12  17.0733
30  11.0101
13  10.0491
22  6.18584
9   4.20852
5   2.65289
17  8.94523
8   5.50482
6   9.53493
7   24.591
13  6.32331
19  11.3894
14  10.1854
4   12.3948
16  6.95055
13  6.17838
5   3.8309
13  8.73328
4   23.4474
14  13.4613
4   13.3889
20  9.6924
8   5.18591
8   17.0651
18  9.52647
4   6.32325
7   29.7699
6   27.8564
8   14.4558
8   5.96027
34  7.37892
6   6.57987
9   13.0858
19  10.6525
10  13.784
36  3.44008
10  4.98896
4   10.5359
4   5.80166
8   7.54147
21  1.14524
16  11.7418
8   3.41447
7   5.28356
10  5.5154
5   2.77046
9   6.69647
33  9.50621
14  6.7445
5   4.51881
8   11.509
4   16.4914
4   9.5769
8   4.15454
7   12.4834
39  7.09677
4   4.52977
9   16.6967
5   3.47655
9   8.80103
5   2.4592
40  8.09468
9   5.35303
8   6.09031
10  7.09897
21  3.46474
21  8.12347
11  11.7323
6   12.7858
7   7.12583
4   8.68419
5   8.87775
4   8.78327
28  7.22714
5   8.93233
19  7.91032
5   8.4773
5   10.0489
22  5.03526
5   9.64074
4   9.25775
4   17.4061
4   7.67731
8   6.36563
7   7.6863
6   2.00972
10  11.559
21  9.80919
19  4.61711
5   13.1991
4   16.1863
13  8.52632
13  11.713
4   6.39226
5   7.43297
17  3.0411
6   6.13122
6   6.64945
11  6.8625
5   16.6535
6   5.92925
9   9.09044
4   5.8015
4   11.7663
55  6.83198
6   17.7091
4   6.84847
10  6.96107
4   12.2952
7   15.7357
7   16.9079
5   4.77904
4   4.92745
4   12.5846
6   12.1043
15  9.16974
5   10.5594
4   9.85629
7   4.14754
5   5.73541
4   25.081
11  3.85567
5   2.75741
9   5.10188
7   8.81165
4   2.19676
5   14.0147
6   4.66927
15  5.60593
4   21.1329
6   16.578
8   5.60286
4   6.34807
13  11.3636
4   5.06866
7   13.8345
4   8.63026
5   12.6181
7   3.72891
14  11.4156
6   5.65498
4   2.00478
4   6.70047
4   2.74247
7   7.15954
6   6.97321
6   3.06345
7   5.16588
4   1.9815
7   5.71259
4   11.2309
8   13.7251
4   6.49702
17  11.5877
38  2.18001
8   4.10022
50  4.84289
41  12.7175
5   3.99481
39  4.3202
5   9.02036
18  8.49845
14  8.36378
45  7.68327
8   16.1262
47  7.72268
18  1.52906
7   6.55152
23  7.28533
17  7.63679
23  7.1983
20  9.68639
26  2.2919
10  9.31858
6   10.2451
14  10.0946
5   3.35212
13  7.92773
11  7.54864
47  2.69414
10  6.86291
9   5.20244
8   6.42733
4   10.8517
12  3.75473
33  3.27723
6   3.00593
4   15.6508
21  7.96871
12  8.75405
31  12.324
10  1.11662
7   2.15066
24  6.83173
7   3.96771
11  7.5619
4   0.785628
11  14.4666
6   5.11272
5   7.59668
5   9.04664
7   11.9044
5   5.61802
9   11.6637
4   13.5922
4   9.948
18  9.21967
8   11.062
4   14.0495
7   9.60146
47  3.41381
24  5.48075
7   9.34019
4   5.67435
11  3.40312
11  9.22323
37  5.44413
5   22.4815
6   7.20836
6   4.52437
12  10.1285
14  7.16214
20  7.26324
5   20.8528
35  5.39124
4   6.32888
5   7.0733
6   2.41672
21  11.0176
12  3.09272
6   7.32828
5   11.8614
4   13.5878
6   7.44575
37  5.42578
10  16.5581
7   12.1824
20  16.6054
20  18.147
25  4.2557
5   1.51733
4   14.4149
7   7.60474
7   7.05497
13  8.77247
47  7.80778
6   6.32124
5   1.04715
5   8.83554
22  9.06805
18  8.8941
17  2.18289
9   5.88177
9   14.1725
7   8.8699
8   4.18207
12  4.09766
21  8.31261
25  6.74651
21  6.39138
6   6.783
49  2.53901
5   26.7969
16  6.55789
9   17.4564
4   6.49943
5   5.53018
9   6.55773
8   8.22126
17  9.93245
7   10.1271
27  8.38053
4   14.6347
22  5.34149
14  11.3401
7   7.64656
15  4.97067
15  1.49902
7   6.81685
10  14.7443
26  5.19094
4   5.37994
11  9.79944
6   7.01459
8   7.79019
19  11.2786
6   5.355
5   1.26712
9   6.61735
12  7.72715
7   9.55011
67  2.79386
4   2.40071
8   7.30456
46  7.416
9   14.6428
9   7.2112
4   6.63294
7   6.79824
45  2.55119
12  7.82306
5   17.3145
14  11.1806
4   4.08319
7   14.3597
6   3.11201
7   10.0034
8   8.49861
5   11.1623
13  10.6563
6   7.88141
10  13.8632
6   4.04427
13  7.85135
39  5.87709
11  2.46188
25  5.91836
33  10.6482
25  2.37395
21  7.55021
6   6.77897
12  8.32483
7   6.37397
6   14.526
23  4.2424
5   7.73115
4   11.2847
5   13.3916
10  10.1114
5   6.17557
12  8.13141
12  9.6928
17  9.32123
4   3.97583
14  6.00034
9   3.42081
9   12.0713
50  3.79332
15  11.4132
27  5.64309
8   6.7623
7   7.22301
9   12.0606
9   4.29732
15  10.2285
5   17.1166
37  3.41162
6   8.42037
5   3.24976
5   10.4622
6   8.40845
6   1.81865
4   9.25185
23  3.93845
5   21.6799
12  10.6917
16  9.17709
5   31.985
15  17.0313
9   6.52704
7   3.83975
6   2.99867
6   4.39106
21  8.07896
5   6.83469
4   16.8171
6   3.72637
4   4.83495
44  6.07658
22  13.059
6   20.6309
12  4.32898
24  5.63681
4   12.7224
4   27.9618
79  2.83718
25  7.71501
14  7.70377
5   4.41151
10  6.56613
41  3.03904
4   9.90708
4   0.779275
76  4.11521
5   5.35364
10  9.24407
7   2.74147
6   16.4438
6   15.0684
15  2.0893
5   24.5116
5   15.2534
21  3.9638
5   9.42489
34  2.57225
4   7.94264
32  3.59779
8   6.8339
4   1.8738
26  2.59653
4   20.1512
4   3.10731
12  1.38828
4   5.32289
8   2.69905
4   6.26715
7   8.92059
13  4.86136
37  2.38795
5   8.40931
5   10.9193
5   9.2014
7   15.5844
4   10.3963
7   6.36847
16  4.29113
32  5.53641
33  10.2215
8   7.71818
7   14.1442
6   2.99928
4   4.21772
11  6.87553
12  1.34241
18  14.0353
47  2.96704
23  3.70181
7   8.57761
22  6.07572
8   3.50741
43  4.82435
66  6.11313
4   4.73957
14  3.21847
5   6.85557
11  6.90241
4   6.7317
15  2.17576
5   8.61794
5   6.015
4   11.7745
8   1.78445
21  5.67131
4   16.9644
31  0.708555
8   2.1312
16  7.07874
4   8.99811
6   5.80737
82  6.57077
15  9.81252
14  10.0203
11  8.51049
5   4.66913
14  5.1661
28  7.92444
4   4.87349
9   8.18891
4   9.17976
5   2.1189
16  8.0799
6   7.58069
7   4.17751
7   4.41031
13  5.13741
4   2.75857
4   6.82822
4   3.02871
9   13.6115
7   6.33422
7   2.90223
18  8.23854
9   3.79853
6   9.56885
6   9.86923
6   7.31371
6   5.71552
7   4.56533
4   10.0795
46  5.88529
4   18.5347
6   9.14274
9   9.26039
6   8.31048
5   9.35301
7   4.82153
4   3.88126
4   10.8491
4   2.9009
4   7.24601
5   8.66639
5   4.73344
6   5.41322
4   9.48994
14  7.08554
4   9.26597
5   3.9454
4   9.51764
9   4.53588
4   8.6098
7   4.80259
5   3.88361
5   7.41984
9   2.16905
4   6.00152
5   4.41005
19  9.51822
6   7.56169
6   8.70246
10  8.40757
6   5.65566
5   4.26509
21  8.19307
6   5.18222
12  9.12786
4   5.12812
5   14.599
10  5.49054
5   2.03264
6   4.32049
7   2.21361
6   7.26104
5   5.40368
8   2.92935
4   7.79551
4   9.65819
7   8.60384
5   1.68915
7   7.27015
6   6.23645
6   2.48142
11  6.32948
6   2.4595
7   4.95916
11  5.57612
11  4.11866
5   4.14263
10  5.33286
5   4.03639
4   7.61417
8   6.38952
8   4.65564
4   13.087
4   5.47296
4   5.76844
4   2.74936

拟合应该看起来像伽马分布拟合。

任何有关用于创建拟合然后使用 ggplot 绘图的代码的建议都会有很大帮助。就像是??:

function(D) (((n/D)^n)*D^(n-1)*exp(-n*D/D))/(n-1)

我当前的分布图代码:

p <- ggplot(df) +
  geom_histogram(aes(x = D, y = ..density..),
                 binwidth = 0.5, fill = "grey", color = "black")
4

1 回答 1

1

我的理解是,该公式表示在给定扩散常数D的情况下,在n步后在特定距离D*处找到分子的概率。由于D*可能与D混淆,因此有点令人困惑,因此在函数中已将其替换为x。请注意,在公式中,(n - 1)!只是伽马函数。因此,R中的函数将写为:gamma(n)

f <- function(x, n, D) (n/D)^n * x^(n-1) * exp(-n * x/D) / gamma(n)

我们在这里遇到的问题是,虽然数据包含我们可以为 x 和 n(df$D 和 df$n)插入的值,但我们没有扩散常数,实际上这可能是您正在尝试的在这里找到。

但是,我们可以使用上述函数为我们提供对于任何给定的D值具有这些数据点的负对数几率的总和

f2 <- function(D) sum(-log(f(df$D, df$n, D)/(1 - f(df$D, df$n, D))))

为了让事情变得更容易,我们将它矢量化:

f3 <- function(D) sapply(D, f2)

这意味着如果我们为D绘制各种值,我们可以找到 D 的最大似然估计

plot(0:100, f3(0:100))

在此处输入图像描述

由此看来,我们的最佳D值介于 4 到 9 之间:

plot(seq(4, 9, 0.1), f3(seq(4, 9, 0.1)))

在此处输入图像描述

在 7 到 8 之间:

plot(seq(7, 8, 0.01), f3(seq(7, 8, 0.01)))

在此处输入图像描述

我们可以像这样找到精确的点:

optimize(f3, range = c(7, 8))
#> $minimum
#> [1] 7.442408

#> $objective
#> [1] 5984.383

这意味着根据您的数据,我们对 D 值的最佳猜测是 7.442408。因此,我们可以计算出对于所有不同的n值在特定距离处找到分子的概率密度:

n <- c(4:10, 20, 100)
x <- seq(0, 30, 0.1)
dens <- do.call(c, lapply(n, function(i) f(x, i, 7.442408)))

sim <- data.frame(x = rep(x, length(n)), y = dens, n = factor(rep(n, each = 301)))

ggplot(sim, aes(x, y, colour = n)) + geom_line() + theme_minimal()

在此处输入图像描述

所以我们可以看到结果是一系列根据步数变化的伽马分布。

为了让我们自己确信我们在正确的轨道上,我们可以在 n == 4 处绘制数据点的经验密度函数并叠加我们的预测密度函数:

plot(density(df$D[df$n == 4]), ylim= c(0, 0.2))
lines(sim$x[sim$n == 4], sim$y[sim$n == 4], lty = 2, col = 2)

在此处输入图像描述

这看起来很接近。

于 2020-06-18T21:40:05.877 回答