8
8
# (bound_inf, bound_sup), LaTeX name
9
9
# The name of the variables must to be the same at the name of the Parameter
10
10
m = Parameter ("m" , 0 , 0.05 , (0 , 0.1 ), "m_0" )
11
+ # m = Parameter("m", 3, 0.5, (0,5), "m_0")
11
12
b = Parameter ("b" , 3 , 0.05 , (0 , 5 ), "b_0" )
12
13
13
14
# 2) Create a list with your parameters objects
14
15
parameterlist = [m , b ]
15
16
16
17
# 3) Define a method that reads a list of parameters,
18
+ # unzip them and return the a function of x with the
19
+ # parameters.
20
+ def model (parameterlist , x ):
21
+ m , b = parameterlist
22
+ return m * x + b
17
23
18
- model = 'm*x+b'
19
24
cosmo_model = 'Ocb/a**3+Omrad/a**4+NuContrib+(1.0-Om-m)'
20
25
21
26
# 4) Use SimpleMC as usually, but with model = custom_model
22
27
23
- # analyzer = DriverMC(model='simple', datasets='dline', analyzername='mcmc',
24
- # custom_parameters=parameterlist, custom_function=model)
28
+ analyzer = DriverMC (model = 'simple' , datasets = 'dline' , analyzername = 'mcmc' ,
29
+ custom_parameters = parameterlist , custom_function = model )
25
30
26
- analyzer = DriverMC (model = 'simple_cosmo' , datasets = 'SN' , analyzername = 'mcmc' ,
27
- custom_parameters = parameterlist , custom_function = cosmo_model )
31
+ # analyzer = DriverMC(model='simple_cosmo', datasets='SN', analyzername='mcmc',
32
+ # custom_parameters=parameterlist, custom_function=cosmo_model)
28
33
29
34
30
- analyzer .executer (nsamp = 1000 )
31
-
32
- # import corner
33
- # import numpy as np
34
- # import matplotlib.pyplot as plt
35
- #
36
- # dir = 'simplemc/chains/'
37
- # text_chain = 'simple_phy_dline_mcmc_1.txt'
38
- # npchain = np.loadtxt(dir+text_chain)
39
- # chain = npchain[:,2:5]
40
- # figure = corner.corner(chain)
41
- # plt.show()
35
+ analyzer .executer (nsamp = 1000 )
0 commit comments