Hello! I have a code composed of various modules. I would like the user to be able to set the form of the priors of a model in a config file, but without fitting it until the function in which it’s used it’s called. Right now, I’m doing everything in the function, in a very inelegant way:
model = pm.Model() with model: for par in config.PARAMETERS: if(par != 'csi'): guy.priors[par] = pm.Normal(par, mu=0, sigma=5) else: guy.priors[par] = pm.HalfNormal(par, sigma=5) # Expected value of outcome cost = config.TCA_MODEL.weighted_cost(data, guy.priors) # Likelihood (sampling distribution) of observations Y_obs = config.TCA_MODEL.likelihood('Y_obs', data, cost , guy.priors)`
I would like to set the Normal and HalfNormal in the same config file the variables come from. Is there a way to do it?