-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Priors on stellar parameters #32
Comments
I'm happy that we're at a stage where we can start removing some of my "durty hacks" This may be a bit more dangerous than what you suggested, but what about having users actually write their own prior in python code, in a The cons are that someone might write code that doesn't properly interface with the package, but I think with some proper example files that this might be a mostly avoidable. |
I really like the idea of having a user-defined A thought on fixing parameters-- the only thing I can think of is to make a very narrow Gaussian and then set the jump size equal to (or much less than) the very narrow Gaussian sigma. This too is a hack, and has the drawback that it would eventually throw away samples, but in principle even very well constrained parameters must have some uncertainty anyways. |
Here is a sketch of a solution I'm working on in a fork of this repo. It doesn't leverage the ThetaParam object because of differences in the implementation, but the main idea is there. If the user wishes to apply a prior, she/he would need to:
def lnprior(p):
if not ( (p[11] > 0) and (p[6] < p[0]) ):
return -np.inf
# Try to load a user-defined prior
try:
sourcepath_env = Starfish.config['Theta_priors']
sourcepath = os.path.expandvars(sourcepath)
with open(sourcepath, 'r') as f:
sourcecode = f.read()
code = compile(sourcecode, sourcepath, 'exec')
exec(code)
lnprior = user_defined_prior
print("Using the user defined prior in {}".format(sourcepath_env))
except:
pass |
👍 this looks excellent I'm still wondering about how to fix the parameters. @dfm points out that unimportant nuisance parameters hurts your sampling efficiency, so while I suppose a narrow prior would work, I'm wondering if there is a way we can specify this in the config file like
and have a conversion method between the MCMC proposal interface and the |
Here is a possible implementation of methods to sample with fixed parameters: https://github.com/iancze/PSOAP/blob/master/psoap/utils.py |
In the spirit of our recent discussion, I actually really like the idea of not baking in priors at all for the primary fitting (not the emulator fitting). If we can define a model that has some
|
Priors on stellar parameters
The problem: I suspect that a common use case might resemble the following scenario: A user would like to force the value of a parameter to either a single value, or else a distribution- for example a mean and variance. Perhaps she has astro-seismic log g, or metallicity measured from a companion. Or she might wish to constrain more than one stellar property or calibration parameter. The existing framework currently assumes uniform priors for stellar parameters over the library interval. There exists a "fix_logg" mechanism to fix the log g to a singular value, but it's labeled as a "durty hack".
Suggested solution:
Add a mechanism for picking among an array of priors, or a user configurable prior. The default prior would remain as stated in Czekala et al. 2015, but through some flag, a user could specify a normal distribution, or whatever.
The text was updated successfully, but these errors were encountered: