You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I’m a grad student attempting to use snpy to fit some SNe Ia data. Specifically I’m attempting to use the fitMCMC method to enforce priors. I have two corrections which I believe should be made:
R_V is not a parameter, Rv is. I believe passing this extra argument does nothing (e.g. if I pass foobar=’N,2.3,0.9’ then the fit will run without errors, but obviously that’s not a parameter).
I believe that R_V should be changed to Rv in the MCMCfit documentation.
However, making sure parameter names match introduces an error. Here’s the partial traceback when I try to enforce a prior on EBVhost:
emcee: Exception while calling your likelihood function:
params: [3.25815455e+01 1.55605255e+00 5.81841998e+04]
args: ({'varlist': ['DM', 'dm15', 'EBVhost', 'Tmax'], 'fitflux': True, 'free': ['DM', 'dm15', 'Tmax'], 'DM': {'fixed': False, 'index': 0, 'prior_type': 'model'}, 'dm15': {'fixed': False, 'index': 1, 'prior_type': 'model'}, 'EBVhost': {'value': 'U,0,1', 'fixed': True}, . . .
. . .
"/Users/jamisonfrost/miniconda3/envs/earlysne/lib/python3.7/site-packages/snpy/model.py", line 473, in __call__
temp = temp + self.Robs[band]*self.EBVhost + R*self.parent.EBVgal
TypeError: can't multiply sequence by non-int of type 'numpy.float64'
The parameter is getting fixed as a string, instead of translated into the desired prior. In order for the built-in priors (uniform, exponential, and normal) to be instantiated, I believe this line should be changed:
Currently it’s checking for an arg with type bytes, and I think this should be changed to str. Passing the argument as a byte string doesn’t work, I get ValueError: I don't understand the prior code b'U,0,1' (since it checks if st[0] in [‘U’, ‘G’, ‘E’], and b’U,0,1’[0] is apparently 85). I’ve tested it and making the change to str allows priors to be enforced as expected.
For completeness, I’m running this on python 3.7.9, snpy version 2.5.3.
The text was updated successfully, but these errors were encountered:
jfrostburke
changed the title
Problems with MCMCfit (with proposed fixes)
Problems with fitMCMC (with proposed fixes)
Jun 9, 2021
Hi, I’m a grad student attempting to use snpy to fit some SNe Ia data. Specifically I’m attempting to use the
fitMCMC
method to enforce priors. I have two corrections which I believe should be made:fitMCMC
(https://users.obs.carnegiescience.edu/cburns/SNooPyDocs/html/fitting_MCMC.html), the first fit is run usingThis correctly fixes the
Rv
parameter. However, the MCMC fit is run usingR_V
is not a parameter,Rv
is. I believe passing this extra argument does nothing (e.g. if I passfoobar=’N,2.3,0.9’
then the fit will run without errors, but obviously that’s not a parameter).I believe that
R_V
should be changed toRv
in the MCMCfit documentation.EBVhost
:The parameter is getting fixed as a string, instead of translated into the desired prior. In order for the built-in priors (uniform, exponential, and normal) to be instantiated, I believe this line should be changed:
snpy/snpy/snemcee.py
Line 65 in f8c6ca8
Currently it’s checking for an arg with type
bytes
, and I think this should be changed tostr
. Passing the argument as a byte string doesn’t work, I getValueError: I don't understand the prior code b'U,0,1'
(since it checks ifst[0] in [‘U’, ‘G’, ‘E’]
, andb’U,0,1’[0]
is apparently85
). I’ve tested it and making the change tostr
allows priors to be enforced as expected.For completeness, I’m running this on python 3.7.9, snpy version 2.5.3.
The text was updated successfully, but these errors were encountered: