Open AdityaSavara opened 4 years ago
Edit: uniform priors are now done as described below. The below is just being kept for record purposes. Truly uninformed priors are not yet done. I'm not sure we should allow them unless using a different mcmc engine, because our mcmc requires a variance for each parameter (which doesn't exist for a truly uninformed parameter).
For somebody to use a uniform prior for a particular variable, I think that what I’m going to do is the following for uniform distributions:
a) It will require someone to put an uncertainty of “-1” that parameter’s uncertainty. b) It will require the person to put upperbounds and lowerbounds for that parameter. c) In the future, they may have to declare the type of distribution for each parameter if they use a -1. such as ['std', 'std', 'uni', 'uni'] where 'std' or 'norm' means a normal distribution.
In the case of a uniform distribution, the standard deviation and variance are given by....: https://www.quora.com/What-is-the-standard-deviation-of-a-uniform-distribution-How-is-this-formula-determined The standard deviation is the square root of the variance , and thus the standard deviation of the uniform distribution is given by :
σ=(b−a)/ √12
To make uncertainties of 0 into constants, all that would be needed during preprocessing would be something similar to the below:
if len (model['reducedParameterSpace'] ) ==0:
set model['reducedParameterSpace'] = list ( numpy.linspace( 0, len(model['InputParameterPriorValues'] ) ) )
for individualUncertaintyIndex, if individualUncertainty in enumerate(model['InputParametersPriorValuesUncertainties']):
if individualUncertainty ==0; model['reducedParameterSpace'].pop(individualUncertaintyIndex)
else:
for individualUncertaintyIndex, if individualUncertainty in enumerate(model['InputParametersPriorValuesUncertainties']):
if individualUncertainty ==0;
if individualUncertaintyIndex in model['reducedParameterSpace']:
model['reducedParameterSpace'].delete(individualUncertaintyIndex )
For the the "if" part, it's important that the object being enumerated over is not the same as the one being popped. For the "else" part, that is for the case that somebody has already specified a reducedParameterSpace, in which case it can get reduced down even further by anything that is declared a constant.
We can implement it like this: