-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnalytical_Cosmo_Config.py
1990 lines (1787 loc) · 128 KB
/
Analytical_Cosmo_Config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
@file Analytical_Cosmo_Config.py
@date September 6, 2023
@authors Fabrizio Cogato <fabrizio.cogato@inaf.it>
Michele Moresco <michele.moresco@unibo.it>
Please remember to cite: https://ui.adsabs.harvard.edu/abs/2023arXiv230901375C
"""
import numpy as np
from astropy.cosmology import FlatLambdaCDM, FlatwCDM, Flatw0waCDM, LambdaCDM, wCDM, w0waCDM
import pandas as pd
import astropy.units as u
##############################
#### Functions Definition ####
##############################
# Selecting Column Function
def column(matrix, i):
return [row[i] for row in matrix]
c = 299792.458
####------------------------------------FLCDM---------------------------------------
#SN
def mu_model_FLCDM(H0, Om, M, z):
cosmo = FlatLambdaCDM(H0=H0, Om0=Om)
mu = np.array(cosmo.distmod(z)) - M
return mu
# CC
def E_model_FLCDM(H0, Om, z):
cosmo = FlatLambdaCDM(H0=H0, Om0=Om)
return np.array(cosmo.efunc(z))
def Hz_model_FLCDM(H0, Om, z):
arr = []
for j in range(len(z)):
arr.append(H0*E_model_FLCDM(H0, Om, z[j]))
arr = np.array(arr)
return arr
def dL_model_FLCDM(H0, Om, z):
cosmo = FlatLambdaCDM(H0=H0, Om0=Om)
dl = np.array(cosmo.luminosity_distance(z))
return dl
#GRB
def Eiso_model_FLCDM(H0,Om,Eiso,z):
dL=dL_model_FLCDM(H0,Om,z)
dL_cal=dL_model_FLCDM(70,0.3,z)
E=Eiso*(dL/dL_cal)**2
return E
def errEiso_model_FLCDM(H0,Om,errEiso,z):
dL=dL_model_FLCDM(H0,Om,z)
dL_cal=dL_model_FLCDM(70,0.3,z)
err=errEiso*(dL/dL_cal)**2
return err
#BAO
def DHrd_model_FLCDM(H0, Om, rd, z):
arr = []
for j in range(len(z)):
arr.append(c/(H0*rd*E_model_FLCDM(H0, Om, z[j])))
arr = np.array(arr)
return arr
def DM_model_FLCDM(H0, Om, z):
cosmo = FlatLambdaCDM(H0=H0, Om0=Om)
DM = np.array(cosmo.comoving_transverse_distance(z))
return DM
def DMrd_model_FLCDM(H0, Om, rd, z):
arr = []
for i in range(len(z)):
arr.append(DM_model_FLCDM(H0, Om, z[i]) / rd)
arr = np.array(arr)
arr.shape
return arr
def DH_model_FLCDM(H0, Om, z):
arr = []
for j in range(len(z)):
arr.append(c/(H0*E_model_FLCDM(H0, Om, z[j])))
arr = np.array(arr)
return arr
def DVrd_model_FLCDM(H0, Om, rd, z):
dh = DH_model_FLCDM(H0, Om, z)
dm = DM_model_FLCDM(H0, Om, z)
arr = []
for i in range(len(z)):
arr.append(np.cbrt(z[i]*dh[i]*dm[i]**2)/rd)
arr = np.array(arr)
arr.shape
return arr
def DMrd_DHrd_model_FLCDM(H0, Om, rd, z):
dMrd = DMrd_model_FLCDM(H0, Om, rd, z)
dHrd = DHrd_model_FLCDM(H0, Om, rd, z)
arr = []
for i in range(len(z)):
arr.append(dMrd[i])
arr.append(dHrd[i])
arr = np.array(arr)
arr.shape
return arr
###############################
#### Likelihood Definition ####
###############################
## BAO
## Cov
def lnlikeBAOCov_FLCDM(theta, zBAO, dataBAO, inv_covBAO): # Likelihood Cov
H0, Om, M, a, b, intr, rd = theta
chi2=0.
ndim=np.shape(inv_covBAO)[0]
residual=dataBAO-DMrd_DHrd_model_FLCDM(H0, Om, rd, zBAO)
for i in range(0, ndim):
for j in range(0, ndim):
chi2=chi2+((residual[i])*inv_covBAO[i,j]*(residual[j]))
return -0.5 * chi2
## Err
def lnlikeDMrd_FLCDM(theta, zDMrd, DMrdBAO, errDMrdBAO):
H0, Om, M, a, b, intr, rd = theta
sigma2 = errDMrdBAO ** 2
return -0.5 * np.sum((DMrdBAO - DMrd_model_FLCDM(H0, Om, rd, zDMrd)) ** 2 / sigma2)
def lnlikeDHrd_FLCDM(theta, zDHrd, DHrdBAO, errDHrdBAO):
H0, Om, M, a, b, intr, rd = theta
sigma2 = errDHrdBAO ** 2
return -0.5 * np.sum((DHrdBAO - DHrd_model_FLCDM(H0, Om, rd, zDHrd)) ** 2 / sigma2)
def lnlikeDVrd_FLCDM(theta, zDVrd, DVrdBAO, errDVrdBAO):
H0, Om, M, a, b, intr, rd = theta
sigma2 = errDVrdBAO ** 2
return -0.5 * np.sum((DVrdBAO - DVrd_model_FLCDM(H0, Om, rd, zDVrd)) ** 2 / sigma2)
def lnlikeBAO_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia):
return lnlikeBAOCov_FLCDM(theta,zAlam, dataAlam, inv_cov_Alam)+lnlikeBAOCov_FLCDM(theta, zHou, dataHou, inv_cov_Hou)+lnlikeBAOCov_FLCDM(theta, zGil, dataGil, inv_cov_Gil)+lnlikeDMrd_FLCDM(theta, zDumas, DMrdDumas, errDMrdDumas)+lnlikeDHrd_FLCDM(theta, zDumas, DHrdDumas, errDHrdDumas)+lnlikeDVrd_FLCDM(theta, zRoss, DVrdRoss, errDVrdRoss)+lnlikeDVrd_FLCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia)
def lnlikeBAO_Alam_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam):
return lnlikeBAOCov_FLCDM(theta,zAlam, dataAlam, inv_cov_Alam)
def lnlikeBAO_Hou_FLCDM(theta, zHou, dataHou, inv_cov_Hou):
return lnlikeBAOCov_FLCDM(theta, zHou, dataHou, inv_cov_Hou)
def lnlikeBAO_Gil_FLCDM(theta, zGil, dataGil, inv_cov_Gil):
return lnlikeBAOCov_FLCDM(theta, zGil, dataGil, inv_cov_Gil)
def lnlikeBAO_Dumas_FLCDM(theta, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas):
return lnlikeDMrd_FLCDM(theta, zDumas, DMrdDumas, errDMrdDumas)+lnlikeDHrd_FLCDM(theta, zDumas, DHrdDumas, errDHrdDumas)
def lnlikeBAO_Ross_FLCDM(theta, zRoss, DVrdRoss, errDVrdRoss):
return lnlikeDVrd_FLCDM(theta, zRoss, DVrdRoss, errDVrdRoss)
def lnlikeBAO_Demattia_FLCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia):
return lnlikeDVrd_FLCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia)
## CC
def lnlikeCC_FLCDM(theta, zC, Hz, inv_cov_matC): # Likelihood Cov
H0, Om, M, a, b, intr, rd=theta
chi2=0.
residual=Hz-Hz_model_FLCDM(H0, Om, zC)
for i in range(0, len(zC)):
for j in range(0, len(zC)):
chi2=chi2+((residual[i])*inv_cov_matC[i,j]*(residual[j]))
return -0.5 * chi2
## SNe
def lnlikeSN_FLCDM(theta, zS, DmS, inv_cov_matS): # Likelihood Cov
H0, Om, M, a, b, intr, rd=theta
mu = mu_model_FLCDM(H0, Om, M, zS)
residual= DmS - mu
chi2=0.
for i in range(0, len(zS)):
for j in range(0, len(zS)):
chi2=chi2+((residual[i])*inv_cov_matS[i,j]*(residual[j]))
return -0.5 * chi2
##GRB
def lnlikeGRB_FLCDM(theta,z,Ep,Eiso,errEp,errEiso):
H0, Om, M, a, b, intr, rd=theta
E_iso=Eiso_model_FLCDM(H0,Om,Eiso,z)
err_Eiso=errEiso_model_FLCDM(H0,Om,errEiso,z)
logEiso=np.log10(E_iso)
logEp=np.log10(Ep)
errlog_iso=err_Eiso/(np.log(10)*E_iso)
errlog_p=errEp/(np.log(10)*Ep)
fact1=0.5*np.log((1+a**2)/(2*np.pi*(intr**2+errlog_p**2+(a*errlog_iso)**2)))
fact2=0.5*((logEp-a*logEiso-b)**2/(intr**2+errlog_p**2+(a*errlog_iso)**2))
lnlike=np.sum(fact1-fact2)
return lnlike
#######################################
#### Probes Combination Likelihood ####
#######################################
###########################
# BAO + CC + SN + GRB
def lnlikeBAOCCSNGRB_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso):
return lnlikeBAO_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeCC_FLCDM(theta, zC, Hz, inv_cov_matC)+lnlikeSN_FLCDM(theta, zS, DmS, inv_cov_matS) + lnlikeGRB_FLCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# BAO + CC + GRB
def lnlikeBAOCCGRB_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso):
return lnlikeBAO_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeCC_FLCDM(theta, zC, Hz, inv_cov_matC) + lnlikeGRB_FLCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# BAO + CC + SN
def lnlikeBAOCCSN_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS):
return lnlikeBAO_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeCC_FLCDM(theta, zC, Hz, inv_cov_matC)+lnlikeSN_FLCDM(theta, zS, DmS, inv_cov_matS)
# BAO + SN + GRB
def lnlikeBAOSNGRB_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS,zG, Ep, Eiso, errEp, errEiso):
return lnlikeBAO_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeSN_FLCDM(theta, zS, DmS, inv_cov_matS) + lnlikeGRB_FLCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# CC + SN + GRB
def lnlikeCCSNGRB_FLCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso):
return lnlikeCC_FLCDM(theta, zC, Hz, inv_cov_matC)+lnlikeSN_FLCDM(theta, zS, DmS, inv_cov_matS) + lnlikeGRB_FLCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# BAO + CC
def lnlikeBAOCC_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC):
return lnlikeBAO_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeCC_FLCDM(theta, zC, Hz, inv_cov_matC)
# BAO + SN
def lnlikeBAOSN_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS):
return lnlikeBAO_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeSN_FLCDM(theta, zS, DmS, inv_cov_matS)
# BAO + GRB
def lnlikeBAOGRB_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zG, Ep, Eiso, errEp, errEiso):
return lnlikeBAO_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia) + lnlikeGRB_FLCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# SN + GRB
def lnlikeSNGRB_FLCDM(theta, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso):
return lnlikeSN_FLCDM(theta, zS, DmS, inv_cov_matS) + lnlikeGRB_FLCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# CC + SN
def lnlikeCCSN_FLCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS):
return lnlikeCC_FLCDM(theta, zC, Hz, inv_cov_matC)+lnlikeSN_FLCDM(theta, zS, DmS, inv_cov_matS)
# CC + GRB
def lnlikeCCGRB_FLCDM(theta, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso):
return lnlikeCC_FLCDM(theta, zC, Hz, inv_cov_matC)+ lnlikeGRB_FLCDM(theta, zG, Ep, Eiso, errEp, errEiso)
###########
## Prior ##
###########
# Flat Prior
def lnflatprior_FLCDM(theta):
H0, Om, M, a, b, intr, rd=theta
if (0.0 < H0 < 100.0 and 0.0 < Om < 1.0 and 15. < M < 25. and 0. < a < 3.0 and 0. < b < 5.0 and 0. < intr < 1.0 and 50 < rd < 250):
return 0.0
return -np.inf
###############
## Posterior ##
###############
## BAO + CC + SN + GRB
# Flat Prior
def lnflatprobBAOCCSNGRB_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAOCCSNGRB_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO + CC + GRB
# Flat Prior
def lnflatprobBAOCCGRB_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAOCCGRB_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC,zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO + SN + GRB
# Flat Prior
def lnflatprobBAOSNGRB_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAOSNGRB_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia,zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO + CC + SN
# Flat Prior
def lnflatprobBAOCCSN_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAOCCSN_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS) if np.isfinite(lp) else -np.inf
## CC + SN + GRB
# Flat Prior
def lnflatprobCCSNGRB_FLCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeCCSNGRB_FLCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO + CC
# Flat Prior
def lnflatprobBAOCC_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAOCC_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC) if np.isfinite(lp) else -np.inf
## BAO + SN
# Flat Prior
def lnflatprobBAOSN_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAOSN_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS) if np.isfinite(lp) else -np.inf
## BAO + GRB
# Flat Prior
def lnflatprobBAOGRB_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAOGRB_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## SN + GRB
# Flat Prior
def lnflatprobSNGRB_FLCDM(theta, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeSNGRB_FLCDM(theta,zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## CC + SN
# Flat Prior
def lnflatprobCCSN_FLCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeCCSN_FLCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS) if np.isfinite(lp) else -np.inf
## CC + GRB
# Flat Prior
def lnflatprobCCGRB_FLCDM(theta, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeCCGRB_FLCDM(theta, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO
# Flat Prior
def lnflatprobBAO_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAO_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Alam_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAO_Alam_FLCDM(theta, zAlam, dataAlam, inv_cov_Alam) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Hou_FLCDM(theta, zHou, dataHou, inv_cov_Hou): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAO_Hou_FLCDM(theta, zHou, dataHou, inv_cov_Hou) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Gil_FLCDM(theta, zGil, dataGil, inv_cov_Gil): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAO_Gil_FLCDM(theta, zGil, dataGil, inv_cov_Gil) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Dumas_FLCDM(theta, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAO_Dumas_FLCDM(theta, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Ross_FLCDM(theta, zRoss, DVrdRoss, errDVrdRoss): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAO_Ross_FLCDM(theta, zRoss, DVrdRoss, errDVrdRoss) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Demattia_FLCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeBAO_Demattia_FLCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia) if np.isfinite(lp) else -np.inf
## SN
# Flat Prior
def lnflatprobSN_FLCDM(theta, zS, DmS, inv_cov_matS): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeSN_FLCDM(theta,zS, DmS, inv_cov_matS) if np.isfinite(lp) else -np.inf
## CC
# Flat Prior
def lnflatprobCC_FLCDM(theta, zC, Hz, inv_cov_matC): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeCC_FLCDM(theta, zC, Hz, inv_cov_matC) if np.isfinite(lp) else -np.inf
## GRB
# Flat Prior
def lnflatprobGRB_FLCDM(theta, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FLCDM(theta)
return lp + lnlikeGRB_FLCDM(theta, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
### --------------------------FwCDM--------------------------------------
#SN
def mu_model_FwCDM(H0, Om, w, M, z):
cosmo = FlatwCDM(H0=H0, Om0=Om, w0=w)
mu = np.array(cosmo.distmod(z)) - M
return mu
# CC
def E_model_FwCDM(H0, Om, w, z):
cosmo = FlatwCDM(H0=H0, Om0=Om, w0=w)
return np.array(cosmo.efunc(z))
def Hz_model_FwCDM(H0, Om, w, z):
arr = []
for j in range(len(z)):
arr.append(H0*E_model_FwCDM(H0, Om, w, z[j]))
arr = np.array(arr)
return arr
def dL_model_FwCDM(H0, Om, w, z):
cosmo = FlatwCDM(H0=H0, Om0=Om, w0=w)
dl = np.array(cosmo.luminosity_distance(z))
return dl
#GRB
def Eiso_model_FwCDM(H0, Om, w, Eiso,z):
dL=dL_model_FwCDM(H0, Om, w, z)
dL_cal=dL_model_FLCDM(70,0.3,z)
E=Eiso*(dL/dL_cal)**2
return E
def errEiso_model_FwCDM(H0, Om, w, errEiso,z):
dL=dL_model_FwCDM(H0, Om, w, z)
dL_cal=dL_model_FLCDM(70,0.3,z)
err=errEiso*(dL/dL_cal)**2
return err
#BAO
def DHrd_model_FwCDM(H0, Om, w, rd, z):
arr = []
for j in range(len(z)):
arr.append(c/(H0*rd*E_model_FwCDM(H0, Om, w, z[j])))
arr = np.array(arr)
return arr
def DA_model_FwCDM(H0, Om, w, z):
cosmo = FlatwCDM(H0=H0, Om0=Om, w0=w)
DA = np.array(cosmo.angular_diameter_distance(z))
return DA
def DMrd_model_FwCDM(H0, Om, w, rd, z):
arr = []
for i in range(len(z)):
arr.append(DA_model_FwCDM(H0, Om, w, z[i]) * (1+z[i]) / rd)
arr = np.array(arr)
arr.shape
return arr
def DH_model_FwCDM(H0, Om, w, z):
arr = []
for j in range(len(z)):
arr.append(c/(H0*E_model_FwCDM(H0, Om, w, z[j])))
arr = np.array(arr)
return arr
def DM_model_FwCDM(H0, Om, w, z):
arr = []
for i in range(len(z)):
arr.append(DA_model_FwCDM(H0, Om, w, z[i]) * (1+z[i]))
arr = np.array(arr)
arr.shape
return arr
def DVrd_model_FwCDM(H0, Om, w, rd, z):
dh = DH_model_FwCDM(H0, Om, w, z)
dm = DM_model_FwCDM(H0, Om, w, z)
arr = []
for i in range(len(z)):
arr.append(np.cbrt(z[i]*dh[i]*dm[i]**2)/rd)
arr = np.array(arr)
arr.shape
return arr
def DMrd_DHrd_model_FwCDM(H0, Om, w, rd, z):
dMrd = DMrd_model_FwCDM(H0, Om, w, rd, z)
dHrd = DHrd_model_FwCDM(H0, Om, w, rd, z)
arr = []
for i in range(len(z)):
arr.append(dMrd[i])
arr.append(dHrd[i])
arr = np.array(arr)
arr.shape
return arr
###############################
#### Likelihood Definition ####
###############################
## BAO
## Cov
def lnlikeBAOCov_FwCDM(theta, zBAO, dataBAO, inv_covBAO): # Likelihood Cov
H0, Om, w, M, a, b, intr, rd = theta
chi2=0.
ndim=np.shape(inv_covBAO)[0]
residual=dataBAO-DMrd_DHrd_model_FwCDM(H0, Om, w, rd, zBAO)
for i in range(0, ndim):
for j in range(0, ndim):
chi2=chi2+((residual[i])*inv_covBAO[i,j]*(residual[j]))
return -0.5 * chi2
## Err
def lnlikeDMrd_FwCDM(theta, zBAO, DMrdBAO, errDMrdBAO):
H0, Om, w, M, a, b, intr, rd = theta
sigma2 = errDMrdBAO ** 2
return -0.5 * np.sum((DMrdBAO - DMrd_model_FwCDM(H0, Om, w, rd, zBAO)) ** 2 / sigma2)
def lnlikeDHrd_FwCDM(theta, zBAO, DHrdBAO, errDHrdBAO):
H0, Om, w, M, a, b, intr, rd = theta
sigma2 = errDHrdBAO ** 2
return -0.5 * np.sum((DHrdBAO - DHrd_model_FwCDM(H0, Om, w, rd, zBAO)) ** 2 / sigma2)
def lnlikeDVrd_FwCDM(theta, zBAO, DVrdBAO, errDVrdBAO):
H0, Om, w, M, a, b, intr, rd = theta
sigma2 = errDVrdBAO ** 2
return -0.5 * np.sum((DVrdBAO - DVrd_model_FwCDM(H0, Om, w, rd, zBAO)) ** 2 / sigma2)
def lnlikeBAO_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia):
return lnlikeBAOCov_FwCDM(theta,zAlam, dataAlam, inv_cov_Alam)+lnlikeBAOCov_FwCDM(theta, zHou, dataHou, inv_cov_Hou)+lnlikeBAOCov_FwCDM(theta, zGil, dataGil, inv_cov_Gil)+lnlikeDMrd_FwCDM(theta, zDumas, DMrdDumas, errDMrdDumas)+lnlikeDHrd_FwCDM(theta, zDumas, DHrdDumas, errDHrdDumas)+lnlikeDVrd_FwCDM(theta, zRoss, DVrdRoss, errDVrdRoss)+lnlikeDVrd_FwCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia)
def lnlikeBAO_Alam_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam):
return lnlikeBAOCov_FwCDM(theta,zAlam, dataAlam, inv_cov_Alam)
def lnlikeBAO_Hou_FwCDM(theta, zHou, dataHou, inv_cov_Hou):
return lnlikeBAOCov_FwCDM(theta, zHou, dataHou, inv_cov_Hou)
def lnlikeBAO_Gil_FwCDM(theta, zGil, dataGil, inv_cov_Gil):
return lnlikeBAOCov_FwCDM(theta, zGil, dataGil, inv_cov_Gil)
def lnlikeBAO_Dumas_FwCDM(theta, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas):
return lnlikeDMrd_FwCDM(theta, zDumas, DMrdDumas, errDMrdDumas)+lnlikeDHrd_FwCDM(theta, zDumas, DHrdDumas, errDHrdDumas)
def lnlikeBAO_Ross_FwCDM(theta, zRoss, DVrdRoss, errDVrdRoss):
return lnlikeDVrd_FwCDM(theta, zRoss, DVrdRoss, errDVrdRoss)
def lnlikeBAO_Demattia_FwCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia):
return lnlikeDVrd_FwCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia)
## CC
def lnlikeCC_FwCDM(theta, zC, Hz, inv_cov_matC): # Likelihood Cov
H0, Om, w, M, a, b, intr, rd=theta
chi2=0.
residual=Hz-Hz_model_FwCDM(H0, Om, w, zC)
for i in range(0, len(zC)):
for j in range(0, len(zC)):
chi2=chi2+((residual[i])*inv_cov_matC[i,j]*(residual[j]))
return -0.5 * chi2
## SNe
def lnlikeSN_FwCDM(theta, zS, DmS, inv_cov_matS): # Likelihood Cov
H0, Om, w, M, a, b, intr, rd=theta
mu = mu_model_FwCDM(H0, Om, w, M, zS)
residual= DmS - mu
chi2=0.
for i in range(0, len(zS)):
for j in range(0, len(zS)):
chi2=chi2+((residual[i])*inv_cov_matS[i,j]*(residual[j]))
return -0.5 * chi2
##GRB
def lnlikeGRB_FwCDM(theta,z,Ep,Eiso,errEp,errEiso):
H0, Om, w, M, a, b, intr, rd=theta
E_iso=Eiso_model_FwCDM(H0, Om, w, Eiso,z)
err_Eiso=errEiso_model_FwCDM(H0, Om, w, errEiso,z)
logEiso=np.log10(E_iso)
logEp=np.log10(Ep)
errlog_iso=err_Eiso/(np.log(10)*E_iso)
errlog_p=errEp/(np.log(10)*Ep)
fact1=0.5*np.log((1+a**2)/(2*np.pi*(intr**2+errlog_p**2+(a*errlog_iso)**2)))
fact2=0.5*((logEp-a*logEiso-b)**2/(intr**2+errlog_p**2+(a*errlog_iso)**2))
lnlike=np.sum(fact1-fact2)
return lnlike
#######################################
#### Probes Combination Likelihood ####
#######################################
###########################
# BAO + CC + SN + GRB
def lnlikeBAOCCSNGRB_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso):
return lnlikeBAO_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeCC_FwCDM(theta, zC, Hz, inv_cov_matC)+lnlikeSN_FwCDM(theta, zS, DmS, inv_cov_matS) + lnlikeGRB_FwCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# BAO + CC + GRB
def lnlikeBAOCCGRB_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso):
return lnlikeBAO_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeCC_FwCDM(theta, zC, Hz, inv_cov_matC) + lnlikeGRB_FwCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# BAO + CC + SN
def lnlikeBAOCCSN_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS):
return lnlikeBAO_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeCC_FwCDM(theta, zC, Hz, inv_cov_matC)+lnlikeSN_FwCDM(theta, zS, DmS, inv_cov_matS)
# BAO + SN + GRB
def lnlikeBAOSNGRB_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS,zG, Ep, Eiso, errEp, errEiso):
return lnlikeBAO_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeSN_FwCDM(theta, zS, DmS, inv_cov_matS) + lnlikeGRB_FwCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# CC + SN + GRB
def lnlikeCCSNGRB_FwCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso):
return lnlikeCC_FwCDM(theta, zC, Hz, inv_cov_matC)+lnlikeSN_FwCDM(theta, zS, DmS, inv_cov_matS) + lnlikeGRB_FwCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# BAO + CC
def lnlikeBAOCC_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC):
return lnlikeBAO_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeCC_FwCDM(theta, zC, Hz, inv_cov_matC)
# BAO + SN
def lnlikeBAOSN_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS):
return lnlikeBAO_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeSN_FwCDM(theta, zS, DmS, inv_cov_matS)
# BAO + GRB
def lnlikeBAOGRB_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zG, Ep, Eiso, errEp, errEiso):
return lnlikeBAO_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia) + lnlikeGRB_FwCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# SN + GRB
def lnlikeSNGRB_FwCDM(theta, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso):
return lnlikeSN_FwCDM(theta, zS, DmS, inv_cov_matS) + lnlikeGRB_FwCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# CC + SN
def lnlikeCCSN_FwCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS):
return lnlikeCC_FwCDM(theta, zC, Hz, inv_cov_matC)+lnlikeSN_FwCDM(theta, zS, DmS, inv_cov_matS)
# CC + GRB
def lnlikeCCGRB_FwCDM(theta, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso):
return lnlikeCC_FwCDM(theta, zC, Hz, inv_cov_matC)+ lnlikeGRB_FwCDM(theta, zG, Ep, Eiso, errEp, errEiso)
###########
## Prior ##
###########
# Flat Prior
def lnflatprior_FwCDM(theta):
H0, Om, w, M, a, b, intr, rd=theta
if (0.0 < H0 < 100.0 and 0.0 < Om < 1.0 and -5.0 < w < -0.3 and 15. < M < 25. and 0. < a < 3.0 and 0. < b < 5.0 and 0. < intr < 1.0 and 50 < rd < 250):
return 0.0
return -np.inf
###############
## Posterior ##
###############
## BAO + CC + SN + GRB
# Flat Prior
def lnflatprobBAOCCSNGRB_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAOCCSNGRB_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO + CC + GRB
# Flat Prior
def lnflatprobBAOCCGRB_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAOCCGRB_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC,zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO + SN + GRB
# Flat Prior
def lnflatprobBAOSNGRB_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAOSNGRB_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia,zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO + CC + SN
# Flat Prior
def lnflatprobBAOCCSN_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAOCCSN_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS) if np.isfinite(lp) else -np.inf
## CC + SN + GRB
# Flat Prior
def lnflatprobCCSNGRB_FwCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeCCSNGRB_FwCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO + CC
# Flat Prior
def lnflatprobBAOCC_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAOCC_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC) if np.isfinite(lp) else -np.inf
## BAO + SN
# Flat Prior
def lnflatprobBAOSN_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAOSN_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS) if np.isfinite(lp) else -np.inf
## BAO + GRB
# Flat Prior
def lnflatprobBAOGRB_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAOGRB_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## SN + GRB
# Flat Prior
def lnflatprobSNGRB_FwCDM(theta, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeSNGRB_FwCDM(theta,zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## CC + SN
# Flat Prior
def lnflatprobCCSN_FwCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeCCSN_FwCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS) if np.isfinite(lp) else -np.inf
## CC + GRB
# Flat Prior
def lnflatprobCCGRB_FwCDM(theta, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeCCGRB_FwCDM(theta, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO
# Flat Prior
def lnflatprobBAO_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAO_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Alam_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAO_Alam_FwCDM(theta, zAlam, dataAlam, inv_cov_Alam) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Hou_FwCDM(theta, zHou, dataHou, inv_cov_Hou): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAO_Hou_FwCDM(theta, zHou, dataHou, inv_cov_Hou) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Gil_FwCDM(theta, zGil, dataGil, inv_cov_Gil): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAO_Gil_FwCDM(theta, zGil, dataGil, inv_cov_Gil) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Dumas_FwCDM(theta, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAO_Dumas_FwCDM(theta, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Ross_FwCDM(theta, zRoss, DVrdRoss, errDVrdRoss): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAO_Ross_FwCDM(theta, zRoss, DVrdRoss, errDVrdRoss) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Demattia_FwCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeBAO_Demattia_FwCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia) if np.isfinite(lp) else -np.inf
## SN
# Flat Prior
def lnflatprobSN_FwCDM(theta, zS, DmS, inv_cov_matS): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeSN_FwCDM(theta,zS, DmS, inv_cov_matS) if np.isfinite(lp) else -np.inf
## CC
# Flat Prior
def lnflatprobCC_FwCDM(theta, zC, Hz, inv_cov_matC): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeCC_FwCDM(theta, zC, Hz, inv_cov_matC) if np.isfinite(lp) else -np.inf
## GRB
# Flat Prior
def lnflatprobGRB_FwCDM(theta, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_FwCDM(theta)
return lp + lnlikeGRB_FwCDM(theta, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
####-------------------------Fw0waCDM------------------------------####
#SN
def mu_model_Fw0waCDM(H0, Om, w0, wa, M, z):
cosmo = Flatw0waCDM(H0=H0, Om0=Om, w0=w0, wa=wa)
mu = np.array(cosmo.distmod(z)) - M
return mu
# CC
def E_model_Fw0waCDM(H0, Om, w0, wa, z):
cosmo = Flatw0waCDM(H0=H0, Om0=Om, w0=w0, wa=wa)
return np.array(cosmo.efunc(z))
def Hz_model_Fw0waCDM(H0, Om, w0, wa, z):
arr = []
for j in range(len(z)):
arr.append(H0*E_model_Fw0waCDM(H0, Om, w0, wa, z[j]))
arr = np.array(arr)
return arr
def dL_model_Fw0waCDM(H0, Om, w0, wa, z):
cosmo = Flatw0waCDM(H0=H0, Om0=Om, w0=w0, wa=wa)
dl = np.array(cosmo.luminosity_distance(z))
return dl
#GRB
def Eiso_model_Fw0waCDM(H0, Om, w0, wa, Eiso,z):
dL=dL_model_Fw0waCDM(H0, Om, w0, wa, z)
dL_cal=dL_model_FLCDM(70,0.3,z)
E=Eiso*(dL/dL_cal)**2
return E
def errEiso_model_Fw0waCDM(H0, Om, w0, wa, errEiso,z):
dL=dL_model_Fw0waCDM(H0, Om, w0, wa, z)
dL_cal=dL_model_FLCDM(70,0.3,z)
err=errEiso*(dL/dL_cal)**2
return err
#BAO
def DHrd_model_Fw0waCDM(H0, Om, w0, wa, rd, z):
arr = []
for j in range(len(z)):
arr.append(c/(H0*rd*E_model_Fw0waCDM(H0, Om, w0, wa, z[j])))
arr = np.array(arr)
return arr
def DA_model_Fw0waCDM(H0, Om, w0, wa, z):
cosmo = Flatw0waCDM(H0=H0, Om0=Om, w0=w0, wa=wa)
DA = np.array(cosmo.angular_diameter_distance(z))
return DA
def DMrd_model_Fw0waCDM(H0, Om, w0, wa, rd, z):
arr = []
for i in range(len(z)):
arr.append(DA_model_Fw0waCDM(H0, Om, w0, wa, z[i]) * (1+z[i]) / rd)
arr = np.array(arr)
arr.shape
return arr
def DH_model_Fw0waCDM(H0, Om, w0, wa, z):
arr = []
for j in range(len(z)):
arr.append(c/(H0*E_model_Fw0waCDM(H0, Om, w0, wa, z[j])))
arr = np.array(arr)
return arr
def DM_model_Fw0waCDM(H0, Om, w0, wa, z):
arr = []
for i in range(len(z)):
arr.append(DA_model_Fw0waCDM(H0, Om, w0, wa, z[i]) * (1+z[i]))
arr = np.array(arr)
arr.shape
return arr
def DVrd_model_Fw0waCDM(H0, Om, w0, wa, rd, z):
dh = DH_model_Fw0waCDM(H0, Om, w0, wa, z)
dm = DM_model_Fw0waCDM(H0, Om, w0, wa, z)
arr = []
for i in range(len(z)):
arr.append(np.cbrt(z[i]*dh[i]*dm[i]**2)/rd)
arr = np.array(arr)
arr.shape
return arr
def DMrd_DHrd_model_Fw0waCDM(H0, Om, w0, wa, rd, z):
dMrd = DMrd_model_Fw0waCDM(H0, Om, w0, wa, rd, z)
dHrd = DHrd_model_Fw0waCDM(H0, Om, w0, wa, rd, z)
arr = []
for i in range(len(z)):
arr.append(dMrd[i])
arr.append(dHrd[i])
arr = np.array(arr)
arr.shape
return arr
###############################
#### Likelihood Definition ####
###############################
## BAO
## Cov
def lnlikeBAOCov_Fw0waCDM(theta, zBAO, dataBAO, inv_covBAO): # Likelihood Cov
H0, Om, w0, wa, M, a, b, intr, rd = theta
chi2=0.
ndim=np.shape(inv_covBAO)[0]
residual=dataBAO-DMrd_DHrd_model_Fw0waCDM(H0, Om, w0, wa, rd, zBAO)
for i in range(0, ndim):
for j in range(0, ndim):
chi2=chi2+((residual[i])*inv_covBAO[i,j]*(residual[j]))
return -0.5 * chi2
## Err
def lnlikeDMrd_Fw0waCDM(theta, zBAO, DMrdBAO, errDMrdBAO):
H0, Om, w0, wa, M, a, b, intr, rd = theta
sigma2 = errDMrdBAO ** 2
return -0.5 * np.sum((DMrdBAO - DMrd_model_Fw0waCDM(H0, Om, w0, wa, rd, zBAO)) ** 2 / sigma2)
def lnlikeDHrd_Fw0waCDM(theta, zBAO, DHrdBAO, errDHrdBAO):
H0, Om, w0, wa, M, a, b, intr, rd = theta
sigma2 = errDHrdBAO ** 2
return -0.5 * np.sum((DHrdBAO - DHrd_model_Fw0waCDM(H0, Om, w0, wa, rd, zBAO)) ** 2 / sigma2)
def lnlikeDVrd_Fw0waCDM(theta, zBAO, DVrdBAO, errDVrdBAO):
H0, Om, w0, wa, M, a, b, intr, rd = theta
sigma2 = errDVrdBAO ** 2
return -0.5 * np.sum((DVrdBAO - DVrd_model_Fw0waCDM(H0, Om, w0, wa, rd, zBAO)) ** 2 / sigma2)
def lnlikeBAO_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia):
return lnlikeBAOCov_Fw0waCDM(theta,zAlam, dataAlam, inv_cov_Alam)+lnlikeBAOCov_Fw0waCDM(theta, zHou, dataHou, inv_cov_Hou)+lnlikeBAOCov_Fw0waCDM(theta, zGil, dataGil, inv_cov_Gil)+lnlikeDMrd_Fw0waCDM(theta, zDumas, DMrdDumas, errDMrdDumas)+lnlikeDHrd_Fw0waCDM(theta, zDumas, DHrdDumas, errDHrdDumas)+lnlikeDVrd_Fw0waCDM(theta, zRoss, DVrdRoss, errDVrdRoss)+lnlikeDVrd_Fw0waCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia)
def lnlikeBAO_Alam_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam):
return lnlikeBAOCov_Fw0waCDM(theta,zAlam, dataAlam, inv_cov_Alam)
def lnlikeBAO_Hou_Fw0waCDM(theta, zHou, dataHou, inv_cov_Hou):
return lnlikeBAOCov_Fw0waCDM(theta, zHou, dataHou, inv_cov_Hou)
def lnlikeBAO_Gil_Fw0waCDM(theta, zGil, dataGil, inv_cov_Gil):
return lnlikeBAOCov_Fw0waCDM(theta, zGil, dataGil, inv_cov_Gil)
def lnlikeBAO_Dumas_Fw0waCDM(theta, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas):
return lnlikeDMrd_Fw0waCDM(theta, zDumas, DMrdDumas, errDMrdDumas)+lnlikeDHrd_Fw0waCDM(theta, zDumas, DHrdDumas, errDHrdDumas)
def lnlikeBAO_Ross_Fw0waCDM(theta, zRoss, DVrdRoss, errDVrdRoss):
return lnlikeDVrd_Fw0waCDM(theta, zRoss, DVrdRoss, errDVrdRoss)
def lnlikeBAO_Demattia_Fw0waCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia):
return lnlikeDVrd_Fw0waCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia)
## CC
def lnlikeCC_Fw0waCDM(theta, zC, Hz, inv_cov_matC): # Likelihood Cov
H0, Om, w0, wa, M, a, b, intr, rd=theta
chi2=0.
residual=Hz-Hz_model_Fw0waCDM(H0, Om, w0, wa, zC)
for i in range(0, len(zC)):
for j in range(0, len(zC)):
chi2=chi2+((residual[i])*inv_cov_matC[i,j]*(residual[j]))
return -0.5 * chi2
## SNe
def lnlikeSN_Fw0waCDM(theta, zS, DmS, inv_cov_matS): # Likelihood Cov
H0, Om, w0, wa, M, a, b, intr, rd=theta
mu = mu_model_Fw0waCDM(H0, Om, w0, wa, M, zS)
residual= DmS - mu
chi2=0.
for i in range(0, len(zS)):
for j in range(0, len(zS)):
chi2=chi2+((residual[i])*inv_cov_matS[i,j]*(residual[j]))
return -0.5 * chi2
##GRB
def lnlikeGRB_Fw0waCDM(theta,z,Ep,Eiso,errEp,errEiso):
H0, Om, w0, wa, M, a, b, intr, rd=theta
E_iso=Eiso_model_Fw0waCDM(H0, Om, w0, wa, Eiso,z)
err_Eiso=errEiso_model_Fw0waCDM(H0, Om, w0, wa, errEiso,z)
logEiso=np.log10(E_iso)
logEp=np.log10(Ep)
errlog_iso=err_Eiso/(np.log(10)*E_iso)
errlog_p=errEp/(np.log(10)*Ep)
fact1=0.5*np.log((1+a**2)/(2*np.pi*(intr**2+errlog_p**2+(a*errlog_iso)**2)))
fact2=0.5*((logEp-a*logEiso-b)**2/(intr**2+errlog_p**2+(a*errlog_iso)**2))
lnlike=np.sum(fact1-fact2)
return lnlike
#######################################
#### Probes Combination Likelihood ####
#######################################
###########################
# BAO + CC + SN + GRB
def lnlikeBAOCCSNGRB_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso):
return lnlikeBAO_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeCC_Fw0waCDM(theta, zC, Hz, inv_cov_matC)+lnlikeSN_Fw0waCDM(theta, zS, DmS, inv_cov_matS) + lnlikeGRB_Fw0waCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# BAO + CC + GRB
def lnlikeBAOCCGRB_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso):
return lnlikeBAO_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeCC_Fw0waCDM(theta, zC, Hz, inv_cov_matC) + lnlikeGRB_Fw0waCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# BAO + CC + SN
def lnlikeBAOCCSN_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS):
return lnlikeBAO_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeCC_Fw0waCDM(theta, zC, Hz, inv_cov_matC)+lnlikeSN_Fw0waCDM(theta, zS, DmS, inv_cov_matS)
# BAO + SN + GRB
def lnlikeBAOSNGRB_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS,zG, Ep, Eiso, errEp, errEiso):
return lnlikeBAO_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeSN_Fw0waCDM(theta, zS, DmS, inv_cov_matS) + lnlikeGRB_Fw0waCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# CC + SN + GRB
def lnlikeCCSNGRB_Fw0waCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso):
return lnlikeCC_Fw0waCDM(theta, zC, Hz, inv_cov_matC)+lnlikeSN_Fw0waCDM(theta, zS, DmS, inv_cov_matS) + lnlikeGRB_Fw0waCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# BAO + CC
def lnlikeBAOCC_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC):
return lnlikeBAO_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeCC_Fw0waCDM(theta, zC, Hz, inv_cov_matC)
# BAO + SN
def lnlikeBAOSN_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS):
return lnlikeBAO_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia)+lnlikeSN_Fw0waCDM(theta, zS, DmS, inv_cov_matS)
# BAO + GRB
def lnlikeBAOGRB_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zG, Ep, Eiso, errEp, errEiso):
return lnlikeBAO_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia) + lnlikeGRB_Fw0waCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# SN + GRB
def lnlikeSNGRB_Fw0waCDM(theta, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso):
return lnlikeSN_Fw0waCDM(theta, zS, DmS, inv_cov_matS) + lnlikeGRB_Fw0waCDM(theta, zG, Ep, Eiso, errEp, errEiso)
# CC + SN
def lnlikeCCSN_Fw0waCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS):
return lnlikeCC_Fw0waCDM(theta, zC, Hz, inv_cov_matC)+lnlikeSN_Fw0waCDM(theta, zS, DmS, inv_cov_matS)
# CC + GRB
def lnlikeCCGRB_Fw0waCDM(theta, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso):
return lnlikeCC_Fw0waCDM(theta, zC, Hz, inv_cov_matC)+ lnlikeGRB_Fw0waCDM(theta, zG, Ep, Eiso, errEp, errEiso)
###########
## Prior ##
###########
# Flat Prior
def lnflatprior_Fw0waCDM(theta):
H0, Om, w0, wa, M, a, b, intr, rd=theta
if (0.0 < H0 < 100.0 and 0.0 < Om < 1.0 and -5.0 < w0 < -0.3 and -5.0 < wa < 5 and 15. < M < 25. and 0. < a < 3.0 and 0. < b < 5.0 and 0. < intr < 1.0 and 50 < rd < 250):
return 0.0
return -np.inf
###############
## Posterior ##
###############
## BAO + CC + SN + GRB
# Flat Prior
def lnflatprobBAOCCSNGRB_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAOCCSNGRB_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO + CC + GRB
# Flat Prior
def lnflatprobBAOCCGRB_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAOCCGRB_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC,zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO + SN + GRB
# Flat Prior
def lnflatprobBAOSNGRB_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAOSNGRB_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia,zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO + CC + SN
# Flat Prior
def lnflatprobBAOCCSN_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAOCCSN_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS) if np.isfinite(lp) else -np.inf
## CC + SN + GRB
# Flat Prior
def lnflatprobCCSNGRB_Fw0waCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeCCSNGRB_Fw0waCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO + CC
# Flat Prior
def lnflatprobBAOCC_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAOCC_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zC, Hz, inv_cov_matC) if np.isfinite(lp) else -np.inf
## BAO + SN
# Flat Prior
def lnflatprobBAOSN_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAOSN_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zS, DmS, inv_cov_matS) if np.isfinite(lp) else -np.inf
## BAO + GRB
# Flat Prior
def lnflatprobBAOGRB_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAOGRB_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## SN + GRB
# Flat Prior
def lnflatprobSNGRB_Fw0waCDM(theta, zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeSNGRB_Fw0waCDM(theta,zS, DmS, inv_cov_matS, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## CC + SN
# Flat Prior
def lnflatprobCCSN_Fw0waCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeCCSN_Fw0waCDM(theta, zC, Hz, inv_cov_matC, zS, DmS, inv_cov_matS) if np.isfinite(lp) else -np.inf
## CC + GRB
# Flat Prior
def lnflatprobCCGRB_Fw0waCDM(theta, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeCCGRB_Fw0waCDM(theta, zC, Hz, inv_cov_matC, zG, Ep, Eiso, errEp, errEiso) if np.isfinite(lp) else -np.inf
## BAO
# Flat Prior
def lnflatprobBAO_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAO_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam, zHou, dataHou, inv_cov_Hou, zGil, dataGil, inv_cov_Gil, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas, zRoss, DVrdRoss, errDVrdRoss, zDemattia, DVrdDemattia, errDVrdDemattia) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Alam_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAO_Alam_Fw0waCDM(theta, zAlam, dataAlam, inv_cov_Alam) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Hou_Fw0waCDM(theta, zHou, dataHou, inv_cov_Hou): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAO_Hou_Fw0waCDM(theta, zHou, dataHou, inv_cov_Hou) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Gil_Fw0waCDM(theta, zGil, dataGil, inv_cov_Gil): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAO_Gil_Fw0waCDM(theta, zGil, dataGil, inv_cov_Gil) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Dumas_Fw0waCDM(theta, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAO_Dumas_Fw0waCDM(theta, zDumas, DMrdDumas, errDMrdDumas, DHrdDumas, errDHrdDumas) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Ross_Fw0waCDM(theta, zRoss, DVrdRoss, errDVrdRoss): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAO_Ross_Fw0waCDM(theta, zRoss, DVrdRoss, errDVrdRoss) if np.isfinite(lp) else -np.inf
def lnflatprobBAO_Demattia_Fw0waCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeBAO_Demattia_Fw0waCDM(theta, zDemattia, DVrdDemattia, errDVrdDemattia) if np.isfinite(lp) else -np.inf
## SN
# Flat Prior
def lnflatprobSN_Fw0waCDM(theta, zS, DmS, inv_cov_matS): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeSN_Fw0waCDM(theta,zS, DmS, inv_cov_matS) if np.isfinite(lp) else -np.inf
## CC
# Flat Prior
def lnflatprobCC_Fw0waCDM(theta, zC, Hz, inv_cov_matC): # Cov Probability
lp = lnflatprior_Fw0waCDM(theta)
return lp + lnlikeCC_Fw0waCDM(theta, zC, Hz, inv_cov_matC) if np.isfinite(lp) else -np.inf
## GRB
# Flat Prior