Skip to content

Instantly share code, notes, and snippets.

@SebastianM-C
Created November 5, 2017 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SebastianM-C/06b66daa66d05fde19538fc4b1f07b25 to your computer and use it in GitHub Desktop.
Save SebastianM-C/06b66daa66d05fde19538fc4b1f07b25 to your computer and use it in GitHub Desktop.
#!/usr/bin/env julia
using StatsBase
raw = [3.041048548
5.31726102
7.540351846
8.21285941
10.33415448
11.34478297
12.63634874
13.62528381
14.74969453
15.82836396
17.14877504
18.15718434
18.38602684
19.44962249
20.88312875
21.7008539
22.22882334
23.29980573
24.04371036
24.8050021
25.62558297
26.26212961
27.31907502
27.90803064
28.9029638
29.76688586
30.2543806
30.47062902
31.4891829
32.1251393
33.16710002
34.02575112
34.43348265
34.84182147
35.81459637
36.52658526
36.76963418
37.58663109
38.40757715
38.94529798
39.36520022
40.28802418
40.94664445
41.30654291
42.15216684
42.94148109
43.46123274
43.68479306
44.03173411
44.89918579
45.5316069
46.09944696
46.85553338
47.60254121
48.04297568
48.55885304
48.83355667
49.64199626
50.26396958
50.51411477
51.05224281
51.68926437
52.38359936
52.87471991
53.58062727
53.76372426
54.50968543
55.06606391
55.3970751
56.14208279
56.64659352
57.28832339
57.67871874
57.92369981
58.73557453
58.8160142
59.49498372
60.01201543
60.49482678
61.36019548
61.7212416
62.29918838
62.64231442
63.10326354
63.98475038
64.01507713
64.59234348
65.04413812
65.21296352
65.7443742
66.69946002
66.90707045
67.4171199
67.81590906
68.41802329
69.26463342
69.41263903
69.79404958
70.158328
70.47550252
71.12228392
72.15395908
72.19789635
72.62941054
72.79544803
73.16406496
73.85631905
74.65045939
74.92280941
75.09312193
75.44048211
75.88880856
76.61918105
77.586355
77.71861604
77.91466662
78.15675255
78.64394433
79.41009618
80.13658002
80.47500676
80.54083799
80.60615234
80.89787278
81.42927789
82.22836072
83.06250518
83.33145302
83.3889646
83.67801345
84.2433245
85.07333557
85.71459709
85.91620646
86.10220715
86.26250814
86.48768881
87.0830338
87.08523308
87.94443375
88.57218432
88.64947943
88.9098107
89.16100982
89.3275701
89.95418207
90.84111081
91.35993001
91.48594819
91.75019718
92.08402968
92.19561273
92.8494684
93.76285868
94.12787685
94.31690549
94.620377
95.03114792
95.09099102
95.7704605
96.7092005
96.78505223
97.05767138
97.22936739
97.52040401
98.00195605
98.01280683
98.71658531
99.67968676
99.80275633
100.0940766
100.4450726
100.9602803
100.9961017
101.6873172
102.495254
102.6738921
102.8524235
103.0945048
103.4002436
103.9328432
104.0131771
104.6821696
105.1420527
105.6029002
105.6914127
105.9775195
106.374364
106.929835
107.0528465
107.7006889
107.9536346
108.3192761
108.7318642
108.7556789
109.0589673
109.381833
109.9508293
110.1147691
110.74245
111.0038509
111.5216819
111.7948797
111.9634167
112.4022281
112.9952198
113.198618
113.6550425
113.8070519
114.259618
114.7641988
114.8801086
115.1170362
115.4594684
116.0627272
116.3040783
116.8941156
116.9726852
117.5509843
117.9872106
118.0475994
118.524232
119.1527436
119.4308466
119.6599002
120.003281
120.3115339
120.8732068
121.1158739
121.2653865
121.6288151
122.2651115
122.3197635
122.5786301
123.0500389
123.1342061
123.6840101
124.2260359
124.2658153
124.7367722
125.3992127
125.747146
125.7667145
126.2865608
126.4687931
127.0781121
127.4366105
127.5011571
127.8864255
128.4609032
128.554982
128.9361212
129.2324333
129.460037
129.915166
130.4951538
130.6281788
131.0367542
131.1313279
131.7317975
131.9759961
132.1452913
132.6543157
132.7256589
133.3747708
133.8213304
133.8403052
134.2294311
134.6996921
134.9296569
135.3744006
135.5150141
135.8691516
136.2397328
136.8515906
137.0720958
137.4030385
137.4214433
138.1479461
138.2848503
138.6232015
139.0769875
139.1043513
139.7594825
140.0850084
140.22414
140.3240326
140.6553519
141.0359703
141.3867046
141.8914538
141.8929958
142.3592806
142.6536495
143.2923675
143.5954471
143.7685694
143.8883777
144.645304
144.6893086
145.178925
145.5188081
145.634152
146.228935
146.4823064
146.7066702
146.8863422
147.1619821
147.4671632
147.9238955
148.3620405
148.4853891
148.9283112
149.1533734
149.1763645
149.8147815
150.1962488
150.2273227
150.43533
151.1850709
151.2219564
151.8106269
152.0471108
152.2419439
152.7801442
152.9699471
153.2669284
153.5251666
153.7473222
153.989844
154.5391677
154.9182972
155.1544256
155.5742525
155.6947987
155.7357969
156.416378
156.7769382
156.8726188
157.0602733
157.7687167
157.8755351
158.5165783
158.6586387
158.925779
159.4104006
159.547062
159.9029723
160.2386577
160.4095475
160.6004746
161.2306011
161.5583514
161.8968837
162.2951655
162.3003869
162.3982105
163.094919
163.4143925
163.6227292
163.7613917
164.436554
164.604429
165.2951461
165.3504483
165.6838768
166.1172215
166.2114639
166.6130272
167.0249935
167.1470289
167.2956975
167.996398
168.2791638
168.7111756
168.9920813
169.0887753
169.1386408
169.8483564
170.1365465
170.4446668
170.5371875
171.1855067
171.406871
172.1198926
172.1447879
172.5145631
172.8983013
172.9604691
173.3954769
173.8821217
173.9585465
174.0724336
174.8348662
175.0780135
175.5957976
175.7678199
175.9437499
175.9645001
176.6748092
176.9403782
177.3356809
177.3872063
178.0127737
178.2812301
178.9645831
179.0640349
179.4162554
179.7514496
179.7913464
180.2488492
180.8060012
180.8450112
180.9279077
181.3353069
181.744405
181.9524514
182.5493232
182.625127
182.8364625
182.8957884
183.5725442
183.8230667
184.0955254
184.286149
184.3180498
184.915819
185.2259708
185.4433606
185.8823371
186.0515004
186.3874511
186.6745428
186.7015349
187.1718
187.780852
187.8191386
187.8596894
188.2460816
188.7234922
188.9002643
189.5614355
189.5703969
189.795402
189.9006438
190.5399611
190.7820095
191.0335562
191.2831567
191.3397764
191.8923378
192.2396414
192.4061695
192.8711583
193.1058619
193.4267136
193.6657616
193.6884693
193.8058214
194.1630975
194.8060597
194.8646248
194.8795734
195.2353125
195.770669
195.9194492
196.5626298
196.5742622
196.6577283
196.82306
196.9734274
197.5755781
197.814813
198.04932
198.3412381
198.4351453
198.940226
199.320866
199.445484
199.9292072
200.2258603
200.532651
200.7239989
200.7491914
200.8484621
201.2216053
201.8950409
201.9427266
202.0080965
202.3009026
202.8845213
203.0081981
203.632703
203.6612252
203.8100864
203.918137
204.112493
204.6780191
204.9192756
205.141093
205.4648628
205.5971157
206.0575548
206.4683375
206.559009
207.0547805
207.4102953
207.7038671
207.8481193
207.8811197
207.966507
208.3462657
209.0489916
209.0905625
209.2024558
209.4406909
210.0636497
210.164901
210.7770841
210.8201338
211.0262875
211.0792004
211.3165165
211.846001
212.0933706
212.3069326
212.6536526
212.8236173
213.2425486
213.6808115
213.7445614
214.2462936
214.6580204
214.9387872
215.0367623
215.0823985
215.1583632
215.5360831
216.2672498
216.3065586
216.4606708
216.6525585
217.3066135
217.3881769
217.9945445
218.0489506
218.303535
218.3065384
218.5842812
219.0783228
219.3352317
219.5448413
219.9066381
220.1132843
220.4935661
220.9571014
221.0000939
221.5022656
221.9679392
222.2346424
222.2899283
222.3513238
222.4222557
222.7901076
223.5490582
223.5887817
223.6256962
223.7814626
223.9344802
224.6118235
224.6769618
225.2834879
225.3457991
225.5936477
225.6459533
225.9146381
226.3738546
226.6431406
226.8528537
227.2227615
227.4649431
227.809085
228.1320518
228.296074
228.3236994
228.8213065
229.3390021
229.5794004
229.6171896
229.6862163
229.7563324
230.1074204
230.8936358
230.9353974
230.9662871
231.1637013
231.2845465
231.9773708
232.030662
232.6421473
232.7089547
232.9446262
233.047194
233.3064926
233.7315299
234.0155131
234.22908
234.6009694
234.8775113
235.1876871
235.5163836
235.6966452
235.7136069
236.2021066
236.7702022
236.9591646
237.0302064
237.0855111
237.1587186
237.4871215
238.3001032
238.3447951
238.3760234
238.6063346
238.7009692
239.4010225
239.4491433
240.0686938
240.1368396
240.3565021
240.5081013
240.7587969
241.1503381
241.4508858
241.6717274
242.0402362
242.3499677
242.6280468
242.9686488
243.1577771
243.1681729
243.6434263
244.2605704
244.3906756
244.510172
244.547777
244.6275744
244.9283215
245.7674931
245.8155808
245.8534876
246.1083655
246.1820801
246.8810487
246.9318916
247.5612839
247.628024
247.8282243
248.02772
248.2705457
248.6293189
248.7243923
248.9479006
249.1791083
249.5395702
249.8813398
250.1289201
250.4871817
250.6784742
250.6858722
251.1440887
251.8091604
251.8787053
252.0504081
252.0716817
252.161151
252.4301372
253.2948021
253.3465188
253.3971474
253.6688427
253.7263247
254.417125
254.4770988
255.1180589
255.1812416
255.3588188
255.6051397
255.8407708
256.1675582
256.2929431
256.5052909
256.7496423
257.0980149
257.4706972
257.6891361
258.0703386
258.2577781
258.2652912
258.7029721
259.4145011
259.4238779
259.6490714
259.6559634
259.7578224
259.9916924
260.881032
260.9364799
261.0054427
261.286855
261.3322545
262.0095001
262.0824858
262.7370907
262.7954294
262.9474132
]
function rel_spacing(Γ::AbstractArray)
n = length(Γ)
[n * (Γ[i + 1] - Γ[i]) / (Γ[end] - Γ[1]) for i in 1:n - 1]
end
data = rel_spacing(raw)
ws = weights(ones(raw) / (3 * length(raw) * 0.25))
hists = fit(Histogram, data, ws, 0:0.25:4, closed=:left)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment