Closed pkuxjw closed 1 year ago
Maybe you modified the array? Show the code
You probably print the values in your own space, which is not unit cube. Please provide MWE.
vpar = np.array([[0,4095],[0,4095],[0,30],[-2,1]])
def prior(cube,ndim,nparams):
print(cube[-1])
for i in range(nparams):
cube[i] = vpar[i,0]+cube[i]*(vpar[i,1]-vpar[i,0])
for i in range(args_i[1]):
cube[i] = int(cube[i])
cube[-1] = np.power(10,cube[-1])
when I run the code, it present a problem of 'overflow encountered in power '.
Please use indentation and code specifier here.
Please provide full code. The current one cannot be re-run by readers.
Are you sure it's range(args_i[1])
in the second loop? If so, then args_i[1]
has to be provided.
I think you can diagnose your problem without PyMultiNest.
Please use indentation and code specifier here. Please provide full code. The current one cannot be re-run by readers. Are you sure it's
range(args_i[1])
in the second loop? If so, thenargs_i[1]
has to be provided. I think you can diagnose your problem without PyMultiNest.
sorry, I did not notice the form problem. My problem is why some values of cube[-1] is larger than 1. Isn't it a unit cube prior?
vpar = np.array([[0,4095],[0,4095],[0,30],[-2,1]])
def prior(cube,ndim,nparams):
print(cube[-1])
for i in range(nparams):
cube[i] = vpar[i,0]+cube[i]*(vpar[i,1]-vpar[i,0])
for i in range(2):
cube[i] = int(cube[i])
cube[-1] = np.power(10,cube[-1])]
Well, you are modifying it in the line
cube[i] = vpar[i,0]+cube[i]*(vpar[i,1]-vpar[i,0])
since it loops i from 0 to nparams-1 (which is the -1 entry)
According to the document, the prior cube should be unit. However, when I print these prior parameters, some of them are larger than 1. I am confused about this. Many thanks!