brinckmann / montepython_public

Public repository for the Monte Python Code
MIT License
93 stars 80 forks source link

Issue: IndexError: index 12 is out of bounds for axis 0 with size 12 #375

Open yanzhij opened 4 months ago

yanzhij commented 4 months ago

Hi everyone, I encountered a problem while using MontePython, and received the following error message during runtime:

File "/home/cosmology/jwst_hst/montepython_public-3.6/montepython/mcmc.py", line 149, in get_new_position
sigmas[j+Previous] = (math.sqrt(1./Range)) *
IndexError: index 12 is out of bounds for axis 0 with size 12

I also reviewed my input data, but couldn't find any issues related to index out of bounds.

brinckmann commented 4 months ago

Hi,

Can you copy your param file?

Best, Thejs

yanzhij commented 4 months ago

Hi, Thank you,This is my param file ‘’‘ data.experiments=['four_par_UVLF_HST_ST_model1', 'Pantheon']

data.over_sampling=[1, 3, 1]

data.parameters['sigma8'] = [0.8120, 0.1, 3., 0.3, 1, 'cosmo']

data.parameters['omega_m'] = [0.1432, 0., 1., 0.02, 1, 'cosmo']

data.parameters['omega_b'] = [2.236, 0., None, 0.5, 0.01, 'cosmo']

data.parameters['n_s'] = [0.9649, 0.7, 1.3, 0.2, 1, 'cosmo']

data.parameters['alphastar'] = [-6.499906e-01, -3., 0, 0.2, 1, 'nuisance'] data.parameters['betastar'] = [5.830253e-01, 0., 3., 0.1, 1, 'nuisance'] data.parameters['epsilonstar_slope'] = [-1.250277e+00, -3., 3., 0.1, 1, 'nuisance'] data.parameters['epsilonstar_icept'] = [-2.065852e+00, -3., 3., 0.1, 1, 'nuisance'] data.parameters['Mc_slope'] = [1.241402e+00, -3., 3., 0.1, 1, 'nuisance'] data.parameters['Mc_icept'] = [1.191313e+01, 7., 15., 0.5, 1, 'nuisance'] data.parameters['sigma_MUV'] = [1.149963e-02, 0.001, 3., 0.1, 1, 'nuisance'] data.parameters['Q'] = [2.089035e+00, 1.5, 2.5, 0.1, 1, 'nuisance'] data.parameters['M'] = [-1.943457e+01, None, None, 0.05, 1, 'nuisance'] data.parameters['A_star_bump'] = [1, 0,10, 1,1,'nuisance'] data.parameters['ln_k_star_bump'] = [0.5, -0.6, 1, 0.1, 1,'nuisance']

data.parameters['h'] = [0.7, None, None, 0, 1, 'derived']

data.parameters['Omega_m'] = [0.3, None, None, 0, 1, 'derived']

data.cosmo_arguments['100*theta_s'] = 1.04110 data.cosmo_arguments['tau_reio'] = 0.0544 data.cosmo_arguments['k_pivot'] = 0.05 data.cosmo_arguments['output'] = 'mPk' data.cosmo_arguments['P_k_max_1/Mpc'] = 11000. data.cosmo_arguments['z_max_pk'] = 15.

data.cosmo_arguments['m_ncdm'] = 0.06 data.cosmo_arguments['N_ur'] = 2.0308 data.cosmo_arguments['N_ncdm'] = 1 data.cosmo_arguments['T_ncdm'] = 0.71611

data.N=5000 data.write_step=1

’‘’

brinckmann commented 4 months ago

Hi,

I agree this is odd. I don't see any problems with the param file. I was "hoping" you'd have a line with a comment at the end of it, which isn't allowed and prompts this kind of error, but that's not the case. I see you have 12 varying parameters (1 cosmo and 11 nuisance) and for some reason it tries to go to parameter 13 (index 12).

Trying to brainstorm, a couple of questions come to mind:

I hope some of this helps.

Best, Thejs